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 field to Extension API to skip crd safety checks #699

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ generate: $(CONTROLLER_GEN) #EXHELP Generate code containing DeepCopy, DeepCopyI
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

.PHONY: verify
verify: tidy fmt vet generate #HELP Verify all generated code is up-to-date.
verify: tidy fmt vet generate manifests #HELP Verify all generated code is up-to-date.
git diff --exit-code

.PHONY: fmt
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/extension_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ type ExtensionSpec struct {

// source of Extension to be installed
Source ExtensionSource `json:"source"`

//+kubebuilder:Optional
//
// skipCRDUpgradeSafetyCheck specifies whether or not the CRD upgrade safety checks should be skipped when attempting to install the extension
SkipCRDUpgradeSafetyCheck bool `json:"skipCRDUpgradeSafetyCheck,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I think in the past we identified that bool fields are problematic over time since quite frequently an additional value would slip in, so for maximum flexibility we've been using enum/string for this role, like so.
Is there any reason not to do so here?

Copy link
Contributor Author

@everettraven everettraven Mar 22, 2024

Choose a reason for hiding this comment

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

I don't disagree, but I recall us having also gone back and forth on our feelings on that. I'm happy to make a change to this, but I do think we should make sure we come up with a consistent approach as a project and that we (maintainers) all agree to prevent flip-flopping.

Copy link
Member

Choose a reason for hiding this comment

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

IMO, let's go ahead and get this merged to unblock further development. We'll separately plan for a full API review once we have all of the MVP functionality complete, and do any necessary refactoring at that point.

}

// ExtensionStatus defines the observed state of Extension
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/olm.operatorframework.io_extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ spec:
maxLength: 253
pattern: ^[a-z0-9]+([\.-][a-z0-9]+)*$
type: string
skipCRDUpgradeSafetyCheck:
description: skipCRDUpgradeSafetyCheck specifies whether or not the
CRD upgrade safety checks should be skipped when attempting to install
the extension
type: boolean
source:
description: source of Extension to be installed
properties:
Expand Down
Loading