From 063478791eeb4fee4cc854734bb18a2fddf126f5 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 8 Jul 2022 01:47:32 +0800 Subject: [PATCH 01/45] ci: add new chart test workflow --- .ci/ct.yaml | 25 +++++++++++++ .github/workflows/chart_test.yml | 62 ++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 .ci/ct.yaml create mode 100644 .github/workflows/chart_test.yml diff --git a/.ci/ct.yaml b/.ci/ct.yaml new file mode 100644 index 00000000..7811a7a1 --- /dev/null +++ b/.ci/ct.yaml @@ -0,0 +1,25 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +chart-dirs: + - charts + +debug: true +helm-extra-args: --timeout 1200 +validate-maintainers: false diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml new file mode 100644 index 00000000..f8b77ff1 --- /dev/null +++ b/.github/workflows/chart_test.yml @@ -0,0 +1,62 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +name: Chart Test +on: + pull_request: + branches: + - '*' + paths: + - 'charts/**' + - '.github/workflows/**' + +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Run chart-testing (lint) + if: steps.list-changed.outputs.changed == 'true' + run: ct lint --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml + + From a8e8950e435c1051ec32d6b38dd5e87d99e634b4 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 8 Jul 2022 01:48:07 +0800 Subject: [PATCH 02/45] ci: update Chart version for test --- charts/pulsar-operator/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar-operator/Chart.yaml b/charts/pulsar-operator/Chart.yaml index fddbdf07..24353894 100644 --- a/charts/pulsar-operator/Chart.yaml +++ b/charts/pulsar-operator/Chart.yaml @@ -18,7 +18,7 @@ # apiVersion: v1 -version: 0.11.0 +version: 0.12.0 appVersion: "0.11.5" kubeVersion: ">= 1.16.0-0 < 1.24.0-0" description: Apache Pulsar Operators Helm chart for Kubernetes From effb7a70e65503cf983c53133b170d8f3b867a8c Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 8 Jul 2022 01:55:20 +0800 Subject: [PATCH 03/45] ci: use yamllint to lint the manifest --- .github/workflows/chart_test.yml | 35 ++++++++++++++++++++++++++ lintconf.yaml | 42 ++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 lintconf.yaml diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index f8b77ff1..c94d4092 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -60,3 +60,38 @@ jobs: run: ct lint --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml + template-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" + fi + + - name: Run template test + if: steps.list-changed.outputs.changed == 'true' + run: | + helm template test ${{ steps.list-changed.outputs.chart_name }} > demo.yaml + yamllint demo.yaml --config-file lintconf.yaml diff --git a/lintconf.yaml b/lintconf.yaml new file mode 100644 index 00000000..90f48c88 --- /dev/null +++ b/lintconf.yaml @@ -0,0 +1,42 @@ +--- +rules: + braces: + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + min-spaces-inside-empty: -1 + max-spaces-inside-empty: -1 + colons: + max-spaces-before: 0 + max-spaces-after: 1 + commas: + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + comments: + require-starting-space: true + min-spaces-from-content: 2 + document-end: disable + document-start: disable # No --- to start a file + empty-lines: + max: 2 + max-start: 0 + max-end: 0 + hyphens: + max-spaces-after: 1 + indentation: + spaces: consistent + indent-sequences: whatever # - list indentation will handle both indentation and without + check-multi-line-strings: false + key-duplicates: enable + line-length: disable # Lines can be any length + new-line-at-end-of-file: enable + new-lines: + type: unix + trailing-spaces: enable + truthy: + level: warning From 29001752fad437e778063768f79601f9f3ad37fe Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 8 Jul 2022 02:04:14 +0800 Subject: [PATCH 04/45] ci: update pulsar-operator kubeVersion for tests --- charts/pulsar-operator/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pulsar-operator/Chart.yaml b/charts/pulsar-operator/Chart.yaml index 24353894..9ca08385 100644 --- a/charts/pulsar-operator/Chart.yaml +++ b/charts/pulsar-operator/Chart.yaml @@ -20,7 +20,7 @@ apiVersion: v1 version: 0.12.0 appVersion: "0.11.5" -kubeVersion: ">= 1.16.0-0 < 1.24.0-0" +kubeVersion: ">= 1.16.0-0 < 1.25.0-0" description: Apache Pulsar Operators Helm chart for Kubernetes name: pulsar-operator home: https://streamnative.io From 75c7d9a4170a9996ddbe9e9ada5f62ce6d16e14a Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 8 Jul 2022 02:23:46 +0800 Subject: [PATCH 05/45] ci: generate manifests for multiple k8s version --- .github/workflows/chart_test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index c94d4092..ae58c0ba 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -93,5 +93,8 @@ jobs: - name: Run template test if: steps.list-changed.outputs.changed == 'true' run: | - helm template test ${{ steps.list-changed.outputs.chart_name }} > demo.yaml - yamllint demo.yaml --config-file lintconf.yaml + for i in v1.19.0 v1.20.0 v1.21.0 v1.22.0 v1.23.0 v1.24.0 + do + helm template test ${{ steps.list-changed.outputs.chart_name }} --kube-version $i> $i.yaml + yamllint $i.yaml --config-file lintconf.yaml + done From 644fcf0a00074f7acf98fc5fa31acc472828a990 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 8 Jul 2022 02:42:11 +0800 Subject: [PATCH 06/45] ci: add installation test --- .github/workflows/chart_test.yml | 34 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index ae58c0ba..d5b8371f 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -27,7 +27,7 @@ on: - '.github/workflows/**' jobs: - lint-test: + basic-tests: runs-on: ubuntu-latest steps: - name: Checkout @@ -51,17 +51,33 @@ jobs: id: list-changed run: | changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" fi - name: Run chart-testing (lint) if: steps.list-changed.outputs.changed == 'true' run: ct lint --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml + - name: Run template test + if: steps.list-changed.outputs.changed == 'true' + run: | + for i in v1.19.0 v1.20.0 v1.21.0 v1.22.0 v1.23.0 v1.24.0 + do + helm template test ${{ steps.list-changed.outputs.chart_name }} --kube-version $i> $i.yaml + yamllint $i.yaml --config-file lintconf.yaml + done - template-test: + - name: Run unittest + if: steps.list-changed.outputs.changed == 'true' + run: | + helm unittest -3 ${{ steps.list-changed.outputs.chart_name }} + + installation-test: runs-on: ubuntu-latest + needs: basic-tests steps: - name: Checkout uses: actions/checkout@v2 @@ -84,17 +100,13 @@ jobs: id: list-changed run: | changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" fi - - name: Run template test + - name: Create kind cluster + uses: helm/kind-action@v1.3.0 if: steps.list-changed.outputs.changed == 'true' - run: | - for i in v1.19.0 v1.20.0 v1.21.0 v1.22.0 v1.23.0 v1.24.0 - do - helm template test ${{ steps.list-changed.outputs.chart_name }} --kube-version $i> $i.yaml - yamllint $i.yaml --config-file lintconf.yaml - done + + - name: Run chart-testing (install) + run: ct install From 436c251380ac6a7a1f7535506c2093f114684372 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 8 Jul 2022 02:44:09 +0800 Subject: [PATCH 07/45] ci: install helm plugin unittest --- .github/workflows/chart_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index d5b8371f..c5687a2f 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -73,6 +73,7 @@ jobs: - name: Run unittest if: steps.list-changed.outputs.changed == 'true' run: | + helm plugin install https://github.com/quintush/helm-unittest helm unittest -3 ${{ steps.list-changed.outputs.chart_name }} installation-test: From d612bfb93f106d401c1f7b68fa3bd5bbe95d3fd2 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 8 Jul 2022 02:55:30 +0800 Subject: [PATCH 08/45] ci: install the chart on multiple k8s version --- .github/workflows/chart_test.yml | 234 ++++++++++++++++++++++++++++++- 1 file changed, 233 insertions(+), 1 deletion(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index c5687a2f..62cc825e 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -76,7 +76,7 @@ jobs: helm plugin install https://github.com/quintush/helm-unittest helm unittest -3 ${{ steps.list-changed.outputs.chart_name }} - installation-test: + install-on-v1.18: runs-on: ubuntu-latest needs: basic-tests steps: @@ -107,6 +107,238 @@ jobs: - name: Create kind cluster uses: helm/kind-action@v1.3.0 + with: + node_image: kindest/node:v1.18.20 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + run: ct install + + install-on-v1.19: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Create kind cluster + uses: helm/kind-action@v1.3.0 + with: + node_image: kindest/node:v1.19.11 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + run: ct install + + install-on-v1.20: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Create kind cluster + uses: helm/kind-action@v1.3.0 + with: + node_image: kindest/node:v1.20.15 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + run: ct install + + install-on-v1.21: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Create kind cluster + uses: helm/kind-action@v1.3.0 + with: + node_image: kindest/node:v1.21.12 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + run: ct install + + + install-on-v1.22: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Create kind cluster + uses: helm/kind-action@v1.3.0 + with: + node_image: kindest/node:v1.22.9 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + run: ct install + + install-on-v1.23: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Create kind cluster + uses: helm/kind-action@v1.3.0 + with: + node_image: kindest/node:v1.23.6 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + run: ct install + + + install-on-v1.24: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Create kind cluster + uses: helm/kind-action@v1.3.0 + with: + node_image: kindest/node:v1.24.0 if: steps.list-changed.outputs.changed == 'true' - name: Run chart-testing (install) From 998221ea0600ce2d3d64efa31e3c21f3a8487ab8 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 8 Jul 2022 02:58:03 +0800 Subject: [PATCH 09/45] fix: syntax --- .github/workflows/chart_test.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 62cc825e..756f3666 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -76,7 +76,7 @@ jobs: helm plugin install https://github.com/quintush/helm-unittest helm unittest -3 ${{ steps.list-changed.outputs.chart_name }} - install-on-v1.18: + install-on-v1-18: runs-on: ubuntu-latest needs: basic-tests steps: @@ -114,7 +114,7 @@ jobs: - name: Run chart-testing (install) run: ct install - install-on-v1.19: + install-on-v1-19: runs-on: ubuntu-latest needs: basic-tests steps: @@ -152,7 +152,7 @@ jobs: - name: Run chart-testing (install) run: ct install - install-on-v1.20: + install-on-v1-20: runs-on: ubuntu-latest needs: basic-tests steps: @@ -190,7 +190,7 @@ jobs: - name: Run chart-testing (install) run: ct install - install-on-v1.21: + install-on-v1-21: runs-on: ubuntu-latest needs: basic-tests steps: @@ -229,7 +229,7 @@ jobs: run: ct install - install-on-v1.22: + install-on-v1-22: runs-on: ubuntu-latest needs: basic-tests steps: @@ -267,7 +267,7 @@ jobs: - name: Run chart-testing (install) run: ct install - install-on-v1.23: + install-on-v1-23: runs-on: ubuntu-latest needs: basic-tests steps: @@ -306,7 +306,7 @@ jobs: run: ct install - install-on-v1.24: + install-on-v1-24: runs-on: ubuntu-latest needs: basic-tests steps: From 720934c93bf4d3a0da5f7f0078248787a5df2f05 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 8 Jul 2022 03:03:05 +0800 Subject: [PATCH 10/45] fix: reset the chart changes --- charts/pulsar-operator/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/pulsar-operator/Chart.yaml b/charts/pulsar-operator/Chart.yaml index 9ca08385..fddbdf07 100644 --- a/charts/pulsar-operator/Chart.yaml +++ b/charts/pulsar-operator/Chart.yaml @@ -18,9 +18,9 @@ # apiVersion: v1 -version: 0.12.0 +version: 0.11.0 appVersion: "0.11.5" -kubeVersion: ">= 1.16.0-0 < 1.25.0-0" +kubeVersion: ">= 1.16.0-0 < 1.24.0-0" description: Apache Pulsar Operators Helm chart for Kubernetes name: pulsar-operator home: https://streamnative.io From 4594f22add78edd2b8699d3ef8e866e93d5f0b70 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 8 Jul 2022 03:04:31 +0800 Subject: [PATCH 11/45] ci: test sn-platform --- charts/sn-platform/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/sn-platform/Chart.yaml b/charts/sn-platform/Chart.yaml index 20d4c903..d37f0b54 100644 --- a/charts/sn-platform/Chart.yaml +++ b/charts/sn-platform/Chart.yaml @@ -21,7 +21,7 @@ apiVersion: v1 appVersion: "2.9" description: StreamNative Platform Chart name: sn-platform -version: 1.5.0 +version: 1.6.0 home: https://streamnative.io sources: - https://github.com/streamnative/charts/tree/master/charts/sn-platform From df528032d8909fa174f088ee12e20a6c6fac5f08 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Tue, 12 Jul 2022 17:17:48 +0800 Subject: [PATCH 12/45] chore: disable the trailing-spaces check of yamllint --- lintconf.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lintconf.yaml b/lintconf.yaml index 90f48c88..ff61c46e 100644 --- a/lintconf.yaml +++ b/lintconf.yaml @@ -37,6 +37,6 @@ rules: new-line-at-end-of-file: enable new-lines: type: unix - trailing-spaces: enable + trailing-spaces: disable truthy: level: warning From e29331021913c70ef8b0bc39ff9f582f2cd01da9 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Wed, 13 Jul 2022 17:59:19 +0800 Subject: [PATCH 13/45] fix: yaml lint errors for sn-platform --- .../alertmanager-deployment.yaml | 2 +- .../alert-manager/alertmanager-service.yaml | 2 +- .../templates/broker/broker-cluster.yaml | 18 +++++++------- .../detector/pulsar-detector-deployment.yaml | 6 ++--- .../grafana/grafana-statefulset.yaml | 2 +- .../node-exporter/node-exporter.yaml | 2 +- .../templates/prometheus/prometheus-pvc.yaml | 2 +- .../templates/proxy/proxy-cluster.yaml | 24 +++++++++---------- .../streamnative-console-pvc.yaml | 2 +- .../templates/vault/vault-statefulset.yaml | 2 +- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/charts/sn-platform/templates/alert-manager/alertmanager-deployment.yaml b/charts/sn-platform/templates/alert-manager/alertmanager-deployment.yaml index 901b87d5..80494990 100644 --- a/charts/sn-platform/templates/alert-manager/alertmanager-deployment.yaml +++ b/charts/sn-platform/templates/alert-manager/alertmanager-deployment.yaml @@ -64,7 +64,7 @@ spec: - --volume-dir=/etc/config - --webhook-url=http://127.0.0.1:{{ .Values.alert_manager.port }}{{ template "pulsar.control_center_path.alertmanager" . }}/-/reload resources: -{{ toYaml .Values.configmapReload.alertmanager.resources | indent 12 }} +{{- toYaml .Values.configmapReload.alertmanager.resources | nindent 10 }} volumeMounts: - name: config-volume mountPath: /etc/config diff --git a/charts/sn-platform/templates/alert-manager/alertmanager-service.yaml b/charts/sn-platform/templates/alert-manager/alertmanager-service.yaml index e48f3275..82e38e3c 100644 --- a/charts/sn-platform/templates/alert-manager/alertmanager-service.yaml +++ b/charts/sn-platform/templates/alert-manager/alertmanager-service.yaml @@ -27,7 +27,7 @@ metadata: {{- include "pulsar.standardLabels" . | nindent 4 }} component: {{ .Values.alert_manager.component }} annotations: - {{ toYaml .Values.alert_manager.service.annotations | indent 4 }} + {{- toYaml .Values.alert_manager.service.annotations | nindent 4 }} spec: {{- with .Values.alert_manager.service.spec }} {{ toYaml . | indent 2 }} diff --git a/charts/sn-platform/templates/broker/broker-cluster.yaml b/charts/sn-platform/templates/broker/broker-cluster.yaml index b46bedcb..4d913fd0 100644 --- a/charts/sn-platform/templates/broker/broker-cluster.yaml +++ b/charts/sn-platform/templates/broker/broker-cluster.yaml @@ -130,14 +130,14 @@ spec: {{- if .Values.auth.authentication.enabled }} - name: PULSAR_PREFIX_OIDCTokenAudienceID valueFrom: - secretKeyRef: - name: {{ template "pulsar.vault-secret-key-name" . }} - key: PULSAR_PREFIX_OIDCTokenAudienceID + secretKeyRef: + name: {{ template "pulsar.vault-secret-key-name" . }} + key: PULSAR_PREFIX_OIDCTokenAudienceID - name: brokerClientAuthenticationParameters valueFrom: - secretKeyRef: - name: {{ template "pulsar.vault-secret-key-name" . }} - key: brokerClientAuthenticationParameters + secretKeyRef: + name: {{ template "pulsar.vault-secret-key-name" . }} + key: brokerClientAuthenticationParameters {{- end }} {{- if and .Values.broker.offload.s3.enabled .Values.broker.offload.s3.secret }} - name: AWS_ACCESS_KEY_ID @@ -168,9 +168,9 @@ spec: {{ toYaml . | indent 4 }} {{- end }} # not support envFrom currently - #envFrom: - #- secretRef: - # name: {{ template "pulsar.vault-secret-key-name" . }} + # envFrom: + # - secretRef: + # name: {{ template "pulsar.vault-secret-key-name" . }} {{- if .Values.broker.resources }} resources: {{ toYaml .Values.broker.resources | indent 6 }} diff --git a/charts/sn-platform/templates/detector/pulsar-detector-deployment.yaml b/charts/sn-platform/templates/detector/pulsar-detector-deployment.yaml index 9e1d49e5..491f930b 100644 --- a/charts/sn-platform/templates/detector/pulsar-detector-deployment.yaml +++ b/charts/sn-platform/templates/detector/pulsar-detector-deployment.yaml @@ -106,8 +106,8 @@ spec: {{- if .Values.components.vault }} - name: brokerClientAuthenticationParameters valueFrom: - secretKeyRef: - name: {{ template "pulsar.vault-secret-key-name" . }} - key: brokerClientAuthenticationParameters + secretKeyRef: + name: {{ template "pulsar.vault-secret-key-name" . }} + key: brokerClientAuthenticationParameters {{- end }} {{- end }} diff --git a/charts/sn-platform/templates/grafana/grafana-statefulset.yaml b/charts/sn-platform/templates/grafana/grafana-statefulset.yaml index 34e6f6b6..05502f70 100644 --- a/charts/sn-platform/templates/grafana/grafana-statefulset.yaml +++ b/charts/sn-platform/templates/grafana/grafana-statefulset.yaml @@ -148,7 +148,7 @@ spec: - metadata: name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}-{{ .Values.grafana.volumes.data.name }}" spec: - accessModes: [ "ReadWriteOnce" ] + accessModes: ["ReadWriteOnce"] resources: requests: storage: {{ .Values.grafana.volumes.data.size }} diff --git a/charts/sn-platform/templates/node-exporter/node-exporter.yaml b/charts/sn-platform/templates/node-exporter/node-exporter.yaml index 727adb21..149137b4 100644 --- a/charts/sn-platform/templates/node-exporter/node-exporter.yaml +++ b/charts/sn-platform/templates/node-exporter/node-exporter.yaml @@ -75,7 +75,7 @@ spec: volumeMounts: - name: proc mountPath: /host/proc - readOnly: true + readOnly: true - name: sys mountPath: /host/sys readOnly: true diff --git a/charts/sn-platform/templates/prometheus/prometheus-pvc.yaml b/charts/sn-platform/templates/prometheus/prometheus-pvc.yaml index 1cdfe433..f22ac646 100644 --- a/charts/sn-platform/templates/prometheus/prometheus-pvc.yaml +++ b/charts/sn-platform/templates/prometheus/prometheus-pvc.yaml @@ -29,7 +29,7 @@ spec: resources: requests: storage: {{ .Values.prometheus.volumes.data.size }} - accessModes: [ "ReadWriteOnce" ] + accessModes: ["ReadWriteOnce"] {{- if and .Values.volumes.local_storage .Values.prometheus.volumes.data.local_storage }} storageClassName: "local-storage" {{- else }} diff --git a/charts/sn-platform/templates/proxy/proxy-cluster.yaml b/charts/sn-platform/templates/proxy/proxy-cluster.yaml index 1a8e4019..ba8f7f28 100644 --- a/charts/sn-platform/templates/proxy/proxy-cluster.yaml +++ b/charts/sn-platform/templates/proxy/proxy-cluster.yaml @@ -120,26 +120,26 @@ spec: vars: - name: PULSAR_PREFIX_OIDCTokenAudienceID valueFrom: - secretKeyRef: - name: {{ template "pulsar.vault-secret-key-name" . }} - key: PULSAR_PREFIX_OIDCTokenAudienceID + secretKeyRef: + name: {{ template "pulsar.vault-secret-key-name" . }} + key: PULSAR_PREFIX_OIDCTokenAudienceID - name: brokerClientAuthenticationParameters valueFrom: - secretKeyRef: - name: {{ template "pulsar.vault-secret-key-name" . }} - key: brokerClientAuthenticationParameters + secretKeyRef: + name: {{ template "pulsar.vault-secret-key-name" . }} + key: brokerClientAuthenticationParameters - name: PROXY_TOKEN valueFrom: - secretKeyRef: - name: {{ template "pulsar.vault-secret-key-name" . }} - key: brokerClientAuthenticationParameters + secretKeyRef: + name: {{ template "pulsar.vault-secret-key-name" . }} + key: brokerClientAuthenticationParameters {{- end }} {{- with .Values.proxy.extraEnv}} {{ toYaml . | indent 4 }} {{- end }} - #envFrom: - #- secretRef: - # name: {{ template "pulsar.vault-secret-key-name" . }} + # envFrom: + # - secretRef: + # name: {{ template "pulsar.vault-secret-key-name" . }} {{- if .Values.proxy.resources }} resources: {{ toYaml .Values.proxy.resources | indent 6 }} diff --git a/charts/sn-platform/templates/streamnative-console/streamnative-console-pvc.yaml b/charts/sn-platform/templates/streamnative-console/streamnative-console-pvc.yaml index 1370b06b..1ff8ec47 100644 --- a/charts/sn-platform/templates/streamnative-console/streamnative-console-pvc.yaml +++ b/charts/sn-platform/templates/streamnative-console/streamnative-console-pvc.yaml @@ -29,7 +29,7 @@ spec: resources: requests: storage: {{ .Values.streamnative_console.volumes.data.size }} - accessModes: [ "ReadWriteOnce" ] + accessModes: ["ReadWriteOnce"] {{- if and .Values.volumes.local_storage .Values.streamnative_console.volumes.data.local_storage }} storageClassName: "local-storage" {{- else }} diff --git a/charts/sn-platform/templates/vault/vault-statefulset.yaml b/charts/sn-platform/templates/vault/vault-statefulset.yaml index 6cbf87d4..91ed289d 100644 --- a/charts/sn-platform/templates/vault/vault-statefulset.yaml +++ b/charts/sn-platform/templates/vault/vault-statefulset.yaml @@ -82,7 +82,7 @@ spec: - metadata: name: "{{ template "pulsar.fullname" . }}-{{ .Values.vault.component }}-{{ .Values.vault.volume.name }}" spec: - accessModes: [ "ReadWriteOnce" ] + accessModes: ["ReadWriteOnce"] resources: requests: storage: {{ .Values.vault.volume.size }} From 40dba27b2e7afaa271c1e009b3968b1b7597f47d Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Wed, 13 Jul 2022 18:06:06 +0800 Subject: [PATCH 14/45] fix: license header --- lintconf.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lintconf.yaml b/lintconf.yaml index ff61c46e..56ccf1cb 100644 --- a/lintconf.yaml +++ b/lintconf.yaml @@ -1,3 +1,21 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# --- rules: braces: From 64ddc6c4655acea5336c6214f2ffa80d1fd5e20a Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Wed, 13 Jul 2022 19:19:36 +0800 Subject: [PATCH 15/45] ci: install pulsar-operator before install sn-platform --- .github/workflows/chart_test.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 756f3666..6da3cb80 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -101,8 +101,10 @@ jobs: id: list-changed run: | changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" fi - name: Create kind cluster @@ -139,8 +141,10 @@ jobs: id: list-changed run: | changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" fi - name: Create kind cluster @@ -177,8 +181,10 @@ jobs: id: list-changed run: | changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" fi - name: Create kind cluster @@ -215,8 +221,10 @@ jobs: id: list-changed run: | changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" fi - name: Create kind cluster @@ -254,8 +262,10 @@ jobs: id: list-changed run: | changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" fi - name: Create kind cluster @@ -292,8 +302,10 @@ jobs: id: list-changed run: | changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" fi - name: Create kind cluster @@ -302,6 +314,14 @@ jobs: node_image: kindest/node:v1.23.6 if: steps.list-changed.outputs.changed == 'true' + # Install the pulsar operator before testing the sn-platform + - name: Install the pulsar operator + if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + run: | + helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com + helm -n sn-system install sn charts/pulsar-operator --create-namespace + helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator + - name: Run chart-testing (install) run: ct install @@ -331,8 +351,10 @@ jobs: id: list-changed run: | changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" fi - name: Create kind cluster @@ -341,5 +363,13 @@ jobs: node_image: kindest/node:v1.24.0 if: steps.list-changed.outputs.changed == 'true' + # Install the pulsar operator before testing the sn-platform + - name: Install the pulsar operator + if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + run: | + helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com + helm -n sn-system install sn charts/pulsar-operator --create-namespace + helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator + - name: Run chart-testing (install) run: ct install From b6264e068f186b3988456f31fc7769bae7ed7e61 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Wed, 13 Jul 2022 19:45:34 +0800 Subject: [PATCH 16/45] ci: use script to create kind cluster --- .github/workflows/chart_test.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 6da3cb80..e1d1e9f0 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -309,11 +309,13 @@ jobs: fi - name: Create kind cluster - uses: helm/kind-action@v1.3.0 - with: - node_image: kindest/node:v1.23.6 + run: | + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.23.6 + env: + KIND_VERSION: 0.14.0 if: steps.list-changed.outputs.changed == 'true' + # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' From 6a1b00d706587eb37a76071a717b6b0e949fdf7e Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Wed, 13 Jul 2022 19:58:23 +0800 Subject: [PATCH 17/45] ci: pull and load sn-platform image --- .github/workflows/chart_test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index e1d1e9f0..9f8372cd 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -311,8 +311,11 @@ jobs: - name: Create kind cluster run: | ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.23.6 + docker pull "$SN_IMAGE" + kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" env: KIND_VERSION: 0.14.0 + SN_IMAGE: streamnative/sn-platform:2.9.2.20 if: steps.list-changed.outputs.changed == 'true' From 4d22f846b41faa8ed27a84b06556b3b61196ec33 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Wed, 13 Jul 2022 21:35:59 +0800 Subject: [PATCH 18/45] ci: test on k8s v1.23 --- .github/workflows/chart_test.yml | 499 ++++++++++++++++--------------- 1 file changed, 252 insertions(+), 247 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 9f8372cd..70c9edc5 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -76,206 +76,206 @@ jobs: helm plugin install https://github.com/quintush/helm-unittest helm unittest -3 ${{ steps.list-changed.outputs.chart_name }} - install-on-v1-18: - runs-on: ubuntu-latest - needs: basic-tests - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Helm - uses: azure/setup-helm@v1 - with: - version: v3.9.0 - - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 - - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" - fi - - - name: Create kind cluster - uses: helm/kind-action@v1.3.0 - with: - node_image: kindest/node:v1.18.20 - if: steps.list-changed.outputs.changed == 'true' - - - name: Run chart-testing (install) - run: ct install - - install-on-v1-19: - runs-on: ubuntu-latest - needs: basic-tests - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Helm - uses: azure/setup-helm@v1 - with: - version: v3.9.0 - - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 - - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" - fi - - - name: Create kind cluster - uses: helm/kind-action@v1.3.0 - with: - node_image: kindest/node:v1.19.11 - if: steps.list-changed.outputs.changed == 'true' - - - name: Run chart-testing (install) - run: ct install - - install-on-v1-20: - runs-on: ubuntu-latest - needs: basic-tests - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Helm - uses: azure/setup-helm@v1 - with: - version: v3.9.0 - - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 - - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" - fi - - - name: Create kind cluster - uses: helm/kind-action@v1.3.0 - with: - node_image: kindest/node:v1.20.15 - if: steps.list-changed.outputs.changed == 'true' - - - name: Run chart-testing (install) - run: ct install - - install-on-v1-21: - runs-on: ubuntu-latest - needs: basic-tests - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Helm - uses: azure/setup-helm@v1 - with: - version: v3.9.0 - - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 - - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" - fi - - - name: Create kind cluster - uses: helm/kind-action@v1.3.0 - with: - node_image: kindest/node:v1.21.12 - if: steps.list-changed.outputs.changed == 'true' - - - name: Run chart-testing (install) - run: ct install - - - install-on-v1-22: - runs-on: ubuntu-latest - needs: basic-tests - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Helm - uses: azure/setup-helm@v1 - with: - version: v3.9.0 - - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 - - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" - fi - - - name: Create kind cluster - uses: helm/kind-action@v1.3.0 - with: - node_image: kindest/node:v1.22.9 - if: steps.list-changed.outputs.changed == 'true' - - - name: Run chart-testing (install) - run: ct install +# install-on-v1-18: +# runs-on: ubuntu-latest +# needs: basic-tests +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# with: +# fetch-depth: 0 +# +# - name: Set up Helm +# uses: azure/setup-helm@v1 +# with: +# version: v3.9.0 +# +# - uses: actions/setup-python@v2 +# with: +# python-version: 3.7 +# +# - name: Set up chart-testing +# uses: helm/chart-testing-action@v2.2.1 +# +# - name: Run chart-testing (list-changed) +# id: list-changed +# run: | +# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) +# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') +# if [[ -n "$changed" ]]; then +# echo "::set-output name=changed::true" +# echo "::set-output name=chart_name::$chart_name" +# fi +# +# - name: Create kind cluster +# uses: helm/kind-action@v1.3.0 +# with: +# node_image: kindest/node:v1.18.20 +# if: steps.list-changed.outputs.changed == 'true' +# +# - name: Run chart-testing (install) +# run: ct install +# +# install-on-v1-19: +# runs-on: ubuntu-latest +# needs: basic-tests +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# with: +# fetch-depth: 0 +# +# - name: Set up Helm +# uses: azure/setup-helm@v1 +# with: +# version: v3.9.0 +# +# - uses: actions/setup-python@v2 +# with: +# python-version: 3.7 +# +# - name: Set up chart-testing +# uses: helm/chart-testing-action@v2.2.1 +# +# - name: Run chart-testing (list-changed) +# id: list-changed +# run: | +# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) +# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') +# if [[ -n "$changed" ]]; then +# echo "::set-output name=changed::true" +# echo "::set-output name=chart_name::$chart_name" +# fi +# +# - name: Create kind cluster +# uses: helm/kind-action@v1.3.0 +# with: +# node_image: kindest/node:v1.19.11 +# if: steps.list-changed.outputs.changed == 'true' +# +# - name: Run chart-testing (install) +# run: ct install +# +# install-on-v1-20: +# runs-on: ubuntu-latest +# needs: basic-tests +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# with: +# fetch-depth: 0 +# +# - name: Set up Helm +# uses: azure/setup-helm@v1 +# with: +# version: v3.9.0 +# +# - uses: actions/setup-python@v2 +# with: +# python-version: 3.7 +# +# - name: Set up chart-testing +# uses: helm/chart-testing-action@v2.2.1 +# +# - name: Run chart-testing (list-changed) +# id: list-changed +# run: | +# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) +# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') +# if [[ -n "$changed" ]]; then +# echo "::set-output name=changed::true" +# echo "::set-output name=chart_name::$chart_name" +# fi +# +# - name: Create kind cluster +# uses: helm/kind-action@v1.3.0 +# with: +# node_image: kindest/node:v1.20.15 +# if: steps.list-changed.outputs.changed == 'true' +# +# - name: Run chart-testing (install) +# run: ct install +# +# install-on-v1-21: +# runs-on: ubuntu-latest +# needs: basic-tests +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# with: +# fetch-depth: 0 +# +# - name: Set up Helm +# uses: azure/setup-helm@v1 +# with: +# version: v3.9.0 +# +# - uses: actions/setup-python@v2 +# with: +# python-version: 3.7 +# +# - name: Set up chart-testing +# uses: helm/chart-testing-action@v2.2.1 +# +# - name: Run chart-testing (list-changed) +# id: list-changed +# run: | +# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) +# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') +# if [[ -n "$changed" ]]; then +# echo "::set-output name=changed::true" +# echo "::set-output name=chart_name::$chart_name" +# fi +# +# - name: Create kind cluster +# uses: helm/kind-action@v1.3.0 +# with: +# node_image: kindest/node:v1.21.12 +# if: steps.list-changed.outputs.changed == 'true' +# +# - name: Run chart-testing (install) +# run: ct install +# +# +# install-on-v1-22: +# runs-on: ubuntu-latest +# needs: basic-tests +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# with: +# fetch-depth: 0 +# +# - name: Set up Helm +# uses: azure/setup-helm@v1 +# with: +# version: v3.9.0 +# +# - uses: actions/setup-python@v2 +# with: +# python-version: 3.7 +# +# - name: Set up chart-testing +# uses: helm/chart-testing-action@v2.2.1 +# +# - name: Run chart-testing (list-changed) +# id: list-changed +# run: | +# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) +# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') +# if [[ -n "$changed" ]]; then +# echo "::set-output name=changed::true" +# echo "::set-output name=chart_name::$chart_name" +# fi +# +# - name: Create kind cluster +# uses: helm/kind-action@v1.3.0 +# with: +# node_image: kindest/node:v1.22.9 +# if: steps.list-changed.outputs.changed == 'true' +# +# - name: Run chart-testing (install) +# run: ct install install-on-v1-23: runs-on: ubuntu-latest @@ -325,56 +325,61 @@ jobs: run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-controller-manager + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-zookeeper-operator-controller-manager + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-bookkeeper-operator-controller-manager helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/vault-operator + df -h - name: Run chart-testing (install) run: ct install - install-on-v1-24: - runs-on: ubuntu-latest - needs: basic-tests - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Helm - uses: azure/setup-helm@v1 - with: - version: v3.9.0 - - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 - - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" - fi - - - name: Create kind cluster - uses: helm/kind-action@v1.3.0 - with: - node_image: kindest/node:v1.24.0 - if: steps.list-changed.outputs.changed == 'true' - - # Install the pulsar operator before testing the sn-platform - - name: Install the pulsar operator - if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' - run: | - helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com - helm -n sn-system install sn charts/pulsar-operator --create-namespace - helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator - - - name: Run chart-testing (install) - run: ct install +# install-on-v1-24: +# runs-on: ubuntu-latest +# needs: basic-tests +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# with: +# fetch-depth: 0 +# +# - name: Set up Helm +# uses: azure/setup-helm@v1 +# with: +# version: v3.9.0 +# +# - uses: actions/setup-python@v2 +# with: +# python-version: 3.7 +# +# - name: Set up chart-testing +# uses: helm/chart-testing-action@v2.2.1 +# +# - name: Run chart-testing (list-changed) +# id: list-changed +# run: | +# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) +# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') +# if [[ -n "$changed" ]]; then +# echo "::set-output name=changed::true" +# echo "::set-output name=chart_name::$chart_name" +# fi +# +# - name: Create kind cluster +# uses: helm/kind-action@v1.3.0 +# with: +# node_image: kindest/node:v1.24.0 +# if: steps.list-changed.outputs.changed == 'true' +# +# # Install the pulsar operator before testing the sn-platform +# - name: Install the pulsar operator +# if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' +# run: | +# helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com +# helm -n sn-system install sn charts/pulsar-operator --create-namespace +# helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator +# +# - name: Run chart-testing (install) +# run: ct install From dd98b98b9eb6a5d8029fa8ce2ea91381adb3fd64 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Thu, 14 Jul 2022 11:20:49 +0800 Subject: [PATCH 19/45] ci: fix deployment name --- .github/workflows/chart_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 70c9edc5..75f6c2ec 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -325,9 +325,9 @@ jobs: run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace - kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-controller-manager - kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-zookeeper-operator-controller-manager - kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-bookkeeper-operator-controller-manager + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-controller-manager + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-zookeeper-controller-manager + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-bookkeeper-controller-manager helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator kubectl -nsn-system wait --for condition=available --timeout=360s deployment/vault-operator df -h From 922fd64bebb39459f88afb2844a332c1e0bbe738 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Thu, 14 Jul 2022 11:46:49 +0800 Subject: [PATCH 20/45] ci: debug --- .github/workflows/chart_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 75f6c2ec..7f9d20fc 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -325,6 +325,7 @@ jobs: run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace + kubectl -nsn-system get deploy kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-controller-manager kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-zookeeper-controller-manager kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-bookkeeper-controller-manager From 48e0ecf4a5464739e4fff57daeb73a1535a63b1d Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Thu, 14 Jul 2022 13:02:00 +0800 Subject: [PATCH 21/45] ci: fix deployment name --- .github/workflows/chart_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 7f9d20fc..7de03995 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -326,9 +326,9 @@ jobs: helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace kubectl -nsn-system get deploy - kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-controller-manager - kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-zookeeper-controller-manager - kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-bookkeeper-controller-manager + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-pulsar-controller-manager + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-zookeeper-controller-manager + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-bookkeeper-controller-manager helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator kubectl -nsn-system wait --for condition=available --timeout=360s deployment/vault-operator df -h From 23cdd9f6400a890a4292bf2eef6352dad9e37d66 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Thu, 14 Jul 2022 18:23:14 +0800 Subject: [PATCH 22/45] ci: clean disk --- .github/workflows/chart_test.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 7de03995..ffa00917 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -286,6 +286,15 @@ jobs: with: fetch-depth: 0 + - name: clean disk + run: | + df -h + sudo swapoff -a + sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc "$AGENT_TOOLSDIRECTORY" + sudo apt clean + docker rmi $(docker images -q) -f + df -h + - name: Set up Helm uses: azure/setup-helm@v1 with: From d3a8fded93b298c02055245c9ef0c5bb98d745d0 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Thu, 14 Jul 2022 20:02:39 +0800 Subject: [PATCH 23/45] ci: add tmate to debug --- .github/workflows/chart_test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index ffa00917..76280051 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -345,6 +345,11 @@ jobs: - name: Run chart-testing (install) run: ct install + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: failure() + + # install-on-v1-24: # runs-on: ubuntu-latest From 156c110d9b2749d1d05930e77f62af7ae1ba29f4 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Thu, 14 Jul 2022 20:45:52 +0800 Subject: [PATCH 24/45] ci: add initialize=true to ci/disable-monitoring-values.yaml --- charts/sn-platform/ci/disable-monitoring-values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/sn-platform/ci/disable-monitoring-values.yaml b/charts/sn-platform/ci/disable-monitoring-values.yaml index 1e2814eb..b5e8ed6b 100644 --- a/charts/sn-platform/ci/disable-monitoring-values.yaml +++ b/charts/sn-platform/ci/disable-monitoring-values.yaml @@ -17,6 +17,7 @@ # under the License. # +initialize: true # Based on the defult values, disable the monitoring components monitoring: prometheus: false From 077840c197d076717b5e77b1203a9286b8a49b6e Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 15 Jul 2022 01:24:26 +0800 Subject: [PATCH 25/45] ci: update timeout seconds --- ct.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct.yaml b/ct.yaml index 5e132d76..c6999802 100644 --- a/ct.yaml +++ b/ct.yaml @@ -27,5 +27,5 @@ charts: - charts/sn-platform - charts/pulsar debug: true -helm-extra-args: --timeout 1200 +helm-extra-args: --timeout 1200s validate-maintainers: false From e63629d0b8ae022b0b507a5ef7ddc8b032ed2937 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 15 Jul 2022 01:47:06 +0800 Subject: [PATCH 26/45] ci: enable chart-testing debug --- .github/workflows/chart_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 76280051..cbdbced9 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -343,7 +343,7 @@ jobs: df -h - name: Run chart-testing (install) - run: ct install + run: ct install --debug - name: Setup tmate session uses: mxschmitt/action-tmate@v3 From 0f61d2b0a60aa3b7c90cd527e4bf08642f3e59eb Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 15 Jul 2022 02:15:00 +0800 Subject: [PATCH 27/45] ci: specify the ct config --- .github/workflows/chart_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index cbdbced9..6130c30c 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -343,7 +343,7 @@ jobs: df -h - name: Run chart-testing (install) - run: ct install --debug + run: ct install --debug --config ct.yaml --print-config - name: Setup tmate session uses: mxschmitt/action-tmate@v3 From 2c8e942cbeb9397048a63ddb297775915c9da077 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Thu, 28 Jul 2022 21:50:33 +0800 Subject: [PATCH 28/45] ci: remove value files of istio and zookeeper --- charts/sn-platform/Chart.yaml | 2 +- .../sn-platform/ci/enable-istio-values.yaml | 29 ------------------- .../ci/enable-zookeeper-backup.yaml | 24 --------------- 3 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 charts/sn-platform/ci/enable-istio-values.yaml delete mode 100644 charts/sn-platform/ci/enable-zookeeper-backup.yaml diff --git a/charts/sn-platform/Chart.yaml b/charts/sn-platform/Chart.yaml index d37f0b54..38e5b695 100644 --- a/charts/sn-platform/Chart.yaml +++ b/charts/sn-platform/Chart.yaml @@ -21,7 +21,7 @@ apiVersion: v1 appVersion: "2.9" description: StreamNative Platform Chart name: sn-platform -version: 1.6.0 +version: 1.6.1 home: https://streamnative.io sources: - https://github.com/streamnative/charts/tree/master/charts/sn-platform diff --git a/charts/sn-platform/ci/enable-istio-values.yaml b/charts/sn-platform/ci/enable-istio-values.yaml deleted file mode 100644 index e65f43f9..00000000 --- a/charts/sn-platform/ci/enable-istio-values.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -# Based on the defult values, enable the istio -istio: - enabled: true - # istio labels used to inject sidecars if it's not `sidecar.istio.io/inject: "true"` - labels: {} - gateway: - # gateway selector if it's not `istio: ingressgateway` - selector: {} - tls: - certSecretName: istio-cert diff --git a/charts/sn-platform/ci/enable-zookeeper-backup.yaml b/charts/sn-platform/ci/enable-zookeeper-backup.yaml deleted file mode 100644 index e33d50dd..00000000 --- a/charts/sn-platform/ci/enable-zookeeper-backup.yaml +++ /dev/null @@ -1,24 +0,0 @@ - -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -zookeeper: - customTools: - backup: - enable: true \ No newline at end of file From 80f41c926634a4618f2e7d83c1e00d886ddc6734 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Thu, 28 Jul 2022 22:01:43 +0800 Subject: [PATCH 29/45] ci: trigger chart test --- .github/workflows/chart_test.yml | 79 ++++++++++++++++---------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 6130c30c..d6ad2e1c 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -237,45 +237,45 @@ jobs: # run: ct install # # -# install-on-v1-22: -# runs-on: ubuntu-latest -# needs: basic-tests -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# fetch-depth: 0 -# -# - name: Set up Helm -# uses: azure/setup-helm@v1 -# with: -# version: v3.9.0 -# -# - uses: actions/setup-python@v2 -# with: -# python-version: 3.7 -# -# - name: Set up chart-testing -# uses: helm/chart-testing-action@v2.2.1 -# -# - name: Run chart-testing (list-changed) -# id: list-changed -# run: | -# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) -# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') -# if [[ -n "$changed" ]]; then -# echo "::set-output name=changed::true" -# echo "::set-output name=chart_name::$chart_name" -# fi -# -# - name: Create kind cluster -# uses: helm/kind-action@v1.3.0 -# with: -# node_image: kindest/node:v1.22.9 -# if: steps.list-changed.outputs.changed == 'true' -# -# - name: Run chart-testing (install) -# run: ct install + install-on-v1-22: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" + fi + + - name: Create kind cluster + uses: helm/kind-action@v1.3.0 + with: + node_image: kindest/node:v1.22.9 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + run: ct install install-on-v1-23: runs-on: ubuntu-latest @@ -322,6 +322,7 @@ jobs: ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.23.6 docker pull "$SN_IMAGE" kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" + env: KIND_VERSION: 0.14.0 SN_IMAGE: streamnative/sn-platform:2.9.2.20 From 31333972520b90a73fa273926d8c81c1e821c829 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 5 Aug 2022 18:59:18 +0800 Subject: [PATCH 30/45] fix: try to add push to trigger workflow --- .github/workflows/chart_test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index d6ad2e1c..b7ef8a0f 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -19,6 +19,9 @@ name: Chart Test on: + push: + paths: + - '.github/workflows/chart_test.yml' pull_request: branches: - '*' From 1fdb20e4ef9d871e1c74e20df7fa31f726de383a Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 26 Aug 2022 09:55:03 +0800 Subject: [PATCH 31/45] ci: trigger tests --- .github/workflows/chart_test.yml | 74 ++++++++++++++++---------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index b7ef8a0f..fb462cce 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -240,45 +240,45 @@ jobs: # run: ct install # # - install-on-v1-22: - runs-on: ubuntu-latest - needs: basic-tests - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 +# install-on-v1-22: +# runs-on: ubuntu-latest +# needs: basic-tests +# steps: +# - name: Checkout +# uses: actions/checkout@v2 +# with: +# fetch-depth: 0 - - name: Set up Helm - uses: azure/setup-helm@v1 - with: - version: v3.9.0 +# - name: Set up Helm +# uses: azure/setup-helm@v1 +# with: +# version: v3.9.0 - - uses: actions/setup-python@v2 - with: - python-version: 3.7 +# - uses: actions/setup-python@v2 +# with: +# python-version: 3.7 - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 +# - name: Set up chart-testing +# uses: helm/chart-testing-action@v2.2.1 - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" - fi +# - name: Run chart-testing (list-changed) +# id: list-changed +# run: | +# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) +# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') +# if [[ -n "$changed" ]]; then +# echo "::set-output name=changed::true" +# echo "::set-output name=chart_name::$chart_name" +# fi - - name: Create kind cluster - uses: helm/kind-action@v1.3.0 - with: - node_image: kindest/node:v1.22.9 - if: steps.list-changed.outputs.changed == 'true' +# - name: Create kind cluster +# uses: helm/kind-action@v1.3.0 +# with: +# node_image: kindest/node:v1.22.9 +# if: steps.list-changed.outputs.changed == 'true' - - name: Run chart-testing (install) - run: ct install +# - name: Run chart-testing (install) +# run: ct install install-on-v1-23: runs-on: ubuntu-latest @@ -338,10 +338,10 @@ jobs: run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace - kubectl -nsn-system get deploy - kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-pulsar-controller-manager - kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-zookeeper-controller-manager - kubectl -nsn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-bookkeeper-controller-manager + kubectl -n sn-system get deploy + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-pulsar-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-zookeeper-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-bookkeeper-controller-manager helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator kubectl -nsn-system wait --for condition=available --timeout=360s deployment/vault-operator df -h From 7e8aab8ca0c93dad4328e3b5d2e062cb0f7f28ac Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 2 Sep 2022 08:43:39 +0800 Subject: [PATCH 32/45] ci: just install chart sn-platform --- .github/workflows/chart_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index fb462cce..732b7f60 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -347,7 +347,7 @@ jobs: df -h - name: Run chart-testing (install) - run: ct install --debug --config ct.yaml --print-config + run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform - name: Setup tmate session uses: mxschmitt/action-tmate@v3 From 6b4e30de923146370bcfc346e7873c085c40d57c Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 2 Sep 2022 09:25:46 +0800 Subject: [PATCH 33/45] ci: test install sn-platform on multiple k8s version --- .github/workflows/chart_test.yml | 609 ++++++++++++++++++------------- 1 file changed, 362 insertions(+), 247 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 732b7f60..d722b889 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -79,206 +79,298 @@ jobs: helm plugin install https://github.com/quintush/helm-unittest helm unittest -3 ${{ steps.list-changed.outputs.chart_name }} -# install-on-v1-18: -# runs-on: ubuntu-latest -# needs: basic-tests -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# fetch-depth: 0 -# -# - name: Set up Helm -# uses: azure/setup-helm@v1 -# with: -# version: v3.9.0 -# -# - uses: actions/setup-python@v2 -# with: -# python-version: 3.7 -# -# - name: Set up chart-testing -# uses: helm/chart-testing-action@v2.2.1 -# -# - name: Run chart-testing (list-changed) -# id: list-changed -# run: | -# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) -# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') -# if [[ -n "$changed" ]]; then -# echo "::set-output name=changed::true" -# echo "::set-output name=chart_name::$chart_name" -# fi -# -# - name: Create kind cluster -# uses: helm/kind-action@v1.3.0 -# with: -# node_image: kindest/node:v1.18.20 -# if: steps.list-changed.outputs.changed == 'true' -# -# - name: Run chart-testing (install) -# run: ct install -# -# install-on-v1-19: -# runs-on: ubuntu-latest -# needs: basic-tests -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# fetch-depth: 0 -# -# - name: Set up Helm -# uses: azure/setup-helm@v1 -# with: -# version: v3.9.0 -# -# - uses: actions/setup-python@v2 -# with: -# python-version: 3.7 -# -# - name: Set up chart-testing -# uses: helm/chart-testing-action@v2.2.1 -# -# - name: Run chart-testing (list-changed) -# id: list-changed -# run: | -# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) -# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') -# if [[ -n "$changed" ]]; then -# echo "::set-output name=changed::true" -# echo "::set-output name=chart_name::$chart_name" -# fi -# -# - name: Create kind cluster -# uses: helm/kind-action@v1.3.0 -# with: -# node_image: kindest/node:v1.19.11 -# if: steps.list-changed.outputs.changed == 'true' -# -# - name: Run chart-testing (install) -# run: ct install -# -# install-on-v1-20: -# runs-on: ubuntu-latest -# needs: basic-tests -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# fetch-depth: 0 -# -# - name: Set up Helm -# uses: azure/setup-helm@v1 -# with: -# version: v3.9.0 -# -# - uses: actions/setup-python@v2 -# with: -# python-version: 3.7 -# -# - name: Set up chart-testing -# uses: helm/chart-testing-action@v2.2.1 -# -# - name: Run chart-testing (list-changed) -# id: list-changed -# run: | -# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) -# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') -# if [[ -n "$changed" ]]; then -# echo "::set-output name=changed::true" -# echo "::set-output name=chart_name::$chart_name" -# fi -# -# - name: Create kind cluster -# uses: helm/kind-action@v1.3.0 -# with: -# node_image: kindest/node:v1.20.15 -# if: steps.list-changed.outputs.changed == 'true' -# -# - name: Run chart-testing (install) -# run: ct install -# -# install-on-v1-21: -# runs-on: ubuntu-latest -# needs: basic-tests -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# fetch-depth: 0 -# -# - name: Set up Helm -# uses: azure/setup-helm@v1 -# with: -# version: v3.9.0 -# -# - uses: actions/setup-python@v2 -# with: -# python-version: 3.7 -# -# - name: Set up chart-testing -# uses: helm/chart-testing-action@v2.2.1 -# -# - name: Run chart-testing (list-changed) -# id: list-changed -# run: | -# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) -# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') -# if [[ -n "$changed" ]]; then -# echo "::set-output name=changed::true" -# echo "::set-output name=chart_name::$chart_name" -# fi -# -# - name: Create kind cluster -# uses: helm/kind-action@v1.3.0 -# with: -# node_image: kindest/node:v1.21.12 -# if: steps.list-changed.outputs.changed == 'true' -# -# - name: Run chart-testing (install) -# run: ct install -# -# -# install-on-v1-22: -# runs-on: ubuntu-latest -# needs: basic-tests -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# fetch-depth: 0 - -# - name: Set up Helm -# uses: azure/setup-helm@v1 -# with: -# version: v3.9.0 - -# - uses: actions/setup-python@v2 -# with: -# python-version: 3.7 - -# - name: Set up chart-testing -# uses: helm/chart-testing-action@v2.2.1 - -# - name: Run chart-testing (list-changed) -# id: list-changed -# run: | -# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) -# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') -# if [[ -n "$changed" ]]; then -# echo "::set-output name=changed::true" -# echo "::set-output name=chart_name::$chart_name" -# fi - -# - name: Create kind cluster -# uses: helm/kind-action@v1.3.0 -# with: -# node_image: kindest/node:v1.22.9 -# if: steps.list-changed.outputs.changed == 'true' - -# - name: Run chart-testing (install) -# run: ct install + install-on-v1-18: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: clean disk + run: | + df -h + sudo swapoff -a + sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc "$AGENT_TOOLSDIRECTORY" + sudo apt clean + docker rmi $(docker images -q) -f + df -h + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" + fi + + - name: Create kind cluster + run: | + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.18.20 + docker pull "$SN_IMAGE" + kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" + + env: + KIND_VERSION: 0.14.0 + SN_IMAGE: streamnative/sn-platform:2.9.2.20 + if: steps.list-changed.outputs.changed == 'true' + + + # Install the pulsar operator before testing the sn-platform + - name: Install the pulsar operator + if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + run: | + helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com + helm -n sn-system install sn charts/pulsar-operator --create-namespace + kubectl -n sn-system get deploy + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-pulsar-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-zookeeper-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-bookkeeper-controller-manager + helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/vault-operator + df -h + + - name: Run chart-testing (install) + run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: failure() + + + install-on-v1-19: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: clean disk + run: | + df -h + sudo swapoff -a + sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc "$AGENT_TOOLSDIRECTORY" + sudo apt clean + docker rmi $(docker images -q) -f + df -h + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" + fi + + - name: Create kind cluster + run: | + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.19.11 + docker pull "$SN_IMAGE" + kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" + + env: + KIND_VERSION: 0.14.0 + SN_IMAGE: streamnative/sn-platform:2.9.2.20 + if: steps.list-changed.outputs.changed == 'true' + + + # Install the pulsar operator before testing the sn-platform + - name: Install the pulsar operator + if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + run: | + helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com + helm -n sn-system install sn charts/pulsar-operator --create-namespace + kubectl -n sn-system get deploy + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-pulsar-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-zookeeper-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-bookkeeper-controller-manager + helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/vault-operator + df -h + + - name: Run chart-testing (install) + run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: failure() + + + install-on-v1-20: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: clean disk + run: | + df -h + sudo swapoff -a + sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc "$AGENT_TOOLSDIRECTORY" + sudo apt clean + docker rmi $(docker images -q) -f + df -h + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" + fi + + - name: Create kind cluster + run: | + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.21.12 + docker pull "$SN_IMAGE" + kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" + + env: + KIND_VERSION: 0.14.0 + SN_IMAGE: streamnative/sn-platform:2.9.2.20 + if: steps.list-changed.outputs.changed == 'true' + + + # Install the pulsar operator before testing the sn-platform + - name: Install the pulsar operator + if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + run: | + helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com + helm -n sn-system install sn charts/pulsar-operator --create-namespace + kubectl -n sn-system get deploy + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-pulsar-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-zookeeper-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-bookkeeper-controller-manager + helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/vault-operator + df -h + + - name: Run chart-testing (install) + run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: failure() + install-on-v1-22: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: clean disk + run: | + df -h + sudo swapoff -a + sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc "$AGENT_TOOLSDIRECTORY" + sudo apt clean + docker rmi $(docker images -q) -f + df -h + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" + fi + + - name: Create kind cluster + run: | + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.22.9 + docker pull "$SN_IMAGE" + kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" + + env: + KIND_VERSION: 0.14.0 + SN_IMAGE: streamnative/sn-platform:2.9.2.20 + if: steps.list-changed.outputs.changed == 'true' + + + # Install the pulsar operator before testing the sn-platform + - name: Install the pulsar operator + if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + run: | + helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com + helm -n sn-system install sn charts/pulsar-operator --create-namespace + kubectl -n sn-system get deploy + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-pulsar-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-zookeeper-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-bookkeeper-controller-manager + helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/vault-operator + df -h + + - name: Run chart-testing (install) + run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: failure() install-on-v1-23: runs-on: ubuntu-latest @@ -353,52 +445,75 @@ jobs: uses: mxschmitt/action-tmate@v3 if: failure() + install-on-v1-24: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: clean disk + run: | + df -h + sudo swapoff -a + sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc "$AGENT_TOOLSDIRECTORY" + sudo apt clean + docker rmi $(docker images -q) -f + df -h -# install-on-v1-24: -# runs-on: ubuntu-latest -# needs: basic-tests -# steps: -# - name: Checkout -# uses: actions/checkout@v2 -# with: -# fetch-depth: 0 -# -# - name: Set up Helm -# uses: azure/setup-helm@v1 -# with: -# version: v3.9.0 -# -# - uses: actions/setup-python@v2 -# with: -# python-version: 3.7 -# -# - name: Set up chart-testing -# uses: helm/chart-testing-action@v2.2.1 -# -# - name: Run chart-testing (list-changed) -# id: list-changed -# run: | -# changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) -# chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') -# if [[ -n "$changed" ]]; then -# echo "::set-output name=changed::true" -# echo "::set-output name=chart_name::$chart_name" -# fi -# -# - name: Create kind cluster -# uses: helm/kind-action@v1.3.0 -# with: -# node_image: kindest/node:v1.24.0 -# if: steps.list-changed.outputs.changed == 'true' -# -# # Install the pulsar operator before testing the sn-platform -# - name: Install the pulsar operator -# if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' -# run: | -# helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com -# helm -n sn-system install sn charts/pulsar-operator --create-namespace -# helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator -# -# - name: Run chart-testing (install) -# run: ct install + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.9.0 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.2.1 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + echo "::set-output name=chart_name::$chart_name" + fi + + - name: Create kind cluster + run: | + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.24.0 + docker pull "$SN_IMAGE" + kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" + + env: + KIND_VERSION: 0.14.0 + SN_IMAGE: streamnative/sn-platform:2.9.2.20 + if: steps.list-changed.outputs.changed == 'true' + + + # Install the pulsar operator before testing the sn-platform + - name: Install the pulsar operator + if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + run: | + helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com + helm -n sn-system install sn charts/pulsar-operator --create-namespace + kubectl -n sn-system get deploy + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-pulsar-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-zookeeper-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-bookkeeper-controller-manager + helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/vault-operator + df -h + + - name: Run chart-testing (install) + run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: failure() \ No newline at end of file From f1a9d1b819dc719ca78b0aa7dec3fb4d59460adc Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 21 Jul 2023 11:53:50 +0800 Subject: [PATCH 34/45] ci: upgrade dependencies --- .ci/ct.yaml | 3 ++ .github/workflows/chart_test.yml | 92 +++++++++++++++++--------------- 2 files changed, 53 insertions(+), 42 deletions(-) diff --git a/.ci/ct.yaml b/.ci/ct.yaml index 7811a7a1..912b91a4 100644 --- a/.ci/ct.yaml +++ b/.ci/ct.yaml @@ -19,6 +19,9 @@ chart-dirs: - charts +charts: + - pulsar-operator + - sn-platform debug: true helm-extra-args: --timeout 1200 diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index d722b889..e1961c0d 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -26,7 +26,9 @@ on: branches: - '*' paths: - - 'charts/**' + - 'charts/sn-platform' + - 'charts/sn-platform-slim' + - 'charts/pulsar-operator' - '.github/workflows/**' jobs: @@ -41,14 +43,14 @@ jobs: - name: Set up Helm uses: azure/setup-helm@v1 with: - version: v3.9.0 + version: v3.12.1 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.9 - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 + uses: helm/chart-testing-action@v2.4.0 - name: Run chart-testing (list-changed) id: list-changed @@ -100,14 +102,14 @@ jobs: - name: Set up Helm uses: azure/setup-helm@v1 with: - version: v3.9.0 + version: v3.12.1 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.9 - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 + uses: helm/chart-testing-action@v2.4.0 - name: Run chart-testing (list-changed) id: list-changed @@ -126,8 +128,8 @@ jobs: kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" env: - KIND_VERSION: 0.14.0 - SN_IMAGE: streamnative/sn-platform:2.9.2.20 + KIND_VERSION: 0.20.0 + SN_IMAGE: streamnative/sn-platform:2.10.4.3 if: steps.list-changed.outputs.changed == 'true' @@ -150,6 +152,7 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 + timeout-minutes: 10 if: failure() @@ -174,14 +177,14 @@ jobs: - name: Set up Helm uses: azure/setup-helm@v1 with: - version: v3.9.0 + version: v3.12.1 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.9 - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 + uses: helm/chart-testing-action@v2.4.0 - name: Run chart-testing (list-changed) id: list-changed @@ -200,8 +203,8 @@ jobs: kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" env: - KIND_VERSION: 0.14.0 - SN_IMAGE: streamnative/sn-platform:2.9.2.20 + KIND_VERSION: 0.20.0 + SN_IMAGE: streamnative/sn-platform:2.10.4.3 if: steps.list-changed.outputs.changed == 'true' @@ -224,6 +227,7 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 + timeout-minutes: 10 if: failure() @@ -248,14 +252,14 @@ jobs: - name: Set up Helm uses: azure/setup-helm@v1 with: - version: v3.9.0 + version: v3.12.1 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.9 - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 + uses: helm/chart-testing-action@v2.4.0 - name: Run chart-testing (list-changed) id: list-changed @@ -274,8 +278,8 @@ jobs: kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" env: - KIND_VERSION: 0.14.0 - SN_IMAGE: streamnative/sn-platform:2.9.2.20 + KIND_VERSION: 0.20.0 + SN_IMAGE: streamnative/sn-platform:2.10.4.3 if: steps.list-changed.outputs.changed == 'true' @@ -298,6 +302,7 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 + timeout-minutes: 10 if: failure() install-on-v1-22: runs-on: ubuntu-latest @@ -320,14 +325,14 @@ jobs: - name: Set up Helm uses: azure/setup-helm@v1 with: - version: v3.9.0 + version: v3.12.1 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.9 - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 + uses: helm/chart-testing-action@v2.4.0 - name: Run chart-testing (list-changed) id: list-changed @@ -346,8 +351,8 @@ jobs: kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" env: - KIND_VERSION: 0.14.0 - SN_IMAGE: streamnative/sn-platform:2.9.2.20 + KIND_VERSION: 0.20.0 + SN_IMAGE: streamnative/sn-platform:2.10.4.3 if: steps.list-changed.outputs.changed == 'true' @@ -370,6 +375,7 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 + timeout-minutes: 10 if: failure() install-on-v1-23: @@ -393,14 +399,14 @@ jobs: - name: Set up Helm uses: azure/setup-helm@v1 with: - version: v3.9.0 + version: v3.12.1 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.9 - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 + uses: helm/chart-testing-action@v2.4.0 - name: Run chart-testing (list-changed) id: list-changed @@ -419,8 +425,8 @@ jobs: kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" env: - KIND_VERSION: 0.14.0 - SN_IMAGE: streamnative/sn-platform:2.9.2.20 + KIND_VERSION: 0.20.0 + SN_IMAGE: streamnative/sn-platform:2.10.4.3 if: steps.list-changed.outputs.changed == 'true' @@ -443,6 +449,7 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 + timeout-minutes: 10 if: failure() install-on-v1-24: @@ -466,14 +473,14 @@ jobs: - name: Set up Helm uses: azure/setup-helm@v1 with: - version: v3.9.0 + version: v3.12.1 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.9 - name: Set up chart-testing - uses: helm/chart-testing-action@v2.2.1 + uses: helm/chart-testing-action@v2.4.0 - name: Run chart-testing (list-changed) id: list-changed @@ -492,8 +499,8 @@ jobs: kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" env: - KIND_VERSION: 0.14.0 - SN_IMAGE: streamnative/sn-platform:2.9.2.20 + KIND_VERSION: 0.20.0 + SN_IMAGE: streamnative/sn-platform:2.10.4.3 if: steps.list-changed.outputs.changed == 'true' @@ -516,4 +523,5 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 - if: failure() \ No newline at end of file + timeout-minutes: 10 + if: failure() From 2582e247e55d0ec159b68cd71051e9e58f01e8f5 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 21 Jul 2023 11:54:19 +0800 Subject: [PATCH 35/45] fix: spaces and indentation issues --- charts/sn-platform/templates/_helpers.tpl | 30 +++++++++---------- .../templates/broker/broker-cluster.yaml | 2 +- .../templates/grafana/grafana-pvc.yaml | 3 +- .../templates/prometheus/prometheus-pvc.yaml | 3 +- .../streamnative-console-pvc.yaml | 3 +- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/charts/sn-platform/templates/_helpers.tpl b/charts/sn-platform/templates/_helpers.tpl index 566a9ba5..e741d927 100644 --- a/charts/sn-platform/templates/_helpers.tpl +++ b/charts/sn-platform/templates/_helpers.tpl @@ -243,36 +243,36 @@ Define function for get authenticaiton environment variable {{- if .Values.auth.vault.enabled }} - name: PULSAR_PREFIX_OIDCTokenAudienceID valueFrom: - secretKeyRef: - name: {{ template "pulsar.vault-secret-key-name" . }} - key: PULSAR_PREFIX_OIDCTokenAudienceID + secretKeyRef: + name: {{ template "pulsar.vault-secret-key-name" . }} + key: PULSAR_PREFIX_OIDCTokenAudienceID {{- if and (eq .Component "proxy") .Values.auth.superUsers.proxyRolesEnabled }} - name: brokerClientAuthenticationParameters valueFrom: - secretKeyRef: - name: {{ template "pulsar.vault-secret-key-name" . }} - key: PROXY_brokerClientAuthenticationParameters + secretKeyRef: + name: {{ template "pulsar.vault-secret-key-name" . }} + key: PROXY_brokerClientAuthenticationParameters {{- else }} - name: brokerClientAuthenticationParameters valueFrom: - secretKeyRef: - name: {{ template "pulsar.vault-secret-key-name" . }} - key: brokerClientAuthenticationParameters + secretKeyRef: + name: {{ template "pulsar.vault-secret-key-name" . }} + key: brokerClientAuthenticationParameters {{- end }} {{- end }} {{- if .Values.auth.authentication.jwt.enabled }} {{- if and (eq .Component "proxy") .Values.auth.superUsers.proxyRolesEnabled }} - name: brokerClientAuthenticationParameters valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-token-proxy-admin - key: TOKEN + secretKeyRef: + name: {{ .Release.Name }}-token-proxy-admin + key: TOKEN {{- else }} - name: brokerClientAuthenticationParameters valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-token-admin - key: TOKEN + secretKeyRef: + name: {{ .Release.Name }}-token-admin + key: TOKEN {{- end }} {{- if .Values.auth.authentication.jwt.usingSecretKey }} - name: tokenSecretKey diff --git a/charts/sn-platform/templates/broker/broker-cluster.yaml b/charts/sn-platform/templates/broker/broker-cluster.yaml index b833d0f2..05779d76 100644 --- a/charts/sn-platform/templates/broker/broker-cluster.yaml +++ b/charts/sn-platform/templates/broker/broker-cluster.yaml @@ -350,7 +350,7 @@ spec: name: "{{ template "pulsar.fullname" . }}-{{ .Values.zookeeper.customTools.restore.component }}" {{- end }} {{- if .Values.broker.resources }} - resources: {{- toYaml .Values.broker.resources | nindent 10 }} + resources: {{- toYaml .Values.broker.resources | nindent 6 }} {{- end }} {{- if or .Values.tls.broker.enabled .Values.broker.extraVolumeMounts .Values.broker.extraVolumeClaimTemplates }} apiObjects: diff --git a/charts/sn-platform/templates/grafana/grafana-pvc.yaml b/charts/sn-platform/templates/grafana/grafana-pvc.yaml index d2765e5e..8e8d1da1 100644 --- a/charts/sn-platform/templates/grafana/grafana-pvc.yaml +++ b/charts/sn-platform/templates/grafana/grafana-pvc.yaml @@ -29,7 +29,8 @@ spec: resources: requests: storage: {{ .Values.grafana.volumes.data.size }} - accessModes: [ "ReadWriteOnce" ] + accessModes: + - "ReadWriteOnce" {{- if .Values.grafana.volumes.data.storageClass }} storageClassName: "{{ template "pulsar.grafana.volumes.pvc.name" . }}}" {{- else if .Values.grafana.volumes.data.storageClassName }} diff --git a/charts/sn-platform/templates/prometheus/prometheus-pvc.yaml b/charts/sn-platform/templates/prometheus/prometheus-pvc.yaml index 6d46fe74..eccf88fe 100644 --- a/charts/sn-platform/templates/prometheus/prometheus-pvc.yaml +++ b/charts/sn-platform/templates/prometheus/prometheus-pvc.yaml @@ -29,7 +29,8 @@ spec: resources: requests: storage: {{ .Values.prometheus.volumes.data.size }} - accessModes: [ "ReadWriteOnce" ] + accessModes: + - "ReadWriteOnce" {{- if .Values.prometheus.volumes.data.storageClass }} storageClassName: "{{ template "pulsar.prometheus.data.pvc.name" . }}" {{- else if .Values.prometheus.volumes.data.storageClassName }} diff --git a/charts/sn-platform/templates/streamnative-console/streamnative-console-pvc.yaml b/charts/sn-platform/templates/streamnative-console/streamnative-console-pvc.yaml index 747e1724..f2f96357 100644 --- a/charts/sn-platform/templates/streamnative-console/streamnative-console-pvc.yaml +++ b/charts/sn-platform/templates/streamnative-console/streamnative-console-pvc.yaml @@ -29,7 +29,8 @@ spec: resources: requests: storage: {{ .Values.streamnative_console.volumes.data.size }} - accessModes: [ "ReadWriteOnce" ] + accessModes: + - "ReadWriteOnce" {{- if .Values.streamnative_console.volumes.data.storageClass }} storageClassName: "{{ template "pulsar.streamnative_console.data.pvc.name" . }}" {{- else if .Values.streamnative_console.volumes.data.storageClassName }} From abfaa5fd9a7347a1280343bcaa0157b5088176f3 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 21 Jul 2023 11:54:36 +0800 Subject: [PATCH 36/45] ci: bump chart version to trigger test --- charts/sn-platform/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/sn-platform/Chart.yaml b/charts/sn-platform/Chart.yaml index e51462a5..c5f3d2b1 100644 --- a/charts/sn-platform/Chart.yaml +++ b/charts/sn-platform/Chart.yaml @@ -21,7 +21,7 @@ apiVersion: v1 appVersion: "2.10.4" description: StreamNative Platform Chart name: sn-platform -version: 1.10.0 +version: 1.10.1 home: https://streamnative.io sources: - https://github.com/streamnative/charts/tree/master/charts/sn-platform From 4917f8a0d6fbcd78a7ad66bd5a09eba4504df235 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 21 Jul 2023 12:08:20 +0800 Subject: [PATCH 37/45] fix: chart path --- .ci/ct.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/ct.yaml b/.ci/ct.yaml index 912b91a4..6290483a 100644 --- a/.ci/ct.yaml +++ b/.ci/ct.yaml @@ -20,8 +20,8 @@ chart-dirs: - charts charts: - - pulsar-operator - - sn-platform + - charts/pulsar-operator + - charts/sn-platform debug: true helm-extra-args: --timeout 1200 From 77c8370ef38106bab782a2f7e9e72f7787b0bc89 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 21 Jul 2023 12:21:04 +0800 Subject: [PATCH 38/45] ci: remove deleted function-mesh-operator --- ct.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/ct.yaml b/ct.yaml index c6999802..eeef1265 100644 --- a/ct.yaml +++ b/ct.yaml @@ -23,7 +23,6 @@ charts: - charts/local-storage-provisioner - charts/image-puller - charts/pulsar-operator - - charts/function-mesh-operator - charts/sn-platform - charts/pulsar debug: true From 4f60189e59ba86508f5c31d5da681c1f7bb086c6 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 21 Jul 2023 12:23:07 +0800 Subject: [PATCH 39/45] fix: helm unittest param issue --- .github/workflows/chart_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index e1961c0d..87dccd49 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -79,7 +79,7 @@ jobs: if: steps.list-changed.outputs.changed == 'true' run: | helm plugin install https://github.com/quintush/helm-unittest - helm unittest -3 ${{ steps.list-changed.outputs.chart_name }} + helm unittest ${{ steps.list-changed.outputs.chart_name }} install-on-v1-18: runs-on: ubuntu-latest From 6484335ea5505951f4b9774b718a33bbc74e83e5 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 21 Jul 2023 12:35:29 +0800 Subject: [PATCH 40/45] ci: remove the push trigger --- .github/workflows/chart_test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 87dccd49..bbdd270e 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -19,9 +19,6 @@ name: Chart Test on: - push: - paths: - - '.github/workflows/chart_test.yml' pull_request: branches: - '*' @@ -30,6 +27,7 @@ on: - 'charts/sn-platform-slim' - 'charts/pulsar-operator' - '.github/workflows/**' + - '.ci/ct.yaml' jobs: basic-tests: From 5b143ceded3c81475462565d8060417c422401e2 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 21 Jul 2023 12:42:06 +0800 Subject: [PATCH 41/45] ci: optimize the deprecated action command --- .github/workflows/chart_test.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index bbdd270e..13b716ab 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -56,8 +56,8 @@ jobs: changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" + echo "changed=true" >> $GITHUB_OUTPUT + echo "chart_name=$chart_name" >> $GITHUB_OUTPUT fi - name: Run chart-testing (lint) @@ -115,8 +115,8 @@ jobs: changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" + echo "changed=true" >> $GITHUB_OUTPUT + echo "chart_name=$chart_name" >> $GITHUB_OUTPUT fi - name: Create kind cluster @@ -190,8 +190,8 @@ jobs: changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" + echo "changed=true" >> $GITHUB_OUTPUT + echo "chart_name=$chart_name" >> $GITHUB_OUTPUT fi - name: Create kind cluster @@ -265,8 +265,8 @@ jobs: changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" + echo "changed=true" >> $GITHUB_OUTPUT + echo "chart_name=$chart_name" >> $GITHUB_OUTPUT fi - name: Create kind cluster @@ -338,8 +338,8 @@ jobs: changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" + echo "changed=true" >> $GITHUB_OUTPUT + echo "chart_name=$chart_name" >> $GITHUB_OUTPUT fi - name: Create kind cluster @@ -412,8 +412,8 @@ jobs: changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" + echo "changed=true" >> $GITHUB_OUTPUT + echo "chart_name=$chart_name" >> $GITHUB_OUTPUT fi - name: Create kind cluster @@ -486,8 +486,8 @@ jobs: changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - echo "::set-output name=chart_name::$chart_name" + echo "changed=true" >> $GITHUB_OUTPUT + echo "chart_name=$chart_name" >> $GITHUB_OUTPUT fi - name: Create kind cluster From 398dae517c1b883da63dff52b133c5ed70ed4fac Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 21 Jul 2023 17:35:06 +0800 Subject: [PATCH 42/45] ci: remove k8s 1.18,1.19, and add 1.25,1.26,1.27 in test --- .github/workflows/chart_test.yml | 180 ++++++++++++++++++++++++++++--- 1 file changed, 165 insertions(+), 15 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 13b716ab..6c8d4347 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -67,7 +67,7 @@ jobs: - name: Run template test if: steps.list-changed.outputs.changed == 'true' run: | - for i in v1.19.0 v1.20.0 v1.21.0 v1.22.0 v1.23.0 v1.24.0 + for i in v1.20.0 v1.21.0 v1.22.0 v1.23.0 v1.24.0 v1.25.0 v1.26.0 v1.27.0 do helm template test ${{ steps.list-changed.outputs.chart_name }} --kube-version $i> $i.yaml yamllint $i.yaml --config-file lintconf.yaml @@ -79,7 +79,7 @@ jobs: helm plugin install https://github.com/quintush/helm-unittest helm unittest ${{ steps.list-changed.outputs.chart_name }} - install-on-v1-18: + install-on-v1-20: runs-on: ubuntu-latest needs: basic-tests steps: @@ -121,7 +121,7 @@ jobs: - name: Create kind cluster run: | - ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.18.20 + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.20.15 docker pull "$SN_IMAGE" kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" @@ -153,8 +153,81 @@ jobs: timeout-minutes: 10 if: failure() + install-on-v1-21: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: clean disk + run: | + df -h + sudo swapoff -a + sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc "$AGENT_TOOLSDIRECTORY" + sudo apt clean + docker rmi $(docker images -q) -f + df -h + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.12.1 + + - uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.4.0 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') + if [[ -n "$changed" ]]; then + echo "changed=true" >> $GITHUB_OUTPUT + echo "chart_name=$chart_name" >> $GITHUB_OUTPUT + fi + + - name: Create kind cluster + run: | + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.21.14 + docker pull "$SN_IMAGE" + kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" + + env: + KIND_VERSION: 0.20.0 + SN_IMAGE: streamnative/sn-platform:2.10.4.3 + if: steps.list-changed.outputs.changed == 'true' + - install-on-v1-19: + # Install the pulsar operator before testing the sn-platform + - name: Install the pulsar operator + if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + run: | + helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com + helm -n sn-system install sn charts/pulsar-operator --create-namespace + kubectl -n sn-system get deploy + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-pulsar-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-zookeeper-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-bookkeeper-controller-manager + helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/vault-operator + df -h + + - name: Run chart-testing (install) + run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 10 + if: failure() + + install-on-v1-22: runs-on: ubuntu-latest needs: basic-tests steps: @@ -196,7 +269,7 @@ jobs: - name: Create kind cluster run: | - ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.19.11 + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.22.17 docker pull "$SN_IMAGE" kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" @@ -227,9 +300,8 @@ jobs: uses: mxschmitt/action-tmate@v3 timeout-minutes: 10 if: failure() - - install-on-v1-20: + install-on-v1-23: runs-on: ubuntu-latest needs: basic-tests steps: @@ -271,7 +343,7 @@ jobs: - name: Create kind cluster run: | - ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.21.12 + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.23.17 docker pull "$SN_IMAGE" kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" @@ -302,7 +374,8 @@ jobs: uses: mxschmitt/action-tmate@v3 timeout-minutes: 10 if: failure() - install-on-v1-22: + + install-on-v1-24: runs-on: ubuntu-latest needs: basic-tests steps: @@ -344,7 +417,7 @@ jobs: - name: Create kind cluster run: | - ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.22.9 + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.24.15 docker pull "$SN_IMAGE" kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" @@ -376,7 +449,8 @@ jobs: timeout-minutes: 10 if: failure() - install-on-v1-23: + + install-on-v1-25: runs-on: ubuntu-latest needs: basic-tests steps: @@ -418,7 +492,7 @@ jobs: - name: Create kind cluster run: | - ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.23.6 + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.25.11 docker pull "$SN_IMAGE" kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" @@ -449,8 +523,9 @@ jobs: uses: mxschmitt/action-tmate@v3 timeout-minutes: 10 if: failure() - - install-on-v1-24: + + + install-on-v1-26: runs-on: ubuntu-latest needs: basic-tests steps: @@ -492,7 +567,7 @@ jobs: - name: Create kind cluster run: | - ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.24.0 + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.26.6 docker pull "$SN_IMAGE" kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" @@ -523,3 +598,78 @@ jobs: uses: mxschmitt/action-tmate@v3 timeout-minutes: 10 if: failure() + + + install-on-v1-27: + runs-on: ubuntu-latest + needs: basic-tests + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: clean disk + run: | + df -h + sudo swapoff -a + sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc "$AGENT_TOOLSDIRECTORY" + sudo apt clean + docker rmi $(docker images -q) -f + df -h + + - name: Set up Helm + uses: azure/setup-helm@v1 + with: + version: v3.12.1 + + - uses: actions/setup-python@v4 + with: + python-version: 3.9 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.4.0 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') + if [[ -n "$changed" ]]; then + echo "changed=true" >> $GITHUB_OUTPUT + echo "chart_name=$chart_name" >> $GITHUB_OUTPUT + fi + + - name: Create kind cluster + run: | + ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.27.3 + docker pull "$SN_IMAGE" + kind load docker-image --name pulsar-dev --nodes pulsar-dev-worker "$SN_IMAGE" + + env: + KIND_VERSION: 0.20.0 + SN_IMAGE: streamnative/sn-platform:2.10.4.3 + if: steps.list-changed.outputs.changed == 'true' + + + # Install the pulsar operator before testing the sn-platform + - name: Install the pulsar operator + if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + run: | + helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com + helm -n sn-system install sn charts/pulsar-operator --create-namespace + kubectl -n sn-system get deploy + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-pulsar-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-zookeeper-controller-manager + kubectl -n sn-system wait --for condition=available --timeout=360s deployment/sn-pulsar-operator-bookkeeper-controller-manager + helm -n sn-system upgrade --install vault-operator banzaicloud-stable/vault-operator + kubectl -nsn-system wait --for condition=available --timeout=360s deployment/vault-operator + df -h + + - name: Run chart-testing (install) + run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + timeout-minutes: 10 + if: failure() \ No newline at end of file From f9e055c213d152811d0d87facd6690985a04c7d8 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Fri, 21 Jul 2023 17:35:25 +0800 Subject: [PATCH 43/45] chore: reset sn-platform chart version --- charts/sn-platform/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/sn-platform/Chart.yaml b/charts/sn-platform/Chart.yaml index c5f3d2b1..e51462a5 100644 --- a/charts/sn-platform/Chart.yaml +++ b/charts/sn-platform/Chart.yaml @@ -21,7 +21,7 @@ apiVersion: v1 appVersion: "2.10.4" description: StreamNative Platform Chart name: sn-platform -version: 1.10.1 +version: 1.10.0 home: https://streamnative.io sources: - https://github.com/streamnative/charts/tree/master/charts/sn-platform From 8c67dc82157882cd38f8695f5cb4ce8ca2e3f346 Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Sat, 22 Jul 2023 01:52:06 +0800 Subject: [PATCH 44/45] ci: use output to pass chart_name between jobs --- .github/workflows/chart_test.yml | 132 +++++++------------------------ 1 file changed, 28 insertions(+), 104 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index 6c8d4347..e4a12b2d 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -32,6 +32,10 @@ on: jobs: basic-tests: runs-on: ubuntu-latest + outputs: + changed: ${{ steps.list-changed.outputs.changed }} + chart_name: ${{ steps.list-changed.outputs.chart_name }} + steps: - name: Checkout uses: actions/checkout@v2 @@ -109,16 +113,6 @@ jobs: - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "changed=true" >> $GITHUB_OUTPUT - echo "chart_name=$chart_name" >> $GITHUB_OUTPUT - fi - - name: Create kind cluster run: | ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.20.15 @@ -128,12 +122,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: steps.list-changed.outputs.changed == 'true' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -146,7 +140,7 @@ jobs: df -h - name: Run chart-testing (install) - run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -183,16 +177,6 @@ jobs: - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "changed=true" >> $GITHUB_OUTPUT - echo "chart_name=$chart_name" >> $GITHUB_OUTPUT - fi - - name: Create kind cluster run: | ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.21.14 @@ -202,12 +186,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: steps.list-changed.outputs.changed == 'true' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -220,7 +204,7 @@ jobs: df -h - name: Run chart-testing (install) - run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -257,16 +241,6 @@ jobs: - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "changed=true" >> $GITHUB_OUTPUT - echo "chart_name=$chart_name" >> $GITHUB_OUTPUT - fi - - name: Create kind cluster run: | ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.22.17 @@ -276,12 +250,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: steps.list-changed.outputs.changed == 'true' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -294,7 +268,7 @@ jobs: df -h - name: Run chart-testing (install) - run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -331,16 +305,6 @@ jobs: - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "changed=true" >> $GITHUB_OUTPUT - echo "chart_name=$chart_name" >> $GITHUB_OUTPUT - fi - - name: Create kind cluster run: | ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.23.17 @@ -350,12 +314,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: steps.list-changed.outputs.changed == 'true' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -368,7 +332,7 @@ jobs: df -h - name: Run chart-testing (install) - run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -405,16 +369,6 @@ jobs: - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "changed=true" >> $GITHUB_OUTPUT - echo "chart_name=$chart_name" >> $GITHUB_OUTPUT - fi - - name: Create kind cluster run: | ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.24.15 @@ -424,12 +378,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: steps.list-changed.outputs.changed == 'true' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -442,7 +396,7 @@ jobs: df -h - name: Run chart-testing (install) - run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -480,16 +434,6 @@ jobs: - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "changed=true" >> $GITHUB_OUTPUT - echo "chart_name=$chart_name" >> $GITHUB_OUTPUT - fi - - name: Create kind cluster run: | ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.25.11 @@ -499,12 +443,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: steps.list-changed.outputs.changed == 'true' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -517,7 +461,7 @@ jobs: df -h - name: Run chart-testing (install) - run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -555,16 +499,6 @@ jobs: - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "changed=true" >> $GITHUB_OUTPUT - echo "chart_name=$chart_name" >> $GITHUB_OUTPUT - fi - - name: Create kind cluster run: | ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.26.6 @@ -574,12 +508,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: steps.list-changed.outputs.changed == 'true' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -592,7 +526,7 @@ jobs: df -h - name: Run chart-testing (install) - run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -630,16 +564,6 @@ jobs: - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then - echo "changed=true" >> $GITHUB_OUTPUT - echo "chart_name=$chart_name" >> $GITHUB_OUTPUT - fi - - name: Create kind cluster run: | ./hack/kind-cluster-build.sh --nodeNum 3 --k8sVersion v1.27.3 @@ -649,12 +573,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: steps.list-changed.outputs.changed == 'true' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: steps.list-changed.outputs.changed == 'true' && steps.list-changed.outputs.chart_name == 'charts/sn-platform' + if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -667,7 +591,7 @@ jobs: df -h - name: Run chart-testing (install) - run: ct install --debug --config ct.yaml --print-config --charts charts/sn-platform + run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 From c440e0836ef3e07a3fe2803b60f3c386c053d27e Mon Sep 17 00:00:00 2001 From: Fushu Wang Date: Sat, 12 Aug 2023 12:49:52 +0800 Subject: [PATCH 45/45] ci: fix if condition --- .github/workflows/chart_test.yml | 88 +++++++++++++++++++++++++------- 1 file changed, 69 insertions(+), 19 deletions(-) diff --git a/.github/workflows/chart_test.yml b/.github/workflows/chart_test.yml index e4a12b2d..40b15dd5 100644 --- a/.github/workflows/chart_test.yml +++ b/.github/workflows/chart_test.yml @@ -57,11 +57,13 @@ jobs: - name: Run chart-testing (list-changed) id: list-changed run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml) - chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>') - if [[ -n "$changed" ]]; then + chart_name=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --config .ci/ct.yaml | grep -v '>>>' || echo '') + if [[ -n "$chart_name" ]]; then echo "changed=true" >> $GITHUB_OUTPUT echo "chart_name=$chart_name" >> $GITHUB_OUTPUT + else + echo "changed=false" >> $GITHUB_OUTPUT + echo "chart_name=$chart_name" >> $GITHUB_OUTPUT fi - name: Run chart-testing (lint) @@ -91,6 +93,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: clean disk run: | @@ -100,18 +103,22 @@ jobs: sudo apt clean docker rmi $(docker images -q) -f df -h + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up Helm uses: azure/setup-helm@v1 with: version: v3.12.1 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - uses: actions/setup-python@v4 with: python-version: 3.9 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Create kind cluster run: | @@ -122,12 +129,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: ${{ needs.basic-tests.outputs.changed }} == 'true' + if: ${{ needs.basic-tests.outputs.changed == 'true' }} # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' + if: ${{ needs.basic-tests.outputs.changed == 'true' && needs.basic-tests.outputs.chart_name != 'charts/pulsar-operator' }} run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -141,6 +148,7 @@ jobs: - name: Run chart-testing (install) run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -155,6 +163,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: clean disk run: | @@ -164,18 +173,22 @@ jobs: sudo apt clean docker rmi $(docker images -q) -f df -h + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up Helm uses: azure/setup-helm@v1 with: version: v3.12.1 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - uses: actions/setup-python@v4 with: python-version: 3.9 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Create kind cluster run: | @@ -186,12 +199,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: ${{ needs.basic-tests.outputs.changed }} == 'true' + if: ${{ needs.basic-tests.outputs.changed == 'true' }} # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' + if: ${{ needs.basic-tests.outputs.changed == 'true' && needs.basic-tests.outputs.chart_name != 'charts/pulsar-operator' }} run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -205,6 +218,7 @@ jobs: - name: Run chart-testing (install) run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -219,6 +233,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: clean disk run: | @@ -228,18 +243,22 @@ jobs: sudo apt clean docker rmi $(docker images -q) -f df -h + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up Helm uses: azure/setup-helm@v1 with: version: v3.12.1 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - uses: actions/setup-python@v4 with: python-version: 3.9 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Create kind cluster run: | @@ -250,12 +269,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: ${{ needs.basic-tests.outputs.changed }} == 'true' + if: ${{ needs.basic-tests.outputs.changed == 'true' }} # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' + if: ${{ needs.basic-tests.outputs.changed == 'true' && needs.basic-tests.outputs.chart_name != 'charts/pulsar-operator' }} run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -269,6 +288,7 @@ jobs: - name: Run chart-testing (install) run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -283,6 +303,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: clean disk run: | @@ -292,18 +313,22 @@ jobs: sudo apt clean docker rmi $(docker images -q) -f df -h + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up Helm uses: azure/setup-helm@v1 with: version: v3.12.1 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - uses: actions/setup-python@v4 with: python-version: 3.9 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Create kind cluster run: | @@ -314,12 +339,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: ${{ needs.basic-tests.outputs.changed }} == 'true' + if: ${{ needs.basic-tests.outputs.changed == 'true' }} # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' + if: ${{ needs.basic-tests.outputs.changed == 'true' && needs.basic-tests.outputs.chart_name != 'charts/pulsar-operator' }} run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -333,6 +358,7 @@ jobs: - name: Run chart-testing (install) run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -347,6 +373,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: clean disk run: | @@ -356,18 +383,22 @@ jobs: sudo apt clean docker rmi $(docker images -q) -f df -h + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up Helm uses: azure/setup-helm@v1 with: version: v3.12.1 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - uses: actions/setup-python@v4 with: python-version: 3.9 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Create kind cluster run: | @@ -378,12 +409,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: ${{ needs.basic-tests.outputs.changed }} == 'true' + if: ${{ needs.basic-tests.outputs.changed == 'true' }} # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' + if: ${{ needs.basic-tests.outputs.changed == 'true' && needs.basic-tests.outputs.chart_name != 'charts/pulsar-operator' }} run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -397,6 +428,7 @@ jobs: - name: Run chart-testing (install) run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -412,6 +444,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: clean disk run: | @@ -421,18 +454,22 @@ jobs: sudo apt clean docker rmi $(docker images -q) -f df -h + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up Helm uses: azure/setup-helm@v1 with: version: v3.12.1 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - uses: actions/setup-python@v4 with: python-version: 3.9 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Create kind cluster run: | @@ -443,12 +480,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: ${{ needs.basic-tests.outputs.changed }} == 'true' + if: ${{ needs.basic-tests.outputs.changed == 'true' }} # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' + if: ${{ needs.basic-tests.outputs.changed == 'true' && needs.basic-tests.outputs.chart_name != 'charts/pulsar-operator' }} run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -462,6 +499,7 @@ jobs: - name: Run chart-testing (install) run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -477,6 +515,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: clean disk run: | @@ -486,18 +525,22 @@ jobs: sudo apt clean docker rmi $(docker images -q) -f df -h + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up Helm uses: azure/setup-helm@v1 with: version: v3.12.1 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - uses: actions/setup-python@v4 with: python-version: 3.9 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Create kind cluster run: | @@ -508,12 +551,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: ${{ needs.basic-tests.outputs.changed }} == 'true' + if: ${{ needs.basic-tests.outputs.changed == 'true' }} # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' + if: ${{ needs.basic-tests.outputs.changed == 'true' && needs.basic-tests.outputs.chart_name != 'charts/pulsar-operator' }} run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -527,6 +570,7 @@ jobs: - name: Run chart-testing (install) run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 @@ -542,6 +586,7 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: clean disk run: | @@ -551,18 +596,22 @@ jobs: sudo apt clean docker rmi $(docker images -q) -f df -h + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up Helm uses: azure/setup-helm@v1 with: version: v3.12.1 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - uses: actions/setup-python@v4 with: python-version: 3.9 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Set up chart-testing uses: helm/chart-testing-action@v2.4.0 + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Create kind cluster run: | @@ -573,12 +622,12 @@ jobs: env: KIND_VERSION: 0.20.0 SN_IMAGE: streamnative/sn-platform:2.10.4.3 - if: ${{ needs.basic-tests.outputs.changed }} == 'true' + if: ${{ needs.basic-tests.outputs.changed == 'true' }} # Install the pulsar operator before testing the sn-platform - name: Install the pulsar operator - if: ${{ needs.basic-tests.outputs.changed }} == 'true' && ${{ needs.basic-tests.outputs.chart_name }} != 'charts/pulsar-operator' + if: ${{ needs.basic-tests.outputs.changed == 'true' && needs.basic-tests.outputs.chart_name != 'charts/pulsar-operator' }} run: | helm repo add banzaicloud-stable https://kubernetes-charts.banzaicloud.com helm -n sn-system install sn charts/pulsar-operator --create-namespace @@ -592,6 +641,7 @@ jobs: - name: Run chart-testing (install) run: ct install --debug --config ct.yaml --print-config --charts ${{ needs.basic-tests.outputs.chart_name }} + if: ${{ needs.basic-tests.outputs.changed == 'true' }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3