Skip to content

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

Conversation

timflannagan
Copy link
Member

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

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

@timflannagan timflannagan force-pushed the avoid-graceperiod-delete-zero branch from 23d97ba to 0acd9f3 Compare March 16, 2021 19:56
@timflannagan timflannagan changed the title pkg,test: Avoid setting metadata.GracePeriodSeconds to zero seconds Bug 1939294: Avoid setting metadata.GracePeriodSeconds to zero seconds Mar 16, 2021
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Mar 16, 2021
@openshift-ci-robot
Copy link
Collaborator

@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
  • bug is open, matching expected state (open)
  • bug target release (4.8.0) matches configured target release for branch (4.8.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @jianzhangbjz

In response to this:

Bug 1939294: Avoid setting metadata.GracePeriodSeconds to zero seconds

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
Copy link
Collaborator

@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:

@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
  • bug is open, matching expected state (open)
  • bug target release (4.8.0) matches configured target release for branch (4.8.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @jianzhangbjz

In response to this:

Bug 1939294: Avoid setting metadata.GracePeriodSeconds to zero seconds

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.

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.

@timflannagan
Copy link
Member Author

/retest

@timflannagan
Copy link
Member Author

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

@timflannagan
Copy link
Member Author

/retest

@ankitathomas
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2021
@timflannagan timflannagan force-pushed the avoid-graceperiod-delete-zero branch from 0acd9f3 to c5a192a Compare March 17, 2021 20:21
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2021
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]>
@timflannagan timflannagan force-pushed the avoid-graceperiod-delete-zero branch from c5a192a to 9c1b99b Compare March 17, 2021 20:41
@@ -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 {
Copy link
Member Author

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.

Copy link
Member

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.

@timflannagan
Copy link
Member Author

/retest

2 similar comments
@timflannagan
Copy link
Member Author

/retest

@timflannagan
Copy link
Member Author

/retest

@ecordell
Copy link
Member

/approve

@openshift-ci-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 30, 2021
@ankitathomas
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 30, 2021
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@timflannagan
Copy link
Member Author

That last upgrade test looks somewhat concerning, but going to retest anyway just in case a flake was produced.

/retest

@openshift-merge-robot openshift-merge-robot merged commit 2645388 into operator-framework:master Mar 31, 2021
@openshift-ci-robot
Copy link
Collaborator

@timflannagan: All pull requests linked via external trackers have merged:

Bugzilla bug 1939294 has been moved to the MODIFIED state.

In response to this:

Bug 1939294: Avoid setting metadata.GracePeriodSeconds to zero seconds

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.

@timflannagan timflannagan deleted the avoid-graceperiod-delete-zero branch March 31, 2021 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants