diff --git a/pkg/apis/helm.cattle.io/v1/types.go b/pkg/apis/helm.cattle.io/v1/types.go index 3172ae9a..aa5f5cca 100644 --- a/pkg/apis/helm.cattle.io/v1/types.go +++ b/pkg/apis/helm.cattle.io/v1/types.go @@ -34,6 +34,7 @@ type HelmChartSpec struct { JobImage string `json:"jobImage,omitempty"` BackOffLimit *int32 `json:"backOffLimit,omitempty"` Timeout *metav1.Duration `json:"timeout,omitempty"` + SkipCRDs bool `json:"skipCRDs,omitempty"` FailurePolicy string `json:"failurePolicy,omitempty"` AuthSecret *corev1.LocalObjectReference `json:"authSecret,omitempty"` diff --git a/pkg/controllers/chart/chart.go b/pkg/controllers/chart/chart.go index 02271f35..34b25a3c 100644 --- a/pkg/controllers/chart/chart.go +++ b/pkg/controllers/chart/chart.go @@ -678,6 +678,10 @@ func args(chart *v1.HelmChart) []string { args = append(args, "--version", spec.Version) } + if spec.SkipCRDs { + args = append(args, "--skip-crds") + } + for _, k := range keys(spec.Set) { val := spec.Set[k] if typedVal(val) { diff --git a/pkg/controllers/chart/chart_test.go b/pkg/controllers/chart/chart_test.go index b222cd7c..4b40f491 100644 --- a/pkg/controllers/chart/chart_test.go +++ b/pkg/controllers/chart/chart_test.go @@ -143,6 +143,7 @@ func TestInstallArgs(t *testing.T) { assert := assert.New(t) stringArgs := strings.Join(args(NewChart()), " ") assert.Equal("install "+ + "--skip-crds "+ "--set-string acme.dnsProvider.name=cloudflare "+ "--set-string global.clusterCIDR=10.42.0.0/16\\,fd42::/48 "+ "--set-string global.systemDefaultRegistry= "+ @@ -163,7 +164,8 @@ func TestDeleteArgs(t *testing.T) { func NewChart() *v1.HelmChart { return v1.NewHelmChart("kube-system", "traefik", v1.HelmChart{ Spec: v1.HelmChartSpec{ - Chart: "stable/traefik", + Chart: "stable/traefik", + SkipCRDs: true, Set: map[string]intstr.IntOrString{ "rbac.enabled": intstr.Parse("true"), "ssl.enabled": intstr.Parse("false"),