File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
testing/chainsaw/e2e/version Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ # yaml-language-server: $schema=https://raw.githubusercontent.com/kyverno/chainsaw/main/.schemas/json/test-chainsaw-v1alpha1.json
2+ apiVersion : chainsaw.kyverno.io/v1alpha1
3+ kind : Test
4+ metadata :
5+ creationTimestamp : null
6+ name : version
7+ spec :
8+ steps :
9+ - name : step-00
10+ try :
11+ - script :
12+ content : |
13+ contains() { bash -ceu '[[ "$1" == *"$2"* ]]' - "$@"; }
14+
15+ VERSION_OUTPUT=$(kubectl pgo version)
16+ { contains "${VERSION_OUTPUT}" "Client Version:"; } || {
17+ echo "Expected: Client Version:*"
18+ echo "Actual: ${VERSION_OUTPUT}"
19+ exit 1
20+ }
21+ - script :
22+ content : |
23+ contains() { bash -ceu '[[ "$1" == *"$2"* ]]' - "$@"; }
24+
25+ OPERATOR_VERSION=$(
26+ kubectl get crd postgresclusters.postgres-operator.crunchydata.com \
27+ -o go-template='{{ index .metadata.labels "app.kubernetes.io/version" }}'
28+ )
29+
30+ VERSION_OUTPUT=$(kubectl pgo version)
31+
32+ { contains "${VERSION_OUTPUT}" "Operator Version: v${OPERATOR_VERSION}"; } || {
33+ echo "Expected: ${OPERATOR_VERSION}"
34+ echo "Actual: ${VERSION_OUTPUT}"
35+ exit 1
36+ }
37+ - name : step-01
38+ try :
39+ - script :
40+ content : |
41+ contains() { bash -ceu '[[ "$1" == *"$2"* ]]' - "$@"; }
42+
43+ VERSION_OUTPUT=$(KUBECONFIG=blah kubectl pgo version --client)
44+
45+ { contains "${VERSION_OUTPUT}" "Client Version:"; } || {
46+ echo "Expected: Client Version:*"
47+ echo "Actual: ${VERSION_OUTPUT}"
48+ exit 1
49+ }
50+
You can’t perform that action at this time.
0 commit comments