mirror of https://github.com/istio/istio.io.git
Expand istio_version variable in snips (#8965)
* Expand istio_version variable in snips * regen
This commit is contained in:
parent
061a219fc9
commit
a8148ae39b
|
@ -47,7 +47,7 @@ istioctl analyze samples/bookinfo/networking/bookinfo-gateway.yaml samples/booki
|
||||||
! read -r -d '' snip_analyze_sample_destrule_out <<\ENDSNIP
|
! read -r -d '' snip_analyze_sample_destrule_out <<\ENDSNIP
|
||||||
Error [IST0101] (VirtualService bookinfo.default samples/bookinfo/networking/bookinfo-gateway.yaml:39) Referenced host not found: "productpage"
|
Error [IST0101] (VirtualService bookinfo.default samples/bookinfo/networking/bookinfo-gateway.yaml:39) Referenced host not found: "productpage"
|
||||||
Error: Analyzers found issues when analyzing namespace: default.
|
Error: Analyzers found issues when analyzing namespace: default.
|
||||||
See https://istio.io/v{{< istio_version >}}/docs/reference/config/analysis for more information about causes and resolutions.
|
See https://istio.io/v1.10/docs/reference/config/analysis for more information about causes and resolutions.
|
||||||
ENDSNIP
|
ENDSNIP
|
||||||
|
|
||||||
snip_analyze_networking_directory() {
|
snip_analyze_networking_directory() {
|
||||||
|
@ -74,7 +74,7 @@ spec:
|
||||||
...
|
...
|
||||||
status:
|
status:
|
||||||
validationMessages:
|
validationMessages:
|
||||||
- documentation_url: https://istio.io/v{{< istio_version >}}/docs/reference/config/analysis/ist0101/?ref=status-controller
|
- documentation_url: https://istio.io/v1.10/docs/reference/config/analysis/ist0101/?ref=status-controller
|
||||||
level: 3
|
level: 3
|
||||||
type:
|
type:
|
||||||
code: IST0101
|
code: IST0101
|
||||||
|
|
|
@ -35,11 +35,7 @@ snip_fix_default_namespace
|
||||||
_verify_contains snip_try_with_fixed_namespace "$snip_try_with_fixed_namespace_out"
|
_verify_contains snip_try_with_fixed_namespace "$snip_try_with_fixed_namespace_out"
|
||||||
|
|
||||||
echo '*** istioctl-analyze step 3 ***'
|
echo '*** istioctl-analyze step 3 ***'
|
||||||
# Pull the Istio version from the docs configuration file.
|
_verify_contains snip_analyze_sample_destrule "$snip_analyze_sample_destrule_out"
|
||||||
ISTIO_VERSION=$(yq r "${REPO_ROOT}"/data/args.yml 'version')
|
|
||||||
# shellcheck disable=SC2001
|
|
||||||
verify_string=$(echo "$snip_analyze_sample_destrule_out" | sed "s/{{< istio_version >}}/${ISTIO_VERSION}/")
|
|
||||||
_verify_contains snip_analyze_sample_destrule "$verify_string"
|
|
||||||
|
|
||||||
# There are multiple DestinationRules, some are valid for the VirtualService, some lack subsets
|
# There are multiple DestinationRules, some are valid for the VirtualService, some lack subsets
|
||||||
echo '*** istioctl-analyze step 4 ***'
|
echo '*** istioctl-analyze step 4 ***'
|
||||||
|
@ -82,10 +78,7 @@ echo '*** istioctl-analyze step 10 ***'
|
||||||
get_ratings_virtual_service() {
|
get_ratings_virtual_service() {
|
||||||
kubectl get vs ratings -o yaml
|
kubectl get vs ratings -o yaml
|
||||||
}
|
}
|
||||||
|
_verify_elided get_ratings_virtual_service "$snip_vs_yaml_with_status"
|
||||||
# shellcheck disable=SC2001
|
|
||||||
verify_string=$(echo "$snip_vs_yaml_with_status" | sed "s/{{< istio_version >}}/${ISTIO_VERSION}/")
|
|
||||||
_verify_elided get_ratings_virtual_service "$verify_string"
|
|
||||||
|
|
||||||
echo '*** istioctl-analyze step 11 ***'
|
echo '*** istioctl-analyze step 11 ***'
|
||||||
kubectl create ns frod
|
kubectl create ns frod
|
||||||
|
|
|
@ -87,8 +87,10 @@ with open("data/args.yml", 'r') as stream:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
source_branch_name = docs_config['source_branch_name']
|
source_branch_name = docs_config['source_branch_name']
|
||||||
|
istio_version = docs_config['version']
|
||||||
|
istio_full_version = docs_config['full_version']
|
||||||
except:
|
except:
|
||||||
sys.stderr.write('"source_branch_name" not defined in "data/args.yml"\n')
|
sys.stderr.write('failed to retrieve data from "data/args.yml"\n')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
with open(markdown, 'rt', encoding='utf-8') as mdfile:
|
with open(markdown, 'rt', encoding='utf-8') as mdfile:
|
||||||
|
@ -172,6 +174,8 @@ with open(markdown, 'rt', encoding='utf-8') as mdfile:
|
||||||
print(" " + msg)
|
print(" " + msg)
|
||||||
if heredoc.search(line):
|
if heredoc.search(line):
|
||||||
multiline_cmd = True
|
multiline_cmd = True
|
||||||
|
line = line.replace("{{< istio_version >}}", istio_version)
|
||||||
|
line = line.replace("{{< istio_full_version >}}", istio_full_version)
|
||||||
current_snip["script"].append(line)
|
current_snip["script"].append(line)
|
||||||
|
|
||||||
if len(boilerplates) > 0:
|
if len(boilerplates) > 0:
|
||||||
|
|
Loading…
Reference in New Issue