Merge pull request #10542 from zmerlynn/redo_10520

Wait until a token shows up to start addons (redux)
pull/6/head
Zach Loafman 2015-06-30 09:46:58 -07:00
commit 102a8a1e36
1 changed files with 9 additions and 3 deletions

View File

@ -134,6 +134,15 @@ for k,v in yaml.load(sys.stdin).iteritems():
''' < "${kube_env_yaml}")
fi
# Wait for the default service account
token_found=""
while [ -z "${token_found}" ]; do
sleep .5
token_found=$(${KUBECTL} get serviceaccount default -o template -t "{{with index .secrets 0}}{{.name}}{{end}}" || true)
done
echo "== default service account has token ${token_found} =="
# Generate secrets for "internal service accounts".
# TODO(etune): move to a completely yaml/object based
# workflow so that service accounts can be created
@ -171,6 +180,3 @@ while true; do
`dirname $0`/kube-addon-update.sh /etc/kubernetes/addons
sleep $ADDON_CHECK_INTERVAL_SEC
done