Skip to content

Commit 1465949

Browse files
committed
[api/extensions] Allow empty mode when GoPluginSource is set
1 parent ce659cf commit 1465949

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/extensions/v1alpha2/validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (r *EdgeFunction) validate() field.ErrorList {
6262
errs = append(errs, field.Invalid(field.NewPath("spec").Child("template").Child("mode"), r, "mode must be either 'filter' or 'backend'"))
6363
}
6464

65-
if spec.Template.Code.GoPluginSource != nil && spec.Template.Mode != FilterEdgeFunctionMode {
65+
if spec.Template.Code.GoPluginSource != nil && (spec.Template.Mode != FilterEdgeFunctionMode || spec.Template.Mode != "") {
6666
errs = append(errs, field.Invalid(field.NewPath("spec").Child("template").Child("code").Child("goPluginSource"), r, "goPluginSource can only be specified when mode is 'filter'"))
6767
}
6868

0 commit comments

Comments
 (0)