Update to use current version (#14909)

* Update to use current version

* Try just replacing APP VERSION with ...

* Add versionregex to verify_like and update to include APP VERSION

* Allow more fields with verify_like

* Move column heading

* Update header and add additional verify comments
This commit is contained in:
Eric Van Norman 2024-04-22 12:56:32 -05:00 committed by GitHub
parent e117650695
commit cc3a534e60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 63 additions and 39 deletions

View File

@ -87,11 +87,11 @@ After installing all the components, you can check the Helm deployment status wi
{{< text syntax=bash snip_id=show_components >}}
$ helm ls -n istio-system
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 ... ... ... ... deployed base-1.0.0 1.0.0
istio-cni istio-system 1 ... ... ... ... deployed cni-1.0.0 1.0.0
istiod istio-system 1 ... ... ... ... deployed istiod-1.0.0 1.0.0
ztunnel istio-system 1 ... ... ... ... deployed ztunnel-1.0.0 1.0.0
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed base-{{< istio_full_version >}} {{< istio_full_version >}}
istio-cni istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed cni-{{< istio_full_version >}} {{< istio_full_version >}}
istiod istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed istiod-{{< istio_full_version >}} {{< istio_full_version >}}
ztunnel istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed ztunnel-{{< istio_full_version >}} {{< istio_full_version >}}
{{< /text >}}
You can check the status of the deployed pods with:
@ -118,11 +118,11 @@ installed above.
{{< text syntax=bash >}}
$ helm ls -n istio-system
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 ... ... ... ... deployed base-1.0.0 1.0.0
istio-cni istio-system 1 ... ... ... ... deployed cni-1.0.0 1.0.0
istiod istio-system 1 ... ... ... ... deployed istiod-1.0.0 1.0.0
ztunnel istio-system 1 ... ... ... ... deployed ztunnel-1.0.0 1.0.0
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed base-{{< istio_full_version >}} {{< istio_full_version >}}
istio-cni istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed cni-{{< istio_full_version >}} {{< istio_full_version >}}
istiod istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed istiod-{{< istio_full_version >}} {{< istio_full_version >}}
ztunnel istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed ztunnel-{{< istio_full_version >}} {{< istio_full_version >}}
{{< /text >}}
1. (Optional) Delete any Istio gateway chart installations:

View File

@ -54,11 +54,11 @@ helm ls -n istio-system
}
! IFS=$'\n' read -r -d '' snip_show_components_out <<\ENDSNIP
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 ... ... ... ... deployed base-1.0.0 1.0.0
istio-cni istio-system 1 ... ... ... ... deployed cni-1.0.0 1.0.0
istiod istio-system 1 ... ... ... ... deployed istiod-1.0.0 1.0.0
ztunnel istio-system 1 ... ... ... ... deployed ztunnel-1.0.0 1.0.0
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed base-1.22.0 1.22.0
istio-cni istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed cni-1.22.0 1.22.0
istiod istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed istiod-1.22.0 1.22.0
ztunnel istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed ztunnel-1.22.0 1.22.0
ENDSNIP
snip_check_pods() {
@ -77,11 +77,11 @@ helm ls -n istio-system
}
! IFS=$'\n' read -r -d '' snip_uninstall_1_out <<\ENDSNIP
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 ... ... ... ... deployed base-1.0.0 1.0.0
istio-cni istio-system 1 ... ... ... ... deployed cni-1.0.0 1.0.0
istiod istio-system 1 ... ... ... ... deployed istiod-1.0.0 1.0.0
ztunnel istio-system 1 ... ... ... ... deployed ztunnel-1.0.0 1.0.0
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed base-1.22.0 1.22.0
istio-cni istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed cni-1.22.0 1.22.0
istiod istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed istiod-1.22.0 1.22.0
ztunnel istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed ztunnel-1.22.0 1.22.0
ENDSNIP
snip_delete_ingress() {

View File

@ -58,8 +58,8 @@ You can display the default values of configuration parameters using the `helm s
{{< text syntax=bash >}}
$ helm ls -n istio-system
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 ... ... ... ... deployed base-1.16.1 1.16.1
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed base-{{< istio_full_version >}} {{< istio_full_version >}}
{{< /text >}}
In the output locate the entry for `istio-base` and make sure the status is set to `deployed`.
@ -76,9 +76,9 @@ You can display the default values of configuration parameters using the `helm s
{{< text syntax=bash >}}
$ helm ls -n istio-system
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 ... ... ... ... deployed base-1.16.1 1.16.1
istiod istio-system 1 ... ... ... ... deployed istiod-1.16.1 1.16.1
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed base-{{< istio_full_version >}} {{< istio_full_version >}}
istiod istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed istiod-{{< istio_full_version >}} {{< istio_full_version >}}
{{< /text >}}
1. Get the status of the installed helm chart to ensure it is deployed:
@ -120,7 +120,7 @@ You can display the default values of configuration parameters using the `helm s
{{< text syntax=bash >}}
$ kubectl get deployments -n istio-system --output wide
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
istiod 1/1 1 1 10m discovery docker.io/istio/pilot:1.16.1 istio=pilot
istiod 1/1 1 1 10m discovery docker.io/istio/pilot:{{< istio_full_version >}} istio=pilot
{{< /text >}}
1. (Optional) Install an ingress gateway:
@ -176,9 +176,9 @@ installed above.
{{< text syntax=bash snip_id=helm_ls >}}
$ helm ls -n istio-system
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 ... ... ... ... deployed base-1.0.0 1.0.0
istiod istio-system 1 ... ... ... ... deployed istiod-1.0.0 1.0.0
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed base-{{< istio_full_version >}} {{< istio_full_version >}}
istiod istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed istiod-{{< istio_full_version >}} {{< istio_full_version >}}
{{< /text >}}
1. (Optional) Delete any Istio gateway chart installations:

View File

@ -34,8 +34,8 @@ helm ls -n istio-system
}
! IFS=$'\n' read -r -d '' snip_installation_steps_4_out <<\ENDSNIP
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 ... ... ... ... deployed base-1.16.1 1.16.1
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed base-1.22.0 1.22.0
ENDSNIP
snip_install_discovery() {
@ -47,9 +47,9 @@ helm ls -n istio-system
}
! IFS=$'\n' read -r -d '' snip_installation_steps_6_out <<\ENDSNIP
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 ... ... ... ... deployed base-1.16.1 1.16.1
istiod istio-system 1 ... ... ... ... deployed istiod-1.16.1 1.16.1
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed base-1.22.0 1.22.0
istiod istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed istiod-1.22.0 1.22.0
ENDSNIP
snip_installation_steps_7() {
@ -93,7 +93,7 @@ kubectl get deployments -n istio-system --output wide
! IFS=$'\n' read -r -d '' snip_installation_steps_8_out <<\ENDSNIP
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
istiod 1/1 1 1 10m discovery docker.io/istio/pilot:1.16.1 istio=pilot
istiod 1/1 1 1 10m discovery docker.io/istio/pilot:1.22.0 istio=pilot
ENDSNIP
snip_install_ingressgateway() {
@ -106,9 +106,9 @@ helm ls -n istio-system
}
! IFS=$'\n' read -r -d '' snip_helm_ls_out <<\ENDSNIP
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 ... ... ... ... deployed base-1.0.0 1.0.0
istiod istio-system 1 ... ... ... ... deployed istiod-1.0.0 1.0.0
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
istio-base istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed base-1.22.0 1.22.0
istiod istio-system 1 2024-04-17 22:14:45.964722028 +0000 UTC deployed istiod-1.22.0 1.22.0
ENDSNIP
snip_delete_delete_gateway_charts() {

View File

@ -246,6 +246,8 @@ expected output. The framework includes the following built-in verify functions:
respectively.
1. prefix match ending with a dash character (e.g., `reviews-v1-12345...` is like `reviews-v1-67890...`)
1. expected `...` is a wildcard token, matches anything
1. different dates in YYYY-MM-DD (e.g. 2024-04-17)
1. different times in HH:MM:SS.MS (e.g. 22:14:45.964722028)
This function is useful for comparing the output of commands that include some run-specific
values in the output (e.g., `kubectl get pods`), or when whitespace in the output may be different.

View File

@ -126,12 +126,17 @@ __cmp_first_line() {
# variables, respectively.
# - prefix match ending with a dash character
# - expected ... is a wildcard token, matches anything
# - different dates in YYYY-MM-DD (e.g. 2024-04-17)
# - different times HH:MM:SS.MS (e.g. 22:14:45.964722028)
# Otherwise, returns 1.
__cmp_like() {
local out="${1//$'\r'}"
local expected=$2
local ipregex="^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$"
local timeregex="^([0-9]+[smhd])+$"
local durationregex="^([0-9]+[smhd])+$"
local versionregex="^[0-9]+\.[0-9]+\.[0-9]+$"
local dateregex="^\d{4}\-(0?[1-9]|1[012])\-(0?[1-9]|[12][0-9]|3[01])$"
local timeregex="^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9]).[0-9]+$"
if [[ "$out" != "$expected" ]]; then
local olines=()
@ -185,6 +190,21 @@ __cmp_like() {
fi
# Check for elapsed time tokens.
if [[ "$otok" =~ $durationregex && "$etok" =~ $durationregex ]]; then
continue
fi
# Check for version tokens.
if [[ "$otok" =~ $versionregex && "$etok" =~ $versionregex ]]; then
continue
fi
# Check for date tokens.
if [[ "$otok" =~ $dateregex && "$etok" =~ $dateregex ]]; then
continue
fi
# Check for hms time tokens.
if [[ "$otok" =~ $timeregex && "$etok" =~ $timeregex ]]; then
continue
fi
@ -431,6 +451,8 @@ _verify_first_line() {
# variables, respectively.
# - prefix match ending with a dash character
# - expected ... is a wildcard token, matches anything
# - different dates in YYYY-MM-DD (e.g. 2024-04-17)
# - different times HH:MM:SS.MS (e.g. 22:14:45.964722028)
_verify_like() {
local func=$1
local expected=$2