There was an error while loading. Please reload this page.
1 parent dde7787 commit 39244cbCopy full SHA for 39244cb
1 file changed
cmd/tester/main.go
@@ -94,7 +94,14 @@ func main() {
94
95
validateErrs := v1alpha1cip.Validate(ctx)
96
if validateErrs != nil {
97
- log.Fatalf("CIP is invalid: %s", validateErrs.Error())
+ // CIP validation can return Warnings so let's just go through them
98
+ // and only exit if there are Errors.
99
+ if warnFE := validateErrs.Filter(apis.WarningLevel); warnFE != nil {
100
+ log.Printf("CIP has warnings:\n%s\n", warnFE.Error())
101
+ }
102
+ if errorFE := validateErrs.Filter(apis.ErrorLevel); errorFE != nil {
103
+ log.Fatalf("CIP is invalid: %s", errorFE.Error())
104
105
}
106
cip := webhookcip.ConvertClusterImagePolicyV1alpha1ToWebhook(&v1alpha1cip)
107
0 commit comments