-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for wildcards in k8s ingress host, fixes #792 #1029
Conversation
rule := "Host:" + r.Host | ||
|
||
if strings.Contains(r.Host, "*") { | ||
rule = "HostRegexp:" + strings.Replace(r.Host, "*", "{subdomain:[a-z]+}", 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The subdomain rule you implemented here does not allow for capital letters, numbers, or dashes/underscores. This means that ww2.example.com
will not have a properly matched rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dtomcej I've changed it to allow dashes and capital letter, but I believe underscores are disallowed in domain names, aren't they?
http://stackoverflow.com/a/2183140 The commenter is correct, many services include underscores in the subdomains. |
@dtomcej fixed |
Why not just _test.example.com |
@dtomcej fixed |
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
If we allow PS: I edited my comment, read too quickly ;) |
Example ingress: