-
Notifications
You must be signed in to change notification settings - Fork 552
Bug 1939294: Avoid setting metadata.GracePeriodSeconds to zero seconds #2047
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
Bug 1939294: Avoid setting metadata.GracePeriodSeconds to zero seconds #2047
Conversation
23d97ba
to
0acd9f3
Compare
@timflannagan: This pull request references Bugzilla bug 1939294, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@openshift-ci-robot: GitHub didn't allow me to request PR reviews from the following users: jianzhangbjz. Note that only operator-framework members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
Hmm, I searched for that upgrade error in the openshift CI search tool and it looks like a known flake. Going to try and retest again before pinging the monitoring team. /retest |
/retest |
/lgtm |
0acd9f3
to
c5a192a
Compare
Update any references where we set the metadata.GracePeriodSeconds field to zero seconds. If we need a Pod to be deleted as quick as possible, use a single second. Signed-off-by: timflannagan <[email protected]>
c5a192a
to
9c1b99b
Compare
@@ -226,7 +226,7 @@ func (c *GrpcRegistryReconciler) ensurePod(source grpcCatalogSourceDecorator, sa | |||
return nil | |||
} | |||
for _, p := range currentLivePods { | |||
if err := c.OpClient.KubernetesInterface().CoreV1().Pods(source.GetNamespace()).Delete(context.TODO(), p.GetName(), *metav1.NewDeleteOptions(0)); err != nil { | |||
if err := c.OpClient.KubernetesInterface().CoreV1().Pods(source.GetNamespace()).Delete(context.TODO(), p.GetName(), *metav1.NewDeleteOptions(1)); err != 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.
Probably easiest if I also add a package constant set to 1 and just reference that variable in NewDeleteOptions(...)
instead of hardcoding the value of 1. I need to double-check what the default grace period seconds are, and whether we can just pass an empty metav1.DeleteOptions object instead of explicitly setting the grace period every time.
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 partial to a package scoped constant that is also the zero value for metav1.DeleteOptions
: metav1.DeleteOptions{}
.
According to the type docs, as long as the GracePeriodSeconds
field is nil
:
... the default grace period for the specified type will be used.
/retest |
2 similar comments
/retest |
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ecordell, timflannagan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
/retest Please review the full test history for this PR and help us cut down flakes. |
That last upgrade test looks somewhat concerning, but going to retest anyway just in case a flake was produced. /retest |
@timflannagan: All pull requests linked via external trackers have merged: Bugzilla bug 1939294 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Update any references where we set the metadata.GracePeriodSeconds field
to zero seconds. If we need a Pod to be deleted as quick as possible,
use a single second.
Description of the change:
Motivation for the change:
Reviewer Checklist
/docs