Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

release: support skipping CRD installations for Helm v3 #282

Merged
merged 1 commit into from
Feb 12, 2020

Conversation

stefansedich
Copy link
Contributor

@stefansedich stefansedich commented Feb 11, 2020

Adding support for skipCRDs for helm3 to allow a user to skip CRD installation if desired.

@hiddeco I used the same release from the original issue for my e2e test, not sure we want this dependency on the kong chart so let me know if that is an issue.

Closes #278

@@ -208,6 +208,7 @@ func (r *Release) Sync(client helm.Client, hr *v1.HelmRelease) (rHr *v1.HelmRele
ResetValues: hr.Spec.ResetValues,
MaxHistory: hr.GetMaxHistory(),
Wait: hr.Spec.Wait || (curRel != nil && hr.Spec.Rollback.Enable),
SkipCRDs: hr.Spec.SkipCRDs,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hiddeco I know you are a stickler for ordering of the properties so let me know if you want it moved 😄

Copy link
Member

Choose a reason for hiding this comment

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

Haha, I'd probably have done something like this:

...
Install:     curRel == nil,
Force:       hr.Spec.ForceUpgrade,
ResetValues: hr.Spec.ResetValues,
SkipCRDs:    hr.Spec.SkipCRDs,
MaxHistory:  hr.GetMaxHistory(),
...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, reordered in the CRD too.

#!/usr/bin/env bats

function setup() {
# Load libraries in setup() to access BATS_* variables
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copying and pasting e2e to get going makes me feel dirty... I will have a look at what common stuff we can extract out at some point to make it easier to get started.

version: 1.1.1
values:
ingressController:
installCRDs: false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to set this so CRDs are not installed by the normal templates.

@@ -208,6 +208,7 @@ func (r *Release) Sync(client helm.Client, hr *v1.HelmRelease) (rHr *v1.HelmRele
ResetValues: hr.Spec.ResetValues,
MaxHistory: hr.GetMaxHistory(),
Wait: hr.Spec.Wait || (curRel != nil && hr.Spec.Rollback.Enable),
SkipCRDs: hr.Spec.SkipCRDs,
Copy link
Member

Choose a reason for hiding this comment

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

Haha, I'd probably have done something like this:

...
Install:     curRel == nil,
Force:       hr.Spec.ForceUpgrade,
ResetValues: hr.Spec.ResetValues,
SkipCRDs:    hr.Spec.SkipCRDs,
MaxHistory:  hr.GetMaxHistory(),
...

deploy/flux-helm-release-crd.yaml Outdated Show resolved Hide resolved
@hiddeco hiddeco changed the title Adding support for skipCRDs to allow skipping helm3 CRD installation release: support skipping CRD installations for Helm v3 Feb 11, 2020
@hiddeco hiddeco added enhancement New feature or request helm v3 Issue or PR related to Helm v3 labels Feb 11, 2020
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

Local chart change for end-to-end test will be taken care of in a separate PR.

🚀

@hiddeco hiddeco merged commit 530fcf2 into fluxcd:master Feb 12, 2020
@stefansedich stefansedich deleted the skip-crds-support branch February 12, 2020 00:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request helm v3 Issue or PR related to Helm v3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Operator does not support --skip-crds
2 participants