Skip to content

Commit

Permalink
check for cert file and env vars in deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya committed Sep 13, 2024
1 parent 01298da commit f38d673
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4276,6 +4276,30 @@ jobs:
echo "check if the kotsadm deployment is using the configmap"
kubectl get deployment kotsadm -n "$APP_SLUG" -o yaml
echo "exec into the deployment and check for the file and its contents"
if ! kubectl exec -n "$APP_SLUG" deployment/kotsadm -- cat /certs/ca.crt | grep "test value"; then
echo "expected /certs/ca.crt to contain 'test value'"
kubectl exec -n "$APP_SLUG" deployment/kotsadm -- cat /certs/ca.crt
exit 1
fi
echo "check that the deployment has an environment variable pointing to the file"
if ! kubectl exec -n "$APP_SLUG" deployment/kotsadm -- env | grep "SSL_CERT_DIR" | grep "/certs"; then
echo "expected env output to contain SSL_CERT_DIR=/certs"
kubectl exec -n "$APP_SLUG" deployment/kotsadm -- env
exit 1
fi
echo "check that the deployment has an environment variable with the configmap name"
if ! kubectl exec -n "$APP_SLUG" deployment/kotsadm -- env | grep "SSL_CERT_CONFIGMAP" | grep "custom-cas"; then
echo "expected env output to contain SSL_CERT_CONFIGMAP=custom-cas"
kubectl exec -n "$APP_SLUG" deployment/kotsadm -- env
exit 1
fi
./bin/kots admin-console generate-manifests -n "$NAMESPACE" --shared-password password --private-ca-configmap generated-custom-cas > generated-manifests.yaml
cat generated-manifests.yaml
- name: Generate support bundle on failure
if: failure()
uses: ./.github/actions/generate-support-bundle
Expand Down

0 comments on commit f38d673

Please sign in to comment.