File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 253253echo " deploying hostpath components"
254254for i in $( ls ${BASE_DIR} /hostpath/* .yaml | sort) ; do
255255 echo " $i "
256+
257+ # Copy original file to temp directory to avoid modifying git-tracked files
258+ temp_yaml=" ${TEMP_DIR} /$( basename " $i " ) "
259+ cp " $i " " $temp_yaml "
260+
256261 if volume_mode_conversion; then
257- sed -i -e ' s/# end csi-provisioner args/- \"--prevent-volume-mode-conversion=true\"\n # end csi-provisioner args/' $i
262+ sed -i -e ' s/# end csi-provisioner args/- \"--prevent-volume-mode-conversion=true\"\n # end csi-provisioner args/' " $temp_yaml "
258263 fi
259264
260265 # Add external-snapshot-metadata sidecar to the driver, mount TLS certs,
261266 # and enable snapshot-metadata service
262267 if snapshot_metadata; then
263- sed -i -e " /# end csi containers/r ${SNAPSHOT_METADATA_SIDECAR_PATCH_RELATIVE_PATH} " $i
264- sed -i -e ' s/# end csi volumes/- name: csi-snapshot-metadata-server-certs\n secret:\n secretName: csi-snapshot-metadata-certs\n # end csi volumes/' $i
265- sed -i -e ' s/# end hostpath args/- \"--enable-snapshot-metadata\"\n # end hostpath args/' $i
268+ sed -i -e " /# end csi containers/r ${SNAPSHOT_METADATA_SIDECAR_PATCH_RELATIVE_PATH} " " $temp_yaml "
269+ sed -i -e ' s/# end csi volumes/- name: csi-snapshot-metadata-server-certs\n secret:\n secretName: csi-snapshot-metadata-certs\n # end csi volumes/' " $temp_yaml "
270+ sed -i -e ' s/# end hostpath args/- \"--enable-snapshot-metadata\"\n # end hostpath args/' " $temp_yaml "
266271 fi
267- modified=" $( cat " $i " | sed -e " s;${default_kubelet_data_dir} /;${KUBELET_DATA_DIR} /;" | while IFS= read -r line; do
272+ modified=" $( cat " $temp_yaml " | sed -e " s;${default_kubelet_data_dir} /;${KUBELET_DATA_DIR} /;" | while IFS= read -r line; do
268273 nocomments=" $( echo " $line " | sed -e ' s/ *#.*$//' ) "
269274 if echo " $nocomments " | grep -q ' ^[[:space:]]*image:[[:space:]]*' ; then
270275 # Split 'image: quay.io/k8scsi/csi-attacher:v1.0.1'
You can’t perform that action at this time.
0 commit comments