-
Notifications
You must be signed in to change notification settings - Fork 352
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
validator: make sure Ingress/RouteGroup doesn't have duplicate hosts #2753
Conversation
@@ -0,0 +1,28 @@ | |||
apiVersion: zalando.org/v1 |
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.
I think the test fixture for Ingress is missing
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.
Right now we don't validate ingress in skipper we only do in ValidationWebhook, I think we will need another PR to migrate current ingress adhock validation to validator object.
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.
What I mean by adhock validation https://github.com/zalando/skipper/blob/master/dataclients/kubernetes/ingress.go#L257C1-L269C2
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.
@@ -0,0 +1,41 @@ | |||
{ | |||
"request": { |
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.
I still think we do not need to add tests for admission webhook when we change validator, its just increases size of PR but adds no value as webhook simply calls validator
8828e25
to
6df46c7
Compare
@MustafaSaber What's up with this one? Looks like it needs rebase |
This was based on |
Revert PR |
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
dbbe504
to
2b64634
Compare
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
👍 |
1 similar comment
👍 |
for _, rule := range item.Spec.Rules { | ||
if _, ok := uniqueHosts[rule.Host]; ok { | ||
errs = append(errs, fmt.Errorf("duplicate host %q", rule.Host)) | ||
} | ||
uniqueHosts[rule.Host] = struct{}{} | ||
} |
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.
I think ingress rules may have the same host repeated with different rules, lets check
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.
We agreed to disable duplicate hostname validation for ingress.
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.
Relates to #1618