MCPcopy
hub / github.com/dapr/dapr / DaprWatchdog

Struct DaprWatchdog

pkg/operator/watchdog.go:37–45  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
37type 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 .

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected