-
Notifications
You must be signed in to change notification settings - Fork 500
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
statefulsets are updated during each sync even if no changes to the config #2308
Conversation
/merge |
/run-all-tests |
1 similar comment
/run-all-tests |
@DanielZhangQD merge failed. |
/merge |
/run-all-tests |
@DanielZhangQD merge failed. |
/merge |
/run-all-tests |
@DanielZhangQD merge failed. |
/merge |
/run-all-tests |
@DanielZhangQD merge failed. |
OK, Thanks! |
/merge |
/run-all-tests |
1 similar comment
/run-all-tests |
@DanielZhangQD merge failed. |
/merge |
/run-all-tests |
@DanielZhangQD merge failed. |
/run-e2e-in-kind |
pkg/manager/member/utils.go
Outdated
@@ -100,7 +100,14 @@ func GetLastAppliedConfig(set *apps.StatefulSet) (*apps.StatefulSetSpec, *corev1 | |||
|
|||
// statefulSetEqual compares the new Statefulset's spec with old Statefulset's last applied config | |||
func statefulSetEqual(new apps.StatefulSet, old apps.StatefulSet) bool { | |||
if !apiequality.Semantic.DeepEqual(new.Annotations, old.Annotations) { | |||
// The annotations in old sts may include LastAppliedConfigAnnotation | |||
var tmpAnno map[string]string |
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.
var tmpAnno map[string]string | |
tmpAnno := make(map[string]string) |
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.
fix panic
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 a lot! Fixed.
pkg/manager/member/utils.go
Outdated
if _, ok := tmpTemplate.Annotations[LastAppliedConfigAnnotation]; ok { | ||
delete(tmpTemplate.Annotations, LastAppliedConfigAnnotation) | ||
} |
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.
if _, ok := tmpTemplate.Annotations[LastAppliedConfigAnnotation]; ok { | |
delete(tmpTemplate.Annotations, LastAppliedConfigAnnotation) | |
} | |
delete(tmpTemplate.Annotations, LastAppliedConfigAnnotation) |
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.
more concise
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.
Updated
cherry pick to release-1.1 in PR #2325 |
What problem does this PR solve?
statefulsets are updated during each sync even if no changes to the config
What is changed and how does it work?
Fix the equality check logic
Check List
Tests
Code changes
Related changes
Does this PR introduce a user-facing change?: