Merge pull request #1335 from dchen1107/exit1

Convert existing kubernetes system to use ContainerStatus, instead of
This commit is contained in:
Brendan Burns
2014-09-24 21:37:24 -07:00
13 changed files with 93 additions and 58 deletions

View File

@@ -50,7 +50,7 @@ while [ $ALL_RUNNING -ne 1 ]; do
ALL_RUNNING=1
for id in $POD_ID_LIST; do
CURRENT_STATUS=$($KUBECFG -template '{{and .CurrentState.Info.mynginx.State.Running .CurrentState.Info.net.State.Running}}' get pods/$id)
if [ "$CURRENT_STATUS" != "true" ]; then
if [ "$CURRENT_STATUS" != "{}" ]; then
ALL_RUNNING=0
fi
done

View File

@@ -40,10 +40,10 @@ function validate() {
for id in $POD_ID_LIST; do
TEMPLATE_STRING="{{and ((index .CurrentState.Info \"${CONTROLLER_NAME}\").State.Running) .CurrentState.Info.net.State.Running}}"
CURRENT_STATUS=$($KUBECFG -template "${TEMPLATE_STRING}" get pods/$id)
if [ "$CURRENT_STATUS" != "true" ]; then
if [ "$CURRENT_STATUS" != "{}" ]; then
ALL_RUNNING=0
else
CURRENT_IMAGE=$($KUBECFG -template "{{(index .CurrentState.Info \"${CONTROLLER_NAME}\").Config.Image}}" get pods/$id)
CURRENT_IMAGE=$($KUBECFG -template "{{(index .CurrentState.Info \"${CONTROLLER_NAME}\").DetailInfo.Config.Image}}" get pods/$id)
if [ "$CURRENT_IMAGE" != "${DOCKER_HUB_USER}/update-demo:${CONTAINER_IMAGE_VERSION}" ]; then
ALL_RUNNING=0
fi