diff --git a/chart/helm-operator/crds/helmrelease.yaml b/chart/helm-operator/crds/helmrelease.yaml index 40803566f..ac5509bb2 100644 --- a/chart/helm-operator/crds/helmrelease.yaml +++ b/chart/helm-operator/crds/helmrelease.yaml @@ -64,6 +64,9 @@ spec: resetValues: description: If supplied will reset values on helm upgrade type: boolean + skipCRDs: + description: If set, will skip CRD installation for Helm v3 + type: boolean wait: description: Wait for an upgrade to complete before marking release as successful type: boolean diff --git a/deploy/flux-helm-release-crd.yaml b/deploy/flux-helm-release-crd.yaml index 40803566f..ac5509bb2 100644 --- a/deploy/flux-helm-release-crd.yaml +++ b/deploy/flux-helm-release-crd.yaml @@ -64,6 +64,9 @@ spec: resetValues: description: If supplied will reset values on helm upgrade type: boolean + skipCRDs: + description: If set, will skip CRD installation for Helm v3 + type: boolean wait: description: Wait for an upgrade to complete before marking release as successful type: boolean diff --git a/pkg/apis/helm.fluxcd.io/v1/types.go b/pkg/apis/helm.fluxcd.io/v1/types.go index 5a6c3af7d..593c74f40 100644 --- a/pkg/apis/helm.fluxcd.io/v1/types.go +++ b/pkg/apis/helm.fluxcd.io/v1/types.go @@ -205,6 +205,9 @@ type HelmReleaseSpec struct { // Reset values on helm upgrade // +optional ResetValues bool `json:"resetValues,omitempty"` + // Skip helm3 CRD installation + // +optional + SkipCRDs bool `json:"skipCRDs,omitempty"` // Wait for the install or upgrade to complete before marking release as successful // +optional Wait bool `json:"wait,omitempty"` diff --git a/pkg/helm/options.go b/pkg/helm/options.go index 3e8cdf57e..e18f3e5df 100644 --- a/pkg/helm/options.go +++ b/pkg/helm/options.go @@ -25,6 +25,7 @@ type UpgradeOptions struct { ClientOnly bool Force bool ResetValues bool + SkipCRDs bool ReuseValues bool Recreate bool MaxHistory int diff --git a/pkg/helm/v3/upgrade.go b/pkg/helm/v3/upgrade.go index 11af0ca86..24beb42f6 100644 --- a/pkg/helm/v3/upgrade.go +++ b/pkg/helm/v3/upgrade.go @@ -60,6 +60,7 @@ func (opts installOptions) configure(action *action.Install, releaseName string) action.ClientOnly = opts.ClientOnly action.Timeout = opts.Timeout action.Wait = opts.Wait + action.SkipCRDs = opts.SkipCRDs } type upgradeOptions helm.UpgradeOptions diff --git a/pkg/install/generated_templates.gogen.go b/pkg/install/generated_templates.gogen.go index f18fbe920..e4b664337 100644 --- a/pkg/install/generated_templates.gogen.go +++ b/pkg/install/generated_templates.gogen.go @@ -31,9 +31,9 @@ var templates = func() http.FileSystem { "/flux-helm-release-crd.yaml.tmpl": &vfsgen۰CompressedFileInfo{ name: "flux-helm-release-crd.yaml.tmpl", modTime: time.Date(1970, 1, 1, 0, 0, 0, 0, time.UTC), - uncompressedSize: 8741, + uncompressedSize: 8865, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x59\x6d\x6f\xdb\xc8\x11\xfe\xee\x5f\x31\x4d\x0b\x38\x29\x64\xc5\x49\xda\xa2\x15\x70\xb8\x0b\x2e\xb8\x26\x4d\xee\x62\xd8\x71\xfa\xc1\x48\x81\x11\x39\x24\xb7\xda\x17\xde\xbe\xc8\x56\x8b\xfe\xf7\x62\x76\x49\x49\xa4\x28\x4a\x76\xdc\x02\xc5\x95\x9f\x24\xee\xee\xec\x33\x33\xcf\xbc\xec\xf2\xec\xec\xec\x04\x6b\xf1\x99\xac\x13\x46\xcf\x00\x6b\x41\x77\x9e\x34\xff\x73\xd3\xc5\x1f\xdd\x54\x98\xe7\xcb\x17\x73\xf2\xf8\xe2\x64\x21\x74\x3e\x83\xef\x83\xf3\x46\x5d\x92\x33\xc1\x66\xf4\x86\x0a\xa1\x85\x17\x46\x9f\x28\xf2\x98\xa3\xc7\xd9\x09\x80\x46\x45\x33\xa8\x48\x2a\x4b\x92\xd0\x91\x9b\xf2\x9f\x69\x21\xc3\x5d\x96\x4f\x85\x39\x71\x35\x65\x3c\xb3\xb4\x26\xd4\x69\xea\xd6\x68\x92\xe0\x78\x02\x40\xda\xf7\x2d\x49\x75\x99\x84\xc5\xb7\x52\x38\xff\xbe\x3f\xf2\x41\x38\x1f\x47\x6b\x19\x2c\xca\x2e\x84\x38\xe0\x2a\x63\xfd\x4f\x1b\xe1\x67\x50\xd9\x13\x00\x97\x99\x9a\x66\x10\x07\x6a\xcc\x28\x3f\x01\xc0\x3c\x8f\x9a\xa1\xbc\xb0\x42\x7b\xb2\xdf\x1b\x19\x94\x5e\x2f\xfc\xcb\xd5\xc7\x9f\x2e\xd0\x57\x33\x98\x3a\x8f\x3e\xb8\x69\xb3\x13\x4b\x89\x73\x5a\x43\x6c\xe3\x06\xf0\x2b\xde\xca\x79\x2b\x74\x79\x48\xd4\x55\xfc\xd7\x11\xd6\x79\x75\x94\xac\xcc\xe8\xa4\x89\xbb\xf9\xf6\xe9\x77\x53\x5e\xf3\xcd\x37\x4f\x1a\x50\xf9\x93\x67\x5f\xa6\x8a\x9c\xc3\xb2\x0b\xfa\xc7\xce\xbb\xf1\x8d\x5a\xdf\x4f\x33\x4b\xc8\x3b\x7d\x12\x8a\x9c\x47\x55\x77\x44\xbe\xee\x89\xcb\xd1\xf3\x0b\x17\xe6\xb6\xe1\x53\x63\xdc\x04\x7c\x06\xff\xfc\xd7\x09\xc0\xb2\x65\xe7\xf2\xc5\xe6\xdf\xda\x0b\x49\x72\x1c\x8a\x2b\xc9\x2e\x29\x9f\x81\xb7\xa1\xdd\xcb\x79\x63\xb1\xa4\xf5\xbb\x25\x4a\x91\x47\x94\x49\x86\xa9\x49\xbf\xbe\x78\xf7\xf9\xd5\x55\x56\x91\xc2\x59\xb3\xac\xb6\xa6\x26\xeb\x45\x8b\x29\x8a\x6a\x58\xdb\x3e\x96\x7e\x0e\xc2\xf2\x7e\x37\xa7\x59\x85\xd6\x9f\x7e\xd9\x1a\x1d\x92\xc0\x0f\x93\xb2\x0d\xb9\xce\x00\x40\x4e\x2e\xb3\xa2\x8e\xe0\xe0\x53\x45\x91\xdc\xad\xce\xe0\x2b\xe1\xa0\x61\x06\x78\xb4\x25\x79\x37\x85\x77\x05\x68\xe3\xc1\x85\xba\x96\x82\xf2\x09\x08\x0f\xb7\x42\x4a\xc8\xa9\xc0\x20\x3d\x78\xd3\xdb\x05\x60\xf9\x72\xda\x7b\xb7\xe3\xe0\x2d\x3d\xd0\x7b\xb2\x7a\x06\x4f\xfe\xb6\xbc\x79\x39\x79\xf5\xe5\x37\x4f\x3a\x33\xb6\x68\x7f\x9c\x3e\xad\x0a\xec\xbb\x11\xfc\x73\x82\x92\x34\x59\xf4\x94\xc3\x7c\x05\x58\x14\xe2\x4e\xe8\x12\x7c\x45\x3b\x1a\xe9\x36\x74\xc1\x1b\x9e\x00\x2d\xa5\xd2\x2e\x0f\xd2\xf6\x06\xcf\xfe\x71\x7e\xf6\xa7\x2f\x4f\x6f\xce\x9a\x5f\xbf\x6d\x5f\x3d\xfb\xb6\x67\x04\x85\x77\x6f\x05\x53\x6d\x75\xd0\x06\x0a\xef\x84\x0a\x0a\x74\x50\x73\xb2\x60\x8a\xb5\x41\x2c\x2d\x45\x64\x37\x2b\xb1\x20\xaa\x27\xad\x13\xe3\x9b\x17\xe7\x83\x6a\x70\x72\x2a\xc9\xf6\xc6\x0a\x63\x15\xfa\x38\xfa\xea\x65\x67\x2c\x31\x67\x9d\xeb\xee\xef\xb3\xb8\x6c\xc0\x71\x6c\xf6\x8d\x1f\x5a\x1f\xf2\x5b\xb7\x49\x89\x9b\x07\xdd\xae\xa3\x92\xe8\xff\xb8\xb7\xbc\x50\x64\x82\x1f\x55\x3d\xaa\x2d\xb4\xf3\x28\x25\x18\x0b\xa1\x2e\x2d\xe6\xd4\xae\x05\xa1\xc1\x11\xe7\x56\xf7\x30\xaf\xfc\xe1\x77\xbd\x28\x72\xe4\x3f\xa3\x0c\xfd\x74\xd1\x83\xf5\xae\x58\x5b\x3c\x99\x38\x2e\xe4\xac\x16\xc8\x81\xd1\x31\xbd\xb4\x60\x07\x91\xcd\x8d\x91\x84\xba\x33\x76\x8b\x62\xdc\x1a\x7f\x45\xe1\x19\x3d\xa0\xde\x58\xc2\x40\x66\x54\x2d\xc9\x13\xcc\xa9\x30\x96\xb9\x6d\x17\x1c\xa2\x2d\x5d\xd0\x81\x0b\x59\x46\xce\x15\x41\x1e\x8d\xa6\x30\x36\xa3\xeb\xb4\xcb\xfd\x8c\x11\x57\x26\xd7\xad\x51\x56\xd6\x84\xb2\x82\x9c\x18\xe8\x73\x4b\xb1\x48\x1d\x6f\x1a\x6b\xa4\x9c\x63\xb6\xe8\x03\x49\x2b\xcc\xfc\xef\x94\xf9\x3e\x2b\xf7\x64\x7e\x7e\x48\xe3\x5c\xee\x68\x35\xa8\x19\xf9\x49\xd2\xaa\x26\xcb\xc4\x59\x43\x71\xd1\x13\x9d\x72\x60\x36\x6e\x29\x50\xc8\x60\xa9\x4f\xcb\x71\x2d\xa3\xa6\xe4\x77\xd3\xd7\x5e\x64\x1c\xbb\xed\x96\xa6\x00\x8c\xe8\x38\x53\x63\xb6\x58\xc3\x6a\x93\x00\x8b\x66\x27\x05\xed\x45\x9f\x07\x0d\xb4\xad\xcc\x88\xca\x04\xed\x53\x66\xe4\x75\x0e\xa2\xa6\x98\x55\xb1\x33\xbb\x9f\x56\x0a\xef\x2e\x93\x94\x83\xaa\x7d\x1a\xc5\xe0\x2b\xf4\xdc\x40\x06\x99\xb3\x4a\x9c\x79\x54\xcd\xb5\x29\x86\x45\xa3\xfe\xa0\x6e\x1d\x93\x88\x8d\x44\xb4\xd4\xf0\x21\xef\x66\xfa\xdf\x4f\xe0\x1c\xe8\xe7\x80\xd2\x81\xd0\xb1\xc7\xde\xcd\x9f\xe3\x99\x06\x46\xb3\x0d\xb4\x51\x76\x3f\x22\xa6\xf0\x5a\x67\xec\x50\x73\x0b\xb7\x2f\xc2\x58\x53\x4d\x94\x3f\xc0\x67\xad\x88\x21\x74\xe3\x2b\x73\xe1\xd8\x9e\x6f\x8d\x59\x1c\xf6\x77\x37\xc8\x2c\x2d\x49\x7b\xa8\x78\x29\x14\xd6\x28\xb0\x41\x6b\xce\x66\x79\xb0\x31\xa9\x35\xe1\x77\x6f\x50\x7b\xca\xcd\x0e\x1e\x6e\x9b\xb7\xea\x0a\x33\xe1\x76\x93\x77\x57\x20\x74\x2e\x96\x22\x0f\x28\xe1\x7d\x98\x93\xd5\xe4\x39\xe7\xd7\xdc\x23\x09\xa3\x27\x83\xe4\xdb\xe6\xd5\xab\xf3\xf3\x3d\x45\x0b\xbe\x9a\x4e\x43\x25\x64\xdc\xe2\x51\xb7\x98\x11\x52\xf4\x0b\xdd\xeb\x8b\x2e\x4c\xee\x52\x6e\x79\x43\xb5\x34\x2b\x45\xba\x9f\x6a\xd3\xc3\x81\x24\x34\x07\x21\x61\xbe\x8a\xe7\x87\x9d\x92\x94\x7a\x8d\xc3\x65\x09\x46\xdd\x19\xeb\xec\x0f\x42\xd2\x15\x53\xd4\x8f\xd7\xea\x37\x54\x5b\xca\xb8\x7f\xfd\x15\x5c\x3b\x6a\x8a\xf4\x0f\xd6\xa8\xa9\x8b\xcb\xdf\xd3\xea\x92\x8a\xd8\x65\x10\xf6\xc3\x24\x81\x40\x6b\x71\xd5\x1b\x11\x9e\xd4\x00\xbb\x47\x2a\x52\xf7\xac\xc2\x9d\x56\xe7\xa8\x92\x9e\xb1\xb2\xd5\x9c\xe1\xf6\x30\x6c\x4b\x67\xee\x2b\xd9\x67\xb1\xed\x8b\x4a\x4e\x40\x05\xe7\x39\x65\x0a\xbd\xee\x06\xb7\x1a\xc5\xa6\x0f\xec\x9f\xf0\x87\xb5\x1b\xe8\x02\x37\x56\x1d\x2e\xd1\x8f\x65\xc1\x71\xf3\x64\x46\x17\xa2\xfc\x11\xeb\xe4\xd3\x61\x4b\x8d\xca\x87\xe3\xbc\x74\x18\x0a\x8c\x7a\x0b\xc6\x3c\x96\xb4\x50\x58\x3f\x92\xd3\x60\xbc\x7d\x6f\x9f\x05\x0d\xf6\x1d\x03\x60\xdf\xd3\xaa\x45\xb4\xc6\xca\x99\xad\x24\x1f\x5f\x36\x7d\x30\xa7\xef\x6e\x49\x4d\x03\xd3\x15\xaa\xe1\xfe\xe3\x48\xa4\xa6\x4e\x77\x42\x47\xc2\x6d\xf3\xdd\x26\xdb\x34\xc5\x7f\x89\xb2\xb5\x79\x0b\x59\x48\xe2\x3e\x47\x1b\x90\x46\x97\x64\x41\xa1\xce\x91\x8f\x94\x07\x00\xef\x2b\x3b\xe9\xd1\xfb\x0e\x7a\x7b\x20\x7f\xea\x9c\xe2\x84\x86\xdb\x4a\x64\x55\xcf\xe2\x74\x27\x9c\x1f\xaa\x21\x47\x19\x72\x3b\xf9\xfd\x8f\x06\xca\xa3\xa6\xb6\x23\x4c\x06\x0f\x8d\x92\x04\xf4\xff\x21\xf2\x5f\x0a\x91\xc6\xdc\x5f\x17\x1f\x74\xe7\xc9\x6a\x94\x57\xb1\xcd\x7e\x9c\x20\x09\x56\x3e\x38\x46\x82\x3d\xd6\x99\xd7\x97\x1f\xba\x3e\xfb\x85\xb1\x29\xde\x02\x73\x7b\xf8\x38\x4e\xab\xd1\x57\x0f\xf6\x1a\x2f\x3e\xd2\x6a\x3c\x15\x6e\x85\xaf\x9a\xa4\x11\xef\x90\xa2\x2e\xf0\x34\x9e\x84\x4a\xe1\xc1\x52\x6d\x9e\xc1\x6d\x45\xb6\xe3\x5c\x36\xa1\x34\xb1\xcb\xfd\xa5\xf8\xd9\x68\xfa\x38\xe0\xde\xb3\xee\x07\x81\x6e\x43\x38\xe0\xc6\xee\xfc\xed\xa2\x78\x70\xf2\x4e\x86\x38\xb8\x62\x9b\x99\xbd\xc9\xcb\xc3\xb7\x8e\x99\xd1\x9e\xd2\x75\xc8\xfe\xb8\xde\x4b\xed\xb8\x77\x5f\xfe\xa0\x11\xbb\x98\x4b\xe1\x4f\x27\xb0\x2f\x0a\xc6\x23\xa0\x1c\x3e\x8d\xf6\xf4\xfa\xb3\xf0\x31\x67\xd1\xb4\x9c\xf2\x92\xef\x4a\xe1\xab\x30\x9f\x66\x46\xcd\x8c\x2d\x9f\x33\xe7\xef\x77\x1a\x69\x9f\xf6\xb0\xcc\x91\xf3\xeb\x78\x51\x9e\x53\x21\x74\xfa\x94\xf1\xf1\xf5\xd5\xc0\xa2\xfd\x01\xdb\xc1\x7c\xc1\xc1\x2a\xb4\x13\x79\xba\x5c\x6f\x63\xd3\x09\xa6\x74\x13\xa0\x6d\xdb\xd1\x44\xb1\x18\xae\x45\x07\xb4\xb0\xfb\x92\xd8\x8e\x0d\xe7\x16\x75\x56\x75\xdb\x09\x85\xce\x0f\xde\x23\x1c\xee\x0f\x17\xa2\x7e\x43\xf5\x75\xbc\x5e\x3a\x02\x41\x9b\x0c\x72\x43\x2e\x9a\xda\x06\x0d\xa7\x39\xd5\xa7\xed\x15\xd5\x53\x74\x2e\x28\x6a\xd9\xa5\x48\xfb\x4d\xf6\x42\x99\xae\x0d\x8a\x20\x0b\x21\x25\xe5\xcf\x46\x40\x0f\xe7\x84\x2e\x6f\x37\xde\x60\xfa\xc6\xf6\x74\x02\xa7\xcd\x67\xbc\x7b\x33\x79\x23\xed\x08\x53\x34\x1f\x6b\xd6\x6c\xb8\xbe\xfc\xf0\x75\xfc\x0d\x56\x1e\xcb\xdf\x23\x6f\x08\xb6\x68\xa9\x87\xbe\x0b\x1d\x01\x6f\x39\xfc\xf9\x74\x7c\xb3\x66\xd1\xd7\x99\xc3\x91\x5a\x92\x3d\xd6\x22\x71\xe3\x8b\x20\x65\xba\x2d\x1a\xc6\xfb\xa8\x67\x94\xbe\xff\xe7\xe8\x44\x06\x18\x7c\x05\x4f\x19\xb2\x50\xb5\x8c\xf4\xdf\xc7\xf2\x1d\x6b\xfc\x3b\x00\x00\xff\xff\x07\x32\x7b\x58\x25\x22\x00\x00"), + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x59\x6d\x6f\xdb\xc8\x11\xfe\xee\x5f\x31\x4d\x0b\xd8\x29\x64\xc5\x89\xdb\xa2\x15\x70\xb8\x0b\x62\x5c\x93\x26\x77\x31\xec\x38\xfd\x60\xa4\xc0\x88\x1c\x92\x5b\x2d\x77\x79\xfb\x22\x5b\x2d\xfa\xdf\x8b\xd9\x25\x25\x91\xa2\x28\xda\x71\x0b\x14\x29\x3f\x49\xdc\xdd\xd9\x67\xde\x9e\x99\x5d\x9e\x9e\x9e\x1e\x61\x25\x3e\x93\xb1\x42\xab\x19\x60\x25\xe8\xde\x91\xe2\x7f\x76\xba\xf8\xa3\x9d\x0a\xfd\x62\xf9\x72\x4e\x0e\x5f\x1e\x2d\x84\x4a\x67\xf0\xc6\x5b\xa7\xcb\x2b\xb2\xda\x9b\x84\x2e\x28\x13\x4a\x38\xa1\xd5\x51\x49\x0e\x53\x74\x38\x3b\x02\x50\x58\xd2\x0c\x0a\x92\xa5\x21\x49\x68\xc9\x4e\xf9\xcf\x34\x93\xfe\x3e\x49\xa7\x42\x1f\xd9\x8a\x12\x9e\x99\x1b\xed\xab\x38\x75\x6b\x34\x4a\xb0\x3c\x01\x20\xee\xfb\x96\x64\x79\x15\x85\x85\xb7\x52\x58\xf7\xbe\x3b\xf2\x41\x58\x17\x46\x2b\xe9\x0d\xca\x36\x84\x30\x60\x0b\x6d\xdc\xcf\x1b\xe1\xa7\x50\x98\x23\x00\x9b\xe8\x8a\x66\x10\x06\x2a\x4c\x28\x3d\x02\xc0\x34\x0d\x9a\xa1\xbc\x34\x42\x39\x32\x6f\xb4\xf4\xa5\x5a\x2f\xfc\xcb\xf5\xc7\x9f\x2f\xd1\x15\x33\x98\x5a\x87\xce\xdb\x69\xbd\x13\x4b\x09\x73\x1a\x43\x6c\xe3\x06\x70\x2b\xde\xca\x3a\x23\x54\x7e\x48\xd4\x75\xf8\xd7\x12\xd6\x7a\x35\x4a\x56\xa2\x55\xd4\xc4\xde\x7e\x7f\xf2\xc3\x94\xd7\x7c\xf7\xdd\xb3\x1a\x54\xfa\xec\xf9\x97\x69\x49\xd6\x62\xde\x06\xfd\x53\xeb\xdd\xf0\x46\x8d\xef\xa7\x89\x21\xe4\x9d\x3e\x89\x92\xac\xc3\xb2\x6a\x89\x7c\xdd\x11\x97\xa2\xe3\x17\xd6\xcf\x4d\x1d\x4f\xb5\x71\x23\xf0\x19\xfc\xf3\x5f\x47\x00\xcb\x26\x3a\x97\x2f\x37\xff\xd6\x5e\x88\x92\xc3\x50\x58\x49\x66\x49\xe9\x0c\x9c\xf1\xcd\x5e\xd6\x69\x83\x39\xad\xdf\x2d\x51\x8a\x34\xa0\x8c\x32\x74\x45\xea\xf5\xe5\xbb\xcf\xe7\xd7\x49\x41\x25\xce\xea\x65\x95\xd1\x15\x19\x27\x1a\x4c\x41\x54\x1d\xb5\xcd\x63\xe8\x17\x2f\x0c\xef\x77\x7b\x9c\x14\x68\xdc\xf1\x97\xad\xd1\x3e\x09\xfc\x70\x50\x36\x29\xd7\x1a\x00\x48\xc9\x26\x46\x54\x01\x1c\x7c\x2a\x28\x04\x77\xa3\x33\xb8\x42\x58\xa8\x23\x03\x1c\x9a\x9c\x9c\x9d\xc2\xbb\x0c\x94\x76\x60\x7d\x55\x49\x41\xe9\x04\x84\x83\x3b\x21\x25\xa4\x94\xa1\x97\x0e\x9c\xee\xec\x02\xb0\x7c\x35\xed\xbc\xdb\x71\xf0\x96\x1e\xe8\x1c\x19\x35\x83\x67\x7f\x5b\xde\xbe\x9a\x9c\x7f\xf9\xcd\xb3\xd6\x8c\xad\xb0\x1f\xa7\x4f\xa3\x02\xfb\x6e\x00\xff\x9c\x20\x27\x45\x06\x1d\xa5\x30\x5f\x01\x66\x99\xb8\x17\x2a\x07\x57\xd0\x8e\x46\xaa\x49\x5d\x70\x9a\x27\x40\x13\x52\x71\x97\x47\x69\x7b\x8b\xa7\xff\x38\x3b\xfd\xd3\x97\x93\xdb\xd3\xfa\xd7\x6f\x9b\x57\xcf\xbf\xef\x18\xa1\xc4\xfb\xb7\x82\x43\x6d\x75\xd0\x06\x25\xde\x8b\xd2\x97\xa0\x7c\x39\x27\x03\x3a\x5b\x1b\xc4\xd0\x52\x84\xe8\x66\x25\x16\x44\xd5\xa4\x71\x62\x78\xf3\xf2\xac\x57\x0d\x26\xa7\x9c\x4c\x67\x2c\xd3\xa6\x44\x17\x46\xcf\x5f\xb5\xc6\x62\xe4\xac\xb9\xee\xe1\x3e\x0b\xcb\x7a\x1c\xc7\x66\xdf\xf8\xa1\xf1\x21\xbf\xb5\x1b\x4a\xdc\x3c\x68\x77\x1d\x15\x45\xff\xc7\xbd\xe5\x44\x49\xda\xbb\x41\xd5\x83\xda\x42\x59\x87\x52\x82\x36\xe0\xab\xdc\x60\x4a\xcd\x5a\x10\x0a\x2c\x31\xb7\xda\xc7\x79\xe5\x0f\xbf\xeb\x64\x91\x25\xf7\x19\xa5\xef\xd2\x45\x07\xd6\xbb\x6c\x6d\xf1\x68\xe2\xb0\x90\x59\xcd\x93\x05\xad\x02\xbd\x34\x60\x7b\x91\xcd\xb5\x96\x84\xaa\x35\x66\x17\xa2\x7a\x73\x75\x71\x78\x6b\x72\x93\xb8\x2d\xaf\x80\x37\x57\x17\x8d\x89\x02\xa3\xb2\x7e\x35\x67\x9d\x8f\xde\xfb\x0e\xc5\xb0\x27\xfe\x8a\xc2\x05\xc9\xa8\x36\x5e\xd0\x90\xe8\xb2\x92\xe4\x08\xe6\x94\x69\xc3\x79\x65\x16\x4c\x0f\x4d\xa8\xa2\x05\xeb\x93\x84\xac\xcd\xbc\x1c\x8d\x26\xd3\x26\xa1\x9b\xb8\xcb\xc3\x1c\x11\x56\x46\xed\xd7\x28\x0b\xa3\x7d\x5e\x40\x4a\x0c\xf4\x85\xa1\x50\x20\xc7\xbb\xc5\x68\x29\xe7\x98\x2c\xba\x40\xe2\x0a\x3d\xff\x3b\x25\xae\x9b\x11\x7b\xaa\x0e\x3f\xa4\x70\x2e\x77\xb4\xea\xd5\x6c\xed\xe7\x8a\x0c\x07\xed\x1a\x8a\x0d\x9e\x68\x95\x22\xbd\x71\x4b\x86\x42\x7a\x43\xdd\x94\x18\xd6\x32\x68\x4a\x6e\x97\x3a\xf7\x22\x63\xde\x68\xb6\xd4\x19\x60\x40\xc7\x55\x02\x93\xc5\x1a\x56\x43\x40\x2c\x9a\x9d\xe4\x95\x13\xdd\x38\xa8\xa1\x6d\xb1\x32\x96\xda\x2b\x17\x59\x99\xd7\x59\x08\x9a\x62\x52\x84\xae\xf0\x61\x5a\x95\x78\x7f\x15\xa5\x1c\x54\xed\xd3\x20\x06\x57\xa0\xe3\xe6\xd5\xcb\x94\x55\x62\xd6\x2b\x2b\xae\x8b\x21\x2d\x6a\xf5\x7b\x75\x6b\x99\x44\x6c\x24\xa2\xa1\x3a\x1e\xd2\x76\x95\xf9\xfd\x04\xce\x80\x7e\xf1\x28\x2d\x08\x15\xfa\xfb\x5d\xee\x1e\x66\x39\x18\x64\x3a\x68\xb2\xec\x61\x81\x18\xd3\x6b\x5d\x2d\x7c\xc5\xed\xe3\xbe\x0c\x63\x4d\x15\x51\xfa\x08\x9f\x35\x22\xfa\xd0\x0d\xaf\x4c\x85\x65\x7b\xbe\xd5\x7a\x71\xd8\xdf\xed\x24\x33\xb4\x24\xe5\xa0\xe0\xa5\x90\x19\x5d\x82\xf1\x4a\x31\x9b\xa5\xde\x04\x52\xab\xd3\xef\xc1\xa0\xf6\x94\xba\x1d\x3c\xdc\xb2\x6f\xd5\x34\x8e\x84\xbb\x0d\xef\xae\x40\xa8\x54\x2c\x45\xea\x51\xc2\x7b\x3f\x27\xa3\xc8\x71\xbd\xa9\xb8\x3f\x13\x5a\x4d\x7a\x83\x6f\x3b\xae\xce\xcf\xce\xf6\x14\x4c\xf8\xea\x70\xea\x2b\x21\xc3\x16\x0f\xba\x05\x46\x88\xd9\x2f\x54\xa7\x27\xbb\xd4\xa9\x8d\xdc\x72\x41\x95\xd4\xab\x92\x54\x97\x6a\xe3\xc3\x89\x24\x14\x27\x21\x61\xba\x0a\x67\x97\x9d\x92\x14\xfb\x9c\xc3\x65\x09\x06\xdd\x19\x6a\xfc\x8f\x42\xd2\x35\x87\xa8\x1b\x2e\xd6\x17\x54\x19\x4a\xb8\x77\xfe\x15\xdc\x58\xaa\x1b\x84\x1f\x8d\x2e\xa7\x36\x2c\x7f\x4f\xab\x2b\xca\x42\xf9\x26\xec\xa6\x49\x04\x81\xc6\xe0\xaa\x33\x22\x1c\x95\x3d\xd1\x3d\x50\x91\xda\xe7\x24\xee\xf2\x5a\xc7\xa4\xf8\x0c\x95\xad\xfa\xfc\xb8\x27\xc2\xb6\x74\xe6\x9e\x96\x7d\x16\x5a\xce\xa0\xe4\x04\x4a\x6f\x1d\x53\xa6\x50\xeb\x4e\x74\xab\x49\xad\x7b\xd0\xee\xed\x42\xbf\x76\x3d\x1d\xe8\xc6\xaa\xfd\x25\xfa\xa9\x2c\x38\x6c\x9e\x44\xab\x4c\xe4\x3f\x61\x15\x7d\xda\x6f\xa9\x41\xf9\x30\xce\x4b\x87\xa1\xc0\xa0\xb7\x60\xc8\x63\x51\x8b\x12\xab\x27\x72\x1a\x0c\x1f\x1d\x9a\x67\x41\xbd\x7d\x47\x0f\xd8\xf7\xb4\x6a\x10\xad\xb1\x32\xb3\xe5\xe4\xc2\xcb\xba\x07\x67\xfa\x6e\x97\xd4\x38\x30\x5d\x61\xd9\xdf\x7f\x8c\x44\xaa\xab\x78\x1f\x35\x12\x6e\xc3\x77\x1b\xb6\xa9\x8b\xff\x12\x65\x63\xf3\x06\xb2\x90\xc4\x7d\x8e\xd2\x20\xb5\xca\xc9\x40\x89\x2a\x45\x3e\xce\x1e\x00\xbc\xaf\xec\xc4\x47\xed\x3b\x64\xee\x81\xfc\xa9\x75\x82\x14\x0a\xee\x0a\x91\x14\x1d\x8b\xd3\xbd\xb0\xae\xaf\x86\x8c\x32\xe4\x36\xf9\xfd\x8f\x26\xca\x93\x52\xdb\x08\x93\xc1\x63\xb3\x24\x02\xfd\x7f\x8a\xfc\x97\x52\xa4\x36\xf7\xd7\xe5\x07\xdd\x3b\x32\x0a\xe5\x75\x68\xb3\x9f\x26\x49\xbc\x91\x8f\xce\x11\x6f\xc6\x3a\xf3\xe6\xea\x43\xdb\x67\xdf\x58\x34\x85\x1b\x68\x6e\x0f\x9f\xc6\x69\x15\xba\xe2\xd1\x5e\xe3\xc5\x23\xad\xc6\x53\xe1\x4e\xb8\xa2\x26\x8d\x70\x7f\x15\x74\x81\x93\x70\x12\xca\x85\x03\x43\x95\x7e\x0e\x77\x05\x99\x96\x73\xd9\x84\x52\x87\x2e\xf7\x5b\xf1\xb3\x56\xf4\xb1\xc7\xbd\xa7\xed\x8f\x11\xed\x86\xb0\xc7\x8d\xed\xf9\xdb\x45\xf1\xe0\xe4\x1d\x86\x38\xb8\x62\x3b\x32\x3b\x93\x97\x87\x6f\x3c\x13\xad\x1c\xc5\xeb\x90\xfd\x79\xbd\x37\xb4\xc3\xde\x5d\xf9\xbd\x46\x6c\x63\xce\x85\x3b\x9e\xc0\xbe\x2c\x18\xce\x80\xbc\xff\x34\xda\xd1\xeb\xcf\xc2\x05\xce\xa2\x69\x3e\xe5\x25\x3f\xe4\xc2\x15\x7e\x3e\x4d\x74\x39\xd3\x26\x7f\xc1\x31\xff\xb0\xd3\x48\xf3\x34\x87\x65\xce\x9c\x5f\x87\x4b\xfa\x94\x32\xa1\xe2\x67\x94\x8f\xaf\xaf\x7b\x16\xed\x4f\xd8\x16\xe6\x4b\x4e\x56\xa1\xac\x48\xe3\xc5\x7e\x93\x9b\x56\x70\x48\xd7\x09\xda\xb4\x1d\x75\x16\x8b\xfe\x5a\x74\x40\x0b\xb3\x8f\xc4\x76\x6c\x38\x37\xa8\x92\xa2\xdd\x4e\x94\x68\x5d\xef\x3d\xc2\xe1\xfe\x70\x21\xaa\x0b\xaa\x6e\xc2\xf5\xd2\x08\x04\x0d\x19\xa4\x9a\x6c\x30\xb5\xf1\x0a\x8e\x53\xaa\x8e\x9b\x2b\xaa\x13\xb4\xd6\x97\xd4\x44\x57\x49\xca\x6d\xd8\x0b\x65\xbc\x36\xc8\xbc\xcc\x84\x94\x94\x3e\x1f\x00\xdd\xcf\x09\xed\xb8\xdd\x78\x83\xc3\x37\xb4\xa7\x13\x38\xae\x3f\x21\x3e\x38\x92\x37\xd2\x46\x98\xa2\xfe\x50\xb4\x8e\x86\x9b\xab\x0f\x5f\x17\xbf\xde\xc8\xb1\xf1\x3b\xf2\x86\x60\x2b\x2c\x55\xdf\x37\xa9\x11\xf0\x96\xfd\x9f\x6e\x87\x37\xab\x17\x7d\x9d\x39\x2c\x95\x4b\x32\x63\x2d\x12\x36\xbe\xf4\x52\xc6\xdb\xa2\x7e\xbc\x4f\x7a\x46\xe9\xfa\x7f\x8e\x56\x24\x80\xde\x15\x70\xc2\x90\x45\x59\xc9\x10\xfe\xfb\xa2\x7c\xc7\x1a\xff\x0e\x00\x00\xff\xff\x00\xf6\xce\xdf\xa1\x22\x00\x00"), }, "/helm-operator-deployment.yaml.tmpl": &vfsgen۰CompressedFileInfo{ name: "helm-operator-deployment.yaml.tmpl", diff --git a/pkg/install/templates/flux-helm-release-crd.yaml.tmpl b/pkg/install/templates/flux-helm-release-crd.yaml.tmpl index 40803566f..ac5509bb2 100644 --- a/pkg/install/templates/flux-helm-release-crd.yaml.tmpl +++ b/pkg/install/templates/flux-helm-release-crd.yaml.tmpl @@ -64,6 +64,9 @@ spec: resetValues: description: If supplied will reset values on helm upgrade type: boolean + skipCRDs: + description: If set, will skip CRD installation for Helm v3 + type: boolean wait: description: Wait for an upgrade to complete before marking release as successful type: boolean diff --git a/pkg/release/release.go b/pkg/release/release.go index 5d650d984..f8eff19f7 100644 --- a/pkg/release/release.go +++ b/pkg/release/release.go @@ -206,6 +206,7 @@ func (r *Release) Sync(client helm.Client, hr *v1.HelmRelease) (rHr *v1.HelmRele Install: curRel == nil, Force: hr.Spec.ForceUpgrade, ResetValues: hr.Spec.ResetValues, + SkipCRDs: hr.Spec.SkipCRDs, MaxHistory: hr.GetMaxHistory(), Wait: hr.Spec.Wait || (curRel != nil && hr.Spec.Rollback.Enable), }) diff --git a/test/e2e/10_helm_chart.bats b/test/e2e/10_helm_chart.bats index c344e8dc3..42b21ddb6 100644 --- a/test/e2e/10_helm_chart.bats +++ b/test/e2e/10_helm_chart.bats @@ -18,7 +18,8 @@ function setup() { poll_until_equals "gitconfig secret" "$GITCONFIG" "kubectl get secrets -n $E2E_NAMESPACE gitconfig -ojsonpath={..data.gitconfig} | base64 --decode" # Apply the HelmRelease fixtures - kubectl apply -f "$FIXTURES_DIR/releases" >&3 + kubectl apply -f "$FIXTURES_DIR/releases/git.yaml" >&3 + kubectl apply -f "$FIXTURES_DIR/releases/helm-repository.yaml" >&3 poll_until_equals 'podinfo-helm-repository HelmRelease' 'deployed' "kubectl -n $DEMO_NAMESPACE get helmrelease/podinfo-helm-repository -o 'custom-columns=status:status.releaseStatus' --no-headers" poll_until_equals 'podinfo-git HelmRelease' 'deployed' "kubectl -n $DEMO_NAMESPACE get helmrelease/podinfo-git -o 'custom-columns=status:status.releaseStatus' --no-headers" diff --git a/test/e2e/35_skip_crds.bats b/test/e2e/35_skip_crds.bats new file mode 100644 index 000000000..9eb78abdf --- /dev/null +++ b/test/e2e/35_skip_crds.bats @@ -0,0 +1,42 @@ +#!/usr/bin/env bats + +function setup() { + # Load libraries in setup() to access BATS_* variables + load lib/env + load lib/install + load lib/poll + + kubectl create namespace "$E2E_NAMESPACE" + install_git_srv + install_tiller + install_helm_operator_with_helm + kubectl create namespace "$DEMO_NAMESPACE" +} + +@test "When skipCRDs is set" { + if [ "$HELM_VERSION" != "v3" ]; then + skip + fi + + # Apply the HelmRelease + kubectl apply -f "$FIXTURES_DIR/releases/skip-crd.yaml" >&3 + poll_until_equals 'skip-crd HelmRelease' 'deployed' "kubectl -n $DEMO_NAMESPACE get helmrelease/skip-crd -o 'custom-columns=status:status.releaseStatus' --no-headers" + + # Assert no CRDs were installed + count=$(kubectl get crd --no-headers | grep 'konghq.com' | wc -l) + [ "$count" -eq 0 ] +} + +function teardown() { + # Teardown is verbose when a test fails, and this will help most of the time + # to determine _why_ it failed. + kubectl logs -n "$E2E_NAMESPACE" deploy/helm-operator + + # Removing the operator also takes care of the global resources it installs. + uninstall_helm_operator_with_helm + uninstall_tiller + # Removing the namespace also takes care of removing gitsrv. + kubectl delete namespace "$E2E_NAMESPACE" + # Only remove the demo workloads after the operator, so that they cannot be recreated. + kubectl delete namespace "$DEMO_NAMESPACE" +} diff --git a/test/e2e/fixtures/releases/skip-crd.yaml b/test/e2e/fixtures/releases/skip-crd.yaml new file mode 100644 index 000000000..2f98056a3 --- /dev/null +++ b/test/e2e/fixtures/releases/skip-crd.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: helm.fluxcd.io/v1 +kind: HelmRelease +metadata: + name: skip-crd + namespace: demo +spec: + releaseName: skip-crd + skipCRDs: true + chart: + repository: https://charts.konghq.com/ + name: kong + version: 1.1.1 + values: + ingressController: + installCRDs: false