fix: make static pods check output consistent

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>
This commit is contained in:
Andrey Smirnov 2024-04-08 19:47:56 +04:00
parent c6ad0fcceb
commit b0fdc3c8ca
No known key found for this signature in database
GPG Key ID: FE042E3D4085A811

View File

@ -9,6 +9,7 @@ import (
"context"
"fmt"
"net/netip"
"slices"
"strings"
"github.com/cosi-project/runtime/pkg/safe"
@ -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)
}
}