X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=nonrtric%2Fbin%2Funinstall;fp=nonrtric%2Fbin%2Funinstall;h=0000000000000000000000000000000000000000;hb=c5c107d6d940c784d57623c03104ebd8caac91f2;hp=d0549f57e7236a31b45359b7b2a80ab6483546f9;hpb=a31a9b3dc986ce76b763c210cf45e2212c95181a;p=it%2Fdep.git diff --git a/nonrtric/bin/uninstall b/nonrtric/bin/uninstall deleted file mode 100755 index d0549f57..00000000 --- a/nonrtric/bin/uninstall +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -################################################################################ -# Copyright (c) 2020 Nordix Foundation. # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); # -# you may not use this file except in compliance with the License. # -# You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -################################################################################ - - -COMPONENTS="controlpanel a1controller a1simulator policymanagementservice enrichmentservice rappcatalogueservice nonrtricgateway" -RECIPE_NAMESPACE=$(kubectl get cm --all-namespaces | grep nonrtric-recipe | awk '{print $1}') -kubectl get configmap -n $RECIPE_NAMESPACE nonrtric-recipe -o jsonpath='{.data.recipe}' > /tmp/recipe.yaml - -if [ ! -s /tmp/recipe.yaml ]; then - echo "NONRTRIC recipe is not found. Are you sure it's deployed successfully?" - exit 0 -fi - -COMMON_BLOCK=$(cat /tmp/recipe.yaml | awk '/^common:/{getline; while ($0 ~ /^ +.*|^ *$/) {print $0; if (getline == 0) {break}}}') -NAMESPACE_BLOCK=$(cat /tmp/recipe.yaml | awk '/^ namespace:/{getline; while ($0 ~ /^ .*|^ *$/) {print $0; if (getline == 0) {break}}}') -NONRTRIC_NAMESPACE=$(echo "$NAMESPACE_BLOCK" | awk '/^ *nonrtric:/{print $2}') -RELEASE_PREFIX=$(echo "$COMMON_BLOCK" | awk '/^ *releasePrefix:/{print $2}') - -echo "Undeploying NONRTRIC components [$COMPONENTS]" - -IS_HELM3=$(helm version -c --short|grep -e "^v3") -HELM_FLAG='' -if [ $IS_HELM3 ] -then - HELM_FLAG=' -n '${NONRTRIC_NAMESPACE:-nonrtric} -else - HELM_FLAG='--purge' -fi - -helm delete ${HELM_FLAG} ${RELEASE_PREFIX} - -kubectl delete cm -n ${NONRTRIC_NAMESPACE:-nonrtric} nonrtric-recipe - -kubectl delete ns ${NONRTRIC_NAMESPACE:-nonrtric}