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

operator: rework webhooks #1906

Merged
merged 1 commit into from
Nov 20, 2024
Merged

operator: rework webhooks #1906

merged 1 commit into from
Nov 20, 2024

Conversation

mythi
Copy link
Contributor

@mythi mythi commented Nov 12, 2024

the next controller-runtime drops deprecated webhook.Defaulter/Validator. Move to admission.CustomDefaulter/Validator

@mythi mythi force-pushed the PR-2024-024 branch 2 times, most recently from 12b749d to 1b68395 Compare November 12, 2024 14:55
@mythi
Copy link
Contributor Author

mythi commented Nov 13, 2024

mostly untested and could use a bit of help

build operator from this PR and test deploy modified samples (e.g., without Image and with an old version). observe the webhook logs look sane

@mythi mythi marked this pull request as ready for review November 13, 2024 09:34
@mythi mythi force-pushed the PR-2024-024 branch 2 times, most recently from 1c2ebd7 to 00a50ab Compare November 14, 2024 09:57
Copy link
Contributor

@tkatila tkatila left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Contributor

@tkatila tkatila left a comment

Choose a reason for hiding this comment

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

Less copy-paste 👍

Copy link
Contributor

@eero-t eero-t left a comment

Choose a reason for hiding this comment

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

Great refactoring! I think this reveals more code with non-relevant differences that could be shared between plugins though...

@mythi
Copy link
Contributor Author

mythi commented Nov 18, 2024

pushed an update since I had expectedImage set wrong (intel-x-image but it should be intel-x-plugin)

controller-runtime has deprecated webhook.Defaulter/Validator and they
will be removed in the next controller-runtime release.

Move deviceplugin webhooks to use admission.CustomDefaulter/Validator.
Common defaulter/validator types can serve all the plugins with only
plugin specific data initialized.

As part of the rework, move away from (the unmaintained) pkg/errors
to errors in Go standard library.

Signed-off-by: Mikko Ylinen <[email protected]>
@tkatila tkatila merged commit 8dd66f5 into intel:main Nov 20, 2024
75 checks passed
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.

3 participants