From f617eeafe80c0674cbdc6c37b0d7d9b2eb69c521 Mon Sep 17 00:00:00 2001 From: Danil-Grigorev Date: Mon, 22 Jul 2024 09:55:03 +0200 Subject: [PATCH] Add fleet addon config with auto-import label setting Signed-off-by: Danil-Grigorev --- .../templates/addon-provider-fleet.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/charts/rancher-turtles/templates/addon-provider-fleet.yaml b/charts/rancher-turtles/templates/addon-provider-fleet.yaml index 893a682a..6b4d8798 100644 --- a/charts/rancher-turtles/templates/addon-provider-fleet.yaml +++ b/charts/rancher-turtles/templates/addon-provider-fleet.yaml @@ -1,4 +1,5 @@ {{- if index .Values "rancherTurtles" "features" "addon-provider-fleet" "enabled" }} +--- apiVersion: turtles-capi.cattle.io/v1alpha1 kind: CAPIProvider metadata: @@ -9,4 +10,33 @@ metadata: "helm.sh/hook-weight": "2" spec: type: addon + additionalManifests: + name: fleet-addon-config + namespace: '{{ .Values.rancherTurtles.namespace }}' +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: fleet-addon-config + namespace: '{{ .Values.rancherTurtles.namespace }}' + annotations: + "helm.sh/hook": "post-install, post-upgrade" + "helm.sh/hook-weight": "2" +data: + manifests: |- + apiVersion: addons.cluster.x-k8s.io/v1alpha1 + kind: FleetAddonConfig + metadata: + name: fleet-addon-config + spec: + clusterClass: + patchResource: true + cluster: + patchResource: true + selector: + matchLabels: + cluster-api.cattle.io/rancher-auto-import: "true" + namespaceSelector: + matchLabels: + cluster-api.cattle.io/rancher-auto-import: "true" {{- end }}