From 824e4830d89b7f1785a660a0ae912c25b669213f 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] fix deploy helm chart ceph-csi-rbd-provisioner dup affinities bug Signed-off-by: DashJay <45532257+dashjay@users.noreply.github.com> --- .../templates/provisioner-deployment.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml b/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml index fc1f28cdf8d4..565500eb2e93 100644 --- a/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml +++ b/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml @@ -48,7 +48,15 @@ spec: values: - {{ .Values.provisioner.name }} topologyKey: "kubernetes.io/hostname" -{{- end }} +{{- 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 }} {{- if .Values.provisioner.priorityClassName }} @@ -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 -}}