Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
6243e49
Add workflow to split helm charts into their own repo
mbaldessari Aug 15, 2023
8434529
Merge pull request #341 from mbaldessari/split-repos-workflow
mbaldessari Aug 15, 2023
f6ead1e
Small test for the workflow towards single chart repos
mbaldessari Aug 15, 2023
6b97dde
Merge pull request #343 from mbaldessari/test1
mbaldessari Aug 15, 2023
23c9753
Small test for the workflow towards single chart repos (part 2)
mbaldessari Aug 15, 2023
09bfa2c
Simplify split workflow
mbaldessari Aug 15, 2023
f245789
Small test for the workflow towards single chart repos (part 3)
mbaldessari Aug 15, 2023
bf91925
Tiny change to trigger split workflow
mbaldessari Aug 15, 2023
698aeb3
Add initial helm releasing workflow for acm chart
mbaldessari Aug 15, 2023
3e1b0ac
Add helm repo updating workflow in the per-chart workflows folder
mbaldessari Aug 15, 2023
7d442bb
Fix up CI superlinter on github actions
mbaldessari Aug 16, 2023
31c52ea
Merge pull request #346 from mbaldessari/ci-actionlint
mbaldessari Aug 16, 2023
a86f25f
Fix tests and make .disabled explicit
Aug 16, 2023
28dd3af
Make sure we run the split workflow only when the changes land in val…
mbaldessari Aug 16, 2023
765eb01
Update tests. We get an extra (non-impacting whitespace) with the new…
Aug 16, 2023
41de1a3
Merge pull request #347 from mbaldessari/limit-ci-split
mbaldessari Aug 16, 2023
2bc3c61
re-add logic for extravaluefiles
Aug 16, 2023
31983e1
Merge remote-tracking branch 'upstream/main' into add_extra_value_files
Aug 16, 2023
e0f956a
Add more tests for variable definedness/truth
Aug 16, 2023
8096369
Switch helm to v3.12.3 in CI
mbaldessari Aug 16, 2023
c495d00
Merge pull request #348 from mbaldessari/update-helm
mbaldessari Aug 16, 2023
0cd6a8f
Merge remote-tracking branch 'upstream/main' into add_extra_value_files
Aug 16, 2023
b76d830
Unroll global.extraValueFiles in application-policies directly due to…
Aug 16, 2023
c75b39f
Merge pull request #344 from mhjacks/add_extra_value_files
mhjacks Aug 16, 2023
69837ae
Re-add code to operator-install to understand global.extraValueFiles
Aug 16, 2023
751e373
Make sure to add dollar sign
Aug 16, 2023
6a1e6f7
Merge pull request #349 from mhjacks/main
mbaldessari Aug 16, 2023
e450c49
Add initial multi-source support
mbaldessari Aug 17, 2023
adb9aec
Add changelog entry and add an explicit property entry to the schema
mbaldessari Aug 17, 2023
9e45344
Correct ifs and ranges in pattern, add comments
Aug 17, 2023
1a209e2
Also quote name and value values
Aug 17, 2023
357892c
Merge pull request #351 from mhjacks/main
mhjacks Aug 17, 2023
b0e828b
Drop vault.ui.serviceType: "LoadBalancer"
mbaldessari Aug 23, 2023
686a355
Merge pull request #352 from mbaldessari/vault-lb
mbaldessari Aug 23, 2023
a07677c
Merge pull request #350 from mbaldessari/multisource
mbaldessari Aug 24, 2023
af839b4
Release clustergroup chart version 0.0.2
mbaldessari Aug 25, 2023
5f69baf
Merge pull request #353 from mbaldessari/clustergroup-v0.0.2
mbaldessari Aug 25, 2023
f1f98f2
Update crd in common
mbaldessari Aug 26, 2023
2a3ca7b
Merge pull request #354 from mbaldessari/crd
mbaldessari Aug 26, 2023
d65f7e4
Add support for passing EXTRA_HELM_OPTS
mbaldessari Aug 26, 2023
d6a34da
Merge pull request #355 from mbaldessari/helm-extra-opts-containers
mbaldessari Aug 26, 2023
449b9a8
Disable kubeconform for the time being
mbaldessari Aug 28, 2023
3636645
Add support for deploying multi source via CLI
mbaldessari Aug 28, 2023
b5ae4cd
Merge pull request #356 from mbaldessari/multisource-cli
mbaldessari Aug 28, 2023
3e7654f
Upgrade ESO to v0.9.4
mbaldessari Aug 31, 2023
ef72c51
Merge pull request #357 from mbaldessari/eso-0.9.4
mbaldessari Aug 31, 2023
71f5639
Release 0.0.2 golang-external-secrets
mbaldessari Aug 31, 2023
344d037
Merge pull request #358 from mbaldessari/eso-0.9.4-newchart
mbaldessari Aug 31, 2023
dcd9b81
Simplify the passing of KUBECONFIG
mbaldessari Sep 4, 2023
d644c50
Merge pull request #360 from mbaldessari/script-cleanup
mbaldessari Sep 4, 2023
7207fbd
Update CRD for the operator
mbaldessari Sep 4, 2023
4f97430
Merge pull request #361 from mbaldessari/crd-update
mbaldessari Sep 4, 2023
4d0fafd
Expose UUID
mbaldessari Sep 4, 2023
39833a3
Move to newly released checkout action version
mbaldessari Sep 4, 2023
940bda1
Merge pull request #362 from mbaldessari/expose-uuid
mbaldessari Sep 4, 2023
c328c1e
Update URLs to new github org
mbaldessari Sep 5, 2023
5585af0
Add ~/.config/validated-patterns in the secret search path
mbaldessari Sep 5, 2023
92e83bf
Add support for ~/.config/validated-patterns/pattern-uuid
mbaldessari Sep 5, 2023
34a22f0
Simplify the code around UUID variable definition
mbaldessari Sep 5, 2023
8834fe7
Merge pull request #363 from mbaldessari/vp-paths
mbaldessari Sep 6, 2023
8aece38
Merge remote-tracking branch 'common-upstream/main' into common-autom…
mbaldessari Sep 6, 2023
afcef70
Fix up common/ tests
mbaldessari Sep 6, 2023
f123f05
Move to new checkout action version
mbaldessari Sep 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ jobs:
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

- name: Setup helm
uses: azure/setup-helm@v3
# with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/superlinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion common/.github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

steps:
# Important: This sets up your GITHUB_WORKSPACE environment variable
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Lint Ansible Playbook
uses: ansible/ansible-lint-action@v6
Expand Down
2 changes: 1 addition & 1 deletion common/.github/workflows/ansible-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
Expand Down
118 changes: 118 additions & 0 deletions common/.github/workflows/chart-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
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/**'

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 }}
steps:
- name: Checkout Code
uses: actions/checkout@v4

- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
acm:
- 'acm/**'
golang-external-secrets:
- 'golang-external-secrets/**'
hashicorp-vault:
- 'hashicorp-vault/**'
letsencrypt:
- 'letsencrypt/**'
clustergroup:
- 'clustergroup/**'

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
38 changes: 38 additions & 0 deletions common/.github/workflows/chart-split.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
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"
git push origin -d "${B}" || /bin/true
git subtree split -P "${N}" -b "${B}"
git push -f -u origin "${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"
2 changes: 1 addition & 1 deletion common/.github/workflows/jsonschema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
Expand Down
21 changes: 11 additions & 10 deletions common/.github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ jobs:
# Checkout the code base #
##########################
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Setup helm
uses: azure/setup-helm@v3
# with:
# version: '<version>' # default is latest stable
id: install
with:
version: 'v3.12.3'


################################
# Run Linter against code base #
Expand All @@ -56,9 +56,10 @@ jobs:
run: |
make helmlint

- name: Run make helm kubeconform
run: |
curl -L -O https://github.com/yannh/kubeconform/releases/download/v0.4.13/kubeconform-linux-amd64.tar.gz
tar xf kubeconform-linux-amd64.tar.gz
sudo mv -v kubeconform /usr/local/bin
make kubeconform
# For now disable this until we have a nice and simple process to update the schemas in our repo
# - name: Run make helm kubeconform
# run: |
# curl -L -O https://github.com/yannh/kubeconform/releases/download/v0.4.13/kubeconform-linux-amd64.tar.gz
# tar xf kubeconform-linux-amd64.tar.gz
# sudo mv -v kubeconform /usr/local/bin
# make kubeconform
2 changes: 1 addition & 1 deletion common/.github/workflows/superlinter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
Expand Down
4 changes: 4 additions & 0 deletions common/Changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## Aug 17, 2023

* Introduced support for multisource applications via .chart + .chartVersion

## Jul 8, 2023

* Introduced a default of 20 for sync failures retries in argo applications (global override via global.options.applicationRetryLimit
Expand Down
11 changes: 10 additions & 1 deletion common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,17 @@ TARGET_REPO=$(shell git ls-remote --get-url --symref $(TARGET_ORIGIN) | sed -e '
# git branch --show-current is also available as of git 2.22, but we will use this for compatibility
TARGET_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)

UUID_FILE ?= ~/.config/validated-patterns/pattern-uuid
UUID_HELM_OPTS ?=

# --set values always take precedence over the contents of -f
HELM_OPTS=-f values-global.yaml --set main.git.repoURL="$(TARGET_REPO)" --set main.git.revision=$(TARGET_BRANCH) $(TARGET_SITE_OPT) $(EXTRA_HELM_OPTS)
ifneq ("$(wildcard $(UUID_FILE))","")
UUID := $(shell cat $(UUID_FILE))
UUID_HELM_OPTS := --set main.analyticsUUID=$(UUID)
endif

HELM_OPTS=-f values-global.yaml --set main.git.repoURL="$(TARGET_REPO)" --set main.git.revision=$(TARGET_BRANCH) $(TARGET_SITE_OPT) $(UUID_HELM_OPTS) $(EXTRA_HELM_OPTS)


##@ Pattern Common Tasks

Expand Down
8 changes: 4 additions & 4 deletions common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

This repository is never used as standalone. It is usually imported in each pattern as a subtree.
In order to import the common/ the very first time you can use
`https://github.com/hybrid-cloud-patterns/multicloud-gitops/blob/main/common/scripts/make_common_subtree.sh`
`https://github.com/validatedpatterns/multicloud-gitops/blob/main/common/scripts/make_common_subtree.sh`

In order to update your common subtree inside your pattern repository you can either use
`https://github.com/hybrid-cloud-patterns/utilities/blob/main/scripts/update-common-everywhere.sh` or
`https://github.com/validatedpatterns/utilities/blob/main/scripts/update-common-everywhere.sh` or
do it manually by doing the following:

```sh
git remote add -f upstream-common https://github.com/hybrid-cloud-patterns/common.git
git remote add -f upstream-common https://github.com/validatedpatterns/common.git
git merge -s subtree -Xtheirs -Xsubtree=common upstream-common/ha-vault
```

## Secrets

There are two different secret formats parsed by the ansible bits. Both are documented [here](https://github.com/hybrid-cloud-patterns/common/tree/main/ansible/roles/vault_utils/README.md)
There are two different secret formats parsed by the ansible bits. Both are documented [here](https://github.com/validatedpatterns/common/tree/main/ansible/roles/vault_utils/README.md)
29 changes: 29 additions & 0 deletions common/acm/.github/workflows/update-helm-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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@main
permissions:
contents: read

update-helm-repo:
needs: [helmlint]
uses: validatedpatterns/helm-charts/.github/workflows/update-helm-repo.yml@main
permissions: read-all
secrets: inherit
2 changes: 1 addition & 1 deletion common/acm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
description: A Helm chart to configure Advanced Cluster Manager for OpenShift
description: A Helm chart to configure Advanced Cluster Manager for OpenShift.
keywords:
- pattern
name: acm
Expand Down
3 changes: 3 additions & 0 deletions common/acm/templates/policies/application-policies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ spec:
ignoreMissingValueFiles: true
valueFiles:
{{- include "acm.app.policies.valuefiles" . | nindent 24 }}
{{- range $valueFile := $.Values.global.extraValueFiles }}
- {{ $valueFile | quote }}
{{- end }}
{{- range $valueFile := .extraValueFiles }}
- {{ $valueFile | quote }}
{{- end }}
Expand Down
1 change: 1 addition & 0 deletions common/acm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ main:
channel: "gitops-1.8"

global:
extraValueFiles: []
pattern: none
repoURL: none
targetRevision: main
Expand Down
14 changes: 10 additions & 4 deletions common/ansible/roles/vault_utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,16 @@ This relies on [kubernetes.core](https://docs.ansible.com/ansible/latest/collect

## Values secret file format

Currently this role supports two formats: version 1.0 (which is the assumed default when not specified) and version 2.0.
The latter is more fatureful and supports generating secrets directly into the vault and also prompting the user for a secret.
By default, the first file that will looked up is `~/.config/hybrid-cloud-patterns/values-secret-<patternname>.yaml`, then
`~/values-secret-<patternname>.yaml` and should that not exist it will look for `~/values-secret.yaml`.
Currently this role supports two formats: version 1.0 (which is the assumed
default when not specified) and version 2.0. The latter is more fatureful and
supports generating secrets directly into the vault and also prompting the user
for a secret.

By default, the first file that will looked up is
`~/.config/hybrid-cloud-patterns/values-secret-<patternname>.yaml`, then
`~/.config/validated-patterns/values-secret-<patternname>.yaml`,
`~/values-secret-<patternname>.yaml` and should that not exist it will look for
`~/values-secret.yaml`.
The paths can be overridden by setting the environment variable `VALUES_SECRET` to the path of the
secret file.

Expand Down
1 change: 1 addition & 0 deletions common/ansible/roles/vault_utils/tasks/push_secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
vars:
findme:
- "~/.config/hybrid-cloud-patterns/values-secret-{{ pattern_name }}.yaml"
- "~/.config/validated-patterns/values-secret-{{ pattern_name }}.yaml"
- "~/values-secret-{{ pattern_name }}.yaml"
- "~/values-secret.yaml"
- "{{ pattern_dir }}/values-secret.yaml.template"
Expand Down
Loading