diff --git a/.github/actions/helm/action.yml b/.github/actions/helm/action.yml index c0e5b5c..d500727 100644 --- a/.github/actions/helm/action.yml +++ b/.github/actions/helm/action.yml @@ -4,6 +4,12 @@ author: 'Stefan Prodan' branding: icon: 'command' color: 'blue' +inputs: + helm-version: + description: Helm version to use + required: true runs: using: 'docker' image: 'Dockerfile' + args: + - ${{ inputs.helm-version }} \ No newline at end of file diff --git a/.github/actions/helm/entrypoint.sh b/.github/actions/helm/entrypoint.sh index c456e57..70e6183 100644 --- a/.github/actions/helm/entrypoint.sh +++ b/.github/actions/helm/entrypoint.sh @@ -3,7 +3,7 @@ set -o errexit set -o pipefail -HELM_VERSION=3.2.1 +HELM_VERSION=$1 BIN_DIR="$GITHUB_WORKSPACE/bin" main() { diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 3877d67..9a7782d 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -8,6 +8,11 @@ on: jobs: kind: + strategy: + matrix: + helm-version: + - 2.16.6 + - 3.2.1 runs-on: ubuntu-latest steps: - name: Checkout @@ -23,8 +28,6 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.14.x - - name: Setup Helm - uses: ./.github/actions/helm - name: Setup Kubernetes uses: engineerd/setup-kind@v0.4.0 - name: Run unit tests @@ -40,6 +43,16 @@ jobs: GIT_COMMIT=$(git rev-list -1 HEAD) && \ docker build -t test/podinfo:latest --build-arg "REVISION=${GIT_COMMIT}" . kind load docker-image test/podinfo:latest + - name: Setup Helm + uses: ./.github/actions/helm + with: + helm-version: ${{ matrix.helm-version }} + - name: Install Tiller + if: ${{ startsWith(matrix.helm-version, '2') }} + run: | + kubectl --namespace kube-system create sa tiller + kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller + helm init --service-account tiller --upgrade --wait - name: Deploy run: | helm upgrade -i podinfo ./charts/podinfo \ diff --git a/charts/podinfo/templates/tests/fail.yaml b/charts/podinfo/templates/tests/fail.yaml index f981f48..ef9df64 100644 --- a/charts/podinfo/templates/tests/fail.yaml +++ b/charts/podinfo/templates/tests/fail.yaml @@ -9,7 +9,7 @@ metadata: chart: {{ .Chart.Name }}-{{ .Chart.Version }} app: {{ template "podinfo.name" . }} annotations: - "helm.sh/hook": test + "helm.sh/hook": test-success "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded sidecar.istio.io/inject: "false" linkerd.io/inject: disabled diff --git a/charts/podinfo/templates/tests/grpc.yaml b/charts/podinfo/templates/tests/grpc.yaml index 55f0323..9ed36ae 100644 --- a/charts/podinfo/templates/tests/grpc.yaml +++ b/charts/podinfo/templates/tests/grpc.yaml @@ -8,7 +8,7 @@ metadata: chart: {{ .Chart.Name }}-{{ .Chart.Version }} app: {{ template "podinfo.name" . }} annotations: - "helm.sh/hook": test + "helm.sh/hook": test-success "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded sidecar.istio.io/inject: "false" linkerd.io/inject: disabled diff --git a/charts/podinfo/templates/tests/jwt.yaml b/charts/podinfo/templates/tests/jwt.yaml index 4b7debf..2f8786e 100644 --- a/charts/podinfo/templates/tests/jwt.yaml +++ b/charts/podinfo/templates/tests/jwt.yaml @@ -8,7 +8,7 @@ metadata: chart: {{ .Chart.Name }}-{{ .Chart.Version }} app: {{ template "podinfo.name" . }} annotations: - "helm.sh/hook": test + "helm.sh/hook": test-success "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded sidecar.istio.io/inject: "false" linkerd.io/inject: disabled diff --git a/charts/podinfo/templates/tests/service.yaml b/charts/podinfo/templates/tests/service.yaml index bd81825..1550374 100644 --- a/charts/podinfo/templates/tests/service.yaml +++ b/charts/podinfo/templates/tests/service.yaml @@ -8,7 +8,7 @@ metadata: chart: {{ .Chart.Name }}-{{ .Chart.Version }} app: {{ template "podinfo.name" . }} annotations: - "helm.sh/hook": test + "helm.sh/hook": test-success "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded sidecar.istio.io/inject: "false" linkerd.io/inject: disabled diff --git a/charts/podinfo/templates/tests/timeout.yaml b/charts/podinfo/templates/tests/timeout.yaml index 19e062d..05647d3 100644 --- a/charts/podinfo/templates/tests/timeout.yaml +++ b/charts/podinfo/templates/tests/timeout.yaml @@ -9,7 +9,7 @@ metadata: chart: {{ .Chart.Name }}-{{ .Chart.Version }} app: {{ template "podinfo.name" . }} annotations: - "helm.sh/hook": test + "helm.sh/hook": test-success "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded sidecar.istio.io/inject: "false" linkerd.io/inject: disabled