-
Notifications
You must be signed in to change notification settings - Fork 458
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
Ignore ctrlreg in deletion when computing required ctrlinsts #2612
Conversation
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.
Thanks, the change makes sense 👍 Can you add a new ControllerRegistration
with a deletionTimestamp
and support for resource kind/type that are used by one of the shoots here? That'd probably be enough to test this case (expectation would be that the computed list of required controller registrations doesn't change).
c637f45
to
0a7e98b
Compare
I have amend it to make it easier for testing. |
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.
Thanks for the PR, makes sense!
...trollermanager/controller/controllerregistration/controllerregistration_seed_control_test.go
Outdated
Show resolved
Hide resolved
pkg/controllermanager/controller/controllerregistration/controllerregistration_seed_control.go
Outdated
Show resolved
Hide resolved
/status author-action |
@vpnachev The pull request was assigned to you under |
...trollermanager/controller/controllerregistration/controllerregistration_seed_control_test.go
Outdated
Show resolved
Hide resolved
0a7e98b
to
29207ec
Compare
29207ec
to
dc6e109
Compare
An admission plugin has been implemented, in this way it is guaranteed that creation of a controller installation for controller registration in deletion will not succeed. The change in the controller is re-worked again and it now silently skips the creation of controller installation, however it still can update existing installations. I tried to implement some unit test about this change, something similar to Lines 772 to 823 in f2f47cc
|
Hm, I can't follow - why is such an admission plugin needed? I mean, what's the reason this is so important that we have to forbid it API-wise? Can't we save this code for good? The only code that creates
What exactly didn't you understand? If I see it correctly, the only thing you have to do is to add a |
I have no strong opinion, it was implemented just as a second prevention mechanism. Basically, applying the same approach by k8s community with namespaces - if it is in deletion, no new resources can be created in the namespace.
Exactly these What I really tried to do was to call |
Ok, I was thinking that this is coming from k8s.io, while it is actually from gomock - I will spend some time with this package. Together with @ialidzhikov we have taken a look through the change and he helped me a lot to understand more about the tests, especially for mocks and fake clients, and to implement one (thanks for that, @ialidzhikov !). In parallel, there is a validation that disallow |
88325eb
to
b4f7f3d
Compare
pkg/controllermanager/controller/controllerregistration/controllerregistration_seed_control.go
Outdated
Show resolved
Hide resolved
/invite @timuthy @danielfoehrKn @BeckerMax |
/assign @ialidzhikov |
pkg/controllermanager/controller/controllerregistration/controllerregistration_seed_control.go
Outdated
Show resolved
Hide resolved
b4f7f3d
to
2b09678
Compare
The admission plugin has been removed. |
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
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
How to categorize this PR?
/area quality
/kind bug
/priority normal
What this PR does / why we need it:
Ignore ControllerRegistration in deletion when computing required ControllerInstalations.
To properly apply gardener/gardener-extension-os-suse-chost#20 on existing landscapes, it is necessary to manually delete the existing controller installations. However, on large landscapes GCM creates new controller installations before the last old one to be deleted. With this change, once the deletion of the controller registration is triggered, no new installations will be made out of it.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: