Skip to content

Commit 03f0690

Browse files
authored
Merge pull request #551 from jingxu97/June/windowstest
Update CI test configuration
2 parents 270f665 + 1b4d17f commit 03f0690

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

test/k8s-integration/driver.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ func installDriver(goPath, pkgDir, stagingImage, stagingVersion, deployOverlayNa
7171
statusCmd := exec.Command("kubectl", "describe", "pods", "-n", driverNamespace)
7272
err = runCommand("Checking driver pods", statusCmd)
7373
if err != nil {
74-
return fmt.Errorf("failed to check driver pods: %v", err)
74+
return fmt.Errorf("failed to describe pods: %v", err)
7575
}
76-
7776
return nil
7877
}
7978

test/k8s-integration/main.go

+17
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,23 @@ func handle() error {
298298
}
299299
}()
300300
}
301+
// For windows cluster, when cluster is up, all Windows nodes are tainted with NoSchedule to avoid linux pods
302+
// being scheduled to Windows nodes. When running windows tests, we need to remove the taint.
303+
if *platform == "windows" {
304+
nodesCmd := exec.Command("kubectl", "get", "nodes", "-l", "beta.kubernetes.io/os=windows", "-o", "name")
305+
out, err := nodesCmd.CombinedOutput()
306+
if err != nil {
307+
return fmt.Errorf("failed to get nodes: %v", err)
308+
}
309+
nodes := strings.Fields(string(out))
310+
for _, node := range nodes {
311+
taintCmd := exec.Command("kubectl", "taint", "node", node, "node.kubernetes.io/os:NoSchedule-")
312+
_, err = taintCmd.CombinedOutput()
313+
if err != nil {
314+
return fmt.Errorf("failed to untaint windows node %v", err)
315+
}
316+
}
317+
}
301318

302319
if !*useGKEManagedDriver {
303320
// Install the driver and defer its teardown

test/run-windows-k8s-integration.sh

+3-5
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,20 @@
99
set -o nounset
1010
set -o errexit
1111

12-
readonly GCE_PD_DO_DRIVER_BUILD=false
1312
readonly PKGDIR=${GOPATH}/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver
14-
readonly LOCAL_K8S_DIR=${GOPATH}/src/k8s.io/kubernetes
1513
readonly overlay_name="${GCE_PD_OVERLAY_NAME:-alpha}"
1614
readonly do_driver_build="${GCE_PD_DO_DRIVER_BUILD:-true}"
1715
readonly deployment_strategy=${DEPLOYMENT_STRATEGY:-gce}
1816
readonly test_version=${TEST_VERSION:-master}
1917
readonly gce_zone=${GCE_CLUSTER_ZONE:-us-central1-b}
20-
readonly teardown_driver=${GCE_CLUSTER_ZONE:-true}
18+
readonly teardown_driver=${GCE_PD_TEARDOWN_DRIVER:-true}
2119

2220
make -C ${PKGDIR} test-k8s-integration
2321

2422
base_cmd="${PKGDIR}/bin/k8s-integration-test \
25-
--platform=windows --local-k8s-dir=${LOCAL_K8S_DIR} --bringup-cluster=false --teardown-cluster=false --teardown-driver=${teardown_driver}\
23+
--platform=windows --bringup-cluster=false --teardown-cluster=false --teardown-driver=${teardown_driver}\
2624
--run-in-prow=true --deploy-overlay-name=${overlay_name} --service-account-file=${E2E_GOOGLE_APPLICATION_CREDENTIALS} \
27-
--do-driver-build=${do_driver_build} --gce-zone=${gce_zone}\
25+
--do-driver-build=${do_driver_build} --gce-zone=${gce_zone} --test-version=${test_version}\
2826
--storageclass-file=sc-windows.yaml --snapshotclass-file=pd-volumesnapshotclass.yaml --test-focus="External.Storage" \
2927
--deployment-strategy=${deployment_strategy}"
3028

0 commit comments

Comments
 (0)