From c2b87fcb469b3d3c159e62fd3ebbc642da519ac8 Mon Sep 17 00:00:00 2001 From: Irbe Krumina Date: Wed, 1 Nov 2023 16:15:18 +0000 Subject: [PATCH] cmd/k8s-operator/deploy/chart,.github/workflows: use helm chart API v2 (#10055) API v1 is compatible with helm v2 and v2 is not. However, helm v2 (the Tiller deployment mechanism) was deprecated in 2020 and no-one should be using it anymore. This PR also adds a CI lint test for helm chart Updates tailscale/tailscale#9222 Signed-off-by: Irbe Krumina --- .github/workflows/kubemanifests.yaml | 24 ++++++++++++++++++++++++ cmd/k8s-operator/deploy/chart/Chart.yaml | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/kubemanifests.yaml diff --git a/.github/workflows/kubemanifests.yaml b/.github/workflows/kubemanifests.yaml new file mode 100644 index 000000000..90902ff75 --- /dev/null +++ b/.github/workflows/kubemanifests.yaml @@ -0,0 +1,24 @@ +name: "Kubernetes manifests" +on: + pull_request: + paths: + - './cmd/k8s-operator/' + - '.github/workflows/kubemanifests.yaml' + +# Cancel workflow run if there is a newer push to the same PR for which it is +# running +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + testchart: + runs-on: [ ubuntu-latest ] + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Build and lint Helm chart + run: | + eval `./tool/go run ./cmd/mkversion` + ./tool/helm package --app-version="${VERSION_SHORT}" --version=${VERSION_SHORT} './cmd/k8s-operator/deploy/chart' + ./tool/helm lint "tailscale-operator-${VERSION_SHORT}.tgz" diff --git a/cmd/k8s-operator/deploy/chart/Chart.yaml b/cmd/k8s-operator/deploy/chart/Chart.yaml index 278e8f871..363d87d15 100644 --- a/cmd/k8s-operator/deploy/chart/Chart.yaml +++ b/cmd/k8s-operator/deploy/chart/Chart.yaml @@ -1,7 +1,7 @@ # Copyright (c) Tailscale Inc & AUTHORS # SPDX-License-Identifier: BSD-3-Clause -apiVersion: v1 +apiVersion: v2 name: tailscale-operator description: A Helm chart for Tailscale Kubernetes operator home: https://github.com/tailscale/tailscale