build: incorporate condition changes in e2e

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
This commit is contained in:
Hidde Beydals 2023-10-31 19:36:03 +01:00
parent 16da3ec66f
commit 517d42fe5d
No known key found for this signature in database
GPG Key ID: 979F380FC2341744
17 changed files with 44 additions and 41 deletions

View File

@ -169,7 +169,7 @@ jobs:
kubectl -n helm-system apply -f config/testdata/$test_name
echo -n ">>> Waiting for expected conditions"
count=0
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="False" and .TestSuccess=="False" and .Ready=="False"' )" ]; do
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="True" and .TestSuccess=="False" and .Ready=="False"' )" ]; do
echo -n '.'
sleep 5
count=$((count + 1))
@ -213,7 +213,7 @@ jobs:
fi
kubectl -n helm-system delete -f config/testdata/$test_name
- name: Run install fail with remedition test
- name: Run install fail with remediation test
run: |
test_name=install-fail-remediate
kubectl -n helm-system apply -f config/testdata/$test_name
@ -230,21 +230,22 @@ jobs:
done
echo ' done'
# Ensure release does not exist (was uninstalled).
HISTORY=$(helm -n helm-system history $test_name 2>&1; exit 0)
if [ "$HISTORY" != 'Error: release: not found' ]; then
echo -e "Unexpected release history: $HISTORY"
# Ensure release was uninstalled.
RELEASE_STATUS=$(helm -n helm-system history $test_name -o json | jq -r 'if length == 1 then .[0].status else empty end')
if [ "$RELEASE_STATUS" != "uninstalled" ]; then
echo -e "Unexpected release status: $RELEASE_STATUS"
exit 1
fi
kubectl -n helm-system delete -f config/testdata/$test_name
helm -n helm-system delete $test_name
- name: Run install fail with retry test
run: |
test_name=install-fail-retry
kubectl -n helm-system apply -f config/testdata/$test_name
echo -n ">>> Waiting for expected conditions"
count=0
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.installFailures == 2 and ( .status.conditions | map( { (.type): .status } ) | add | .Released=="False" and .Ready=="False" )' )" ]; do
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.installFailures == 2 and ( .status.conditions | map( { (.type): .status } ) | add | .Released=="False" and .Ready=="False" and .Stalled=="True" )' )" ]; do
echo -n '.'
sleep 5
count=$((count + 1))
@ -290,7 +291,7 @@ jobs:
kubectl -n helm-system apply -f config/testdata/$test_name/upgrade.yaml
echo -n ">>> Waiting for expected conditions"
count=0
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="False" and .Ready=="False"' )" ]; do
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="False" and .Ready=="False" and .Stalled=="True"' )" ]; do
echo -n '.'
sleep 5
count=$((count + 1))
@ -336,7 +337,7 @@ jobs:
kubectl -n helm-system apply -f config/testdata/$test_name/upgrade.yaml
echo -n ">>> Waiting for expected conditions"
count=0
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="False" and .TestSuccess=="False" and .Ready=="False"' )" ]; do
until [ 'true' == "$( kubectl -n helm-system get helmrelease/$test_name -o json | jq '.status.conditions | map( { (.type): .status } ) | add | .Released=="True" and .TestSuccess=="False" and .Ready=="False" and .Stalled=="True"' )" ]; do
echo -n '.'
sleep 5
count=$((count + 1))
@ -558,7 +559,7 @@ jobs:
exit 1
fi
kubectl -n helm-system delete -f config/testdata/post-renderer-kustomize
- name: Boostrap CRDs Upgrade Tests
- name: Bootstrap CRDs Upgrade Tests
if: ${{ startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/') }}
run: |
REF=${{ github.ref }}

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: install-fail-remediate
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,10 +11,12 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
install:
remediation:
remediateLastFailure: true
uninstall:
keepHistory: true
values:
resources:
requests:

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: install-fail-retry
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
install:
remediation:
retries: 1

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: install-fail
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: install-test-fail-ignore
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
test:
enable: true
ignoreFailures: true

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: install-test-fail
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
test:
enable: true
values:

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: upgrade-fail-remediate-uninstall
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: upgrade-fail-remediate-uninstall
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
upgrade:
remediation:
remediateLastFailure: true

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: upgrade-fail-remediate
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: upgrade-fail-remediate
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
upgrade:
remediation:
remediateLastFailure: true

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: upgrade-fail-retry
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: upgrade-fail-retry
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
upgrade:
remediation:
retries: 1

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: upgrade-fail
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: upgrade-fail
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: upgrade-test-fail
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
values:
resources:
requests:

View File

@ -3,7 +3,7 @@ kind: HelmRelease
metadata:
name: upgrade-test-fail
spec:
interval: 5m
interval: 30s
chart:
spec:
chart: podinfo
@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
test:
enable: true
values:

View File

@ -11,7 +11,7 @@ spec:
sourceRef:
kind: HelmRepository
name: podinfo
interval: 1m
interval: 10m
valuesFrom:
- kind: ConfigMap
name: valuesfrom-config