Merge pull request #91 from digitalocean/awg/label-check-stable-output
Make "details" for the label check stablewwarren/update-k8s-deps
commit
37326c1fc5
|
@ -18,6 +18,7 @@ package doks
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/digitalocean/clusterlint/checks"
|
||||
|
@ -57,6 +58,9 @@ func (c *nodeLabelsTaintsCheck) Run(objects *kube.Objects) ([]checks.Diagnostic,
|
|||
}
|
||||
}
|
||||
if len(customLabels) > 0 {
|
||||
// The order of the map iteration above is non-deterministic, so
|
||||
// sort the labels for stable output.
|
||||
sort.Strings(customLabels)
|
||||
d := checks.Diagnostic{
|
||||
Severity: checks.Warning,
|
||||
Message: "Custom node labels will be lost if node is replaced or upgraded. Add custom labels on node pools instead.",
|
||||
|
|
|
@ -77,7 +77,7 @@ func TestNodeLabels(t *testing.T) {
|
|||
Severity: checks.Warning,
|
||||
Message: "Custom node labels will be lost if node is replaced or upgraded. Add custom labels on node pools instead.",
|
||||
Kind: checks.Node,
|
||||
Details: "Custom node labels: [example.com/custom-label example.com/another-label]",
|
||||
Details: "Custom node labels: [example.com/another-label example.com/custom-label]",
|
||||
Object: &metav1.ObjectMeta{
|
||||
Labels: map[string]string{
|
||||
"doks.digitalocean.com/foo": "bar",
|
||||
|
|
Loading…
Reference in New Issue