Skip to content
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

Reliably detect evicted pods for failing BuildRuns #1390

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

isibeni
Copy link
Contributor

@isibeni isibeni commented Sep 28, 2023

Changes

When a BuildRun pod is failing it is not necessary to check for failedContainer first.
We can directly check if the pod is evicted and reflect that in the BuildRun condition
Depending on how the system is evicting the pod, extractFailedPodAndContainer might return a non-nil value for failedContainer.
In such scenarios we were not detecting if the pod was evicted.
This is now fixed as we first check the Reason

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

Release Notes

The logic to detect whether a BuildRun failed due to an evicted Pod was improved

@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 28, 2023
@openshift-ci openshift-ci bot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Sep 28, 2023
@isibeni
Copy link
Contributor Author

isibeni commented Sep 28, 2023

/assign HeavyWombat
/assign qu1queee

@SaschaSchwarze0 SaschaSchwarze0 added the kind/bug Categorizes issue or PR as related to a bug. label Oct 1, 2023
@openshift-ci openshift-ci bot added release-note Label for when a PR has specified a release note and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 1, 2023
@SaschaSchwarze0 SaschaSchwarze0 added this to the release-v0.12.0 milestone Oct 1, 2023
@qu1queee qu1queee removed the request for review from otaviof October 4, 2023 13:11
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 4, 2023
Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/lgtm

@openshift-ci openshift-ci bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 4, 2023
When a BuildRun pod is failing it is not necessary to check for failedContainer first.
We can directly check if the pod is evicted and reflect that in the BuildRun condition
Depending on how the system is evicting the pod, `extractFailedPodAndContainer` might return a non-nil value for `failedContainer`.
In such scenarios we were not detecting if the pod was evicted.
This is now fixed as we first check the Reason
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Oct 5, 2023
@isibeni
Copy link
Contributor Author

isibeni commented Oct 5, 2023

verify failed as I missed the linter directive to ignore the deprecation notice.
Updated the code again. @SaschaSchwarze0 could you leave an approval again to trigger the workflows again? Thanks in advance!

@SaschaSchwarze0
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 5, 2023
@qu1queee
Copy link
Contributor

qu1queee commented Oct 5, 2023

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 5, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qu1queee, SaschaSchwarze0

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:
  • OWNERS [SaschaSchwarze0,qu1queee]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@SaschaSchwarze0 SaschaSchwarze0 merged commit 53380f9 into shipwright-io:main Oct 5, 2023
10 of 11 checks passed
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Label for when a PR has specified a release note size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants