Skip to content

Commit

Permalink
Fix CI (kubeflow#194)
Browse files Browse the repository at this point in the history
* add -o xtrace

Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>

* use client-cert instead password

Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>

* delete get-credentials

Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>

* delete unnecessary line

Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>
  • Loading branch information
YujiOshima authored and k8s-ci-robot committed Oct 10, 2018
1 parent b502fd5 commit 0bfa23b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace

SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/..

Expand Down
16 changes: 13 additions & 3 deletions test/scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,20 @@ echo "Activating service-account"
gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS}

echo "Configuring kubectl"
gcloud --project ${PROJECT} container clusters get-credentials ${CLUSTER_NAME} \
--zone ${ZONE}

kubectl config set-credentials temp-admin --username=admin --password=$(gcloud container clusters describe ${CLUSTER_NAME} --format="value(masterAuth.password)" --zone=${ZONE})
gcloud container clusters describe ${CLUSTER_NAME} \
--zone ${ZONE} \
--format 'value(masterAuth.clusterCaCertificate)'| base64 -d > ca.pem

gcloud container clusters describe ${CLUSTER_NAME} \
--zone ${ZONE} \
--format 'value(masterAuth.clientCertificate)' | base64 -d > client.pem

gcloud container clusters describe ${CLUSTER_NAME} \
--zone ${ZONE} \
--format 'value(masterAuth.clientKey)' | base64 -d > key.rsa

kubectl config set-credentials temp-admin --username=admin --client-certificate=./client.pem --client-key=./key.rsa
kubectl config set-context temp-context --cluster=$(kubectl config get-clusters | grep ${CLUSTER_NAME}) --user=temp-admin
kubectl config use-context temp-context

Expand Down

0 comments on commit 0bfa23b

Please sign in to comment.