-
Notifications
You must be signed in to change notification settings - Fork 72
[release-4.15] OCPBUGS-36812: fix sorting unpack jobs #817
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
[release-4.15] OCPBUGS-36812: fix sorting unpack jobs #817
Conversation
* fix sorting unpack jobs Signed-off-by: Ankita Thomas <[email protected]> * Add test cases to reproduce panic Signed-off-by: Catherine Chan-Tse <[email protected]> * handle nil jobs while sorting unpack jobs Signed-off-by: Ankita Thomas <[email protected]> --------- Signed-off-by: Ankita Thomas <[email protected]> Signed-off-by: Catherine Chan-Tse <[email protected]> Co-authored-by: Catherine Chan-Tse <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: 20a3cbcde1f46ed7f4d56042ccc8b5d962e4d1b8
@openshift-cherrypick-robot: Jira Issue OCPBUGS-36137 has been cloned as Jira Issue OCPBUGS-36812. Will retitle bug to link to clone. 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 openshift-eng/jira-lifecycle-plugin repository. |
@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-36812, which is valid. The bug has been moved to the POST state. 7 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira ([email protected]), skipping review request. The bug has been updated to refer to the pull request using the external bug tracker. 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 openshift-eng/jira-lifecycle-plugin repository. |
/retest |
@@ -864,7 +876,7 @@ func sortUnpackJobs(jobs []*batchv1.Job, maxRetainedJobs int) (latest *batchv1.J | |||
} | |||
|
|||
// cleanup old failed jobs, n-1 recent jobs and the oldest job | |||
for i := 0; i < maxRetainedJobs && i+maxRetainedJobs < len(jobs); i++ { | |||
for i := 0; i < maxRetainedJobs && i+maxRetainedJobs < len(jobs)-1; i++ { |
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.
Hi @ankitathomas, one concern here, if we use the < len(jobs)-1
here, it never returns the last child, which means will retain 6 jobs instead of 5. Is it as expected? Thanks!
maxRetainedJobs := 5 // TODO: make this configurable
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.
That's a good question! The intention there is to preserve the oldest failing unpack job for debugging purposes when this issue happens again, even when it allows for retrying the unpack.
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.
Aha, I see now, thanks!
/retest |
2 similar comments
/retest |
/retest |
/test e2e-gcp-olm |
/label qe-approved |
@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-36812, which is valid. 7 validation(s) were run on this bug
No GitHub users were found matching the public email listed for the QA contact in Jira ([email protected]), skipping review request. 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 openshift-eng/jira-lifecycle-plugin repository. |
/approve |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jianzhangbjz, kevinrizza, openshift-cherrypick-robot 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 |
@openshift-cherrypick-robot: all tests passed! Full PR test history. Your PR dashboard. 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-sigs/prow repository. I understand the commands that are listed here. |
9d4d9f8
into
openshift:release-4.15
@openshift-cherrypick-robot: Jira Issue OCPBUGS-36812: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-36812 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 openshift-eng/jira-lifecycle-plugin repository. |
[ART PR BUILD NOTIFIER] Distgit: operator-lifecycle-manager |
[ART PR BUILD NOTIFIER] Distgit: operator-registry |
This is an automated cherry-pick of #799
/assign ankitathomas