diff --git a/pkg/util/ingress/ingress_test.go b/pkg/util/ingress/ingress_test.go index c2deda388..3bd7f1230 100644 --- a/pkg/util/ingress/ingress_test.go +++ b/pkg/util/ingress/ingress_test.go @@ -249,23 +249,23 @@ func TestValidateIngressPath(t *testing.T) { copyIng: generateDumbIngressforPathTest(&pathTypePrefix, ""), }, { - name: "should deny path with bad characters and pathType not implementationSpecific", - EnablePathTypeValidation: true, - wantErr: true, - additionalChars: "()", - copyIng: generateDumbIngressforPathTest(&pathTypeExact, "/foo/bar/(.+)"), + name: "should deny path with bad characters and pathType not implementationSpecific", + wantErr: true, + additionalChars: "()", + copyIng: generateDumbIngressforPathTest(&pathTypeExact, "/foo/bar/(.+)"), }, { - name: "should accept path with regex characters and pathType implementationSpecific", - wantErr: false, - additionalChars: defaultAdditionalChars, - copyIng: generateDumbIngressforPathTest(&pathTypeImplSpecific, "/foo/bar/(.+)"), + name: "should accept path with regex characters and pathType implementationSpecific", + wantErr: false, + additionalChars: defaultAdditionalChars, + EnablePathTypeValidation: false, + copyIng: generateDumbIngressforPathTest(&pathTypeImplSpecific, "/foo/bar/(.+)"), }, { name: "should accept path with regex characters and pathType exact, but pathType validation disabled", wantErr: false, additionalChars: defaultAdditionalChars, - EnablePathTypeValidation: true, + EnablePathTypeValidation: false, copyIng: generateDumbIngressforPathTest(&pathTypeExact, "/foo/bar/(.+)"), }, { @@ -276,20 +276,23 @@ func TestValidateIngressPath(t *testing.T) { copyIng: generateDumbIngressforPathTest(&pathTypeImplSpecific, "/foo/bar/(.+)"), }, { - name: "should accept path when the allowed additional set does match", - wantErr: false, - additionalChars: "().?", - copyIng: generateDumbIngressforPathTest(&pathTypeImplSpecific, "/foo/bar/(.?)"), + name: "should accept path when the allowed additional set does match", + wantErr: false, + additionalChars: "().?", + EnablePathTypeValidation: false, + copyIng: generateDumbIngressforPathTest(&pathTypeImplSpecific, "/foo/bar/(.?)"), }, { - name: "should block if at least one path is bad", - wantErr: true, - copyIng: generateComplexIngress(generateDumbIngressforPathTest(&pathTypeExact, "/foo/bar/(.?)")), + name: "should block if at least one path is bad", + wantErr: true, + EnablePathTypeValidation: false, + copyIng: generateComplexIngress(generateDumbIngressforPathTest(&pathTypeExact, "/foo/bar/(.?)")), }, { - name: "should block if at least one path is bad", - wantErr: true, - copyIng: generateComplexIngress(generateDumbIngressforPathTest(&pathTypeImplSpecific, "/foo/bar/(.?)")), + name: "should block if at least one path is bad", + wantErr: true, + EnablePathTypeValidation: false, + copyIng: generateComplexIngress(generateDumbIngressforPathTest(&pathTypeImplSpecific, "/foo/bar/(.?)")), }, } for _, tt := range tests {