Skip to content

Commit

Permalink
Replay yq v3 which is deprecated with yq v4 (#11202)
Browse files Browse the repository at this point in the history
* Replay yq v3 which is deprecated with yq v4

* Update yq key
  • Loading branch information
Eric Van Norman authored Apr 20, 2022
1 parent 6afb542 commit fc515c8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ kubectl label namespace default istio-injection=enabled --overwrite
export IFS=
echo "${snip_proxyIstioConfig}" > proxyConfig.yaml
unset IFS
yq m -d2 samples/sleep/sleep.yaml proxyConfig.yaml > sleep_istioconfig.yaml
# yq m -d2 samples/sleep/sleep.yaml proxyConfig.yaml > sleep_istioconfig.yaml
yq 'select(document_index != 2)' samples/sleep/sleep.yaml > tmp1.yaml
yq 'select(document_index == 2)' samples/sleep/sleep.yaml > tmp2.yaml
# shellcheck disable=SC2016
yq eval-all '. as $item ireduce ({}; . *+ $item)' tmp2.yaml proxyConfig.yaml > new2.yaml
yq . tmp1.yaml new2.yaml > sleep_istioconfig.yaml

kubectl apply -f sleep_istioconfig.yaml
_wait_for_deployment default sleep
POD="$(kubectl get pod -l app=sleep -o jsonpath='{.items[0].metadata.name}')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ _verify_elided snip_validating_ingress_routing_based_on_jwt_claims_1 "$snip_vali
_verify_elided snip_validating_ingress_routing_based_on_jwt_claims_2 "$snip_validating_ingress_routing_based_on_jwt_claims_2_out"

# Pull the Istio branch from the docs configuration file.
ISTIO_BRANCH=$(yq r "${REPO_ROOT}"/data/args.yml 'source_branch_name')
ISTIO_BRANCH=$(yq '.source_branch_name' "${REPO_ROOT}"/data/args.yml)

TOKEN_GROUP_URL="https://raw.githubusercontent.com/istio/istio/${ISTIO_BRANCH}/security/tools/jwt/samples/groups-scope.jwt"
export TOKEN_GROUP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ _wait_for_deployment foo httpbin
_wait_for_deployment foo sleep

# Pull the Istio branch from the docs configuration file.
ISTIO_BRANCH=$(yq r "${REPO_ROOT}"/data/args.yml 'source_branch_name')
ISTIO_BRANCH=$(yq '.source_branch_name' "${REPO_ROOT}"/data/args.yml)

TOKEN_URL="https://raw.githubusercontent.com/istio/istio/${ISTIO_BRANCH}/security/tools/jwt/samples/demo.jwt"
TOKEN_GROUP_URL="https://raw.githubusercontent.com/istio/istio/${ISTIO_BRANCH}/security/tools/jwt/samples/groups-scope.jwt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ _verify_elided snip_validating_ingress_routing_based_on_jwt_claims_1 "$snip_vali
_verify_elided snip_validating_ingress_routing_based_on_jwt_claims_2 "$snip_validating_ingress_routing_based_on_jwt_claims_2_out"

# Pull the Istio branch from the docs configuration file.
ISTIO_BRANCH=$(yq r "${REPO_ROOT}"/data/args.yml 'source_branch_name')
ISTIO_BRANCH=$(yq '.source_branch_name' "${REPO_ROOT}"/data/args.yml )

TOKEN_GROUP_URL="https://raw.githubusercontent.com/istio/istio/${ISTIO_BRANCH}/security/tools/jwt/samples/groups-scope.jwt"
export TOKEN_GROUP
Expand Down

0 comments on commit fc515c8

Please sign in to comment.