From: aravind.est Date: Wed, 30 Oct 2024 15:11:52 +0000 (+0000) Subject: SMO TEIV - Enable default usage of yq v4 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=a52adc9ccce4ba06e09e5fd103e46aa86aa97787;p=it%2Fdep.git SMO TEIV - Enable default usage of yq v4 Snap installs yq v4 by default and the syntax between yq v4 and v3 is significant. This installs the yq v4 if not installed and syntax updated to support yq v4. Issue-ID: SMO-154 Change-Id: Id58d2ddc3e603e79e6bbd9ad9c4310cd78947d44 Signed-off-by: aravind.est --- diff --git a/smo-install/scripts/sub-scripts/install-smo.sh b/smo-install/scripts/sub-scripts/install-smo.sh index 4f4187ff..df6cafd7 100755 --- a/smo-install/scripts/sub-scripts/install-smo.sh +++ b/smo-install/scripts/sub-scripts/install-smo.sh @@ -19,6 +19,11 @@ echo '### Installing ORAN SMO part ###' kubectl create namespace smo +if ! command -v yq > /dev/null 2>&1; then + echo "yq is not installed. Installing yq..." + sudo snap install yq --channel=v4/stable +fi + OVERRIDEYAML=$1 helm install --debug oran-smo local/smo --namespace smo -f $OVERRIDEYAML @@ -43,4 +48,4 @@ while IFS= read -r secret; do echo "Copying $secret from onap namespace..." check_for_secrets $secret kubectl get secret $secret -n onap -o json | jq 'del(.metadata["namespace","creationTimestamp","resourceVersion","selfLink","uid","ownerReferences"])' | kubectl apply -n smo -f - -done < <(yq r -d0 $OVERRIDEYAML smo.secrets[*]) \ No newline at end of file +done < <(yq '.smo.secrets[]' $OVERRIDEYAML)