From 1ebca7f858bbb77678a4ea44679870412ff7b003 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 6 Sep 2024 14:59:10 +0200 Subject: [PATCH 01/17] Replace tabs with spaces and add some missing env vars that could be passed --- scripts/pattern-util.sh | 42 ++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/scripts/pattern-util.sh b/scripts/pattern-util.sh index 8fa4a26f..cb7fc873 100755 --- a/scripts/pattern-util.sh +++ b/scripts/pattern-util.sh @@ -71,22 +71,26 @@ fi # $HOME is mounted to /root because the UID in the container is 0 and that's where SSH looks for credentials podman run -it --rm --pull=newer \ - --security-opt label=disable \ - -e EXTRA_HELM_OPTS \ - -e EXTRA_PLAYBOOK_OPTS \ - -e VALUES_SECRET \ - -e KUBECONFIG \ - -e K8S_AUTH_HOST \ - -e K8S_AUTH_VERIFY_SSL \ - -e K8S_AUTH_SSL_CA_CERT \ - -e K8S_AUTH_USERNAME \ - -e K8S_AUTH_PASSWORD \ - -e K8S_AUTH_TOKEN \ - ${PKI_HOST_MOUNT_ARGS} \ - -v "${HOME}":"${HOME}" \ - -v "${HOME}":/pattern-home \ - ${PODMAN_ARGS} \ - ${EXTRA_ARGS} \ - -w "$(pwd)" \ - "$PATTERN_UTILITY_CONTAINER" \ - $@ + --security-opt label=disable \ + -e EXTRA_HELM_OPTS \ + -e EXTRA_PLAYBOOK_OPTS \ + -e TARGET_ORIGIN \ + -e NAME \ + -e TOKEN_SECRET \ + -e TOKEN_NAMESPACE \ + -e VALUES_SECRET \ + -e KUBECONFIG \ + -e K8S_AUTH_HOST \ + -e K8S_AUTH_VERIFY_SSL \ + -e K8S_AUTH_SSL_CA_CERT \ + -e K8S_AUTH_USERNAME \ + -e K8S_AUTH_PASSWORD \ + -e K8S_AUTH_TOKEN \ + ${PKI_HOST_MOUNT_ARGS} \ + -v "${HOME}":"${HOME}" \ + -v "${HOME}":/pattern-home \ + ${PODMAN_ARGS} \ + ${EXTRA_ARGS} \ + -w "$(pwd)" \ + "$PATTERN_UTILITY_CONTAINER" \ + $@ From b8e62f28788e7bc942d1552a55a2cb67fe6bccd0 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 6 Sep 2024 16:14:14 +0200 Subject: [PATCH 02/17] Also push any changes to operator-install to its own repo Since at the time the folder was named operator-install and the chart pattern-install, let's push it out to the `pattern-install-chart` repo which is a bit clearer. --- .github/workflows/chart-branches.yml | 17 +++++++++++ .../.github/workflows/update-helm-repo.yml | 30 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 operator-install/.github/workflows/update-helm-repo.yml diff --git a/.github/workflows/chart-branches.yml b/.github/workflows/chart-branches.yml index 4fb784f0..71d94216 100644 --- a/.github/workflows/chart-branches.yml +++ b/.github/workflows/chart-branches.yml @@ -15,6 +15,7 @@ on: - 'hashicorp-vault/**' - 'letsencrypt/**' - 'clustergroup/**' + - 'operator-install/**' jobs: changes: @@ -28,6 +29,7 @@ jobs: 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 @@ -46,6 +48,8 @@ jobs: - 'letsencrypt/**' clustergroup: - 'clustergroup/**' + operator-install: + - 'operator-install/**' acm: needs: changes @@ -106,3 +110,16 @@ jobs: 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: + chart_name: pattern-install + target_repository: validatedpatterns/pattern-install-chart + secrets: inherit diff --git a/operator-install/.github/workflows/update-helm-repo.yml b/operator-install/.github/workflows/update-helm-repo.yml new file mode 100644 index 00000000..fa1d6247 --- /dev/null +++ b/operator-install/.github/workflows/update-helm-repo.yml @@ -0,0 +1,30 @@ +# This invokes the workflow named 'publish-charts' in the umbrella repo +# It expects to have a secret called CHARTS_REPOS_TOKEN which contains +# the GitHub token that has permissions to invoke workflows and commit code +# inside the umbrella-repo. +# The following fine-grained permissions were used in testing and were limited +# to the umbrella repo only: +# - Actions: r/w +# - Commit statuses: r/w +# - Contents: r/w +# - Deployments: r/w +# - Pages: r/w +# + +name: vp-patterns/update-helm-repo +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + helmlint: + uses: validatedpatterns/helm-charts/.github/workflows/helmlint.yml@985ba37e0eb50b1b35ec194fc999eae2d0ae1486 + permissions: + contents: read + + update-helm-repo: + needs: [helmlint] + uses: validatedpatterns/helm-charts/.github/workflows/update-helm-repo.yml@985ba37e0eb50b1b35ec194fc999eae2d0ae1486 + permissions: read-all + secrets: inherit From 907e33b9cf1645dc47a9abf84b9db17782f1c1f3 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 6 Sep 2024 16:26:10 +0200 Subject: [PATCH 03/17] Update CRD from operator v0.0.55 --- ...gitops.hybrid-cloud-patterns.io_patterns.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml b/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml index b3d769bb..2edacc49 100644 --- a/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml +++ b/operator-install/crds/gitops.hybrid-cloud-patterns.io_patterns.yaml @@ -93,13 +93,19 @@ spec: description: Optional. FQDN of the git server if automatic parsing from TargetRepo is broken type: string + inClusterGitServer: + default: false + description: (EXPERIMENTAL) Enable in-cluster git server (avoids + the need of forking the upstream repository) + type: boolean originRepo: - description: Upstream git repo containing the pattern to deploy. - Used when in-cluster fork to point to the upstream pattern repository + description: |- + Upstream git repo containing the pattern to deploy. Used when in-cluster fork to point to the upstream pattern repository. + Takes precedence over TargetRepo type: string originRevision: - description: Branch, tag or commit in the upstream git repository. - Does not support short-sha's. Default to HEAD + description: (DEPRECATED) Branch, tag or commit in the upstream + git repository. Does not support short-sha's. Default to HEAD type: string pollInterval: default: 180 @@ -124,8 +130,6 @@ spec: description: Optional. K8s secret namespace where the token for connecting to git can be found type: string - required: - - targetRepo type: object multiSourceConfig: properties: From 8452d308911e05a279f29b2b9424d03ed79012c3 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 6 Sep 2024 16:34:20 +0200 Subject: [PATCH 04/17] Fix chart name in pattern-install branch+split wf --- .github/workflows/chart-branches.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/chart-branches.yml b/.github/workflows/chart-branches.yml index 71d94216..5ec0ce8f 100644 --- a/.github/workflows/chart-branches.yml +++ b/.github/workflows/chart-branches.yml @@ -120,6 +120,7 @@ jobs: actions: write contents: write with: - chart_name: pattern-install + # 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 From 35576f6a7da66ea2b0c7269efc1930fb3356549e Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 6 Sep 2024 16:38:51 +0200 Subject: [PATCH 05/17] Tweak readme --- operator-install/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/operator-install/README.md b/operator-install/README.md index a333860e..588b3d78 100644 --- a/operator-install/README.md +++ b/operator-install/README.md @@ -1,4 +1,8 @@ # Update CRD -In order to update the CRD, copy the following file from the last released patterns operator version: -`cp -v patterns-operator/config/crd/bases/gitops.hybrid-cloud-patterns.io_patterns.yaml ./crds/` +In order to update the CRD, copy the following file from the last released +patterns operator version: + +```sh +cp -v patterns-operator/config/crd/bases/gitops.hybrid-cloud-patterns.io_patterns.yaml ./crds/ +``` From 83976a6f010fae1aeaa10b2e165e87b5f4eb04b8 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Sun, 8 Sep 2024 20:14:08 +0200 Subject: [PATCH 06/17] Use $group.name in clusterset metadata Closes: validatedpatterns/regional-resiliency-pattern#5 --- acm/templates/provision/clusterpool.yaml | 2 +- tests/acm-normal.expected.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/acm/templates/provision/clusterpool.yaml b/acm/templates/provision/clusterpool.yaml index d95905f7..dab4dd28 100644 --- a/acm/templates/provision/clusterpool.yaml +++ b/acm/templates/provision/clusterpool.yaml @@ -32,7 +32,7 @@ metadata: cloud: {{ $cloud }} region: '{{ $region }}' vendor: OpenShift - cluster.open-cluster-management.io/clusterset: {{ .name }} + cluster.open-cluster-management.io/clusterset: {{ $group.name }} spec: {{- if .size }} size: {{ .size }} diff --git a/tests/acm-normal.expected.yaml b/tests/acm-normal.expected.yaml index 6823a01b..f8c37f3e 100644 --- a/tests/acm-normal.expected.yaml +++ b/tests/acm-normal.expected.yaml @@ -165,7 +165,7 @@ metadata: cloud: aws region: 'ap-southeast-2' vendor: OpenShift - cluster.open-cluster-management.io/clusterset: aws-ap + cluster.open-cluster-management.io/clusterset: acm-provision-edge spec: size: 3 runningCount: 0 @@ -195,7 +195,7 @@ metadata: cloud: azure region: 'eastus' vendor: OpenShift - cluster.open-cluster-management.io/clusterset: azure-us + cluster.open-cluster-management.io/clusterset: acm-provision-edge spec: size: 2 runningCount: 2 From 68d731edad7c5492c76dacf7a6a804755b173a4c Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Wed, 11 Sep 2024 14:25:59 +0200 Subject: [PATCH 07/17] Expose originURL as helm value This is needed, this way when this variable is set we can actually detect that an in-cluster gitea instance has been set up. --- acm/templates/_helpers.tpl | 2 ++ clustergroup/templates/_helpers.tpl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/acm/templates/_helpers.tpl b/acm/templates/_helpers.tpl index 8302457a..1b934e62 100644 --- a/acm/templates/_helpers.tpl +++ b/acm/templates/_helpers.tpl @@ -26,6 +26,8 @@ Default always defined valueFiles to be included when pushing the cluster wide a {{- define "acm.app.policies.helmparameters" -}} - name: global.repoURL value: {{ $.Values.global.repoURL }} +- name: global.originURL + value: {{ $.Values.global.originURL }} - name: global.targetRevision value: {{ $.Values.global.targetRevision }} - name: global.namespace diff --git a/clustergroup/templates/_helpers.tpl b/clustergroup/templates/_helpers.tpl index 0237e94a..317ed4b1 100644 --- a/clustergroup/templates/_helpers.tpl +++ b/clustergroup/templates/_helpers.tpl @@ -4,6 +4,8 @@ Default always defined top-level variables for helm charts {{- define "clustergroup.app.globalvalues.helmparameters" -}} - name: global.repoURL value: {{ $.Values.global.repoURL }} +- name: global.originURL + value: {{ $.Values.global.originURL }} - name: global.targetRevision value: {{ $.Values.global.targetRevision }} - name: global.namespace From 2ee7a0688705c886deca95c81871ffbcffeabbc3 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Wed, 11 Sep 2024 16:45:50 +0200 Subject: [PATCH 08/17] Update tests after common rebase --- tests/acm-industrial-edge-hub.expected.yaml | 2 ++ tests/acm-medical-diagnosis-hub.expected.yaml | 2 ++ tests/acm-normal.expected.yaml | 6 +++++ ...roup-industrial-edge-factory.expected.yaml | 2 ++ ...tergroup-industrial-edge-hub.expected.yaml | 14 ++++++++++ ...rgroup-medical-diagnosis-hub.expected.yaml | 26 +++++++++++++++++++ tests/clustergroup-normal.expected.yaml | 4 +++ 7 files changed, 56 insertions(+) diff --git a/tests/acm-industrial-edge-hub.expected.yaml b/tests/acm-industrial-edge-hub.expected.yaml index 00cf4e4d..02f2a8dc 100644 --- a/tests/acm-industrial-edge-hub.expected.yaml +++ b/tests/acm-industrial-edge-hub.expected.yaml @@ -420,6 +420,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace diff --git a/tests/acm-medical-diagnosis-hub.expected.yaml b/tests/acm-medical-diagnosis-hub.expected.yaml index 5fea58d0..62402c39 100644 --- a/tests/acm-medical-diagnosis-hub.expected.yaml +++ b/tests/acm-medical-diagnosis-hub.expected.yaml @@ -411,6 +411,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace diff --git a/tests/acm-normal.expected.yaml b/tests/acm-normal.expected.yaml index f8c37f3e..0c826026 100644 --- a/tests/acm-normal.expected.yaml +++ b/tests/acm-normal.expected.yaml @@ -1371,6 +1371,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1477,6 +1479,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1583,6 +1587,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace diff --git a/tests/clustergroup-industrial-edge-factory.expected.yaml b/tests/clustergroup-industrial-edge-factory.expected.yaml index 65344a57..12632e63 100644 --- a/tests/clustergroup-industrial-edge-factory.expected.yaml +++ b/tests/clustergroup-industrial-edge-factory.expected.yaml @@ -652,6 +652,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace diff --git a/tests/clustergroup-industrial-edge-hub.expected.yaml b/tests/clustergroup-industrial-edge-hub.expected.yaml index 1038e54a..89691e7b 100644 --- a/tests/clustergroup-industrial-edge-hub.expected.yaml +++ b/tests/clustergroup-industrial-edge-hub.expected.yaml @@ -995,6 +995,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1068,6 +1070,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1132,6 +1136,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1196,6 +1202,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1290,6 +1298,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1354,6 +1364,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1445,6 +1457,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace diff --git a/tests/clustergroup-medical-diagnosis-hub.expected.yaml b/tests/clustergroup-medical-diagnosis-hub.expected.yaml index 51bff564..bc751aea 100644 --- a/tests/clustergroup-medical-diagnosis-hub.expected.yaml +++ b/tests/clustergroup-medical-diagnosis-hub.expected.yaml @@ -880,6 +880,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -944,6 +946,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1008,6 +1012,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1072,6 +1078,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1136,6 +1144,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1200,6 +1210,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1264,6 +1276,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1328,6 +1342,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1410,6 +1426,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1474,6 +1492,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1538,6 +1558,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1611,6 +1633,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -1684,6 +1708,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace diff --git a/tests/clustergroup-normal.expected.yaml b/tests/clustergroup-normal.expected.yaml index b038286e..a852051f 100644 --- a/tests/clustergroup-normal.expected.yaml +++ b/tests/clustergroup-normal.expected.yaml @@ -875,6 +875,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace @@ -951,6 +953,8 @@ spec: parameters: - name: global.repoURL value: https://github.com/pattern-clone/mypattern + - name: global.originURL + value: - name: global.targetRevision value: main - name: global.namespace From aaf456b607a744d919d7c55a60cc51846d065186 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Wed, 11 Sep 2024 17:37:34 +0200 Subject: [PATCH 09/17] Release clustergroup v0.8.13 --- clustergroup/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clustergroup/Chart.yaml b/clustergroup/Chart.yaml index 2bacbfc5..c5fb5466 100644 --- a/clustergroup/Chart.yaml +++ b/clustergroup/Chart.yaml @@ -3,4 +3,4 @@ description: A Helm chart to create per-clustergroup ArgoCD applications and any keywords: - pattern name: clustergroup -version: 0.8.12 +version: 0.8.13 From 16c2e4ad9ca5be0c16cda7e7894523d0d88d5db8 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Wed, 11 Sep 2024 17:42:03 +0200 Subject: [PATCH 10/17] Release acm v0.1.2 --- acm/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acm/Chart.yaml b/acm/Chart.yaml index 3a7663b4..adb30c66 100644 --- a/acm/Chart.yaml +++ b/acm/Chart.yaml @@ -3,4 +3,4 @@ description: A Helm chart to configure Advanced Cluster Manager for OpenShift. keywords: - pattern name: acm -version: 0.1.1 +version: 0.1.2 From f608f63ba88262d23fade035ff8c6c8bc436a463 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Thu, 12 Sep 2024 16:38:12 +0200 Subject: [PATCH 11/17] Drop schema required under the Main section The "main" subsection of helm values is only used for kickstarting a pattern. It is entirely possible to only set one value and then set the other variables through other means (editing CRs e.g.). There is no point on blocking this. --- clustergroup/values.schema.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/clustergroup/values.schema.json b/clustergroup/values.schema.json index 2fbe3421..08f8c1e5 100644 --- a/clustergroup/values.schema.json +++ b/clustergroup/values.schema.json @@ -76,10 +76,6 @@ "git": { "type": "object", "additionalProperties": false, - "required": [ - "repoURL", - "revision" - ], "properties": { "repoUpstreamURL": { "type": "string", From 9a8b7cc1b02d939d16c86f5439a59cb7e87465dd Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Thu, 12 Sep 2024 16:38:44 +0200 Subject: [PATCH 12/17] Release clustergroup v0.8.14 --- clustergroup/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clustergroup/Chart.yaml b/clustergroup/Chart.yaml index c5fb5466..23764f5e 100644 --- a/clustergroup/Chart.yaml +++ b/clustergroup/Chart.yaml @@ -3,4 +3,4 @@ description: A Helm chart to create per-clustergroup ArgoCD applications and any keywords: - pattern name: clustergroup -version: 0.8.13 +version: 0.8.14 From 47c59239ea454984ac0792eae9f077b0a848afa6 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Fri, 13 Sep 2024 10:14:08 +0200 Subject: [PATCH 13/17] 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 14/17] 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 15/17] 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 16/17] 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 17/17] 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]) }}"