From 4ba6b3e6fef0be4a5ec0e4812e07fc53beeebc44 Mon Sep 17 00:00:00 2001 From: kahirokunn Date: Fri, 24 May 2024 15:58:08 +0900 Subject: [PATCH] Add featureGates to kubeadm ControlPlaneProvider --- .../templates/control-plane.yaml | 13 +++++++++++++ .../templates/infra-conditions.yaml | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/hack/charts/cluster-api-operator/templates/control-plane.yaml b/hack/charts/cluster-api-operator/templates/control-plane.yaml index b7cec76d5..c27c6c8fe 100644 --- a/hack/charts/cluster-api-operator/templates/control-plane.yaml +++ b/hack/charts/cluster-api-operator/templates/control-plane.yaml @@ -44,6 +44,19 @@ spec: {{- if $controlPlaneVersion }} version: {{ $controlPlaneVersion }} {{- end }} +{{- if $.Values.manager }} + manager: +{{- if hasKey $.Values.manager.featureGates $controlPlaneName }} +{{- range $key, $value := $.Values.manager.featureGates }} + {{- if eq $key $controlPlaneName }} + featureGates: + {{- range $k, $v := $value }} + {{ $k }}: {{ $v }} + {{- end }} + {{- end }} +{{- end }} +{{- end }} +{{- end }} {{- if $.Values.configSecret.name }} configSecret: name: {{ $.Values.configSecret.name }} diff --git a/hack/charts/cluster-api-operator/templates/infra-conditions.yaml b/hack/charts/cluster-api-operator/templates/infra-conditions.yaml index 2d1e8ccae..50551a2b6 100644 --- a/hack/charts/cluster-api-operator/templates/infra-conditions.yaml +++ b/hack/charts/cluster-api-operator/templates/infra-conditions.yaml @@ -49,6 +49,15 @@ metadata: "helm.sh/hook-weight": "2" {{- with .Values.configSecret }} spec: +{{- if $.Values.manager }} + manager: +{{- if $.Values.manager.featureGates.kubeadm }} + featureGates: + {{- range $key, $value := $.Values.manager.featureGates.kubeadm }} + {{ $key }}: {{ $value }} + {{- end }} +{{- end }} +{{- end }} configSecret: name: {{ .name }} {{- if .namespace }}