@@ -263,6 +263,7 @@ function Set-EnvironmentVars {
263
263
" WINDOWS_CNI_VERSION" = ${kube_env} [' WINDOWS_CNI_VERSION' ]
264
264
" CSI_PROXY_STORAGE_PATH" = ${kube_env} [' CSI_PROXY_STORAGE_PATH' ]
265
265
" CSI_PROXY_VERSION" = ${kube_env} [' CSI_PROXY_VERSION' ]
266
+ " ENABLE_CSI_PROXY" = ${kube_env} [' ENABLE_CSI_PROXY' ]
266
267
" PKI_DIR" = ${kube_env} [' PKI_DIR' ]
267
268
" CA_FILE_PATH" = ${kube_env} [' CA_FILE_PATH' ]
268
269
" KUBELET_CONFIG" = ${kube_env} [' KUBELET_CONFIG_FILE' ]
@@ -403,26 +404,29 @@ function DownloadAndInstall-KubernetesBinaries {
403
404
# Required ${kube_env} keys:
404
405
# CSI_PROXY_STORAGE_PATH and CSI_PROXY_VERSION
405
406
function DownloadAndInstall-CSIProxyBinaries {
406
- if (ShouldWrite- File ${env: NODE_DIR} \csi-proxy.exe ) {
407
- $tmp_dir = ' C:\k8s_tmp'
408
- New-Item - Force - ItemType ' directory' $tmp_dir | Out-Null
409
- $filename = ' csi-proxy.exe'
410
- $urls = " ${env: CSI_PROXY_STORAGE_PATH} /${env: CSI_PROXY_VERSION} /$filename "
411
- MustDownload- File - OutFile $tmp_dir \$filename - URLs $urls
412
- Move-Item - Force $tmp_dir \$filename ${env: NODE_DIR} \$filename
413
- # Clean up the temporary directory
414
- Remove-Item - Force - Recurse $tmp_dir
407
+ if (" ${env: ENABLE_CSI_PROXY} " -eq " true" ) {
408
+ if (ShouldWrite- File ${env: NODE_DIR} \csi-proxy.exe ) {
409
+ $tmp_dir = ' C:\k8s_tmp'
410
+ New-Item - Force - ItemType ' directory' $tmp_dir | Out-Null
411
+ $filename = ' csi-proxy.exe'
412
+ $urls = " ${env: CSI_PROXY_STORAGE_PATH} /${env: CSI_PROXY_VERSION} /$filename "
413
+ MustDownload- File - OutFile $tmp_dir \$filename - URLs $urls
414
+ Move-Item - Force $tmp_dir \$filename ${env: NODE_DIR} \$filename
415
+ # Clean up the temporary directory
416
+ Remove-Item - Force - Recurse $tmp_dir
417
+ }
415
418
}
416
419
}
417
420
418
421
function Start-CSIProxy {
419
- Log- Output " Creating CSI Proxy Service"
420
- $flags = " -windows-service -log_file=${env: LOGS_DIR} \csi-proxy.log -logtostderr=false"
421
- & sc.exe create csiproxy binPath= " ${env: NODE_DIR} \csi-proxy.exe $flags "
422
- & sc.exe failure csiproxy reset= 0 actions= restart/ 10000
423
- Log- Output " Starting CSI Proxy Service"
424
- & sc.exe start csiproxy
425
-
422
+ if (" ${env: ENABLE_CSI_PROXY} " -eq " true" ) {
423
+ Log- Output " Creating CSI Proxy Service"
424
+ $flags = " -windows-service -log_file=${env: LOGS_DIR} \csi-proxy.log -logtostderr=false"
425
+ & sc.exe create csiproxy binPath= " ${env: NODE_DIR} \csi-proxy.exe $flags "
426
+ & sc.exe failure csiproxy reset= 0 actions= restart/ 10000
427
+ Log- Output " Starting CSI Proxy Service"
428
+ & sc.exe start csiproxy
429
+ }
426
430
}
427
431
428
432
# TODO(pjh): this is copied from
0 commit comments