Skip to content

Update actions/upload-artifact digest to 26f96df #176

Update actions/upload-artifact digest to 26f96df

Update actions/upload-artifact digest to 26f96df #176

name: Run gatekeeper-k8s-integrationtests.sh
on: [push, pull_request]
# Declare default permissions as read only.
permissions: read-all
jobs:
kind:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Validate integration test data via kubeval
uses: redhat-cop/github-actions/confbatstest@11f2ce27643eb7c76ac3623cb99d9b08be30d762 # v4
with:
raw: find policy/* -regex '.*test_data\/integration\/.*$' -exec kubeval --openshift --strict --skip-kinds ServiceMonitor {} \;
- name: Create k8s Kind Cluster
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
- name: Test against KinD
run: |
confbatstest=$(docker images --filter=label=com.github.actions.name=confbatstest --format "{{.Repository}}:{{.Tag}}")
docker run --rm --network host --workdir /conftest --volume "/home/runner/.kube/":"/opt/app-root/src/.kube/" --volume "/home/runner/work/rego-policies/rego-policies":"/conftest" --entrypoint .github/workflows/tests-entrypoint.sh ${confbatstest}
- name: Get pods and events if tests failed
if: ${{ failure() }}
run: |
echo "## nodes:"
kubectl get nodes
echo "## namespaces:"
kubectl get namespaces
echo "## deployments:"
kubectl get deployments --all-namespaces
echo "## pods:"
kubectl get pods --all-namespaces
echo "## events:"
kubectl get events --all-namespaces
echo "## api-versions:"
kubectl api-versions
echo "## describe deployment/gatekeeper-audit:"
kubectl describe deployment/gatekeeper-audit -n gatekeeper-system
echo "## logs deployment/gatekeeper-audit:"
kubectl logs deployment/gatekeeper-audit -n gatekeeper-system
echo "## describe deployment/gatekeeper-controller-manager:"
kubectl describe deployment/gatekeeper-controller-manager -n gatekeeper-system
echo "## logs deployment/gatekeeper-controller-manager:"
kubectl logs deployment/gatekeeper-controller-manager -n gatekeeper-system