-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Craig O'Donnell
committed
Oct 12, 2023
1 parent
41242f2
commit 0f22def
Showing
2 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,11 @@ jobs: | |
exit 1 | ||
fi | ||
if ! echo $output | grep -q 'statusInformers: null'; then | ||
printf "default statusInformers should be null:\n\n%s\n\n" "$output" | ||
exit 1 | ||
fi | ||
output=$(helm template oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0 --set integration.enabled=true) | ||
if ! echo $output | grep -q integration-enabled; then | ||
|
@@ -121,7 +126,7 @@ jobs: | |
exit 1 | ||
fi | ||
cat << EOF >> test-values.yaml | ||
cat << EOF > test-values.yaml | ||
extraEnv: | ||
- name: TEST_EXTRA_ENV | ||
value: test-extra-env | ||
|
@@ -134,6 +139,17 @@ jobs: | |
exit 1 | ||
fi | ||
cat << EOF > test-values.yaml | ||
statusInformers: [] | ||
EOF | ||
output=$(helm template oci://ttl.sh/automated-${{ github.run_id }}/replicated --version 0.0.0 --values test-values.yaml) | ||
if ! echo $output | grep -q 'statusInformers: \[\]'; then | ||
printf "user-set empty statusInformers should exist:\n\n%s\n\n" "$output" | ||
exit 1 | ||
fi | ||
create-test-release: | ||
runs-on: ubuntu-22.04 | ||
needs: [ build-and-push-e2e ] | ||
|
@@ -296,7 +312,7 @@ jobs: | |
helm upgrade test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --set replicated.versionLabel=1.0.0 --wait --timeout 2m | ||
COUNTER=1 | ||
while [ kubectl get pods -l app.kubernetes.io/name=replicated -o jsonpath='{.items[0].metadata.name}' | grep -q $oldpodname ]; do | ||
while kubectl get pods -l app.kubernetes.io/name=replicated -o jsonpath='{.items[0].metadata.name}' | grep -q $oldpodname; do | ||
((COUNTER += 1)) | ||
if [ $COUNTER -gt 60 ]; then | ||
echo "Pod did not restart after upgrade" | ||
|
@@ -340,7 +356,7 @@ jobs: | |
kubectl rollout status deployment replicated --timeout=2m | ||
COUNTER=1 | ||
while [ kubectl get pods -l app.kubernetes.io/name=replicated -o jsonpath='{.items[0].metadata.name}' | grep -q $oldpodname ]; do | ||
while kubectl get pods -l app.kubernetes.io/name=replicated -o jsonpath='{.items[0].metadata.name}' | grep -q $oldpodname; do | ||
((COUNTER += 1)) | ||
if [ $COUNTER -gt 60 ]; then | ||
echo "Pod did not restart after upgrade" | ||
|
@@ -364,6 +380,87 @@ jobs: | |
kubectl wait --for=delete deployment/test-chart --timeout=2m | ||
kubectl wait --for=delete deployment/replicated --timeout=2m | ||
# validate status informers | ||
- name: Create empty status informers for validation | ||
run: | | ||
cat << EOF > test-values.yaml | ||
replicated: | ||
statusInformers: [] | ||
EOF | ||
- name: Install via Helm as subchart in production mode and pass empty status informers | ||
run: | | ||
helm install test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false -f test-values.yaml --wait --timeout 2m | ||
COUNTER=1 | ||
while ! kubectl logs deploy/replicated | grep -q 'Generated informers from Helm release'; do | ||
((COUNTER += 1)) | ||
if [ $COUNTER -gt 60 ]; then | ||
echo "Did not receive empty status informers" | ||
kubectl logs deploy/replicated | ||
exit 1 | ||
fi | ||
sleep 1 | ||
done | ||
- name: Upgrade via Helm as subchart in production mode to use default status informers | ||
run: | | ||
helm upgrade test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false --wait --timeout 2m | ||
COUNTER=1 | ||
while ! kubectl logs deploy/replicated | grep -qv 'Generated informers from Helm release'; do | ||
((COUNTER += 1)) | ||
if [ $COUNTER -gt 60 ]; then | ||
echo "Did not receive default status informers" | ||
kubectl logs deploy/replicated | ||
exit 1 | ||
fi | ||
sleep 1 | ||
done | ||
- name: Uninstall test-chart via Helm | ||
run: helm uninstall test-chart --wait --timeout 2m | ||
|
||
- name: Install via kubectl as subchart in production mode and pass empty status informers | ||
run: | | ||
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false -f test-values.yaml | kubectl apply -f - | ||
kubectl rollout status deployment test-chart --timeout=2m | ||
kubectl rollout status deployment replicated --timeout=2m | ||
COUNTER=1 | ||
while ! kubectl logs deploy/replicated | grep -q 'Generated informers from Helm release'; do | ||
((COUNTER += 1)) | ||
if [ $COUNTER -gt 60 ]; then | ||
echo "Did not receive empty status informers" | ||
kubectl logs deploy/replicated | ||
exit 1 | ||
fi | ||
sleep 1 | ||
done | ||
- name: Upgrade via kubectl as subchart in production mode to use default status informers | ||
run: | | ||
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false | kubectl apply -f - | ||
kubectl rollout status deployment test-chart --timeout=2m | ||
kubectl rollout status deployment replicated --timeout=2m | ||
COUNTER=1 | ||
while ! kubectl logs deploy/replicated | grep -qv 'Generated informers from Helm release'; do | ||
((COUNTER += 1)) | ||
if [ $COUNTER -gt 60 ]; then | ||
echo "Did not receive default status informers" | ||
kubectl logs deploy/replicated | ||
exit 1 | ||
fi | ||
sleep 1 | ||
done | ||
- name: Uninstall test-chart via kubectl | ||
run: | | ||
helm template test-chart oci://registry.replicated.com/$APP_SLUG/$CHANNEL_SLUG/test-chart --set replicated.integration.enabled=false -f test-values.yaml | kubectl delete -f - | ||
kubectl wait --for=delete deployment/test-chart --timeout=2m | ||
kubectl wait --for=delete deployment/replicated --timeout=2m | ||
- name: Remove Cluster | ||
uses: replicatedhq/replicated-actions/[email protected] | ||
if: ${{ success() || cancelled() }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters