Skip to content

Commit eca3f41

Browse files
Copilotandyzhangx
andcommitted
Add support for --allow-downgrades flag in init container
Co-authored-by: andyzhangx <[email protected]>
1 parent c0d1249 commit eca3f41

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ This option does not depend on cloud provider config file, supports cross subscr
4747
> If you want to install a lower version of blobfuse2 than the current version, you can add ` --allow-downgrades` to the `BLOBFUSE2_VERSION` value, e.g.
4848
> ```console
4949
> kubectl patch daemonset csi-blob-node -n kube-system -p '{"spec":{"template":{"spec":{"initContainers":[{"env":[{"name":"INSTALL_BLOBFUSE2","value":"true"},{"name":"BLOBFUSE2_VERSION","value":"2.3.0 --allow-downgrades"}],"name":"install-blobfuse-proxy"}]}}}}'
50+
> ```
51+
>
52+
> Alternatively, when using Helm charts, you can use the dedicated `allowBlobfuse2Downgrades` parameter for cleaner configuration:
53+
> ```console
54+
> helm upgrade --set node.blobfuseProxy.blobfuse2Version="2.3.0" --set node.blobfuseProxy.allowBlobfuse2Downgrades=true blob-csi-driver charts/latest/blob-csi-driver
5055
> ```
5156
5257
- install by [helm charts](./charts)

charts/latest/blob-csi-driver/templates/csi-blob-node.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,14 @@ spec:
8888
value: "{{ .Values.node.blobfuseProxy.installBlobfuse }}"
8989
- name: BLOBFUSE_VERSION
9090
value: "{{ .Values.node.blobfuseProxy.blobfuseVersion }}"
91+
- name: ALLOW_BLOBFUSE_DOWNGRADES
92+
value: "{{ .Values.node.blobfuseProxy.allowBlobfuseDowngrades }}"
9193
- name: INSTALL_BLOBFUSE2
9294
value: "{{ .Values.node.blobfuseProxy.installBlobfuse2 }}"
9395
- name: BLOBFUSE2_VERSION
9496
value: "{{ .Values.node.blobfuseProxy.blobfuse2Version }}"
97+
- name: ALLOW_BLOBFUSE2_DOWNGRADES
98+
value: "{{ .Values.node.blobfuseProxy.allowBlobfuse2Downgrades }}"
9599
- name: INSTALL_BLOBFUSE_PROXY
96100
value: "{{ .Values.node.enableBlobfuseProxy }}"
97101
- name: SET_MAX_OPEN_FILE_NUM

charts/latest/blob-csi-driver/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,10 @@ node:
122122
blobfuseProxy:
123123
installBlobfuse: false
124124
blobfuseVersion: "1.4.5"
125+
allowBlobfuseDowngrades: false
125126
installBlobfuse2: true
126127
blobfuse2Version: "2.4.1"
128+
allowBlobfuse2Downgrades: false
127129
setMaxOpenFileNum: true
128130
maxOpenFileNum: "9000000"
129131
disableUpdateDB: true

pkg/blobfuse-proxy/install-proxy.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ then
5454
echo "install blobfuse with latest version"
5555
pkg_list="${pkg_list} blobfuse"
5656
else
57-
pkg_list="${pkg_list} blobfuse=${BLOBFUSE_VERSION}"
57+
blobfuse_install_str="blobfuse=${BLOBFUSE_VERSION}"
58+
if [ "${ALLOW_BLOBFUSE_DOWNGRADES}" = "true" ]; then
59+
blobfuse_install_str="${blobfuse_install_str} --allow-downgrades"
60+
fi
61+
pkg_list="${pkg_list} ${blobfuse_install_str}"
5862
fi
5963
fi
6064

@@ -73,7 +77,11 @@ then
7377
echo "install blobfuse2 with latest version"
7478
pkg_list="${pkg_list} blobfuse2"
7579
else
76-
pkg_list="${pkg_list} blobfuse2=${BLOBFUSE2_VERSION}"
80+
blobfuse2_install_str="blobfuse2=${BLOBFUSE2_VERSION}"
81+
if [ "${ALLOW_BLOBFUSE2_DOWNGRADES}" = "true" ]; then
82+
blobfuse2_install_str="${blobfuse2_install_str} --allow-downgrades"
83+
fi
84+
pkg_list="${pkg_list} ${blobfuse2_install_str}"
7785
fi
7886
fi
7987

0 commit comments

Comments
 (0)