From 6c7f07bfa2051bb6a5f21a5f7be90c4ea617366b Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Mon, 31 Jul 2023 19:34:55 +0200 Subject: [PATCH] fix(ci): use our helm charts to install dependencies from, to ensure operator validation works in ci (#11093) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** Currently CI uses static manifests for fetching operator dependencies during testing. Lets use helm-charts instead. **โš™๏ธ Type of change** - [x] โš™๏ธ Feature/App addition - [x] ๐Ÿช› Bugfix - [ ] โš ๏ธ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] ๐Ÿ”ƒ Refactor of current code **๐Ÿงช How Has This Been Tested?** **๐Ÿ“ƒ Notes:** **โœ”๏ธ Checklist:** - [ ] โš–๏ธ My code follows the style guidelines of this project - [ ] ๐Ÿ‘€ I have performed a self-review of my own code - [ ] #๏ธโƒฃ I have commented my code, particularly in hard-to-understand areas - [ ] ๐Ÿ“„ I have made corresponding changes to the documentation - [ ] โš ๏ธ My changes generate no new warnings - [ ] ๐Ÿงช I have added tests to this description that prove my fix is effective or that my feature works - [ ] โฌ†๏ธ I increased versions for any altered app according to semantic versioning **โž• App addition** If this PR is an app addition please make sure you have done the following. - [ ] ๐Ÿชž I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] ๐Ÿ–ผ๏ธ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --- .github/workflows/charts-test.yaml | 71 +++++++++++++++------- charts/enterprise/clusterissuer/Chart.yaml | 2 +- 2 files changed, 51 insertions(+), 22 deletions(-) diff --git a/.github/workflows/charts-test.yaml b/.github/workflows/charts-test.yaml index 64e6768a079..0583bfb5725 100644 --- a/.github/workflows/charts-test.yaml +++ b/.github/workflows/charts-test.yaml @@ -146,18 +146,28 @@ jobs: run: | kubectl taint --all=true nodes node.cloudprovider.kubernetes.io/uninitialized- || true + - name: Prep Helm + run: | + helm repo add truecharts https://charts.truecharts.org + helm repo add truecharts-deps https://deps.truecharts.org + helm repo add truecharts-library https://library-charts.truecharts.org + helm repo add jetstack https://charts.jetstack.io + helm repo update + - name: Add Dependencies run: | - ## TODO: Move to our Helm Charts - ## TODO: Only add when required if [[ "${{ matrix.chart }}" == "charts/operators/metallb-config" ]]; then - kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.10/config/manifests/metallb-native.yaml --server-side --force-conflicts || echo "error fetching metallb manifest" + helm install metallb truecharts/metallb --namespace metallb --create-namespace --wait + fi + ## TODO: Only add when required + if [[ "${{ matrix.chart }}" == "charts/enterprise/clusterissuer" ]]; then + helm install cert-manager truecharts/cert-manager --namespace cert-manager --create-namespace --wait fi if [[ "${{ matrix.chart }}" != "charts/operators/cloudnative-pg" ]]; then - kubectl apply -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.20/releases/cnpg-1.20.0.yaml --server-side --force-conflicts || echo "error fetching cnpg manifest" + helm install cloudnative-pg truecharts/cloudnative-pg --namespace cloudnative-pg --create-namespace --wait fi if [[ "${{ matrix.chart }}" != "charts/operators/prometheus-operator" ]]; then - kubectl apply -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.66.0/bundle.yaml --server-side --force-conflicts || echo "error fetching prometheus operator manifest" + helm install prometheus-operator truecharts/prometheus-operator --namespace prometheus-operator --create-namespace --wait fi - name: Run chart-testing (install) @@ -209,13 +219,17 @@ jobs: - name: Add Dependencies run: | if [[ "${{ matrix.chart }}" == "charts/operators/metallb-config" ]]; then - kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.10/config/manifests/metallb-native.yaml --server-side --force-conflicts || echo "error fetching metallb manifest" + helm install metallb truecharts/metallb --namespace metallb --create-namespace --wait + fi + ## TODO: Only add when required + if [[ "${{ matrix.chart }}" == "charts/enterprise/clusterissuer" ]]; then + helm install cert-manager truecharts/cert-manager --namespace cert-manager --create-namespace --wait fi if [[ "${{ matrix.chart }}" != "charts/operators/cloudnative-pg" ]]; then - kubectl apply -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.17/releases/cnpg-1.17.5.yaml --server-side --force-conflicts || echo "error fetching cnpg manifest" + helm install cloudnative-pg truecharts/cloudnative-pg --namespace cloudnative-pg --create-namespace --wait fi if [[ "${{ matrix.chart }}" != "charts/operators/prometheus-operator" ]]; then - kubectl apply -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.66.0/bundle.yaml --server-side --force-conflicts || echo "error fetching prometheus operator manifest" + helm install prometheus-operator truecharts/prometheus-operator --namespace prometheus-operator --create-namespace --wait fi - name: Run chart-testing (install) @@ -267,13 +281,17 @@ jobs: - name: Add Dependencies run: | if [[ "${{ matrix.chart }}" == "charts/operators/metallb-config" ]]; then - kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.10/config/manifests/metallb-native.yaml --server-side --force-conflicts || echo "error fetching metallb manifest" + helm install metallb truecharts/metallb --namespace metallb --create-namespace --wait + fi + ## TODO: Only add when required + if [[ "${{ matrix.chart }}" == "charts/enterprise/clusterissuer" ]]; then + helm install cert-manager truecharts/cert-manager --namespace cert-manager --create-namespace --wait fi if [[ "${{ matrix.chart }}" != "charts/operators/cloudnative-pg" ]]; then - kubectl apply -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.17/releases/cnpg-1.17.5.yaml --server-side --force-conflicts || echo "error fetching cnpg manifest" + helm install cloudnative-pg truecharts/cloudnative-pg --namespace cloudnative-pg --create-namespace --wait fi if [[ "${{ matrix.chart }}" != "charts/operators/prometheus-operator" ]]; then - kubectl apply -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.66.0/bundle.yaml --server-side --force-conflicts || echo "error fetching prometheus operator manifest" + helm install prometheus-operator truecharts/prometheus-operator --namespace prometheus-operator --create-namespace --wait fi - name: Run chart-testing (install) @@ -325,13 +343,17 @@ jobs: - name: Add Dependencies run: | if [[ "${{ matrix.chart }}" == "charts/operators/metallb-config" ]]; then - kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.10/config/manifests/metallb-native.yaml --server-side --force-conflicts || echo "error fetching metallb manifest" + helm install metallb truecharts/metallb --namespace metallb --create-namespace --wait + fi + ## TODO: Only add when required + if [[ "${{ matrix.chart }}" == "charts/enterprise/clusterissuer" ]]; then + helm install cert-manager truecharts/cert-manager --namespace cert-manager --create-namespace --wait fi if [[ "${{ matrix.chart }}" != "charts/operators/cloudnative-pg" ]]; then - kubectl apply -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.17/releases/cnpg-1.17.5.yaml --server-side --force-conflicts || echo "error fetching cnpg manifest" + helm install cloudnative-pg truecharts/cloudnative-pg --namespace cloudnative-pg --create-namespace --wait fi if [[ "${{ matrix.chart }}" != "charts/operators/prometheus-operator" ]]; then - kubectl apply -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.66.0/bundle.yaml --server-side --force-conflicts || echo "error fetching prometheus operator manifest" + helm install prometheus-operator truecharts/prometheus-operator --namespace prometheus-operator --create-namespace --wait fi - name: Run chart-testing (install) @@ -383,15 +405,18 @@ jobs: - name: Add Dependencies run: | if [[ "${{ matrix.chart }}" == "charts/operators/metallb-config" ]]; then - kubectl apply -f --server-side --force-conflicts https://raw.githubusercontent.com/metallb/metallb/v0.13.10/config/manifests/metallb-native.yaml + helm install metallb truecharts/metallb --namespace metallb --create-namespace --wait + fi + ## TODO: Only add when required + if [[ "${{ matrix.chart }}" == "charts/enterprise/clusterissuer" ]]; then + helm install cert-manager truecharts/cert-manager --namespace cert-manager --create-namespace --wait fi if [[ "${{ matrix.chart }}" != "charts/operators/cloudnative-pg" ]]; then - kubectl apply -f --server-side --force-conflicts https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.17/releases/cnpg-1.17.5.yaml + helm install cloudnative-pg truecharts/cloudnative-pg --namespace cloudnative-pg --create-namespace --wait fi if [[ "${{ matrix.chart }}" != "charts/operators/prometheus-operator" ]]; then - kubectl apply -f --server-side --force-conflicts --server-side --force-conflicts https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.66.0/bundle.yaml + helm install prometheus-operator truecharts/prometheus-operator --namespace prometheus-operator --create-namespace --wait fi - - name: Run chart-testing (install) run: ct install --config ".github/ct-install.yaml" --charts "${{ matrix.chart }}" # --upgrade @@ -441,13 +466,17 @@ jobs: - name: Add Dependencies run: | if [[ "${{ matrix.chart }}" == "charts/operators/metallb-config" ]]; then - kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.10/config/manifests/metallb-native.yaml --server-side --force-conflicts || echo "error fetching metallb manifest" + helm install metallb truecharts/metallb --namespace metallb --create-namespace --wait + fi + ## TODO: Only add when required + if [[ "${{ matrix.chart }}" == "charts/enterprise/clusterissuer" ]]; then + helm install cert-manager truecharts/cert-manager --namespace cert-manager --create-namespace --wait fi if [[ "${{ matrix.chart }}" != "charts/operators/cloudnative-pg" ]]; then - kubectl apply -f https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/release-1.17/releases/cnpg-1.17.5.yaml --server-side --force-conflicts || echo "error fetching cnpg manifest" + helm install cloudnative-pg truecharts/cloudnative-pg --namespace cloudnative-pg --create-namespace --wait fi if [[ "${{ matrix.chart }}" != "charts/operators/prometheus-operator" ]]; then - kubectl apply -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.66.0/bundle.yaml --server-side --force-conflicts || echo "error fetching prometheus operator manifest" + helm install prometheus-operator truecharts/prometheus-operator --namespace prometheus-operator --create-namespace --wait fi - name: Run chart-testing (install) diff --git a/charts/enterprise/clusterissuer/Chart.yaml b/charts/enterprise/clusterissuer/Chart.yaml index a25690d1b26..05043c28edd 100644 --- a/charts/enterprise/clusterissuer/Chart.yaml +++ b/charts/enterprise/clusterissuer/Chart.yaml @@ -21,7 +21,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/enterprise/clusterissuer - https://cert-manager.io/ type: application -version: 4.0.0 +version: 4.0.1 annotations: truecharts.org/catagories: | - core