-
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
fix(gracedelete webhook): limit the PodDeletionIndicationLabel update… #197
Conversation
… frequency to avoid update conflict
@@ -37,6 +37,10 @@ import ( | |||
"sigs.k8s.io/controller-runtime/pkg/client" | |||
) | |||
|
|||
var ( | |||
updatePodDeletionIndicationLabelInterval = 5 * 1000 * 1000 * 1000 |
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.
change to 5*time.Second
?
…rval to updateGraceDeleteTimestampAnnoInterval
// limit the AnnotationGraceDeleteTimestamp update frequency to updateGraceDeleteTimestampAnnoInterval, | ||
// to avoid update conflict caused by workload delete pod constantly | ||
if timestamp, ok := newPod.Annotations[appsv1alpha1.AnnotationGraceDeleteTimestamp]; ok { | ||
unixNano, err := strconv.ParseInt(timestamp, 10, 64) |
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.
unixNano => lastDeleteTimestamp
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
… frequency to avoid update conflict
1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):
2. What is the scope of this PR (e.g. component or file name):
pkg/webhook/server/generic/pod/gracedelete/webhook.go
3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):
Fix GraceDelete#Validating method bug. Limit the PodDeletionIndicationLabel update frequency to 10s(default), to avoid update conflict when workload update or scale down, delete pod constantly.
4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):
5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:
6. Release note