@@ -16,6 +16,10 @@ BASE_DIR=$(dirname "$0")
1616TEMP_DIR=" $( mktemp -d ) "
1717trap ' rm -rf ${TEMP_DIR}' EXIT
1818
19+ # KUBELET_DATA_DIR can be set to replace the default /var/lib/kubelet.
20+ # All nodes must use the same directory.
21+ default_kubelet_data_dir=/var/lib/kubelet
22+ : ${KUBELET_DATA_DIR:= ${default_kubelet_data_dir} }
1923
2024# If set, the following env variables override image registry and/or tag for each of the images.
2125# They are named after the image name, with hyphen replaced by underscore and in upper case.
@@ -53,6 +57,7 @@ trap 'rm -rf ${TEMP_DIR}' EXIT
5357#
5458# As a special case, 'none' as registry removes the registry name.
5559
60+
5661# The default is to use the RBAC rules that match the image that is
5762# being used, also in the case that the image gets overridden. This
5863# way if there are breaking changes in the RBAC rules, the deployment
@@ -187,7 +192,7 @@ echo "deploying with CSIStorageCapacity $csistoragecapacities_api: $have_csistor
187192echo " deploying hostpath components"
188193for i in $( ls ${BASE_DIR} /hostpath/* .yaml | sort) ; do
189194 echo " $i "
190- modified=" $( cat " $i " | while IFS= read -r line; do
195+ modified=" $( cat " $i " | sed -e " s; ${default_kubelet_data_dir} /; ${KUBELET_DATA_DIR} /; " | while IFS= read -r line; do
191196 nocomments=" $( echo " $line " | sed -e ' s/ *#.*$//' ) "
192197 if echo " $nocomments " | grep -q ' ^[[:space:]]*image:[[:space:]]*' ; then
193198 # Split 'image: quay.io/k8scsi/csi-attacher:v1.0.1'
0 commit comments