-
Notifications
You must be signed in to change notification settings - Fork 498
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
Fix sts webhook error #2291
Fix sts webhook error #2291
Conversation
klog.Infof("statefulset %s/%s has been protect by partition %s annotations", namespace, name, partitionStr) | ||
return util.ARFail(errors.New("protect by partition annotation")) | ||
} | ||
klog.Infof("admit statefulset %s/%s update partition to %d, protect partition is %d", namespace, name, setPartition, partition) | ||
klog.Infof("admit statefulset %s/%s update partition to %d, protect partition is %d", namespace, name, *stsPartition, partition) |
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.
stsPartition
is possible to be nil here.
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
if set.Spec.UpdateStrategy.RollingUpdate != nil { | ||
return &(set.ObjectMeta), set.Spec.UpdateStrategy.RollingUpdate.Partition, nil | ||
} | ||
return &(set.ObjectMeta), nil, nil |
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.
the code seems identical no matter what apiVersion is?
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.
Suggested release note:
https://github.com/pingcap/tidb-operator/blob/master/docs/release-note-guide.md |
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
/merge |
/run-all-tests |
cherry pick to release-1.1 in PR #2306 |
What problem does this PR solve?
Fix the error which would cause panic for sts webhook when sts updated strategy is not rolling updated.
Does this PR introduce a user-facing change?: