Skip to content

Commit 90d5d73

Browse files
committed
fix: test trigger type usage
1 parent 9d76c32 commit 90d5d73

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

controllers/testtriggers/testtrigger_validator.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -176,24 +176,24 @@ func validateLabelSelector(labelSelector *v1.LabelSelector, fld *field.Path) (em
176176
return s.Empty(), nil
177177
}
178178

179-
func (v *Validator) validateResource(resource string) *field.Error {
180-
if !utils.In(resource, testtrigger.GetSupportedResources()) {
179+
func (v *Validator) validateResource(resource testtriggerv1.TestTriggerResource) *field.Error {
180+
if !utils.In(string(resource), testtrigger.GetSupportedResources()) {
181181
fld := field.NewPath("spec").Child("resource")
182182
return field.NotSupported(fld, resource, testtrigger.GetSupportedResources())
183183
}
184184
return nil
185185
}
186186

187-
func (v *Validator) validateAction(action string) *field.Error {
188-
if !utils.In(action, testtrigger.GetSupportedActions()) {
187+
func (v *Validator) validateAction(action testtriggerv1.TestTriggerAction) *field.Error {
188+
if !utils.In(string(action), testtrigger.GetSupportedActions()) {
189189
fld := field.NewPath("spec").Child("action")
190190
return field.NotSupported(fld, action, testtrigger.GetSupportedActions())
191191
}
192192
return nil
193193
}
194194

195-
func (v *Validator) validateExecution(execution string) *field.Error {
196-
if !utils.In(execution, testtrigger.GetSupportedExecutions()) {
195+
func (v *Validator) validateExecution(execution testtriggerv1.TestTriggerExecution) *field.Error {
196+
if !utils.In(string(execution), testtrigger.GetSupportedExecutions()) {
197197
fld := field.NewPath("spec").Child("execution")
198198
return field.NotSupported(fld, execution, testtrigger.GetSupportedExecutions())
199199
}

0 commit comments

Comments
 (0)