Skip to content
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

webhook: validate skipper annotations in ingress #2493

Merged
merged 11 commits into from
Aug 10, 2023

Conversation

MustafaSaber
Copy link
Member

@MustafaSaber MustafaSaber commented Aug 3, 2023

This should introduce the custom ValidationWebhook for skipper ingress annotations (e.g zalando.org/skipper-routes, zalando.org/skipper-filter and zalando.org/skipper-predicate), currently we skip the annotation if something is wrong from skipper side at https://github.com/zalando/skipper/blob/master/dataclients/kubernetes/ingress.go#L227-L271

This is also a followup to #1618 & #2478

@MustafaSaber MustafaSaber self-assigned this Aug 3, 2023
@MustafaSaber MustafaSaber force-pushed the validate-skipper-annotations-in-ingress branch from f5698b8 to ecf9af6 Compare August 8, 2023 09:55
cmd/webhook/admission/admission_test.go Outdated Show resolved Hide resolved
@@ -0,0 +1,50 @@
package admission
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets name the file ingress.go as it is in the admission folder.

Copy link
Member

@szuecs szuecs Aug 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should rename admission to validation, because we do not plan to change documents but to validate them.
In Kubernetes docs this is not really great documented, but there are both and there are (or were?) both registered as admission webhook AFAIK.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are exported symbols. If we rename I propose we unexport everything to allow active development.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we wait to see in the next steps, it make sense because we may move this package to another place for filter registry, maybe we can rename with the movement?

cmd/webhook/admission/ingressadmission.go Outdated Show resolved Hide resolved
cmd/webhook/admission/ingressadmission.go Outdated Show resolved Hide resolved
cmd/webhook/admission/ingressadmission.go Outdated Show resolved Hide resolved
cmd/webhook/admission/ingressadmission.go Outdated Show resolved Hide resolved
cmd/webhook/admission/rgadmission.go Outdated Show resolved Hide resolved
dataclients/kubernetes/definitions/ingressvalidator.go Outdated Show resolved Hide resolved
@MustafaSaber MustafaSaber force-pushed the validate-skipper-annotations-in-ingress branch from fdc381e to 42afc18 Compare August 9, 2023 13:58
@MustafaSaber MustafaSaber force-pushed the validate-skipper-annotations-in-ingress branch 2 times, most recently from 4e0ac28 to 9e8c82a Compare August 9, 2023 18:46
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
address comments

Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
…ded for backward comptiability

Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Add validatior to admitter

Export skipper ingress annotations

Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Clean admitter functions

Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
This reverts commit 0cd73f2.

Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
@MustafaSaber MustafaSaber force-pushed the validate-skipper-annotations-in-ingress branch from 9e8c82a to 53f054d Compare August 9, 2023 18:47
@AlexanderYastrebov
Copy link
Member

👍

1 similar comment
@MustafaSaber
Copy link
Member Author

👍

@MustafaSaber MustafaSaber merged commit 679e064 into master Aug 10, 2023
11 checks passed
@MustafaSaber MustafaSaber deleted the validate-skipper-annotations-in-ingress branch August 10, 2023 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants