-
Notifications
You must be signed in to change notification settings - Fork 39
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
[controller] Add logic to update StatefulSets #236
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1beef78
[controller] Add logic to update StatefulSets
jeromefroe f1db6ed
Ensure go mod is up to date
jeromefroe 22dde4d
Use DeepDerivative to determine if we should perform an update
jeromefroe e2a5428
Fix typo
jeromefroe 3ef8892
Change value of update annotation from true to enabled
jeromefroe e11bfdb
Fix tests
jeromefroe 03df9e9
Update signature of updatedStatefulSet function
jeromefroe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Image and config updates are definitely the most common case we want to cover, so from that perspective this looks good. There are definitely other cases where the cluster CRD changes and we want to update the statefulsets, and I'm wondering how to address that here. Two thoughts:
Any idea what happens if we try to
DeepEqual
the generated spec and the current spec on the cluster? I'm guessing the Kubernetes API makes some sort of transformations that make that not totally possible, but I'm curious.Assuming
DeepEqual
doesn't work, what do you think about a second annotation that will trigger anUpdate
regardless of whether image and config has changed?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've always had difficulties using
DeepEqual
in the past because the API server sets default (non-zero) values for so many fields. Based on thiskubebuilder
issue though, it seems that we could useDeepDerivative
instead since it "is similar to DeepEqual except that unset fields in a1 are ignored ". That issue also mentionsgithub.com/banzaicloud/k8s-objectmatcher
as another alternative ifDeepDerivative
doesn't work for us. If neither package is sufficient though I'm not opposed to having aforce-update
annotation or something similar which will always trigger an update.