Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated yq -j flag with -o=j #15652

Merged
merged 1 commit into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/includes/juju.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ bootstrap() {

add_model "${model}" "${cloud}" "${bootstrapped_name}" "${output}"
name="${bootstrapped_name}"
BOOTSTRAPPED_CLOUD=$(juju show-model controller | yq -j | jq -r '.[] | .cloud')
BOOTSTRAPPED_CLOUD=$(juju show-model controller | yq -o=j | jq -r '.[] | .cloud')
export BOOTSTRAPPED_CLOUD
BOOTSTRAPPED_CLOUD_REGION=$(juju show-model controller | yq -j | jq -r '.[] | (.cloud + "/" + .region)')
BOOTSTRAPPED_CLOUD_REGION=$(juju show-model controller | yq -o=j | jq -r '.[] | (.cloud + "/" + .region)')
export BOOTSTRAPPED_CLOUD_REGION
else
local cloud_region
Expand Down
4 changes: 2 additions & 2 deletions tests/suites/cli/display_clouds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ EOF
CLOUD_LIST=$(JUJU_DATA="${TEST_DIR}/juju" juju clouds --client --format=json 2>/dev/null | jq -S 'with_entries(select(
.value.defined != "built-in")) | with_entries((select(.value.defined == "local")
| del(.value.defined) | del(.value.description)))')
EXPECTED=$(echo "${CLOUDS}" | yq -j | jq -S '.[] | del(.clouds) | .[] |= ({endpoint} as $endpoint | .[] |= walk(
EXPECTED=$(echo "${CLOUDS}" | yq -o=j | jq -S '.[] | del(.clouds) | .[] |= ({endpoint} as $endpoint | .[] |= walk(
(objects | select(contains($endpoint))) |= del(.endpoint)
))')
if [ "${CLOUD_LIST}" != "${EXPECTED}" ]; then
echo "expected ${EXPECTED}, got ${CLOUD_LIST}"
exit 1
fi

CLOUD_LIST=$(JUJU_DATA="${TEST_DIR}/juju" juju show-cloud finfolk-vmaas --format yaml --client 2>/dev/null | yq -j | jq -S 'with_entries((select(.value!= null)))')
CLOUD_LIST=$(JUJU_DATA="${TEST_DIR}/juju" juju show-cloud finfolk-vmaas --format yaml --client 2>/dev/null | yq -o=j | jq -S 'with_entries((select(.value!= null)))')
EXPECTED=$(
cat <<'EOF' | jq -S
{
Expand Down
2 changes: 1 addition & 1 deletion tests/suites/metrics/metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ run_smoke_test() {

attempt=0
while true; do
OUT=$(juju metrics metered/0 --format yaml | yq -j | jq -r '.[]')
OUT=$(juju metrics metered/0 --format yaml | yq -o=j | jq -r '.[]')
if [[ -n ${OUT} ]]; then
break
fi
Expand Down