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

✨ Add checks for helm deployment status #1349

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

tmshort
Copy link
Contributor

@tmshort tmshort commented Oct 7, 2024

Fix #1296

Don't allow an update to occur when the deployment is still installing.

Description

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

@tmshort tmshort requested a review from a team as a code owner October 7, 2024 19:49
Copy link

netlify bot commented Oct 7, 2024

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 3501c21
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/67054a080cae6000082f423a
😎 Deploy Preview https://deploy-preview-1349--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 74.55%. Comparing base (5097435) to head (3501c21).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...nternal/controllers/clusterextension_controller.go 50.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1349      +/-   ##
==========================================
- Coverage   76.42%   74.55%   -1.88%     
==========================================
  Files          41       42       +1     
  Lines        2431     2515      +84     
==========================================
+ Hits         1858     1875      +17     
- Misses        400      453      +53     
- Partials      173      187      +14     
Flag Coverage Δ
e2e 56.58% <50.00%> (-1.88%) ⬇️
unit 52.56% <0.00%> (-1.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

case rel.Info.Status == release.StatusDeployed:
case rel.Info.Status == release.StatusUninstalled:
case rel.Info.Status == release.StatusSuperseded:
case rel.Info.Status == release.StatusFailed:
Copy link
Contributor

@everettraven everettraven Oct 7, 2024

Choose a reason for hiding this comment

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

If the release is failed, do we want to allow it to be overridden by default?

Copy link
Contributor

Choose a reason for hiding this comment

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

Based on my understanding of #1296 I would assume we would not want to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's in a terminal state; and if an upgrade is the only possible way to fix it, then we need to allow it to happen. Otherwise, the installation will remain in a failed state and be unable to be replaced without manual intervention (i.e. removal).

Comment on lines 483 to 492
switch {
case rel.Info.Status == release.StatusUnknown:
return nil, fmt.Errorf("installation status is unknown")
case rel.Info.Status == release.StatusDeployed:
case rel.Info.Status == release.StatusUninstalled:
case rel.Info.Status == release.StatusSuperseded:
case rel.Info.Status == release.StatusFailed:
case rel.Info.Status == release.StatusUninstalling:
return nil, fmt.Errorf("installation is still pending: %s", rel.Info.Status)
case rel.Info.Status.IsPending():
return nil, fmt.Errorf("installation is still pending: %s", rel.Info.Status)
default:
return nil, fmt.Errorf("unknown installation status: %s", rel.Info.Status)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the status of the release is "Terminal", then we ought to be able to upgrade etc. If it is unknown (in the multiple ways that unknown is defined, ha!) then it is considered an error, The default case catches the situation when the helm API changes. Only if something is pending (and for some reason, StatusUninstalling is not considered pending), then should we wait.

Don't allow an update to occur when the deployment is still installing.

Signed-off-by: Todd Short <tshort@redhat.com>
@tmshort
Copy link
Contributor Author

tmshort commented Oct 8, 2024

ping @thetechnick

Copy link
Member

@LalatenduMohanty LalatenduMohanty left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 9, 2024
@LalatenduMohanty LalatenduMohanty added this pull request to the merge queue Oct 9, 2024
Merged via the queue into operator-framework:main with commit 8558349 Oct 9, 2024
16 of 18 checks passed
@tmshort tmshort deleted the deploy branch October 10, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure rollouts are completed before starting a new upgrade.
3 participants