diff options
author | Alexis de Talhouƫt <alexis.de_talhouet@bell.ca> | 2018-01-10 17:46:13 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-01-10 17:46:13 +0000 |
commit | 8a36a9e441ce46ebe4e5fe46eaafd85d51f2db95 (patch) | |
tree | fc82a10b751a1ed23e99ad3aecb0cae35043a5b4 /kubernetes/oneclick/tools/autoCleanConfig.bash | |
parent | 6e6f78a99d27aa4c0c8303831524d7cdaacc4bb6 (diff) | |
parent | ab1c1ab48b4a0daee88670479d1c57fcf58ae1cd (diff) |
Merge "ONAP config operation in oneclick/tools"
Diffstat (limited to 'kubernetes/oneclick/tools/autoCleanConfig.bash')
-rw-r--r-- | kubernetes/oneclick/tools/autoCleanConfig.bash | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/kubernetes/oneclick/tools/autoCleanConfig.bash b/kubernetes/oneclick/tools/autoCleanConfig.bash new file mode 100644 index 0000000000..e274e0d0c5 --- /dev/null +++ b/kubernetes/oneclick/tools/autoCleanConfig.bash @@ -0,0 +1,54 @@ +######################################################################################## +# This script wraps {$OOM}/kubernetes/oneclick/deleteAll.sh script along with # +# the following steps to clean up ONAP configure for specified namespace: # +# - remove namespace # +# - remove release # +# - remove shared directory # +# # +# To run it, just enter the following command: # +# ./autoCleanConfig.bash <namespace, default is "onap"> # +######################################################################################## +#!/bin/bash + + +NS=$1 +if [[ -z $NS ]] +then + echo "Namespace is not specified, use onap namespace." + NS="onap" +fi + +echo "Clean up $NS configuration" +cd .. +./deleteAll.bash -n $NS -y +cd - + +echo "---------------------------------------------- +Force remove namespace..." +kubectl delete namespace $NS +echo "...done : kubectl get namespace +----------------------------------------------- +>>>>>>>>>>>>>> k8s namespace" +kubectl get namespace +while [[ ! -z `kubectl get namespace|grep $NS` ]] +do + echo "Wait for namespace $NS to be deleted +----------------------------------------------- +>>>>>>>>>>>>>> k8s namespace" + kubectl get namespace + sleep 2 +done + +echo "Force delete helm process ..." +helm delete $NS-config --purge --debug +echo "...done : helm ls --all + ----------------------------------------------- +>>>>>>>>>>>>>> helm" +helm ls --all + +echo "Remove $NS dockerdata..." +sudo rm -rf /dockerdata-nfs/onap +echo "...done : ls -altr /dockerdata-nfs + ----------------------------------------------- +>>>>>>>>>>>>>> /dockerdata-nfs directory" +ls -altr /dockerdata-nfs |