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 a CRD Upgrade Safety preflight check to the BundleDeployment controller #873

Merged

Conversation

everettraven
Copy link
Contributor

@everettraven everettraven commented May 1, 2024

Description:

  • Adds a new preflights/crdupgradesafety package containing the logic for a CRD Upgrade Safety preflight check
  • Updates the BundleDeployment controller to be able to be configured with preflight checks and runs them if they are configured

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 1, 2024
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 1, 2024
cmd/core/main.go Outdated Show resolved Hide resolved
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 6, 2024
Copy link

codecov bot commented May 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 93 lines in your changes are missing coverage. Please review.

Project coverage is 14.55%. Comparing base (0f2b80e) to head (e2ba479).

Files Patch % Lines
...kg/preflights/crdupgradesafety/crdupgradesafety.go 0.00% 57 Missing ⚠️
...l/controllers/bundledeployment/bundledeployment.go 0.00% 29 Missing ⚠️
cmd/core/main.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #873      +/-   ##
==========================================
- Coverage   15.06%   14.55%   -0.52%     
==========================================
  Files          40       41       +1     
  Lines        2443     2529      +86     
==========================================
  Hits          368      368              
- Misses       2018     2104      +86     
  Partials       57       57              

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

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 7, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 13, 2024
@everettraven everettraven force-pushed the feature/preflight branch 2 times, most recently from 21cd9e6 to 3d643ee Compare May 13, 2024 19:58
@everettraven everettraven marked this pull request as ready for review May 13, 2024 19:59
@everettraven everettraven requested a review from a team as a code owner May 13, 2024 19:59
@everettraven everettraven changed the title wip: preflights Add a CRD Upgrade Safety preflight check to the BundleDeployment controller May 13, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 13, 2024
go.mod Outdated Show resolved Hide resolved
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 14, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 14, 2024
@@ -101,6 +101,12 @@ func WithActionClientGetter(acg helmclient.ActionClientGetter) Option {
}
}

func WithPreflights(preflights ...Preflight) Option {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Is this required and present by default for now? If so, it would be nice to add a validation for this in validateConfig func, just to avoid programmer's error since we are calling preflight.Install directly.

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 is not required. If there are no preflight checks defined neither preflight.Install() nor preflight.Upgrade() should be called.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 15, 2024
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 21, 2024
@everettraven everettraven force-pushed the feature/preflight branch 2 times, most recently from 1117d74 to 595b5c2 Compare May 22, 2024 15:22
Signed-off-by: everettraven <everettraven@gmail.com>
Copy link
Member

@rashmigottipati rashmigottipati left a comment

Choose a reason for hiding this comment

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

/lgtm

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.

None yet

6 participants