File tree 5 files changed +25
-9
lines changed
5 files changed +25
-9
lines changed Original file line number Diff line number Diff line change 2
2
3
3
# Common variables
4
4
readonly KUSTOMIZE_PATH=" ${PKGDIR} /bin/kustomize"
5
+ readonly VERBOSITY=" ${GCE_PD_VERBOSITY:- 2} "
6
+ readonly KUBECTL=" ${GCE_PD_KUBECTL:- kubectl} "
5
7
6
8
# Common functions
7
9
Original file line number Diff line number Diff line change @@ -16,5 +16,5 @@ source "${PKGDIR}/deploy/common.sh"
16
16
17
17
ensure_kustomize
18
18
19
- ${KUSTOMIZE_PATH} build ${PKGDIR} /deploy/kubernetes/overlays/${DEPLOY_VERSION} | kubectl delete --ignore-not-found -f -
20
- kubectl delete secret cloud-sa --ignore-not-found
19
+ ${KUSTOMIZE_PATH} build ${PKGDIR} /deploy/kubernetes/overlays/${DEPLOY_VERSION} | ${KUBECTL} delete -v= " ${VERBOSITY} " --ignore-not-found -f -
20
+ ${KUBECTL} delete secret cloud-sa -v= " ${VERBOSITY} " --ignore-not-found
Original file line number Diff line number Diff line change @@ -76,20 +76,21 @@ if [ "$skip_sa_check" != true ]; then
76
76
check_service_account
77
77
fi
78
78
79
- if ! kubectl get secret cloud-sa -n ${NAMESPACE} ;
79
+ if ! ${KUBECTL} get secret cloud-sa -v= " ${VERBOSITY} " -n ${NAMESPACE} ;
80
80
then
81
- kubectl create secret generic cloud-sa --from-file=" ${GCE_PD_SA_DIR} /cloud-sa.json" -n ${NAMESPACE}
81
+ ${KUBECTL} create secret generic cloud-sa -v= " ${VERBOSITY} " --from-file=" ${GCE_PD_SA_DIR} /cloud-sa.json" -n ${NAMESPACE}
82
82
fi
83
83
84
84
# GKE Required Setup
85
- if ! kubectl get clusterrolebinding cluster-admin-binding;
85
+ if ! ${KUBECTL} get clusterrolebinding -v= " ${VERBOSITY} " cluster-admin-binding;
86
86
then
87
- kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user $( gcloud config get-value account)
87
+ ${KUBECTL} create clusterrolebinding cluster-admin-binding -v= " ${VERBOSITY} " --clusterrole cluster-admin --user $( gcloud config get-value account)
88
88
fi
89
89
90
- # Debug log: print kubectl version
91
- kubectl version
90
+ # Debug log: print ${KUBECTL} version
91
+ ${KUBECTL} version
92
92
93
93
readonly tmp_spec=/tmp/gcp-compute-persistent-disk-csi-driver-specs-generated.yaml
94
94
${KUSTOMIZE_PATH} build ${PKGDIR} /deploy/kubernetes/overlays/${DEPLOY_VERSION} | tee $tmp_spec
95
- kubectl apply -v=9 -f $tmp_spec
95
+ ${KUBECTL} apply -v=" ${VERBOSITY} " -f $tmp_spec
96
+
Original file line number Diff line number Diff line change @@ -148,6 +148,18 @@ func handle() error {
148
148
return fmt .Errorf ("failed to build Kubernetes: %v" , err )
149
149
}
150
150
151
+ kshPath := filepath .Join (k8sDir , "cluster" , "kubectl.sh" )
152
+ _ , err = os .Stat (kshPath )
153
+ if err == nil {
154
+ // Set kubectl to the one bundled in the k8s tar for versioning
155
+ err = os .Setenv ("GCE_PD_KUBECTL" , kshPath )
156
+ if err != nil {
157
+ return fmt .Errorf ("failed to set cluster specific kubectl: %v" , err )
158
+ }
159
+ } else {
160
+ glog .Errorf ("could not find cluster kubectl at %s, falling back to default kubectl" , kshPath )
161
+ }
162
+
151
163
err = clusterUp (k8sDir )
152
164
if err != nil {
153
165
return fmt .Errorf ("failed to cluster up: %v" , err )
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ readonly PKGDIR=${GOPATH}/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver
13
13
readonly overlay_name=" ${GCE_PD_OVERLAY_NAME:- prow-head-template} "
14
14
readonly boskos_resource_type=" ${GCE_PD_BOSKOS_RESOURCE_TYPE:- gce-project} "
15
15
readonly do_driver_build=" ${GCE_PD_DO_DRIVER_BUILD:- true} "
16
+ export GCE_PD_VERBOSITY=9
16
17
17
18
make -C ${PKGDIR} test-k8s-integration
18
19
${PKGDIR} /bin/k8s-integration-test --kube-version=master --run-in-prow=true --deploy-overlay-name=${overlay_name} --service-account-file=${E2E_GOOGLE_APPLICATION_CREDENTIALS} --do-driver-build=${do_driver_build} --boskos-resource-type=${boskos_resource_type}
You can’t perform that action at this time.
0 commit comments