From 68332a494ab572e3b526c799aa7389810451749b Mon Sep 17 00:00:00 2001 From: "aravind.est" Date: Wed, 26 Jun 2024 16:20:45 +0100 Subject: [PATCH 1/1] Fix the yq based validation checks Upgrade yq version Fix the permission issues when reading the file Issue-ID: NONRTRIC-994 Change-Id: I463c71258a775122faf17d9caf28780947b6c546 Signed-off-by: aravind.est --- bin/deploy-nonrtric | 8 ++++---- smo-install/scripts/sub-scripts/install-nonrtric.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/deploy-nonrtric b/bin/deploy-nonrtric index e0c33060..2b883639 100755 --- a/bin/deploy-nonrtric +++ b/bin/deploy-nonrtric @@ -52,22 +52,22 @@ fi if ! command -v yq > /dev/null 2>&1; then echo "yq is not installed. Installing yq..." - sudo snap install yq --channel=v3/stable + sudo snap install yq --channel=v4/stable fi -INSTALL_KONG=$(yq read "$OVERRIDEYAML" 'nonrtric.installKong') +INSTALL_KONG=$(cat $OVERRIDEYAML | yq e '.nonrtric.installKong' -) if [ $? -ne 0 ] || [ -z "$INSTALL_KONG" ]; then echo "Error: failed to parse installKong from YAML with yq. Aborting install." exit 1 fi -INSTALL_CAPIF=$(yq read "$OVERRIDEYAML" 'nonrtric.installCapifcore') +INSTALL_CAPIF=$(cat $OVERRIDEYAML | yq e '.nonrtric.installCapifcore' -) if [ $? -ne 0 ] || [ -z "$INSTALL_CAPIF" ]; then echo "Error: failed to parse installCapifcore from YAML with yq. Aborting install." exit 1 fi -INSTALL_SERVICEMANAGER=$(yq read "$OVERRIDEYAML" 'nonrtric.installServicemanager') +INSTALL_SERVICEMANAGER=$(cat $OVERRIDEYAML | yq e '.nonrtric.installServicemanager' -) if [ $? -ne 0 ] || [ -z "$INSTALL_SERVICEMANAGER" ]; then echo "Error: failed to parse installServicemanager from YAML with yq. Aborting install." exit 1 diff --git a/smo-install/scripts/sub-scripts/install-nonrtric.sh b/smo-install/scripts/sub-scripts/install-nonrtric.sh index 97479d05..d91243d7 100755 --- a/smo-install/scripts/sub-scripts/install-nonrtric.sh +++ b/smo-install/scripts/sub-scripts/install-nonrtric.sh @@ -30,22 +30,22 @@ OVERRIDEYAML=$1 if ! command -v yq > /dev/null 2>&1; then echo "yq is not installed. Installing yq..." - sudo snap install yq --channel=v3/stable + sudo snap install yq --channel=v4/stable fi -INSTALL_KONG=$(yq read "$OVERRIDEYAML" 'nonrtric.installKong') +INSTALL_KONG=$(cat $OVERRIDEYAML | yq e '.nonrtric.installKong' -) if [ $? -ne 0 ] || [ -z "$INSTALL_KONG" ]; then echo "Error: failed to parse installKong from YAML with yq. Aborting install." exit 1 fi -INSTALL_CAPIF=$(yq read "$OVERRIDEYAML" 'nonrtric.installCapifcore') +INSTALL_CAPIF=$(cat $OVERRIDEYAML | yq e '.nonrtric.installCapifcore' -) if [ $? -ne 0 ] || [ -z "$INSTALL_CAPIF" ]; then echo "Error: failed to parse installCapifcore from YAML with yq. Aborting install." exit 1 fi -INSTALL_SERVICEMANAGER=$(yq read "$OVERRIDEYAML" 'nonrtric.installServicemanager') +INSTALL_SERVICEMANAGER=$(cat $OVERRIDEYAML | yq e '.nonrtric.installServicemanager' -) if [ $? -ne 0 ] || [ -z "$INSTALL_SERVICEMANAGER" ]; then echo "Error: failed to parse installServicemanager from YAML with yq. Aborting install." exit 1 -- 2.16.6