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
parent
d540555c5e
commit
ffcb75ef12
|
|
@ -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
|
||||
# -------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in New Issue