@@ -70,7 +70,7 @@ default_kubelet_data_dir=/var/lib/kubelet
70
70
# implies that refreshing that image has to be done manually.
71
71
#
72
72
# As a special case, 'none' as registry removes the registry name.
73
-
73
+ # Set VOLUME_MODE_CONVERSION_TESTS to "true" to enable the feature in external-provisioner.
74
74
75
75
# The default is to use the RBAC rules that match the image that is
76
76
# being used, also in the case that the image gets overridden. This
@@ -138,6 +138,10 @@ function version_gt() {
138
138
test " $( printf ' %s' " $versions " | sort -V | head -n 1) " ! = " $greaterVersion "
139
139
}
140
140
141
+ function volume_mode_conversion () {
142
+ [ " ${VOLUME_MODE_CONVERSION_TESTS} " == " true" ]
143
+ }
144
+
141
145
# In addition, the RBAC rules can be overridden separately.
142
146
# For snapshotter 2.0+, the directory has changed.
143
147
SNAPSHOTTER_RBAC_RELATIVE_PATH=" rbac.yaml"
@@ -210,6 +214,11 @@ done
210
214
echo " deploying hostpath components"
211
215
for i in $( ls ${BASE_DIR} /hostpath/* .yaml | sort) ; do
212
216
echo " $i "
217
+ # start of container feature flag arguments
218
+ if volume_mode_conversion; then
219
+ sed -i -e ' s/# end csi-provisioner args/- \"--prevent-volume-mode-conversion=true\"\n # end csi-provisioner args/' $i
220
+ fi
221
+ # end of container feature flag arguments
213
222
modified=" $( cat " $i " | sed -e " s;${default_kubelet_data_dir} /;${KUBELET_DATA_DIR} /;" | while IFS= read -r line; do
214
223
nocomments=" $( echo " $line " | sed -e ' s/ *#.*$//' ) "
215
224
if echo " $nocomments " | grep -q ' ^[[:space:]]*image:[[:space:]]*' ; then
0 commit comments