Cleanup and Roll Update not working. (#8357)

Cleanup and Roll Update not working due to PR #8158 exiting if existing project is not found. Moved command checking above project creation/check so that these commands can execute before scripts exits when it finds that project with the same name exists. (#8357)

Signed-off-by: James Drummond <james@devcomb.com>
6.19.x
James Drummond PE 2018-01-18 11:00:25 -06:00 committed by GitHub
parent d540555c5e
commit ffcb75ef12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 24 deletions

View File

@ -271,6 +271,30 @@ else
fi
echo "done!"
# -------------------------------------------------------------
# If command == cleanup then delete all openshift objects
# -------------------------------------------------------------
if [ "${COMMAND}" == "cleanup" ]; then
echo "[CHE] Deleting all OpenShift objects..."
oc delete all --all
echo "[CHE] Cleanup successfully started. Use \"oc get all\" to verify that all resources have been deleted."
exit 0
# -------------------------------------------------------------
# If command == rollupdate then update Che
# -------------------------------------------------------------
elif [ "${COMMAND}" == "rollupdate" ]; then
echo "[CHE] Update CHE pod"
get_che_pod_config | oc apply -f -
echo "[CHE] Update successfully started"
exit 0
# ----------------------------------------------------------------
# At this point command should be "deploy" otherwise it's an error
# ----------------------------------------------------------------
elif [ "${COMMAND}" != "deploy" ]; then
echo "[CHE] **ERROR**: Command \"${COMMAND}\" is not a valid command. Aborting."
exit 1
fi
# --------------------------
# Create project (if needed)
# --------------------------
@ -357,30 +381,6 @@ else
CHE_KEYCLOAK_CLIENT__ID=${CHE_KEYCLOAK_CLIENT__ID:-"openshiftio-public"}
fi
# -------------------------------------------------------------
# If command == cleanup then delete all openshift objects
# -------------------------------------------------------------
if [ "${COMMAND}" == "cleanup" ]; then
echo "[CHE] Deleting all OpenShift objects..."
oc delete all --all
echo "[CHE] Cleanup successfully started. Use \"oc get all\" to verify that all resources have been deleted."
exit 0
# -------------------------------------------------------------
# If command == rollupdate then update Che
# -------------------------------------------------------------
elif [ "${COMMAND}" == "rollupdate" ]; then
echo "[CHE] Update CHE pod"
get_che_pod_config | oc apply -f -
echo "[CHE] Update successfully started"
exit 0
# ----------------------------------------------------------------
# At this point command should be "deploy" otherwise it's an error
# ----------------------------------------------------------------
elif [ "${COMMAND}" != "deploy" ]; then
echo "[CHE] **ERROR**: Command \"${COMMAND}\" is not a valid command. Aborting."
exit 1
fi
# -------------------------------------------------------------
# Verify that Che ServiceAccount has admin rights at project level
# -------------------------------------------------------------