diff --git a/cmd/webhook/admission/admission_test.go b/cmd/webhook/admission/admission_test.go index 1bba80b425..a2ad4b26da 100644 --- a/cmd/webhook/admission/admission_test.go +++ b/cmd/webhook/admission/admission_test.go @@ -133,11 +133,6 @@ func TestRouteGroupAdmitter(t *testing.T) { inputFile: "rg-with-multiple-predicates.json", message: `single predicate expected at \"Method(\\\"GET\\\") && Path(\\\"/\\\")\"\nsingle predicate expected at \" \"`, }, - { - name: "routegroup with invalid backends", - inputFile: "rg-with-invalid-backend-path.json", - message: `backend address \"http://example.com/foo\" does not match scheme://host format\nbackend address \"http://example.com/foo/bar\" does not match scheme://host format\nbackend address \"http://example.com/foo/\" does not match scheme://host format\nbackend address \"/foo\" does not match scheme://host format\nbackend address \"http://example.com/\" does not match scheme://host format\nbackend address \"example.com/\" does not match scheme://host format\nbackend address \"example.com/foo\" does not match scheme://host format\nbackend address \"http://example.com?foo=bar\" does not match scheme://host format\nbackend address \"example.com\" does not match scheme://host format`, - }, } { t.Run(tc.name, func(t *testing.T) { expectedResponse := responseAllowedFmt diff --git a/dataclients/kubernetes/definitions/routegroupvalidator.go b/dataclients/kubernetes/definitions/routegroupvalidator.go index 24b003f0f2..3fc21edaa0 100644 --- a/dataclients/kubernetes/definitions/routegroupvalidator.go +++ b/dataclients/kubernetes/definitions/routegroupvalidator.go @@ -38,7 +38,7 @@ func (rgv *RouteGroupValidator) Validate(item *RouteGroupItem) error { var errs []error errs = append(errs, rgv.validateFilters(item)) errs = append(errs, rgv.validatePredicates(item)) - errs = append(errs, rgv.validateBackends(item)) + // errs = append(errs, rgv.validateBackends(item)) return errorsJoin(errs...) } diff --git a/dataclients/kubernetes/definitions/testdata/errorwrapdata/errors.log b/dataclients/kubernetes/definitions/testdata/errorwrapdata/errors.log index a710227c99..836138e99f 100644 --- a/dataclients/kubernetes/definitions/testdata/errorwrapdata/errors.log +++ b/dataclients/kubernetes/definitions/testdata/errorwrapdata/errors.log @@ -4,10 +4,3 @@ single predicate expected at "Path(\"/foo\") && Method(\"GET\")" single predicate expected at "" single filter expected at "inlineContent(\"/foo\") -> status(200)" single filter expected at " " -backend address "http://example.com/foo" does not match scheme://host format -backend address "http://example.com/foo/bar" does not match scheme://host format -backend address "http://example.com/foo/" does not match scheme://host format -backend address "/foo" does not match scheme://host format -backend address "example.com/" does not match scheme://host format -backend address "http://example.com?foo=bar" does not match scheme://host format -backend address "example.com" does not match scheme://host format diff --git a/dataclients/kubernetes/definitions/testdata/errorwrapdata/routegroups.json b/dataclients/kubernetes/definitions/testdata/errorwrapdata/routegroups.json index c512a644bc..936370dc3b 100644 --- a/dataclients/kubernetes/definitions/testdata/errorwrapdata/routegroups.json +++ b/dataclients/kubernetes/definitions/testdata/errorwrapdata/routegroups.json @@ -148,46 +148,6 @@ "type": "network", "address": "http://example.com" }, - { - "name": "backend2", - "type": "network", - "address": "http://example.com/foo" - }, - { - "name": "backend3", - "type": "network", - "address": "http://example.com/foo/bar" - }, - { - "name": "backend4", - "type": "network", - "address": "http://example.com/foo/" - }, - { - "name": "backend5", - "type": "network", - "address": "/foo" - }, - { - "name": "backend6", - "type": "network", - "address": "example.com/" - }, - { - "name": "backend7", - "type": "network", - "address": "http://user:pass@example.com" - }, - { - "name": "backend8", - "type": "network", - "address": "http://example.com?foo=bar" - }, - { - "name": "backend9", - "type": "network", - "address": "example.com" - }, { "name": "shunt", "type": "shunt" diff --git a/dataclients/kubernetes/definitions/testdata/validation/route-with-invalid-backend-with-path.log b/dataclients/kubernetes/definitions/testdata/validation/route-with-invalid-backend-with-path.log deleted file mode 100644 index 04eac42162..0000000000 --- a/dataclients/kubernetes/definitions/testdata/validation/route-with-invalid-backend-with-path.log +++ /dev/null @@ -1,8 +0,0 @@ -backend address \\\"http://example\.com/foo\\\" does not match scheme://host format -backend address \\\"http://example\.com/foo/bar\\\" does not match scheme://host format -backend address \\\"/foo\\\" does not match scheme://host format -backend address \\\"/foo/bar\\\" does not match scheme://host format -backend address \\\"example\.com/foo\\\" does not match scheme://host format -backend address \\\"http://example\.com/\\\" does not match scheme://host format -backend address \\\"http://example\.com\?foo=bar\\\" does not match scheme://host format -backend address \\\"example\.com\\\" does not match scheme://host format diff --git a/dataclients/kubernetes/definitions/testdata/validation/route-with-invalid-backend-with-path.yaml b/dataclients/kubernetes/definitions/testdata/validation/route-with-invalid-backend-with-path.yaml deleted file mode 100644 index dc7b64a935..0000000000 --- a/dataclients/kubernetes/definitions/testdata/validation/route-with-invalid-backend-with-path.yaml +++ /dev/null @@ -1,56 +0,0 @@ -apiVersion: zalando.org/v1 -kind: RouteGroup -metadata: - name: test-route-group -spec: - hosts: - - example.org - backends: - - name: app - type: service - serviceName: app-svc - servicePort: 80 - - name: backend1 - type: network - address: http://example.com - - name: backend2 - type: network - address: http://example.com/foo - - name: backend3 - type: network - address: http://example.com/foo/bar - - name: backend4 - type: network - address: /foo - - name: backend5 - type: network - address: /foo/bar - - name: backend6 - type: network - address: example.com/foo - - name: backend7 - type: network - address: http://example.com/ - - name: backend8 - type: network - address: http://user:pass@example.com - - name: backend9 - type: network - address: http://example.com?foo=bar - - name: backend10 - type: network - address: example.com - defaultBackends: - - backendName: app - routes: - - path: / - methods: - - GET - - HEAD - predicates: - - Foo("X-Bar", "42") - filters: - - foo(42) - - bar(24) - backends: - - backendName: app