File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,10 @@ for component in CSI_PROVISIONER; do
148148 # we need to add the files locally in temp folder and using kustomize adding labels it will be applied
149149 if [[ " ${current} " =~ ^http:// ]] || [[ " ${current} " =~ ^https:// ]]; then
150150 run curl " ${current} " --output " ${TEMP_DIR} " /rbac.yaml --silent --location
151- current=./rbac.yaml
151+ else
152+ # Even for local files we need to copy because kustomize only supports files inside
153+ # the root of a kustomization.
154+ cp " ${current} " " ${TEMP_DIR} " /rbac.yaml
152155 fi
153156
154157 cat << - EOF > "${TEMP_DIR} "/kustomization.yaml
@@ -160,7 +163,7 @@ commonLabels:
160163 app.kubernetes.io/part-of: csi-driver-host-path
161164
162165resources:
163- - ${current}
166+ - ./rbac.yaml
164167EOF
165168
166169 run kubectl apply --kustomize " ${TEMP_DIR} "
Original file line number Diff line number Diff line change @@ -185,7 +185,10 @@ for component in CSI_PROVISIONER CSI_ATTACHER CSI_SNAPSHOTTER CSI_RESIZER CSI_EX
185185 # we need to add the files locally in temp folder and using kustomize adding labels it will be applied
186186 if [[ " ${current} " =~ ^http:// ]] || [[ " ${current} " =~ ^https:// ]]; then
187187 run curl " ${current} " --output " ${TEMP_DIR} " /rbac.yaml --silent --location
188- current=./rbac.yaml
188+ else
189+ # Even for local files we need to copy because kustomize only supports files inside
190+ # the root of a kustomization.
191+ cp " ${current} " " ${TEMP_DIR} " /rbac.yaml
189192 fi
190193
191194 cat << - EOF > "${TEMP_DIR} "/kustomization.yaml
@@ -197,7 +200,7 @@ commonLabels:
197200 app.kubernetes.io/part-of: csi-driver-host-path
198201
199202resources:
200- - ${current}
203+ - ./rbac.yaml
201204EOF
202205
203206 run kubectl apply --kustomize " ${TEMP_DIR} "
You can’t perform that action at this time.
0 commit comments