diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a2d79607..d19ac6d0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -74,6 +74,24 @@ jobs: DOCKER_USER: ${{ secrets.ANCHORECI_DOCKER_USER }} DOCKER_PASS: ${{ secrets.ANCHORECI_DOCKER_PASS }} + - name: Check if anchore-engine endpoint is required for admission controller chart + id: engine_required + run: | + if [[ -n $(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep 'anchore-admission-controller') ]]; then + echo "File in the 'stable/anchore-admission-controller' directory was changed. We need an engine deployment" + echo "::set-output name=changed::true" + else + echo "No files in 'stable/anchore-admission-controller' directory were changed. Skipping engine deployment" + echo "::set-output name=changed::false" + fi + shell: bash + + - name: Deploy Engine + if: steps.engine_required.outputs.changed == 'true' + run: | + helm install engine anchore/anchore-engine --namespace anchore --wait + kubectl --namespace anchore get pods + - name: Run chart-testing if: steps.list-changed.outputs.CHANGED == 'true' run: ct install --config ct-config.yaml diff --git a/stable/anchore-admission-controller/Chart.yaml b/stable/anchore-admission-controller/Chart.yaml index ddf85753..9b820450 100644 --- a/stable/anchore-admission-controller/Chart.yaml +++ b/stable/anchore-admission-controller/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: anchore-admission-controller -version: 0.4.7 -appVersion: 0.4.0 +version: 0.5.0 +appVersion: 0.5.0 description: A kubernetes admission controller for validating and mutating webhooks that operates against Anchore Engine to make access decisions and annotations home: https://github.com/anchore/kubernetes-admission-controller maintainers: diff --git a/stable/anchore-admission-controller/ci/fake-values.yaml b/stable/anchore-admission-controller/ci/fake-values.yaml index 3d1c6db8..2983ae32 100644 --- a/stable/anchore-admission-controller/ci/fake-values.yaml +++ b/stable/anchore-admission-controller/ci/fake-values.yaml @@ -4,3 +4,4 @@ credentials: password: password1 - username: user2 password: password2 +anchoreEndpoint: http://engine-anchore-engine-api:8228 diff --git a/stable/anchore-admission-controller/values.yaml b/stable/anchore-admission-controller/values.yaml index 3d1ca196..738365c5 100644 --- a/stable/anchore-admission-controller/values.yaml +++ b/stable/anchore-admission-controller/values.yaml @@ -5,7 +5,7 @@ fullnameOverride: Null replicaCount: 1 logVerbosity: 3 -image: "anchore/kubernetes-admission-controller:v0.4.0" +image: "anchore/kubernetes-admission-controller:v0.5.0" imagePullPolicy: IfNotPresent # ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ imagePullSecrets: []