Admissionwebhook misses faulty regex
Is there an existing issue for this?
- [X] I have searched the existing issues
Kong version ($ kong version)
3.6.1
Current Behavior
Adding following faulty HTTPRoute:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: broken-http-route
annotations:
konghq.com/strip-path: "false"
konghq.com/preserve-host: "false"
konghq.com/protocols: https
spec:
hostnames:
- broken.api-ch-dev.balgroupit.com
rules:
- matches:
- path:
type: RegularExpression
value: .*\.do
- path:
type: RegularExpression
value: .*\.css
- path:
type: RegularExpression
value: .*\.woff2
- path:
type: RegularExpression
value: .*\.js
- path:
type: RegularExpression
value: .*\.svg
backendRefs:
- name: echo-host-service
kind: Service
port: 1027
is not rejected by the AdmissionWebhook while the IngressController discovers the error:
Update route httproute.ch-kong-dev.broken-http-route.0.0 failed: HTTP status 400 (message: "5 schema violations (paths.1: should start with: / (fixed path) or ~/ (regex path); paths.2: should start with: / (fixed path) or ~/ (regex path); paths.3: should start with: / (fixed path) or ~/ (regex path); paths.4: should start with: / (fixed path) or ~/ (regex path); paths.5: should start with: / (fixed path) or ~/ (regex path))")
Expected Behavior
Admissionwebhook rejects the HTTPRoute.
Steps To Reproduce
See current behaviour
Anything else?
No response
@randmonkey , could you take a look at this?
@MarkusFlorian79 KIC enables validation on HTTPRoute to check if the spec is valid (will not generate invalid Kong configuration) since 2.12. Please check if your KIC version is below 2.12 or admission webhooks are not configured correctly.
This issue is marked as stale because it has been open for 14 days with no activity.
Dear contributor,
We are automatically closing this issue because it has not seen any activity for three weeks. We're sorry that your issue could not be resolved. If any new information comes up that could help resolving it, please feel free to reopen it.
Your contribution is greatly appreciated!
Please have a look our pledge to the community for more information.
Sincerely, Your Kong Gateway team