From 4c51ab9dc0791b8e36188e8853f0b288ca0ed6f7 Mon Sep 17 00:00:00 2001 From: "huish@microsoft.com" Date: Wed, 18 Oct 2023 05:46:06 +0000 Subject: [PATCH] revert makefile --- .github/workflows/build-pr.yml | 20 ++++++-------------- Makefile | 8 ++------ test/bats/base-test.bats | 2 +- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 5773da5b40..c389d96ec8 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -86,28 +86,20 @@ jobs: echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH make e2e-bootstrap KUBERNETES_VERSION=${{ matrix.KUBERNETES_VERSION }} make generate-certs - - name: Run e2e base with config policy + - name: Run e2e with config policy run: | make e2e-deploy-gatekeeper GATEKEEPER_VERSION=${{ matrix.GATEKEEPER_VERSION }} make e2e-deploy-ratify GATEKEEPER_VERSION=${{ matrix.GATEKEEPER_VERSION }} - make test-e2e-base GATEKEEPER_VERSION=${{ matrix.GATEKEEPER_VERSION }} + make test-e2e GATEKEEPER_VERSION=${{ matrix.GATEKEEPER_VERSION }} - name: Save logs if: ${{ always() }} run: | - kubectl logs -n gatekeeper-system -l app=ratify --tail=-1 > logs-ratify-base-preinstall-${{ matrix.KUBERNETES_VERSION }}-${{ matrix.GATEKEEPER_VERSION }}-config-policy.json - kubectl logs -n gatekeeper-system -l app.kubernetes.io/name=ratify --tail=-1 > logs-ratify-base-${{ matrix.KUBERNETES_VERSION }}-${{ matrix.GATEKEEPER_VERSION }}-config-policy.json - - name: Run e2e plugin with config policy - run: | - make test-e2e-plugin GATEKEEPER_VERSION=${{ matrix.GATEKEEPER_VERSION }} - - name: Save logs - if: ${{ always() }} - run: | - kubectl logs -n gatekeeper-system -l app=ratify --tail=-1 > logs-ratify-plugin-preinstall-${{ matrix.KUBERNETES_VERSION }}-${{ matrix.GATEKEEPER_VERSION }}-config-policy.json - kubectl logs -n gatekeeper-system -l app.kubernetes.io/name=ratify --tail=-1 > logs-ratify-plugin-${{ matrix.KUBERNETES_VERSION }}-${{ matrix.GATEKEEPER_VERSION }}-config-policy.json + kubectl logs -n gatekeeper-system -l app=ratify --tail=-1 > logs-ratify-preinstall-${{ matrix.KUBERNETES_VERSION }}-${{ matrix.GATEKEEPER_VERSION }}-config-policy.json + kubectl logs -n gatekeeper-system -l app.kubernetes.io/name=ratify --tail=-1 > logs-ratify-${{ matrix.KUBERNETES_VERSION }}-${{ matrix.GATEKEEPER_VERSION }}-config-policy.json - name: Run e2e with Rego policy run: | make deploy-rego-policy - make test-e2e-base + make test-e2e - name: Save logs if: ${{ always() }} run: | @@ -211,4 +203,4 @@ jobs: - name: clean up run: | - make e2e-cleanup AZURE_SUBSCRIPTION_ID=${{ env.AZURE_SUBSCRIPTION_ID }} + make e2e-cleanup AZURE_SUBSCRIPTION_ID=${{ env.AZURE_SUBSCRIPTION_ID }} \ No newline at end of file diff --git a/Makefile b/Makefile index 1b99b40f38..568f3d0b2c 100644 --- a/Makefile +++ b/Makefile @@ -133,13 +133,9 @@ deploy-gatekeeper: delete-gatekeeper: helm delete gatekeeper --namespace ${GATEKEEPER_NAMESPACE} -.PHONY: test-e2e-base +.PHONY: test-e2e test-e2e: generate-rotation-certs timeout 20m bats -t ${BATS_BASE_TESTS_FILE} - -.PHONY: test-e2e-plugin -test-e2e-plugin: generate-rotation-certs - EXPIRING_CERT_DIR=.staging/rotation/expiring-certs CERT_DIR=.staging/rotation GATEKEEPER_VERSION=${GATEKEEPER_VERSION} bats -t ${BATS_PLUGIN_TESTS_FILE} .PHONY: test-e2e-cli @@ -648,4 +644,4 @@ $(CONTROLLER_GEN): $(LOCALBIN) .PHONY: conversion-gen conversion-gen: $(CONVERSION_GEN) ## Download conversion-gen locally if necessary. $(CONVERSION_GEN): $(LOCALBIN) - test -s $(LOCALBIN)/conversion-gen || GOBIN=$(LOCALBIN) go install k8s.io/code-generator/cmd/conversion-gen@$(CONVERSION_TOOLS_VERSION) + test -s $(LOCALBIN)/conversion-gen || GOBIN=$(LOCALBIN) go install k8s.io/code-generator/cmd/conversion-gen@$(CONVERSION_TOOLS_VERSION) \ No newline at end of file diff --git a/test/bats/base-test.bats b/test/bats/base-test.bats index 5ef67f83c6..e0d3208863 100644 --- a/test/bats/base-test.bats +++ b/test/bats/base-test.bats @@ -24,7 +24,7 @@ RATIFY_NAMESPACE=gatekeeper-system wait_for_process ${WAIT_TIME} ${SLEEP_TIME} 'kubectl apply -f ./config/samples/config_v1beta1_verifier_notation.yaml' } run kubectl apply -f ./library/default/template.yaml - assert_success + assert_failure sleep 5 run kubectl apply -f ./library/default/samples/constraint.yaml assert_success