diff --git a/hack/charts/cluster-api-operator/templates/core.yaml b/hack/charts/cluster-api-operator/templates/core.yaml index 4235cd71..21e0dc7c 100644 --- a/hack/charts/cluster-api-operator/templates/core.yaml +++ b/hack/charts/cluster-api-operator/templates/core.yaml @@ -45,7 +45,7 @@ spec: {{- end }} {{- if $.Values.manager }} manager: -{{- if $.Values.manager.featureGates.core }} +{{- if and $.Values.manager.featureGates $.Values.manager.featureGates.core }} featureGates: {{- range $key, $value := $.Values.manager.featureGates.core }} {{ $key }}: {{ $value }} diff --git a/hack/charts/cluster-api-operator/templates/infra.yaml b/hack/charts/cluster-api-operator/templates/infra.yaml index 5f813a22..6fdf3170 100644 --- a/hack/charts/cluster-api-operator/templates/infra.yaml +++ b/hack/charts/cluster-api-operator/templates/infra.yaml @@ -38,7 +38,7 @@ metadata: annotations: "helm.sh/hook": "post-install" "helm.sh/hook-weight": "2" -{{- if or $infrastructureVersion $.Values.configSecret.name }} +{{- if or $infrastructureVersion $.Values.configSecret.name $.Values.manager }} spec: {{- end }} {{- if $infrastructureVersion }} @@ -46,7 +46,7 @@ spec: {{- end }} {{- if $.Values.manager }} manager: -{{- if hasKey $.Values.manager.featureGates $infrastructureName }} +{{- if and (kindIs "map" $.Values.manager.featureGates) (hasKey $.Values.manager.featureGates $infrastructureName) }} {{- range $key, $value := $.Values.manager.featureGates }} {{- if eq $key $infrastructureName }} featureGates: