Skip to content

Commit d6470ca

Browse files
committed
Add marker for args in csi-provisioner manifest and enable the prevent-volume-mode-conversion
flag if VOLUME_MODE_CONVERSION_TESTS is set to true in deploy-hostpath.sh
1 parent d4c5f7a commit d6470ca

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

deploy/kubernetes-1.22/hostpath/csi-hostpath-plugin.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ spec:
328328
- -v=5
329329
- --csi-address=/csi/csi.sock
330330
- --feature-gates=Topology=true
331+
# end csi-provisioner args
331332
securityContext:
332333
# This is necessary only for systems with SELinux, where
333334
# non-privileged sidecar containers cannot access unix domain socket

deploy/util/deploy-hostpath.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ default_kubelet_data_dir=/var/lib/kubelet
7070
# implies that refreshing that image has to be done manually.
7171
#
7272
# 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.
7474

7575
# The default is to use the RBAC rules that match the image that is
7676
# being used, also in the case that the image gets overridden. This
@@ -138,6 +138,10 @@ function version_gt() {
138138
test "$(printf '%s' "$versions" | sort -V | head -n 1)" != "$greaterVersion"
139139
}
140140

141+
function volume_mode_conversion () {
142+
[ "${VOLUME_MODE_CONVERSION_TESTS}" == "true" ]
143+
}
144+
141145
# In addition, the RBAC rules can be overridden separately.
142146
# For snapshotter 2.0+, the directory has changed.
143147
SNAPSHOTTER_RBAC_RELATIVE_PATH="rbac.yaml"
@@ -210,6 +214,11 @@ done
210214
echo "deploying hostpath components"
211215
for i in $(ls ${BASE_DIR}/hostpath/*.yaml | sort); do
212216
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
213222
modified="$(cat "$i" | sed -e "s;${default_kubelet_data_dir}/;${KUBELET_DATA_DIR}/;" | while IFS= read -r line; do
214223
nocomments="$(echo "$line" | sed -e 's/ *#.*$//')"
215224
if echo "$nocomments" | grep -q '^[[:space:]]*image:[[:space:]]*'; then

0 commit comments

Comments
 (0)