From 089b5188588cb6587b72de46ae725e93508f14a2 Mon Sep 17 00:00:00 2001 From: Anthony Rabbito Date: Tue, 13 Aug 2024 14:15:56 -0400 Subject: [PATCH 1/4] fix: package CRDs apart of the cchart CI process Signed-off-by: Anthony Rabbito --- .github/workflows/publish-chart.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml index 309a7274db915..bf49702141e6b 100644 --- a/.github/workflows/publish-chart.yaml +++ b/.github/workflows/publish-chart.yaml @@ -40,6 +40,11 @@ jobs: - name: Install Helm uses: azure/setup-helm@v4 + - name: Package CRDs + shell: bash + run: | + cp cmd/k8s-operator/deploy/crds cmd/k8s-operator/deploy/chart + - name: Package & Push Helm Charts shell: bash run: | From dacbc09a425bb5a45f852ab80db983488dd086d3 Mon Sep 17 00:00:00 2001 From: Anthony Rabbito Date: Tue, 13 Aug 2024 14:19:32 -0400 Subject: [PATCH 2/4] fix: add conditional for PRs Signed-off-by: Anthony Rabbito --- .github/workflows/publish-chart.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml index bf49702141e6b..137d32f58474e 100644 --- a/.github/workflows/publish-chart.yaml +++ b/.github/workflows/publish-chart.yaml @@ -43,10 +43,11 @@ jobs: - name: Package CRDs shell: bash run: | - cp cmd/k8s-operator/deploy/crds cmd/k8s-operator/deploy/chart + cp -r cmd/k8s-operator/deploy/crds cmd/k8s-operator/deploy/chart - name: Package & Push Helm Charts shell: bash + if: ${{ always() && format('refs/heads/{0}', github.event.repository.default_branch) == github.ref }} run: | helm package cmd/k8s-operator/deploy/chart --dependency-update --version ${{ env.HELM_VERSION }} --app-version ${{ env.HELM_VERSION }} pkg=$(ls tailscale-operator-*.tgz) From fe23805d66b52e49e3e9c70b59688afe3b85e362 Mon Sep 17 00:00:00 2001 From: Anthony Rabbito Date: Tue, 13 Aug 2024 15:51:29 -0400 Subject: [PATCH 3/4] fix: move to template Signed-off-by: Anthony Rabbito --- .github/workflows/publish-chart.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-chart.yaml b/.github/workflows/publish-chart.yaml index 137d32f58474e..3da70a26782fa 100644 --- a/.github/workflows/publish-chart.yaml +++ b/.github/workflows/publish-chart.yaml @@ -43,7 +43,16 @@ jobs: - name: Package CRDs shell: bash run: | - cp -r cmd/k8s-operator/deploy/crds cmd/k8s-operator/deploy/chart + cat < cmd/k8s-operator/deploy/chart/templates/crds.yaml + {{- if .Values.installCRDs }} + EOF + for file in cmd/k8s-operator/deploy/crds/*.yaml; do + echo "---" >> cmd/k8s-operator/deploy/chart/templates/crds.yaml + cat "$file" >> cmd/k8s-operator/deploy/chart/templates/crds.yaml + done + cat <> cmd/k8s-operator/deploy/chart/templates/crds.yaml + {{- end }} + EOF - name: Package & Push Helm Charts shell: bash From e9f3c89bfc2541ab1f0940f8493ae7a92d240078 Mon Sep 17 00:00:00 2001 From: Anthony Rabbito Date: Tue, 13 Aug 2024 16:03:55 -0400 Subject: [PATCH 4/4] fix: don't build everywhere on PRs Signed-off-by: Anthony Rabbito --- .github/workflows/publish-image.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish-image.yaml b/.github/workflows/publish-image.yaml index b31b2b233c478..6520b5a6a9a1d 100644 --- a/.github/workflows/publish-image.yaml +++ b/.github/workflows/publish-image.yaml @@ -8,7 +8,6 @@ on: types: ["opened", "synchronize", "reopened"] paths: - .github/workflows/publish-image.yaml - - "**/*" push: branches: - coreweave