-
Notifications
You must be signed in to change notification settings - Fork 277
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: handle pod termination during reconcile #373
fix: handle pod termination during reconcile #373
Conversation
@@ -209,6 +209,22 @@ func (r *SecretProviderClassPodStatusReconciler) Reconcile(req ctrl.Request) (ct | |||
return ctrl.Result{}, nil | |||
} | |||
|
|||
// Obtain the full pod metadata. An object reference is needed for sending | |||
// events and the UID is helpful for validating the SPCPS TargetPath. | |||
pod := &v1.Pod{} |
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.
Moving the get pod to the start of the loop in order to avoid additional API calls if the pod is being terminated
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.
SGTM
/cc @tam7t |
@aramase: GitHub didn't allow me to request PR reviews from the following users: tam7t. Note that only kubernetes-sigs 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. |
@@ -209,6 +209,22 @@ func (r *SecretProviderClassPodStatusReconciler) Reconcile(req ctrl.Request) (ct | |||
return ctrl.Result{}, nil | |||
} | |||
|
|||
// Obtain the full pod metadata. An object reference is needed for sending | |||
// events and the UID is helpful for validating the SPCPS TargetPath. | |||
pod := &v1.Pod{} |
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.
SGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aramase, tam7t 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 |
What this PR does / why we need it:
Checks if the pod is terminating while inside the reconcile or rotation loop. If the pod is terminating, then return.
Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):Fixes #
Special notes for your reviewer: