DaprWatchdog is a controller that periodically polls all pods and ensures that they are in the correct state. This controller only runs on the cluster's leader. Currently, this ensures that the sidecar is injected in each pod, otherwise it kills the pod, so it can be restarted.
| 35 | // This controller only runs on the cluster's leader. |
| 36 | // Currently, this ensures that the sidecar is injected in each pod, otherwise it kills the pod, so it can be restarted. |
| 37 | type DaprWatchdog struct { |
| 38 | interval time.Duration |
| 39 | maxRestartsPerMin int |
| 40 | |
| 41 | client client.Client |
| 42 | restartLimiter ratelimit.Limiter |
| 43 | canPatchPodLabels bool |
| 44 | podSelector labels.Selector |
| 45 | } |
| 46 | |
| 47 | // NeedLeaderElection makes it so the controller runs on the leader node only. |
| 48 | // Implements sigs.k8s.io/controller-runtime/pkg/manager.LeaderElectionRunnable . |
nothing calls this directly
no outgoing calls
no test coverage detected