Skip to content

Commit

Permalink
Merge pull request #1023 from salasberryfin/chart-cleanup-cluster-api…
Browse files Browse the repository at this point in the history
…-operator-features

chore: cleanup cluster-api-operator features in chart values
  • Loading branch information
alexander-demicev authored Jan 22, 2025
2 parents 54b040b + 81c9557 commit 53057d4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions charts/rancher-turtles/questions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ questions:
type: boolean
description: "Flag to enable or disable installation of cert-manager. If set to false then you will need to install cert-manager manually"
label: "Enable Cert Manager"
- variable: rancherTurtles.features.cluster-api-operator.cleanup
- variable: rancherTurtles.cluster-api-operator.cleanup
default: true
description: "Specify that the CAPI Operator post-delete cleanup job will be performed"
type: boolean
label: Cleanup CAPI Operator installation
group: "CAPI Operator cleanup settings"
show_subquestion_if: true
subquestions:
- variable: rancherTurtles.features.cluster-api-operator.kubectlImage
- variable: rancherTurtles.cluster-api-operator.kubectlImage
default: "registry.k8s.io/kubernetes/kubectl:v1.30.0"
description: "Specify the image to use when cleaning up the Cluster API Operator manifests"
type: string
Expand Down
16 changes: 8 additions & 8 deletions charts/rancher-turtles/templates/post-delete-job.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if index .Values "rancherTurtles" "features" "cluster-api-operator" "cleanup" }}
{{- if index .Values "cluster-api-operator" "cleanup" }}
---
apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -62,7 +62,7 @@ spec:
serviceAccountName: post-delete-job
containers:
- name: cluster-api-operator-mutatingwebhook-cleanup
image: {{ index .Values "rancherTurtles" "features" "cluster-api-operator" "kubectlImage" }}
image: {{ index .Values "cluster-api-operator" "kubectlImage" }}
command: ["kubectl"]
args:
- delete
Expand Down Expand Up @@ -90,7 +90,7 @@ spec:
serviceAccountName: post-delete-job
containers:
- name: cluster-api-operator-validatingwebhook-cleanup
image: {{ index .Values "rancherTurtles" "features" "cluster-api-operator" "kubectlImage" }}
image: {{ index .Values "cluster-api-operator" "kubectlImage" }}
command: ["kubectl"]
args:
- delete
Expand Down Expand Up @@ -119,7 +119,7 @@ spec:
restartPolicy: Never
containers:
- name: delete-capi-controller-manager
image: {{ index .Values "rancherTurtles" "features" "cluster-api-operator" "kubectlImage" }}
image: {{ index .Values "cluster-api-operator" "kubectlImage" }}
command: ["kubectl"]
args:
- delete
Expand All @@ -128,7 +128,7 @@ spec:
- {{ index .Values "cluster-api-operator" "cluster-api" "core" "namespace" }}
- --ignore-not-found=true
- name: delete-capi-kubeadm-bootstrap-controller-manager
image: {{ index .Values "rancherTurtles" "features" "cluster-api-operator" "kubectlImage" }}
image: {{ index .Values "cluster-api-operator" "kubectlImage" }}
command: ["kubectl"]
args:
- delete
Expand All @@ -137,7 +137,7 @@ spec:
- capi-kubeadm-bootstrap-system
- --ignore-not-found=true
- name: delete-capi-kubeadm-control-plane-controller-manager
image: {{ index .Values "rancherTurtles" "features" "cluster-api-operator" "kubectlImage" }}
image: {{ index .Values "cluster-api-operator" "kubectlImage" }}
command: ["kubectl"]
args:
- delete
Expand All @@ -146,7 +146,7 @@ spec:
- capi-kubeadm-control-plane-system
- --ignore-not-found=true
- name: delete-rke2-kubeadm-bootstrap-controller-manager
image: {{ index .Values "rancherTurtles" "features" "cluster-api-operator" "kubectlImage" }}
image: {{ index .Values "cluster-api-operator" "kubectlImage" }}
command: ["kubectl"]
args:
- delete
Expand All @@ -155,7 +155,7 @@ spec:
- {{ index .Values "cluster-api-operator" "cluster-api" "rke2" "bootstrap" "namespace" }}
- --ignore-not-found=true
- name: delete-rke2-control-plane-controller-manager
image: {{ index .Values "rancherTurtles" "features" "cluster-api-operator" "kubectlImage" }}
image: {{ index .Values "cluster-api-operator" "kubectlImage" }}
command: ["kubectl"]
args:
- delete
Expand Down
5 changes: 2 additions & 3 deletions charts/rancher-turtles/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ rancherTurtles:
imagePullSecrets: []
rancherInstalled: true
features:
cluster-api-operator:
cleanup: true
kubectlImage: registry.k8s.io/kubernetes/kubectl:v1.30.0
embedded-capi:
disabled: true
rancher-webhook:
Expand Down Expand Up @@ -51,6 +48,8 @@ cluster-api-operator:
- mountPath: /config
name: clusterctl-config
readOnly: true
cleanup: true
kubectlImage: registry.k8s.io/kubernetes/kubectl:v1.30.0
cluster-api:
enabled: true
configSecret:
Expand Down

0 comments on commit 53057d4

Please sign in to comment.