@@ -77,14 +77,14 @@ func (s *ClusterPodConventionSpec) Validate() validation.FieldErrors {
77
77
errs = errs .Also (validation .ErrMissingField ("webhook" )).Also (validation .ErrMissingField ("ytt" ))
78
78
79
79
} else {
80
- // validate via the ytt field as well
81
- // return multiple errors for this to request a desired configuration
82
-
83
80
// only invoke webhook validations if the ytt configuration is not being used
84
81
if s .Ytt == nil && s .Webhook != nil {
85
82
errs = errs .Also (s .Webhook .Validate ().ViaField ("webhook" ))
86
83
}
87
- // errs = errs.Also(s.Ytt.Validate().ViaField("ytt"))
84
+ // only invoke ytt validations if the webhook configuration is not being used
85
+ if s .Webhook == nil && s .Ytt != nil {
86
+ errs = errs .Also (s .Webhook .Validate ().ViaField ("ytt" ))
87
+ }
88
88
}
89
89
90
90
if s .SelectorTarget != PodTemplateSpecLabels && s .SelectorTarget != PodIntentLabels {
@@ -96,13 +96,13 @@ func (s *ClusterPodConventionSpec) Validate() validation.FieldErrors {
96
96
return errs
97
97
}
98
98
99
- // func (s *ClusterPodConventionYttTemplate) Validate() validation.FieldErrors {
100
- // errs := validation.FieldErrors{}
101
- // if s.Template == "" {
102
- // errs = errs.Also(validation.ErrMissingField("template"))
103
- // }
104
- // return errs
105
- // }
99
+ func (s * ClusterPodConventionYttTemplate ) Validate () validation.FieldErrors {
100
+ errs := validation.FieldErrors {}
101
+ if s .Template == "" {
102
+ errs = errs .Also (validation .ErrMissingField ("template" ))
103
+ }
104
+ return errs
105
+ }
106
106
107
107
func (s * ClusterPodConventionWebhook ) Validate () validation.FieldErrors {
108
108
errs := validation.FieldErrors {}
0 commit comments