Skip to content

Commit

Permalink
fix: make static pods check output consistent
Browse files Browse the repository at this point in the history
Sort the pod names, so the check output doesn't re-print itself on no
change to the list of pods.

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
(cherry picked from commit b0fdc3c)
  • Loading branch information
smira committed Jul 22, 2024
1 parent dd241d7 commit b222d50
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/cluster/check/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"context"
"fmt"
"net/netip"
"slices"
"strings"

"github.com/cosi-project/runtime/pkg/safe"
Expand Down Expand Up @@ -420,7 +421,10 @@ func K8sControlPlaneStaticPods(ctx context.Context, cl ClusterInfo) error {
}

if len(expectedStaticPods) > 0 {
return fmt.Errorf("missing static pods on node %s: %v", node.InternalIP, maps.Keys(expectedStaticPods))
missingStaticPods := maps.Keys(expectedStaticPods)
slices.Sort(missingStaticPods)

return fmt.Errorf("missing static pods on node %s: %v", node.InternalIP, missingStaticPods)
}
}

Expand Down

0 comments on commit b222d50

Please sign in to comment.