Skip to content

✨ Add checks for helm deployment status - #1349

Merged
LalatenduMohanty merged 1 commit into
operator-framework:mainfrom
tmshort:deploy
Oct 9, 2024
Merged

✨ Add checks for helm deployment status#1349
LalatenduMohanty merged 1 commit into
operator-framework:mainfrom
tmshort:deploy

Conversation

@tmshort

Copy link
Copy Markdown
Contributor

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 ownerOctober 7, 2024 19:49
@netlify

netlifyBot commented Oct 7, 2024

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

NameLink
🔨 Latest commit3501c21
🔍 Latest deploy loghttps://app.netlify.com/sites/olmv1/deploys/67054a080cae6000082f423a
😎 Deploy Previewhttps://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.

@codecov

codecovBot commented Oct 7, 2024

Copy link
Copy Markdown

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 linesPatch %Lines
...nternal/controllers/clusterextension_controller.go50.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 
FlagCoverage Δ
e2e56.58% <50.00%> (-1.88%)⬇️
unit52.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.

Comment threadinternal/controllers/clusterextension_controller.go
case rel.Info.Status == release.StatusDeployed:
case rel.Info.Status == release.StatusUninstalled:
case rel.Info.Status == release.StatusSuperseded:
case rel.Info.Status == release.StatusFailed:

@everettraveneverettravenOct 7, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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.

Comment threadinternal/controllers/clusterextension_controller.go Outdated
Don't allow an update to occur when the deployment is still installing.
Signed-off-by: Todd Short <tshort@redhat.com>
@tmshort

Copy link
Copy Markdown
ContributorAuthor

ping @thetechnick

@LalatenduMohantyLalatenduMohanty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@openshift-ciopenshift-ciBot 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 8558349Oct 9, 2024
@tmshort
tmshort deleted the deploy branch October 10, 2024 16:04
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtmIndicates 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

@tmshort@LalatenduMohanty@everettraven