Don't set KUBECONFIG when there is no reachable cluster
Travis doesn't pass secret env vars to tests run on forks, so we need a way to skip the tests when there are no credentials passed in. This change unsets KUBECONFIG when there's no reachable cluster. The Go tests already check for KUBECONFIG and skip when it's not defined.
This commit is contained in:
@@ -6,6 +6,14 @@
|
||||
|
||||
set -e
|
||||
|
||||
# If we don't have gcloud credentials, bail out of these tests.
|
||||
if [ -z ${FISSION_CI_SERVICE_ACCOUNT:+} ]
|
||||
then
|
||||
echo "Skipping tests, no cluster credentials"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Get kubectl
|
||||
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
|
||||
chmod +x ./kubectl
|
||||
sudo mv ./kubectl /usr/local/bin/kubectl
|
||||
|
||||
Reference in New Issue
Block a user