mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Merge pull request #31035 from ixdy/e2e-service-account
Automatic merge from submit-queue When running inside docker, activate service account ASAP Also switching to just use `GOOGLE_APPLICATION_CREDENTIALS`, rather than both. x-ref https://github.com/kubernetes/test-infra/issues/318
This commit is contained in:
commit
237db0363a
@ -36,7 +36,7 @@ ENV FAIL_ON_GCP_RESOURCE_LEAK=true \
|
|||||||
KUBE_GCE_ZONE=us-central1-f
|
KUBE_GCE_ZONE=us-central1-f
|
||||||
|
|
||||||
# Variable specific to the machine:
|
# Variable specific to the machine:
|
||||||
# KUBEKINS_SERVICE_ACCOUNT_FILE
|
# GOOGLE_APPLICATION_CREDENTIALS
|
||||||
# JENKINS_GCE_SSH_PRIVATE_KEY_FILE
|
# JENKINS_GCE_SSH_PRIVATE_KEY_FILE
|
||||||
# JENKINS_GCE_SSH_PUBLIC_KEY_FILE
|
# JENKINS_GCE_SSH_PUBLIC_KEY_FILE
|
||||||
# JENKINS_AWS_SSH_PRIVATE_KEY_FILE
|
# JENKINS_AWS_SSH_PRIVATE_KEY_FILE
|
||||||
|
@ -212,6 +212,10 @@ if running_in_docker; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -n "${GOOGLE_APPLICATION_CREDENTIALS:-}" ]]; then
|
||||||
|
gcloud auth activate-service-account --key-file="${GOOGLE_APPLICATION_CREDENTIALS}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Install gcloud from a custom path if provided. Used to test GKE with gcloud
|
# Install gcloud from a custom path if provided. Used to test GKE with gcloud
|
||||||
# at HEAD, release candidate.
|
# at HEAD, release candidate.
|
||||||
# TODO: figure out how to avoid installing the cloud sdk twice if run inside Docker.
|
# TODO: figure out how to avoid installing the cloud sdk twice if run inside Docker.
|
||||||
@ -237,16 +241,6 @@ if [[ -n "${JENKINS_GCI_IMAGE_FAMILY:-}" ]]; then
|
|||||||
setup_gci_vars
|
setup_gci_vars
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "${KUBEKINS_SERVICE_ACCOUNT_FILE:-}" ]]; then
|
|
||||||
echo 'Activating service account...' # No harm in doing this multiple times.
|
|
||||||
gcloud auth activate-service-account --key-file="${KUBEKINS_SERVICE_ACCOUNT_FILE}"
|
|
||||||
# https://developers.google.com/identity/protocols/application-default-credentials
|
|
||||||
export GOOGLE_APPLICATION_CREDENTIALS="${KUBEKINS_SERVICE_ACCOUNT_FILE}"
|
|
||||||
unset KUBEKINS_SERVICE_ACCOUNT_FILE
|
|
||||||
elif [[ -n "${KUBEKINS_SERVICE_ACCOUNT_FILE:-}" ]]; then
|
|
||||||
echo "ERROR: cannot access service account file at: ${KUBEKINS_SERVICE_ACCOUNT_FILE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "--------------------------------------------------------------------------------"
|
echo "--------------------------------------------------------------------------------"
|
||||||
echo "Test Environment:"
|
echo "Test Environment:"
|
||||||
printenv | sort
|
printenv | sort
|
||||||
|
@ -41,16 +41,6 @@ ARTIFACTS=${WORKSPACE}/_artifacts
|
|||||||
|
|
||||||
mkdir -p ${ARTIFACTS}
|
mkdir -p ${ARTIFACTS}
|
||||||
|
|
||||||
if [[ -f "${KUBEKINS_SERVICE_ACCOUNT_FILE:-}" ]]; then
|
|
||||||
echo 'Activating service account...' # No harm in doing this multiple times.
|
|
||||||
gcloud auth activate-service-account --key-file="${KUBEKINS_SERVICE_ACCOUNT_FILE}"
|
|
||||||
# https://developers.google.com/identity/protocols/application-default-credentials
|
|
||||||
export GOOGLE_APPLICATION_CREDENTIALS="${KUBEKINS_SERVICE_ACCOUNT_FILE}"
|
|
||||||
unset KUBEKINS_SERVICE_ACCOUNT_FILE
|
|
||||||
elif [[ -n "${KUBEKINS_SERVICE_ACCOUNT_FILE:-}" ]]; then
|
|
||||||
echo "ERROR: cannot access service account file at: ${KUBEKINS_SERVICE_ACCOUNT_FILE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
go run test/e2e_node/runner/run_e2e.go --logtostderr --vmodule=*=4 --ssh-env="gce" \
|
go run test/e2e_node/runner/run_e2e.go --logtostderr --vmodule=*=4 --ssh-env="gce" \
|
||||||
--zone="$GCE_ZONE" --project="$GCE_PROJECT" --hosts="$GCE_HOSTS" \
|
--zone="$GCE_ZONE" --project="$GCE_PROJECT" --hosts="$GCE_HOSTS" \
|
||||||
--images="$GCE_IMAGES" --image-project="$GCE_IMAGE_PROJECT" \
|
--images="$GCE_IMAGES" --image-project="$GCE_IMAGE_PROJECT" \
|
||||||
|
Loading…
Reference in New Issue
Block a user