diff --git a/hack/charts/cluster-api-operator/templates/addon.yaml b/hack/charts/cluster-api-operator/templates/addon.yaml index 43a705c3f..73ec98a13 100644 --- a/hack/charts/cluster-api-operator/templates/addon.yaml +++ b/hack/charts/cluster-api-operator/templates/addon.yaml @@ -43,6 +43,10 @@ spec: {{- if $addon.manifestPatches }} manifestPatches: {{ toYaml $addon.manifestPatches | nindent 4 }} {{- end }} +{{- if and (kindIs "map" $.Values.fetchConfig) (hasKey $.Values.fetchConfig $addonName) }} + fetchConfig: + {{- index $.Values.fetchConfig $addonName | toYaml | nindent 4 }} +{{- end }} {{- if $addon.additionalManifests }} additionalManifests: name: {{ $addon.additionalManifests.name }} diff --git a/hack/charts/cluster-api-operator/templates/bootstrap.yaml b/hack/charts/cluster-api-operator/templates/bootstrap.yaml index 65378bedc..7ded772c9 100644 --- a/hack/charts/cluster-api-operator/templates/bootstrap.yaml +++ b/hack/charts/cluster-api-operator/templates/bootstrap.yaml @@ -44,6 +44,10 @@ spec: {{- if $bootstrap.manifestPatches }} manifestPatches: {{ toYaml $bootstrap.manifestPatches | nindent 4 }} {{- end }} +{{- if and (kindIs "map" $.Values.fetchConfig) (hasKey $.Values.fetchConfig $bootstrapName) }} + fetchConfig: + {{- index $.Values.fetchConfig $bootstrapName | toYaml | nindent 4 }} +{{- end }} {{- if $bootstrap.additionalManifests }} additionalManifests: name: {{ $bootstrap.additionalManifests.name }} diff --git a/hack/charts/cluster-api-operator/templates/control-plane.yaml b/hack/charts/cluster-api-operator/templates/control-plane.yaml index 33794af9a..8ac40fd2c 100644 --- a/hack/charts/cluster-api-operator/templates/control-plane.yaml +++ b/hack/charts/cluster-api-operator/templates/control-plane.yaml @@ -40,8 +40,8 @@ spec: {{- range $key, $value := $.Values.manager.featureGates }} {{- if eq $key $controlPlaneName }} featureGates: - {{- range $k, $v := $value }} - {{ $k }}: {{ $v }} + {{- range $key, $value := $value }} + {{ $key }}: {{ $value }} {{- end }} {{- end }} {{- end }} @@ -57,6 +57,10 @@ spec: {{- if $controlPlane.manifestPatches }} manifestPatches: {{ toYaml $controlPlane.manifestPatches | nindent 4 }} {{- end }} +{{- if and (kindIs "map" $.Values.fetchConfig) (hasKey $.Values.fetchConfig $controlPlaneName) }} + fetchConfig: + {{- index $.Values.fetchConfig $controlPlaneName | toYaml | nindent 4 }} +{{- end }} {{- if $controlPlane.additionalManifests }} additionalManifests: name: {{ $controlPlane.additionalManifests.name }} diff --git a/hack/charts/cluster-api-operator/templates/core.yaml b/hack/charts/cluster-api-operator/templates/core.yaml index 57629497d..37a86a06a 100644 --- a/hack/charts/cluster-api-operator/templates/core.yaml +++ b/hack/charts/cluster-api-operator/templates/core.yaml @@ -53,6 +53,10 @@ spec: {{- if $core.manifestPatches }} manifestPatches: {{ toYaml $core.manifestPatches | nindent 4 }} {{- end }} +{{- if and (kindIs "map" $.Values.fetchConfig) (hasKey $.Values.fetchConfig $coreName) }} + fetchConfig: + {{- index $.Values.fetchConfig $coreName | toYaml | nindent 4 }} +{{- end }} {{- if $core.additionalManifests }} additionalManifests: name: {{ $core.additionalManifests.name }} diff --git a/hack/charts/cluster-api-operator/templates/infra-conditions.yaml b/hack/charts/cluster-api-operator/templates/infra-conditions.yaml index d2c2c2170..e27dd08c5 100644 --- a/hack/charts/cluster-api-operator/templates/infra-conditions.yaml +++ b/hack/charts/cluster-api-operator/templates/infra-conditions.yaml @@ -1,6 +1,6 @@ {{- if .Values.infrastructure }} -# Deploy bootstrap, and infrastructure components if not specified +# Deploy bootstrap, and control plane components if not specified {{- if not .Values.bootstrap }} --- apiVersion: v1 diff --git a/hack/charts/cluster-api-operator/templates/infra.yaml b/hack/charts/cluster-api-operator/templates/infra.yaml index 8e68b3bf8..4f11a829d 100644 --- a/hack/charts/cluster-api-operator/templates/infra.yaml +++ b/hack/charts/cluster-api-operator/templates/infra.yaml @@ -40,22 +40,16 @@ spec: {{- range $key, $value := $.Values.manager.featureGates }} {{- if eq $key $infrastructureName }} featureGates: - {{- range $k, $v := $value }} - {{ $k }}: {{ $v }} + {{- range $key, $value := $value }} + {{ $key }}: {{ $value }} {{- end }} {{- end }} {{- end }} {{- end }} {{- end }} {{- if and (kindIs "map" $.Values.fetchConfig) (hasKey $.Values.fetchConfig $infrastructureName) }} -{{- range $key, $value := $.Values.fetchConfig }} - {{- if eq $key $infrastructureName }} fetchConfig: - {{- range $k, $v := $value }} - {{ $k }}: {{ $v }} - {{- end }} - {{- end }} -{{- end }} + {{- index $.Values.fetchConfig $infrastructureName | toYaml | nindent 4 }} {{- end }} {{- if $.Values.configSecret.name }} configSecret: diff --git a/hack/charts/cluster-api-operator/templates/ipam.yaml b/hack/charts/cluster-api-operator/templates/ipam.yaml index 314306ffc..ab397d082 100644 --- a/hack/charts/cluster-api-operator/templates/ipam.yaml +++ b/hack/charts/cluster-api-operator/templates/ipam.yaml @@ -40,22 +40,16 @@ spec: {{- range $key, $value := $.Values.manager.featureGates }} {{- if eq $key $ipamName }} featureGates: - {{- range $k, $v := $value }} - {{ $k }}: {{ $v }} + {{- range $key, $value := $value }} + {{ $key }}: {{ $value }} {{- end }} {{- end }} {{- end }} {{- end }} {{- end }} {{- if and (kindIs "map" $.Values.fetchConfig) (hasKey $.Values.fetchConfig $ipamName) }} -{{- range $key, $value := $.Values.fetchConfig }} - {{- if eq $key $ipamName }} fetchConfig: - {{- range $k, $v := $value }} - {{ $k }}: {{ $v }} - {{- end }} - {{- end }} -{{- end }} + {{- index $.Values.fetchConfig $ipamName | toYaml | nindent 4 }} {{- end }} {{- if $.Values.configSecret.name }} configSecret: diff --git a/hack/charts/cluster-api-operator/values.schema.json b/hack/charts/cluster-api-operator/values.schema.json index d22038fce..a494bcd13 100644 --- a/hack/charts/cluster-api-operator/values.schema.json +++ b/hack/charts/cluster-api-operator/values.schema.json @@ -42,6 +42,18 @@ { "type": "object" }, { "type": "null" } ] + }, + "fetchConfig": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "oci": { "type": "string" }, + "selector": { "type": "object" }, + "url": { "type": "string" } + }, + "additionalProperties": false + } } } } diff --git a/hack/charts/cluster-api-operator/values.yaml b/hack/charts/cluster-api-operator/values.yaml index 745ff9e99..3bab38326 100644 --- a/hack/charts/cluster-api-operator/values.yaml +++ b/hack/charts/cluster-api-operator/values.yaml @@ -42,6 +42,10 @@ manager.featureGates: {} # kubeadm: # ClusterTopology: true fetchConfig: {} +# k3s: # Name, required, must match any provider type name +# oci: "" # Optional +# selector: {} # Optional +# url: "" # Optional # --- # Common configuration secret options configSecret: {}