Skip to content

Commit c4fe549

Browse files
authored
Remove overly aggressive annotation validator
Annotations are not labels and should not be validated as such, as this potential messes up apply annotations that are valid.
1 parent 8116154 commit c4fe549

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

pgo/cmd/cluster.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"strings"
2323

2424
"github.com/spf13/cobra"
25-
"k8s.io/apimachinery/pkg/util/validation"
2625

2726
"github.com/crunchydata/postgres-operator/pgo/api"
2827
"github.com/crunchydata/postgres-operator/pgo/util"
@@ -573,17 +572,6 @@ func setClusterAnnotationGroup(annotationGroup map[string]string, annotations []
573572
os.Exit(1)
574573
}
575574

576-
// validate if this the parts are valid annotation names
577-
for _, v := range parts {
578-
if errs := validation.IsValidLabelValue(v); len(errs) != 0 {
579-
fmt.Println(fmt.Sprintf("Error: %q is not valid for an annotation.", v))
580-
for _, e := range errs {
581-
fmt.Println(e)
582-
}
583-
os.Exit(1)
584-
}
585-
}
586-
587575
annotationGroup[parts[0]] = parts[1]
588576
}
589577
}

0 commit comments

Comments
 (0)