sebdet | a2c2df5 | 2021-10-15 13:47:31 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | ### |
DenisGNoonan | 3fdbdbb | 2024-05-16 10:49:21 +0100 | [diff] [blame^] | 4 | # ============LICENSE_START======================================================== |
sebdet | a2c2df5 | 2021-10-15 13:47:31 +0200 | [diff] [blame] | 5 | # ORAN SMO Package |
DenisGNoonan | 3fdbdbb | 2024-05-16 10:49:21 +0100 | [diff] [blame^] | 6 | # ================================================================================= |
sebdet | a2c2df5 | 2021-10-15 13:47:31 +0200 | [diff] [blame] | 7 | # Copyright (C) 2021 AT&T Intellectual Property. All rights |
| 8 | # reserved. |
DenisGNoonan | 3fdbdbb | 2024-05-16 10:49:21 +0100 | [diff] [blame^] | 9 | # Modification Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved. |
| 10 | # ================================================================================= |
sebdet | a2c2df5 | 2021-10-15 13:47:31 +0200 | [diff] [blame] | 11 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 12 | # you may not use this file except in compliance with the License. |
| 13 | # You may obtain a copy of the License at |
| 14 | # |
| 15 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 16 | # |
| 17 | # Unless required by applicable law or agreed to in writing, software |
| 18 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 19 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 20 | # See the License for the specific language governing permissions and |
| 21 | # limitations under the License. |
DenisGNoonan | 3fdbdbb | 2024-05-16 10:49:21 +0100 | [diff] [blame^] | 22 | # ============LICENSE_END========================================================== |
| 23 | # ================================================================================= |
| 24 | # |
sebdet | a2c2df5 | 2021-10-15 13:47:31 +0200 | [diff] [blame] | 25 | ### |
| 26 | |
DenisGNoonan | 3fdbdbb | 2024-05-16 10:49:21 +0100 | [diff] [blame^] | 27 | if ! jq --version > /dev/null 2>&1 ; then |
| 28 | sudo apt-get update |
| 29 | sudo apt-get install -y jq |
| 30 | fi |
| 31 | |
| 32 | INSTALL_KONG=$(helm get values oran-nonrtric -n nonrtric -o json | jq '.nonrtric.installKong') |
| 33 | if [ $? -ne 0 ]; then |
| 34 | echo "Failed to parse helm release value installKong with jq." |
| 35 | exit 1 |
| 36 | fi |
| 37 | |
| 38 | if [ "$INSTALL_KONG" = true ];then |
| 39 | echo "Warning - deleting Kong routes and services for ServiceManager." |
| 40 | SERVICEMANAGER_POD=$(kubectl get pods -o custom-columns=NAME:.metadata.name -l app.kubernetes.io/name=servicemanager --no-headers -n nonrtric) |
| 41 | if [[ -n $SERVICEMANAGER_POD ]]; then |
| 42 | kubectl exec $SERVICEMANAGER_POD -n nonrtric -- ./kongclearup |
| 43 | else |
| 44 | echo "Error - Servicemanager pod not found, didn't delete Kong routes and services for ServiceManager." |
| 45 | fi |
| 46 | fi |
| 47 | |
sebdet | a2c2df5 | 2021-10-15 13:47:31 +0200 | [diff] [blame] | 48 | kubectl delete namespace nonrtric |
| 49 | kubectl delete pv nonrtric-pv2 |
| 50 | kubectl delete pv nonrtric-pv1 |
sebdet | 11f85c7 | 2021-12-17 18:27:29 +0100 | [diff] [blame] | 51 | kubectl delete pv nonrtric-pv3 |
sebdet | dd88f8e | 2022-03-03 23:27:08 +0100 | [diff] [blame] | 52 | kubectl get pv | grep Released | awk '$1 {print$1}' | while read vol; do kubectl delete pv/${vol}; done |