Skip to content

Commit a9f716e

Browse files
committed
Enable all the e2e tests in Windows
1 parent 13bd5f5 commit a9f716e

File tree

12 files changed

+175
-371
lines changed

12 files changed

+175
-371
lines changed

hack/e2e.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ CLUSTER=${CLUSTER:-e2e}
142142
GKE_ENVIRONMENT=${GKE_ENVIRONMENT:-prod}
143143
KUBERNETES_SRC=${KUBERNETES_SRC:-} # If set, skip extracting kubernetes, use it as kubernetes src.
144144
KIND_NODE_IMAGE=${KIND_NODE_IMAGE:-} # Prebuilt kind node image to use, e.g. kindest/node:v1.15.0.
145-
# set from kubernetes/test-infra
145+
# set in the prow job through the common config in kubernetes/test-infra
146146
GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS:-}
147147
JENKINS_GCE_SSH_PRIVATE_KEY_FILE=${JENKINS_GCE_SSH_PRIVATE_KEY_FILE:-}
148148
JENKINS_GCE_SSH_PUBLIC_KEY_FILE=${JENKINS_GCE_SSH_PUBLIC_KEY_FILE:-}
@@ -166,9 +166,6 @@ echo "DEPLOYMENT: $DEPLOYMENT" >&2
166166
echo "CLUSTER: $CLUSTER" >&2
167167
echo "GKE_ENVIRONMENT: $GKE_ENVIRONMENT" >&2
168168
echo "KUBERNETES_SRC: $KUBERNETES_SRC" >&2
169-
echo "GOOGLE_APPLICATION_CREDENTIALS: $GOOGLE_APPLICATION_CREDENTIALS" >&2
170-
echo "JENKINS_GCE_SSH_PRIVATE_KEY_FILE: $JENKINS_GCE_SSH_PRIVATE_KEY_FILE" >&2
171-
echo "JENKINS_GCE_SSH_PUBLIC_KEY_FILE: $JENKINS_GCE_SSH_PUBLIC_KEY_FILE" >&2
172169

173170
kubetest_args=(
174171
--provider "$PROVIDER"
@@ -209,6 +206,8 @@ if [ "$PROVIDER" == "gce" -o "$PROVIDER" == "gke" ]; then
209206
kubetest_args+=(
210207
--gcp-zone "$GCP_ZONE"
211208
)
209+
# also set the default zone for the gcloud sdk
210+
export CLOUDSDK_COMPUTE_ZONE="$GCP_ZONE"
212211
fi
213212

214213
if [ -n "$GOOGLE_APPLICATION_CREDENTIALS" ]; then
@@ -323,9 +322,9 @@ if [ "$PROVIDER" == "gke" ]; then
323322
fi
324323

325324
# legacy path
326-
# --up
327-
# --down
328325
go run $ROOT/hack/e2e.go -- "${kubetest_args[@]}" \
329326
--deployment="$DEPLOYMENT" \
327+
--up \
328+
--down \
330329
--test-cmd="$ROOT/hack/run-e2e.sh" \
331330
"${@:-}"

hack/run-e2e.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fi
8484
if [ -z "$PROVISIONER_E2E_IMAGE" ]; then
8585
# build and push ${version}_linux_amd64 and ${version}_windows_ltsc2019
8686
VERSION=${VERSION:-$(git describe --tags --abbrev=8 --always)}
87-
REGISTRY=${REGISTRY:-k8s.gcr.io/sig-storage}
87+
REGISTRY=${REGISTRY:-gcr.io/${PROJECT}}
8888
IMAGE=local-volume-provisioner
8989

9090
REGISTRY=${REGISTRY} \
@@ -133,13 +133,14 @@ fi
133133
export PROVISIONER_IMAGE_NAME
134134
export PROVISIONER_IMAGE_PULL_POLICY
135135

136+
# Taint nodes of the platform where the test shouldn't run
136137
current_platform=linux
137138
taint_platform=windows
138139
if [ "${KUBERNETES_NODE_PLATFORM}" == "windows" ]; then
139140
current_platform=windows
140141
taint_platform=linux
141142
fi
142-
echo "Running tests for platform=${current_platform}, removing taints from all nodes and tainting platform=${taint_platform} nodes"
143+
echo "Running tests for platform=${current_platform}, tainting platform=${taint_platform} nodes"
143144
kubectl get nodes -o name | \
144145
while IFS= read -r node; do
145146
kubectl taint node $node node.kubernetes.io/os:NoSchedule- || true

helm/generated_examples/helm2/gke-mauricio.yaml

Lines changed: 0 additions & 298 deletions
This file was deleted.

pkg/common/common.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ func ConfigMapDataToVolumeConfig(data map[string]string, provisionerConfig *Prov
329329
if config.MountDir == "" || config.HostDir == "" {
330330
return fmt.Errorf("Storage Class %v is misconfigured, missing HostDir or MountDir parameter", class)
331331
}
332-
config.MountDir = normalizePath(config.MountDir)
333-
config.HostDir = normalizePath(config.HostDir)
332+
config.MountDir = NormalizePath(config.MountDir)
333+
config.HostDir = NormalizePath(config.HostDir)
334334

335335
if config.VolumeMode == "" {
336336
config.VolumeMode = DefaultVolumeMode
@@ -357,10 +357,10 @@ func ConfigMapDataToVolumeConfig(data map[string]string, provisionerConfig *Prov
357357
return nil
358358
}
359359

360-
// normalizePath makes sure the given path is a valid path on Windows too
360+
// NormalizePath makes sure the given path is a valid path on Windows too
361361
// by making sure all instances of `/` are replaced with `\\`, and the
362362
// path beings with `c:`
363-
func normalizePath(path string) string {
363+
func NormalizePath(path string) string {
364364
if runtime.GOOS != "windows" {
365365
return path
366366
}

pkg/controller/controller.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,4 @@ func StartLocalController(client *kubernetes.Clientset, ptable deleter.ProcTable
119119
discoverer.DiscoverLocalVolumes()
120120
time.Sleep(discoveryPeriod)
121121
}
122-
123-
// unreachable
124-
return nil
125122
}

0 commit comments

Comments
 (0)