#!/usr/bin/env bash # T22: Istio sidecar bootstrap static cluster list has no outbound|* traffic clusters, # and dynamic_resources is entirely ADS-based (no file-based/path xDS config). set -euo pipefail NS="istio-vt-t22" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" BOOTSTRAP_JSON="$(mktemp)" cleanup() { echo "[cleanup] deleting namespace ${NS}" kubectl delete namespace "${NS}" --wait=false --ignore-not-found rm -f "${BOOTSTRAP_JSON}" } trap cleanup EXIT echo "[setup] creating namespace ${NS} with istio-injection=enabled" kubectl create namespace "${NS}" kubectl label namespace "${NS}" istio-injection=enabled echo "[setup] applying manifest.yaml" kubectl apply -f "${SCRIPT_DIR}/manifest.yaml" echo "[wait] client pod Ready" kubectl -n "${NS}" wait --for=condition=Ready pod/client --timeout=120s echo "[wait] echo deployment rollout" kubectl -n "${NS}" rollout status deployment/echo --timeout=120s echo "[observe] fetching sidecar bootstrap config_dump" # NOTE: '?resource=bootstrap' (as in the original doc/spec draft) is invalid for the # Envoy admin API -- bootstrap is not a repeated field. The correct query param is # '?mask=bootstrap', which filters the full config_dump down to just the bootstrap section. kubectl -n "${NS}" exec client -c istio-proxy -- curl -s "localhost:15000/config_dump?mask=bootstrap" > "${BOOTSTRAP_JSON}" echo "[observe] static cluster names" # NOTE: this Envoy build serializes config_dump using proto snake_case field names # (static_resources / dynamic_resources / ads_config / path_config_source), not camelCase. jq -r '.configs[0].bootstrap.static_resources.clusters[].name' "${BOOTSTRAP_JSON}" echo "[observe] count of outbound| clusters in static list (expect 0)" jq -r '.configs[0].bootstrap.static_resources.clusters[].name' "${BOOTSTRAP_JSON}" | grep -c 'outbound|' || true echo "[observe] dynamic_resources block" jq '.configs[0].bootstrap.dynamic_resources' "${BOOTSTRAP_JSON}" echo "[observe] ads config per dynamic resource entry (expect ads:{} / ads_config present, no path)" jq '.configs[0].bootstrap.dynamic_resources | to_entries[] | {key, ads: (.value.ads // .value.ads_config // empty)}' "${BOOTSTRAP_JSON}" echo "[observe] search whole bootstrap for path_config_source (expect no output)" jq -r '.. | .path_config_source? // empty' "${BOOTSTRAP_JSON}" echo "[done] T22 observation complete"