From e71acffdfe7229d203e11a4ef423e21c536c0be2 Mon Sep 17 00:00:00 2001 From: Jing Xu Date: Wed, 29 Apr 2020 15:47:31 -0700 Subject: [PATCH] Install diskutil into GCE windows node This PR installs a utility diskutil.exe into GCE windows node. This is a workaround for csiproxy be able to get disk id by name. This utility will be placed once issue is addressed. --- cluster/gce/windows/k8s-node-setup.psm1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cluster/gce/windows/k8s-node-setup.psm1 b/cluster/gce/windows/k8s-node-setup.psm1 index b6efbc2f80f..37866bd5b08 100644 --- a/cluster/gce/windows/k8s-node-setup.psm1 +++ b/cluster/gce/windows/k8s-node-setup.psm1 @@ -925,6 +925,16 @@ function Configure-GcePdTools { '$modulePath = "K8S_DIR\GetGcePdName.dll" Unblock-File $modulePath Import-Module -Name $modulePath'.replace('K8S_DIR', ${env:K8S_DIR}) + + if (Test-IsTestCluster $kube_env) { + if (ShouldWrite-File ${env:K8S_DIR}\diskutil.exe) { + # The source code of this executable file is https://github.com/kubernetes-sigs/sig-windows-tools/blob/master/cmd/diskutil/diskutil.c + MustDownload-File -OutFile ${env:K8S_DIR}\diskutil.exe ` + -URLs "https://ddebroywin1.s3-us-west-2.amazonaws.com/diskutil.exe" + } + Copy-Item ${env:K8S_DIR}\diskutil.exe -Destination "C:\Windows\system32" + } + } # Setup cni network. This function supports both Docker and containerd.