generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 618
Closed
Labels
area/webhookgood first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
Description
What happened:
Looking through the HTTPRequestRedirectFilter spec, the Hostname used has a default kubebuilder validation regex which would allow a user to specify a redirect of *.foo.com which might not make sense as a redirect hostname.
Controllers could catch this and set a condition, we could update the field to use a new hostname type which removes the ability to have a wildcard in the value, or maybe there's a use-case I'm not thinking of that folks would want this?
What you expected to happen:
Hostnames with wildcards would be rejected.
How to reproduce it (as minimally and precisely as possible):
Here's a sample HTTPRoute:
kind: HTTPRoute
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: kuard
namespace: projectcontour
labels:
app: kuard
spec:
parentRefs:
- group: gateway.networking.k8s.io
kind: Gateway
name: contour
hostnames:
- "local.projectcontour.io"
rules:
- matches:
- path:
type: PathPrefix
value: /
filters:
- requestRedirect:
hostname: "*.stevesloka.com"
scheme: https
statusCode: 302
type: RequestRedirect
backendRefs:
- kind: Service
name: kuard
port: 80Right now Contour configures Envoy:
$ curl -i local.projectcontour.io
HTTP/1.1 302 Found
location: https://*.stevesloka.com/
vary: Accept-Encoding
date: Tue, 30 Nov 2021 17:37:35 GMT
server: envoy
content-length: 0
Metadata
Metadata
Assignees
Labels
area/webhookgood first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.Denotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
