Skip to content

Commit

Permalink
fix: ignore pods spun up from checkpoints in health checks
Browse files Browse the repository at this point in the history
Pods which are spun up as checkpoints shouldn't be counted towards the
normal pods spun up as part of the daemon set.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
  • Loading branch information
smira authored and talos-bot committed Dec 22, 2020
1 parent a83e875 commit 5e3b8ee
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/cluster/check/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ func K8sFullControlPlaneAssertion(ctx context.Context, cluster ClusterInfo) erro
return fmt.Errorf("error listing pods for daemonset %s: %w", ds.GetName(), err)
}

// filter out pod checkpoints
n := 0

for _, pod := range pods.Items {
if _, exists := pod.Annotations["checkpointer.alpha.coreos.com/checkpoint-of"]; !exists {
pods.Items[n] = pod
n++
}
}

pods.Items = pods.Items[:n]

if int32(len(pods.Items)) != ds.Status.DesiredNumberScheduled {
return fmt.Errorf("expected number of pods for %s to be %d, got %d", ds.GetName(), ds.Status.DesiredNumberScheduled, len(pods.Items))
}
Expand Down

0 comments on commit 5e3b8ee

Please sign in to comment.