Make deploy-federation.sh more robust.
@@ -50,8 +50,10 @@ set -o pipefail
source "$(dirname "${BASH_SOURCE}")/util.sh"
function deploy-with-helm() {
+ # Don't install tiller if we already have a working install.
+ if ! helm version --server; then
# RBAC should be enabled to avoid CI fail because CI K8s uses RBAC for Tiller
- cat <<EOF | kubectl apply -f -
+ cat <<EOF | cat # kubectl apply -f -
apiVersion: v1
kind: ServiceAccount
metadata:
@@ -73,7 +75,8 @@ subjects:
EOF
helm init --service-account tiller
- util::wait-for-condition "Tiller is ready" "helm version --server &> /dev/null" 120
+ util::wait-for-condition "Tiller to become ready" "helm version --server &> /dev/null" 120
+ fi
REPOSITORY=${IMAGE_NAME%/*}
IMAGE_TAG=${IMAGE_NAME##*/}
@@ -128,7 +131,8 @@ to ensure credentials are available for push:
fi
shift
-JOIN_CLUSTERS="${*}"
+# Allow for no specific JOIN_CLUSTERS: they probably want to kubefed2 themselves.
+JOIN_CLUSTERS="${*-}"
# Use DOCKER_PUSH= ./scripts/deploy-federation.sh <image> to skip docker
# push on container image when not using latest image.
