wait until a token shows up to start addons

This commit is contained in:
Daniel Smith 2015-06-29 17:58:38 -07:00
parent 7ad50cf02c
commit dcd91666b9

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_made}" ]; do
sleep .5
token_found=$(${KUBECTL} get serviceaccount default -o template -t "{{with index .secrets 0}}{{.name}}{{end}}" || echo "")
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