From 140ff5555d39dea6ab570bb4ef64591e73d079de Mon Sep 17 00:00:00 2001 From: Alex Misstear Date: Tue, 25 Jun 2024 07:56:13 -0400 Subject: [PATCH] More robust jq and curl commands --- .../0.1/eaas-copy-secrets-to-ephemeral-cluster.yaml | 2 +- .../0.1/eaas-get-latest-openshift-version-by-prefix.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stepactions/eaas-copy-secrets-to-ephemeral-cluster/0.1/eaas-copy-secrets-to-ephemeral-cluster.yaml b/stepactions/eaas-copy-secrets-to-ephemeral-cluster/0.1/eaas-copy-secrets-to-ephemeral-cluster.yaml index 03bb12120d..b6c5994055 100644 --- a/stepactions/eaas-copy-secrets-to-ephemeral-cluster/0.1/eaas-copy-secrets-to-ephemeral-cluster.yaml +++ b/stepactions/eaas-copy-secrets-to-ephemeral-cluster/0.1/eaas-copy-secrets-to-ephemeral-cluster.yaml @@ -35,7 +35,7 @@ spec: set -eo pipefail oc get secrets -l "$LABEL_SELECTOR" -o json \ - | jq ".items[].metadata.namespace=\"$NAMESPACE\"" \ + | jq --arg ns "$NAMESPACE" '.items[].metadata.namespace=$ns' \ | jq 'del(.items[] | .metadata.creationTimestamp, .metadata.uid, .metadata.resourceVersion, .metadata.annotations."kubectl.kubernetes.io/last-applied-configuration")' \ diff --git a/stepactions/eaas-get-latest-openshift-version-by-prefix/0.1/eaas-get-latest-openshift-version-by-prefix.yaml b/stepactions/eaas-get-latest-openshift-version-by-prefix/0.1/eaas-get-latest-openshift-version-by-prefix.yaml index 9fa5431e86..9fdd18e6b7 100644 --- a/stepactions/eaas-get-latest-openshift-version-by-prefix/0.1/eaas-get-latest-openshift-version-by-prefix.yaml +++ b/stepactions/eaas-get-latest-openshift-version-by-prefix/0.1/eaas-get-latest-openshift-version-by-prefix.yaml @@ -26,6 +26,6 @@ spec: set -eo pipefail echo "GET $URL" - RESULT=$(curl -s -L -H "Accepts: application/json" $URL) + RESULT=$(curl -f -s -L -H "Accepts: application/json" $URL) echo "$RESULT" jq -j '.name' <<< "$RESULT" > $(step.results.version.path)