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 optional field to ClusterExtension API to skip CRD upgrade safety checks #845

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rashmigottipati
Copy link
Member

Description

Adds an optional ClusterExtension.spec.skipCRDUpgradeSafetyChecks field that when set to true will be used to disable the CRD upgrade safety checks when attempting to install a cluster extension.

No logic included in this PR as the CRD Upgrade Safety preflight check as there isn't anything yet to enable/disable. So logic to enable/disable will be added in a future PR once everything is in place.

fixes #745

Reviewer Checklist

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

@rashmigottipati rashmigottipati self-assigned this May 10, 2024
@rashmigottipati rashmigottipati requested a review from a team as a code owner May 10, 2024 16:33
Copy link

netlify bot commented May 10, 2024

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit fffc98a
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/6643b1c826b7530008dd9348
😎 Deploy Preview https://deploy-preview-845--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 May 10, 2024

Codecov Report

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

Project coverage is 70.05%. Comparing base (e9acbd3) to head (e35ad16).

Files Patch % Lines
api/v1alpha1/zz_generated.deepcopy.go 0.00% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #845      +/-   ##
==========================================
- Coverage   71.02%   70.05%   -0.97%     
==========================================
  Files          17       17              
  Lines        1301     1319      +18     
==========================================
  Hits          924      924              
- Misses        304      322      +18     
  Partials       73       73              
Flag Coverage Δ
e2e 43.36% <0.00%> (-0.60%) ⬇️
unit 62.66% <0.00%> (-0.93%) ⬇️

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.

@rashmigottipati rashmigottipati force-pushed the configure-crd-checks branch 2 times, most recently from 96a459e to e35ad16 Compare May 13, 2024 20:18
… checks

Signed-off-by: Rashmi Gottipati <chowdary.grashmi@gmail.com>
Signed-off-by: Rashmi Gottipati <chowdary.grashmi@gmail.com>
//+kubebuilder:validation:Enum:=Enabled;Disabled
//+kubebuilder:default:=Enabled
//+kubebuilder:Optional
CRDUpgradeSafetyMode CRDUpgradeSafetyMode `json:"mode,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
CRDUpgradeSafetyMode CRDUpgradeSafetyMode `json:"mode,omitempty"`
Mode CRDUpgradeSafetyMode `json:"mode,omitempty"`

Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

One minor nit, but not worth blocking this PR from merging IMO. Thanks @rashmigottipati !


//+kubebuilder:Optional
// Preflight defines the strategy for the preflight checks (i.e. as of now, the CRD upgrade safety checks) to be applied or skipped when attempting to install the cluster extension.
Preflight PreflightConfig `json:"preflight,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

If a field is optional (i.e. with omitempty), it should also be a pointer.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah good catch - I totally missed that!

// PreflightConfig holds the config for the preflight checks. Currently, this is implemented for the
// CRDUpgradeSafety preflight check and can be extended in the future to add other preflight checks.
type PreflightConfig struct {
CRDUpgradeSafety CRDUpgradeSafetyPreflightConfig `json:"crdUpgradeSafety,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above: re using pointer if field is optional.

@varshaprasad96
Copy link
Member

Please hold this from merging till #846 gets in. Thanks!

@rashmigottipati
Copy link
Member Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add configuration to the ClusterExtension API for disabling CRD Upgrade Safety validations
5 participants