From f18d7661affdb2cc79fed4279f17141d7b113d02 Mon Sep 17 00:00:00 2001 From: DashJay <45532257+dashjay@users.noreply.github.com> Date: Mon, 17 Apr 2023 07:45:22 +0000 Subject: [PATCH] deploy: fix bug of ceph-csi-rbd helm chart fix bug that make provisioner get dup affinities when deploy helm chart ceph-csi-rbd and ceph-csi-cephfs. Signed-off-by: DashJay <45532257+dashjay@users.noreply.github.com> --- .../templates/provisioner-deployment.yaml | 12 ++++++++---- .../templates/provisioner-deployment.yaml | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 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 -}} diff --git a/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml b/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml index fc1f28cdf8d4..76db4e452293 100644 --- a/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml +++ b/charts/ceph-csi-rbd/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-rbd.serviceAccountName.provisioner" . }} hostNetwork: {{ .Values.provisioner.enableHostNetwork }} @@ -309,10 +317,6 @@ spec: path: oidc-token expirationSeconds: 3600 audience: ceph-csi-kms -{{- if .Values.provisioner.affinity }} - affinity: -{{ toYaml .Values.provisioner.affinity | indent 8 -}} -{{- end -}} {{- if .Values.provisioner.nodeSelector }} nodeSelector: {{ toYaml .Values.provisioner.nodeSelector | indent 8 -}}