-
Notifications
You must be signed in to change notification settings - Fork 11
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
KIM - Fix of the problem with removing exiting shoots using client.Update function to change shoot workers #650
base: main
Are you sure you want to change the base?
KIM - Fix of the problem with removing exiting shoots using client.Update function to change shoot workers #650
Conversation
copyShoot := s.shoot.DeepCopy() | ||
copyShoot.Spec.Provider.Workers = updatedShoot.Spec.Provider.Workers | ||
|
||
err = m.ShootClient.Update(ctx, copyShoot, |
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.
could you just shortly describe in a comment why this second update is needed?
Also, do you think it would be worth to extract this to another method such as `handleWorkerPoolsUpdate() to clearly distinguish which code is responsible for this exceptional logic?
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'm wondering if it would make sense to check if shootWorkers differ from the ones specified in runtimeCR and doing additional update only if they do.
What do you think?
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.
There is the whole workers comparison and matching logic inside converter, this idea would imply this code would have to be duplicated. I can try to come up with something
… shoot workers, restore old convert code
Description
Fix for the bug for scenario when user wanted to remove some workers initially created with the shoot.
Affected scenarios:
Proposed two steps operation as a fix:
client.Update
using existing shoot as a baseclient.Patch
as in the previous approachRelated issue(s)
Additional worker node pools are not removed from shoot