Skip to content

Commit 9e39ed6

Browse files
aramasepaulczar
andauthored
Automated cherry pick of #898: fix: validate additionalProviderPaths does not contain providers dir (#902)
* validate additionalProviderPaths does not contain providerPath Signed-off-by: Paul Czarkowski <username.taken@gmail.com> * update volumes, make same change for windows Signed-off-by: Paul Czarkowski <username.taken@gmail.com> Co-authored-by: Paul Czarkowski <username.taken@gmail.com>
1 parent a859a31 commit 9e39ed6

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

manifest_staging/charts/secrets-store-csi-driver/templates/secrets-store-csi-driver-windows.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ spec:
7676
{{- end }}
7777
- "--endpoint=$(CSI_ENDPOINT)"
7878
- "--nodeid=$(KUBE_NODE_NAME)"
79-
- "--provider-volume={{ .Values.windows.providersDir }}"
79+
- "--provider-volume={{ .Values.windows.providersDir }}"
8080
- "--additional-provider-volume-paths={{ join "," .Values.windows.additionalProvidersDirs }}"
8181
{{- if and (semverCompare ">= v0.0.9-0" .Values.windows.image.tag) .Values.minimumProviderVersions }}
8282
- "--min-provider-version={{ .Values.minimumProviderVersions }}"
@@ -131,12 +131,15 @@ spec:
131131
mountPath: C:\csi
132132
- name: mountpoint-dir
133133
mountPath: {{ .Values.windows.kubeletRootDir }}\pods
134+
{{- $providersDir := .Values.windows.providersDir }}
134135
- name: providers-dir
135-
mountPath: "{{ .Values.windows.providersDir }}"
136+
mountPath: "{{ $providersDir }}"
136137
{{- range $i, $path := .Values.windows.additionalProvidersDirs }}
138+
{{- if ne $providersDir $path }}
137139
- name: providers-dir-{{ $i }}
138140
mountPath: "{{ $path }}"
139141
{{- end }}
142+
{{- end }}
140143
{{- if .Values.windows.volumeMounts }}
141144
{{- toYaml .Values.windows.volumeMounts | nindent 12}}
142145
{{- end }}
@@ -177,16 +180,19 @@ spec:
177180
hostPath:
178181
path: {{ .Values.windows.kubeletRootDir }}\plugins\csi-secrets-store\
179182
type: DirectoryOrCreate
183+
{{- $providersDir := .Values.windows.providersDir }}
180184
- name: providers-dir
181185
hostPath:
182-
path: "{{ .Values.windows.providersDir }}"
186+
path: "{{ $providersDir }}"
183187
type: DirectoryOrCreate
184188
{{- range $i, $path := .Values.windows.additionalProvidersDirs }}
189+
{{- if ne $path $providersDir }}
185190
- name: providers-dir-{{ $i }}
186191
hostPath:
187192
path: "{{ $path }}"
188193
type: DirectoryOrCreate
189194
{{- end }}
195+
{{- end }}
190196
{{- if .Values.windows.volumes }}
191197
{{- toYaml .Values.windows.volumes | nindent 8}}
192198
{{- end }}

manifest_staging/charts/secrets-store-csi-driver/templates/secrets-store-csi-driver.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,15 @@ spec:
134134
- name: mountpoint-dir
135135
mountPath: {{ .Values.linux.kubeletRootDir }}/pods
136136
mountPropagation: Bidirectional
137+
{{- $providersDir := .Values.linux.providersDir }}
137138
- name: providers-dir
138-
mountPath: {{ .Values.linux.providersDir }}
139+
mountPath: {{ $providersDir }}
139140
{{- range $i, $path := .Values.linux.additionalProvidersDirs }}
141+
{{- if ne $path $providersDir }}
140142
- name: providers-dir-{{ $i }}
141143
mountPath: "{{ $path }}"
142144
{{- end }}
145+
{{- end }}
143146
{{- if .Values.linux.volumeMounts }}
144147
{{- toYaml .Values.linux.volumeMounts | nindent 12}}
145148
{{- end }}
@@ -180,15 +183,18 @@ spec:
180183
hostPath:
181184
path: {{ .Values.linux.kubeletRootDir }}/plugins/csi-secrets-store/
182185
type: DirectoryOrCreate
186+
{{- $providersDir := .Values.linux.providersDir }}
183187
- name: providers-dir
184188
hostPath:
185-
path: {{ .Values.linux.providersDir }}
189+
path: {{ $providersDir }}
186190
type: DirectoryOrCreate
187191
{{- range $i, $path := .Values.linux.additionalProvidersDirs }}
192+
{{- if ne $path $providersDir }}
188193
- name: providers-dir-{{ $i }}
189194
hostPath:
190195
path: "{{ $path }}"
191196
type: DirectoryOrCreate
197+
{{- end}}
192198
{{- end }}
193199
{{- if .Values.linux.volumes }}
194200
{{- toYaml .Values.linux.volumes | nindent 8}}

0 commit comments

Comments
 (0)