From cf06a29b0e4c0a3e2ab3a0ba6bf6df990ea6b234 Mon Sep 17 00:00:00 2001 From: DashJay <45532257+dashjay@users.noreply.github.com> Date: Wed, 10 May 2023 05:27:44 +0000 Subject: [PATCH] deploy: fix bug of ceph-csi-cephfs helm chart fix bug that make ceph-csi-cephfs-provisioner get dup affinities when deploy helm chart ceph-csi-cephfs. Signed-off-by: DashJay <45532257+dashjay@users.noreply.github.com> --- .../templates/provisioner-deployment.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml b/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml index 13c083aba053..30f375824fba 100644 --- a/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml +++ b/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml @@ -48,6 +48,14 @@ spec: values: - {{ .Values.provisioner.name }} topologyKey: "kubernetes.io/hostname" +{{- if .Values.provisioner.affinity }} +{{ toYaml .Values.provisioner.affinity | indent 8 -}} +{{- end -}} +{{- else -}} +{{- if .Values.provisioner.affinity }} + affinity: +{{ toYaml .Values.provisioner.affinity | indent 8 -}} +{{- end -}} {{- end }} serviceAccountName: {{ include "ceph-csi-cephfs.serviceAccountName.provisioner" . }} hostNetwork: {{ .Values.provisioner.enableHostNetwork }} @@ -228,10 +236,6 @@ spec: emptyDir: { medium: "Memory" } -{{- if .Values.provisioner.affinity }} - affinity: -{{ toYaml .Values.provisioner.affinity | indent 8 -}} -{{- end -}} {{- if .Values.provisioner.nodeSelector }} nodeSelector: {{ toYaml .Values.provisioner.nodeSelector | indent 8 -}}