From 47c59239ea454984ac0792eae9f077b0a848afa6 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 13 Sep 2024 10:14:08 +0200 Subject: [PATCH 1/5] Update README for the v1 common branch --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 568a2396..63faddc8 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) +## Note + +This is the `v1` branch of common and it contains all the VP helm charts. Please use this branch if your pattern +has not migrated to the multisource approach. + ## Start Here This repository is never used as standalone. It is usually imported in each pattern as a subtree. From 08cff4fedf824cc2b34a78c2f8395f124a78fe4d Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Tue, 17 Sep 2024 10:53:07 +0200 Subject: [PATCH 2/5] Allow customizing the clusterGroupChartVersion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ❯ helm template . --show-only "templates/pattern.yaml" --- apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern metadata: name: release-name namespace: openshift-operators spec: clusterGroupName: default gitSpec: targetRepo: https://github.com/pattern-clone/mypattern targetRevision: main multiSourceConfig: enabled: false ❯ helm template . --show-only "templates/pattern.yaml" --set main.multiSourceConfig.clusterGroupChartVersion=0.9.\* --- apiVersion: gitops.hybrid-cloud-patterns.io/v1alpha1 kind: Pattern metadata: name: release-name namespace: openshift-operators spec: clusterGroupName: default gitSpec: targetRepo: https://github.com/pattern-clone/mypattern targetRevision: main multiSourceConfig: enabled: false clusterGroupChartVersion: 0.9.* --- operator-install/templates/pattern.yaml | 3 +++ operator-install/values.yaml | 1 + 2 files changed, 4 insertions(+) diff --git a/operator-install/templates/pattern.yaml b/operator-install/templates/pattern.yaml index 3eda9482..072036ee 100644 --- a/operator-install/templates/pattern.yaml +++ b/operator-install/templates/pattern.yaml @@ -20,6 +20,9 @@ spec: {{- if .Values.main.multiSourceConfig.helmRepoUrl }} helmRepoUrl: {{ .Values.main.multiSourceConfig.helmRepoUrl }} {{- end }} {{/* if .Values.main.multiSourceConfig.helmRepoUrl */}} +{{- if .Values.main.multiSourceConfig.clusterGroupChartVersion }} + clusterGroupChartVersion: {{ .Values.main.multiSourceConfig.clusterGroupChartVersion }} +{{- end }} {{/* if .Values.main.multiSourceConfig.clusterGroupChartVersion */}} {{- if .Values.main.analyticsUUID }} analyticsUUID: {{ .Values.main.analyticsUUID }} {{- end }} {{/* if .Values.main.analyticsUUID */}} diff --git a/operator-install/values.yaml b/operator-install/values.yaml index 62c9943a..f9b81abd 100644 --- a/operator-install/values.yaml +++ b/operator-install/values.yaml @@ -18,6 +18,7 @@ main: multiSourceConfig: enabled: false # helmRepoUrl: registry.internal.network/helm + # clusterGroupChartVersion: 0.8.* # String to enable certain experimental capabilities in the operator and the # framework. Not needed unless you know exactly what you're doing. From 003e0118f0977a2c30d866f19348b8ece91ef0ff Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Tue, 17 Sep 2024 10:53:39 +0200 Subject: [PATCH 3/5] Release pattern-install v0.0.2 --- operator-install/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operator-install/Chart.yaml b/operator-install/Chart.yaml index 74adcf8f..5122abea 100644 --- a/operator-install/Chart.yaml +++ b/operator-install/Chart.yaml @@ -3,4 +3,4 @@ description: A Helm chart to build and deploy a Cloud Pattern via the patterns o keywords: - pattern name: pattern-install -version: 0.0.1 +version: 0.0.2 From 333152792a413f8032eae0586502e7af8e9f9df5 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Tue, 17 Sep 2024 10:54:14 +0200 Subject: [PATCH 4/5] Drop the chart splitting workflows They used to run only for the main branch and this is the v1 branch, but let's drop them anyway as they cause quite a bit of confusion. --- .github/workflows/chart-branches.yml | 126 --------------------------- .github/workflows/chart-split.yml | 42 --------- 2 files changed, 168 deletions(-) delete mode 100644 .github/workflows/chart-branches.yml delete mode 100644 .github/workflows/chart-split.yml diff --git a/.github/workflows/chart-branches.yml b/.github/workflows/chart-branches.yml deleted file mode 100644 index 5ec0ce8f..00000000 --- a/.github/workflows/chart-branches.yml +++ /dev/null @@ -1,126 +0,0 @@ ---- -name: Create per-chart branches - -# We only run this job on the charts that will be later moved to full blown charts -# We also want to run the subtree comand only for the charts that have been actually changed -# because git subtree split is a bit of an expensive operation -# github actions do not support yaml anchors so there is more duplication than usual -on: - push: - branches: - - main - paths: - - 'acm/**' - - 'golang-external-secrets/**' - - 'hashicorp-vault/**' - - 'letsencrypt/**' - - 'clustergroup/**' - - 'operator-install/**' - -jobs: - changes: - name: Figure out per-chart changes - if: github.repository == 'validatedpatterns/common' - runs-on: ubuntu-latest - permissions: read-all - outputs: - acm: ${{ steps.filter.outputs.acm }} - golang-external-secrets: ${{ steps.filter.outputs.golang-external-secrets }} - hashicorp-vault: ${{ steps.filter.outputs.hashicorp-vault }} - letsencrypt: ${{ steps.filter.outputs.letsencrypt }} - clustergroup: ${{ steps.filter.outputs.clustergroup }} - operator-install: ${{ steps.filter.outputs.operator-install }} - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - acm: - - 'acm/**' - golang-external-secrets: - - 'golang-external-secrets/**' - hashicorp-vault: - - 'hashicorp-vault/**' - letsencrypt: - - 'letsencrypt/**' - clustergroup: - - 'clustergroup/**' - operator-install: - - 'operator-install/**' - - acm: - needs: changes - if: ${{ (needs.changes.outputs.acm == 'true') && (github.repository == 'validatedpatterns/common') }} - uses: validatedpatterns/common/.github/workflows/chart-split.yml@main - permissions: - actions: write - contents: write - with: - chart_name: acm - target_repository: validatedpatterns/acm-chart - secrets: inherit - - golang-external-secrets: - needs: changes - if: ${{ (needs.changes.outputs.golang-external-secrets == 'true') && (github.repository == 'validatedpatterns/common') }} - uses: validatedpatterns/common/.github/workflows/chart-split.yml@main - permissions: - actions: write - contents: write - with: - chart_name: golang-external-secrets - target_repository: validatedpatterns/golang-external-secrets-chart - secrets: inherit - - hashicorp-vault: - needs: changes - if: ${{ (needs.changes.outputs.hashicorp-vault == 'true') && (github.repository == 'validatedpatterns/common') }} - uses: validatedpatterns/common/.github/workflows/chart-split.yml@main - permissions: - actions: write - contents: write - with: - chart_name: hashicorp-vault - target_repository: validatedpatterns/hashicorp-vault-chart - secrets: inherit - - letsencrypt: - needs: changes - if: ${{ (needs.changes.outputs.letsencrypt == 'true') && (github.repository == 'validatedpatterns/common') }} - uses: validatedpatterns/common/.github/workflows/chart-split.yml@main - permissions: - actions: write - contents: write - with: - chart_name: letsencrypt - target_repository: validatedpatterns/letsencrypt-chart - secrets: inherit - - clustergroup: - needs: changes - if: ${{ (needs.changes.outputs.clustergroup == 'true') && (github.repository == 'validatedpatterns/common') }} - uses: validatedpatterns/common/.github/workflows/chart-split.yml@main - permissions: - actions: write - contents: write - with: - chart_name: clustergroup - target_repository: validatedpatterns/clustergroup-chart - secrets: inherit - - # The folder is named 'operator-install' but the chart is called 'pattern-install' - operator-install: - needs: changes - if: ${{ (needs.changes.outputs.operator-install == 'true') && (github.repository == 'validatedpatterns/common') }} - uses: validatedpatterns/common/.github/workflows/chart-split.yml@main - permissions: - actions: write - contents: write - with: - # The name here is really the folder to be used for the chart - chart_name: operator-install - target_repository: validatedpatterns/pattern-install-chart - secrets: inherit diff --git a/.github/workflows/chart-split.yml b/.github/workflows/chart-split.yml deleted file mode 100644 index 150e419b..00000000 --- a/.github/workflows/chart-split.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -name: Split into chart repo branches - -on: - workflow_call: - inputs: - chart_name: - required: true - type: string - target_repository: - required: true - type: string - -jobs: - split_chart: - runs-on: ubuntu-latest - permissions: - actions: write - contents: write - steps: - - name: Checkout Code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.CHARTS_REPOS_TOKEN }} - - - name: Run git subtree split and push - env: - GITHUB_TOKEN: ${{ secrets.CHARTS_REPOS_TOKEN }} - run: | - set -e - N="${{ inputs.chart_name }}" - B="${N}-main-single-chart" - GITIMG="quay.io/hybridcloudpatterns/gitsubtree-container:2.40.1" - sudo apt-get update -y && sudo apt-get install -y podman - echo "Running subtree split for ${B}" - podman pull "${GITIMG}" - git push origin -d "${B}" || /bin/true - # Git subtree got broken on recent versions of git hence this container - podman run --net=host --rm -t -v .:/git "${GITIMG}" subtree split -P "${N}" -b "${B}" - #git clone https://validatedpatterns:${GITHUB_TOKEN}@github.com/validatedpatterns/common.git -b "acm-main-single-chart" --single-branch - git push --force https://validatedpatterns:"${GITHUB_TOKEN}"@github.com/${{ inputs.target_repository }}.git "${B}:main" From 0123cdebec0e5579472fab388b7a9790f5b34c7a Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Wed, 18 Sep 2024 09:07:52 +0200 Subject: [PATCH 5/5] Make sure we compare lists with lists when doing a difference While this works with older ansible versions (2.15 and before), we need to check the difference between two lists and not a list and an item. This breaks with ansible 2.16 and onwards Tested with newer ansible and the vault now unseals correctly. --- ansible/roles/vault_utils/tasks/vault_status.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/roles/vault_utils/tasks/vault_status.yaml b/ansible/roles/vault_utils/tasks/vault_status.yaml index 9dc3e426..a915db02 100644 --- a/ansible/roles/vault_utils/tasks/vault_status.yaml +++ b/ansible/roles/vault_utils/tasks/vault_status.yaml @@ -58,4 +58,4 @@ - name: "Followers" ansible.builtin.set_fact: - followers: "{{ vault_pods | difference(vault_pod) }}" + followers: "{{ vault_pods | difference([vault_pod]) }}"