Skip to content

Commit a5f3d62

Browse files
authored
Merge pull request #302 from pohly/fix-deploy-in-sidecars
deploy: fix kustomize issue when using sidecar files for rbac.yaml
2 parents 94fe681 + 434a896 commit a5f3d62

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

deploy/kubernetes-distributed/deploy.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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
162165
resources:
163-
- ${current}
166+
- ./rbac.yaml
164167
EOF
165168

166169
run kubectl apply --kustomize "${TEMP_DIR}"

deploy/util/deploy-hostpath.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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
199202
resources:
200-
- ${current}
203+
- ./rbac.yaml
201204
EOF
202205

203206
run kubectl apply --kustomize "${TEMP_DIR}"

0 commit comments

Comments
 (0)