File tree Expand file tree Collapse file tree 5 files changed +25
-9
lines changed
Expand file tree Collapse file tree 5 files changed +25
-9
lines changed Original file line number Diff line number Diff line change 22
33# Common variables
44readonly KUSTOMIZE_PATH=" ${PKGDIR} /bin/kustomize"
5+ readonly VERBOSITY=" ${GCE_PD_VERBOSITY:- 2} "
6+ readonly KUBECTL=" ${GCE_PD_KUBECTL:- kubectl} "
57
68# Common functions
79
Original file line number Diff line number Diff line change @@ -16,5 +16,5 @@ source "${PKGDIR}/deploy/common.sh"
1616
1717ensure_kustomize
1818
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
7676 check_service_account
7777fi
7878
79- if ! kubectl get secret cloud-sa -n ${NAMESPACE} ;
79+ if ! ${KUBECTL} get secret cloud-sa -v= " ${VERBOSITY} " -n ${NAMESPACE} ;
8080then
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}
8282fi
8383
8484# GKE Required Setup
85- if ! kubectl get clusterrolebinding cluster-admin-binding;
85+ if ! ${KUBECTL} get clusterrolebinding -v= " ${VERBOSITY} " cluster-admin-binding;
8686then
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)
8888fi
8989
90- # Debug log: print kubectl version
91- kubectl version
90+ # Debug log: print ${KUBECTL} version
91+ ${KUBECTL} version
9292
9393readonly tmp_spec=/tmp/gcp-compute-persistent-disk-csi-driver-specs-generated.yaml
9494${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 {
148148 return fmt .Errorf ("failed to build Kubernetes: %v" , err )
149149 }
150150
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+
151163 err = clusterUp (k8sDir )
152164 if err != nil {
153165 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
1313readonly overlay_name=" ${GCE_PD_OVERLAY_NAME:- prow-head-template} "
1414readonly boskos_resource_type=" ${GCE_PD_BOSKOS_RESOURCE_TYPE:- gce-project} "
1515readonly do_driver_build=" ${GCE_PD_DO_DRIVER_BUILD:- true} "
16+ export GCE_PD_VERBOSITY=9
1617
1718make -C ${PKGDIR} test-k8s-integration
1819${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