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

feat: enable webhooks in sidero-controller-manager #812

Merged
merged 1 commit into from
Apr 8, 2022

Conversation

Unix4ever
Copy link
Member

Based on #794, but instead of
using a dedicated controller for all webhooks keep all of them in each
own controller.

Additionally, implement validation webhooks for Server resource, which
validates that bootFromDiskMethod and configPatches are using proper
values.

Signed-off-by: Artem Chernyshev artem.chernyshev@talos-systems.com

Copy link
Member

@smira smira left a comment

Choose a reason for hiding this comment

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

do webhooks work for the caps-controller-manager as well?

@Unix4ever
Copy link
Member Author

do webhooks work for the caps-controller-manager as well?

They should, but I haven't really verified that.

@smira
Copy link
Member

smira commented Apr 7, 2022

do webhooks work for the caps-controller-manager as well?

They should, but I haven't really verified that.

It might be nice to verify that, e.g. with some validation once again, even if that's temporary.

@Unix4ever
Copy link
Member Author

Unix4ever commented Apr 8, 2022

do webhooks work for the caps-controller-manager as well?

They should, but I haven't really verified that.

It might be nice to verify that, e.g. with some validation once again, even if that's temporary.

Yep, there actually was an issue with the configs. I've fixed that:
Bumped the version to v1. It will simplify enabling validation webhooks in the future.

Based on siderolabs#794, but instead of
using a dedicated controller for all webhooks keep all of them in each
own controller.

Additionally, implement validation webhooks for `Server` resource, which
validates that `bootFromDiskMethod` and `configPatches` are using proper
values.

Signed-off-by: Artem Chernyshev <artem.chernyshev@talos-systems.com>
@Unix4ever
Copy link
Member Author

/m

@@ -216,6 +217,7 @@ func main() {
os.Exit(1)
}

setupWebhooks(mgr)
Copy link
Contributor

Choose a reason for hiding this comment

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

I still don't get how this would work. In #794 I used a dedicated controller for the webhooks because the reconcilers above this line are actively using the conversion webhooks.

To my understanding this will cause Sidero to be unable to start when any of the CRD's change like proposed in #735, because in that case the reconcilers will try to convert them using the conversion webhooks defined here (but at that point, they are not yet available).

Copy link
Member

Choose a reason for hiding this comment

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

@lion7 I'm going to take a closer look today at your PR and do more testing for the conversion

Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏻 that would be great, in that case I'll wait with rebasing #735 so it won't accidentally break (I have a working deployment of it running on my cluster).

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.

4 participants