Skip to content

Commit 588525d

Browse files
authored
Merge pull request #454 from validatedpatterns/main
sync: main to rhdp-deploy
2 parents 5ecdc49 + 8f68659 commit 588525d

File tree

5 files changed

+75
-64
lines changed

5 files changed

+75
-64
lines changed

common/.github/workflows/pattern-sh-ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ jobs:
2020
# Fedora is not an option yet
2121
os: [ubuntu-latest, ubuntu-22.04]
2222
runs-on: ${{ matrix.os }}
23+
permissions:
24+
contents: read
2325

2426
steps:
2527
- name: Checkout Repository
26-
uses: actions/checkout@v4
28+
uses: actions/checkout@v5
29+
with:
30+
persist-credentials: false
2731

2832
- name: Install Podman on Ubuntu
2933
if: contains(matrix.os, 'ubuntu')

common/.github/workflows/superlinter.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@ jobs:
99
name: Super linter
1010
# Set the agent to run on
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
1214

1315
steps:
1416
- name: Checkout Code
15-
uses: actions/checkout@v4
17+
uses: actions/checkout@v5
1618
with:
1719
# Full git history is needed to get a proper list of changed files within `super-linter`
1820
fetch-depth: 0
21+
persist-credentials: false
1922

2023
################################
2124
# Run Linter against code base #
2225
################################
2326
- name: Lint Code Base
24-
uses: super-linter/super-linter/slim@v7
27+
uses: super-linter/super-linter/slim@ffde3b2b33b745cb612d787f669ef9442b1339a6 # v8.1.0
2528
env:
2629
VALIDATE_ALL_CODEBASE: true
2730
DEFAULT_BRANCH: main
@@ -33,12 +36,7 @@ jobs:
3336
VALIDATE_JSCPD: false
3437
VALIDATE_JSON_PRETTIER: false
3538
VALIDATE_MARKDOWN_PRETTIER: false
36-
VALIDATE_KUBERNETES_KUBECONFORM: false
3739
VALIDATE_PYTHON_PYLINT: false
3840
VALIDATE_SHELL_SHFMT: false
3941
VALIDATE_YAML: false
4042
VALIDATE_YAML_PRETTIER: false
41-
# VALIDATE_DOCKERFILE_HADOLINT: false
42-
# VALIDATE_MARKDOWN: false
43-
# VALIDATE_NATURAL_LANGUAGE: false
44-
# VALIDATE_TEKTON: false

common/Changes.md

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,119 +2,119 @@
22

33
## Sep 24, 2024
44

5-
* Ansible has been moved out of the common code tree, you must use a clustergroup chart that is >= 0.9.1
5+
- Ansible has been moved out of the common code tree, you must use a clustergroup chart that is >= 0.9.1
66

77
## Sep 6, 2024
88

9-
* Most charts have been removed from the tree. To get the charts you now have to point to them
9+
- Most charts have been removed from the tree. To get the charts you now have to point to them
1010

1111
## Sep 25, 2023
1212

13-
* Upgraded ESO to v0.9.5
13+
- Upgraded ESO to v0.9.5
1414

1515
## Aug 17, 2023
1616

17-
* Introduced support for multisource applications via .chart + .chartVersion
17+
- Introduced support for multisource applications via .chart + .chartVersion
1818

1919
## Jul 8, 2023
2020

21-
* Introduced a default of 20 for sync failures retries in argo applications (global override via global.options.applicationRetryLimit
21+
- Introduced a default of 20 for sync failures retries in argo applications (global override via global.options.applicationRetryLimit
2222
and per-app override via .syncPolicy)
2323

2424
## May 22, 2023
2525

26-
* Upgraded ESO to 0.8.2
27-
* *Important* we now use the newly blessed sso config for argo. This means that gitops < 1.8 are *unsupported*
26+
- Upgraded ESO to 0.8.2
27+
- *Important* we now use the newly blessed sso config for argo. This means that gitops < 1.8 are *unsupported*
2828

2929
## May 18, 2023
3030

31-
* Introduce a EXTRA_HELM_OPTS env variable that will be passed to the helm invocations
31+
- Introduce a EXTRA_HELM_OPTS env variable that will be passed to the helm invocations
3232

3333
## April 21, 2023
3434

35-
* Added labels and annotation support to namespaces.yaml template
35+
- Added labels and annotation support to namespaces.yaml template
3636

3737
## Apr 11, 2023
3838

39-
* Apply the ACM ocp-gitops-policy everywhere but the hub
39+
- Apply the ACM ocp-gitops-policy everywhere but the hub
4040

4141
## Apr 7, 2023
4242

43-
* Moved to gitops-1.8 channel by default (stable is unmaintained and will be dropped starting with ocp-4.13)
43+
- Moved to gitops-1.8 channel by default (stable is unmaintained and will be dropped starting with ocp-4.13)
4444

4545
## March 20, 2023
4646

47-
* Upgraded ESO to 0.8.1
47+
- Upgraded ESO to 0.8.1
4848

4949
## February 9, 2023
5050

51-
* Add support for /values-<platform>.yaml and for /values-<platform>-<clusterversion>.yaml
51+
- Add support for /values-<platform>.yaml and for /values-<platform>-<clusterversion>.yaml
5252

5353
## January 29, 2023
5454

55-
* Stop extracting the HUB's CA via an imperative job running on the imported cluster.
55+
- Stop extracting the HUB's CA via an imperative job running on the imported cluster.
5656
Just use ACM to push the HUB's CA out to the managed clusters.
5757

5858
## January 23, 2023
5959

60-
* Add initial support for running ESO on ACM-imported clusters
60+
- Add initial support for running ESO on ACM-imported clusters
6161

6262
## January 18, 2023
6363

64-
* Add validate-schema target
64+
- Add validate-schema target
6565

6666
## January 13, 2023
6767

68-
* Simplify the secrets paths when using argo hosted sites
68+
- Simplify the secrets paths when using argo hosted sites
6969

7070
## January 10, 2023
7171

72-
* vaultPrefixes is now optional in the v2 secret spec and defaults to ["hub"]
72+
- vaultPrefixes is now optional in the v2 secret spec and defaults to ["hub"]
7373

7474
## December 9, 2022
7575

76-
* Dropped insecureUnsealVaultInsideCluster (and file_unseal) entirely. Now
76+
- Dropped insecureUnsealVaultInsideCluster (and file_unseal) entirely. Now
7777
vault is always unsealed via a cronjob in the cluster. It is recommended to
7878
store the imperative/vaultkeys secret offline securely and then delete it.
7979

8080
## December 8, 2022
8181

82-
* Removed the legacy installation targets:
82+
- Removed the legacy installation targets:
8383
`deploy upgrade legacy-deploy legacy-upgrade`
8484
Patterns must now use the operator-based installation
8585

8686
## November 29, 2022
8787

88-
* Upgraded vault-helm to 0.23.0
89-
* Enable vault-ssl by default
88+
- Upgraded vault-helm to 0.23.0
89+
- Enable vault-ssl by default
9090

9191
## November 22, 2022
9292

93-
* Implemented a new format for the values-secret.yaml. Example can be found in examples/ folder
94-
* Now the order of values-secret file lookup is the following:
93+
- Implemented a new format for the values-secret.yaml. Example can be found in examples/ folder
94+
- Now the order of values-secret file lookup is the following:
9595
1. ~/values-secret-<patternname>.yaml
96-
2. ~/values-secret.yaml
97-
3. <patterngitrepo>/values-secret.yaml.template
98-
* Add support for ansible vault encrypted values-secret files. You can now encrypt your values-secret file
96+
1. ~/values-secret.yaml
97+
1. <patterngitrepo>/values-secret.yaml.template
98+
- Add support for Ansible vault encrypted values-secret files. You can now encrypt your values-secret file
9999
at rest with `ansible-vault encrypt ~/values-secret.yaml`. When running `make load-secrets` if an encrypted
100100
file is encountered the user will be prompted automatically for the password to decrypt it.
101101

102102
## November 6, 2022
103103

104-
* Add support for /values-<CloudPlatform>-<clusterGroup>.yaml (e.g. /values-AWS-group-one.yaml)
104+
- Add support for /values-<CloudPlatform>-<clusterGroup>.yaml (e.g. /values-AWS-group-one.yaml)
105105

106106
## October 28, 2022
107107

108-
* Updated vault helm chart to v0.22.1 and vault containers to 1.12.0
108+
- Updated vault helm chart to v0.22.1 and vault containers to 1.12.0
109109

110110
## October 25, 2022
111111

112-
* Updated External Secrets Operator to v0.6.0
113-
* Moved to -UBI based ESO containers
112+
- Updated External Secrets Operator to v0.6.0
113+
- Moved to -UBI based ESO containers
114114

115115
## October 13, 2022
116116

117-
* Added global.clusterVersion as a new helm variable which represents the OCP
117+
- Added global.clusterVersion as a new helm variable which represents the OCP
118118
Major.Minor cluster version. By default now a user can add a
119119
values-<ocpversion>-<clustergroup>.yaml file to have specific cluster version
120120
overrides (e.g. values-4.10-hub.yaml). Will need Validated Patterns Operator >= 0.0.6
@@ -123,20 +123,25 @@
123123

124124
## October 4, 2022
125125

126-
* Extended the values-secret.yaml file to support multiple vault paths and re-wrote
126+
- Extended the values-secret.yaml file to support multiple vault paths and re-wrote
127127
the push_secrets feature as python module plugin. This requires the following line
128128
in a pattern's ansible.cfg's '[defaults]' stanza:
129129

130130
`library=~/.ansible/plugins/modules:./ansible/plugins/modules:./common/ansible/plugins/modules:/usr/share/ansible/plugins/modules`
131131

132132
## October 3, 2022
133133

134-
* Restore the ability to install a non-default site: `make TARGET_SITE=mysite install`
135-
* Revised tests (new output and filenames, requires adding new result files to Git)
136-
* ACM 2.6 required for ACM-based managed sites
137-
* Introduced global.clusterDomain template variable (without the `apps.` prefix)
138-
* Removed the ability to send specific charts to another cluster, use hosted argo sites instead
139-
* Added the ability to have the hub host `values-{site}.yaml` for spoke clusters.
134+
- Restore the ability to install a non-default site: `make TARGET_SITE=mysite install`
135+
136+
- Revised tests (new output and filenames, requires adding new result files to Git)
137+
138+
- ACM 2.6 required for ACM-based managed sites
139+
140+
- Introduced global.clusterDomain template variable (without the `apps.` prefix)
141+
142+
- Removed the ability to send specific charts to another cluster, use hosted argo sites instead
143+
144+
- Added the ability to have the hub host `values-{site}.yaml` for spoke clusters.
140145

141146
The following example would deploy the namespaces, subscriptions, and
142147
applications defined in `values-group-one.yaml` to the `perth` cluster

common/Makefile

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ endif
77
# Set this to true if you want to skip any origin validation
88
DISABLE_VALIDATE_ORIGIN ?= false
99
ifeq ($(DISABLE_VALIDATE_ORIGIN),true)
10-
VALIDATE_ORIGIN :=
10+
VALIDATE_ORIGIN :=
1111
else
1212
VALIDATE_ORIGIN := validate-origin
1313
endif
@@ -31,9 +31,8 @@ TARGET_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
3131
#default to the branch remote
3232
TARGET_ORIGIN ?= $(shell git config branch.$(TARGET_BRANCH).remote)
3333

34-
# This is to ensure that whether we start with a git@ or https:// URL, we end up with an https:// URL
35-
# This is because we expect to use tokens for repo authentication as opposed to SSH keys
36-
TARGET_REPO=$(shell git ls-remote --get-url --symref $(TARGET_ORIGIN) | sed -e 's/.*URL:[[:space:]]*//' -e 's%^git@%%' -e 's%^https://%%' -e 's%:%/%' -e 's%^%https://%')
34+
# The URL for the configured origin (could be HTTP/HTTPS/SSH)
35+
TARGET_REPO_RAW := $(shell git ls-remote --get-url --symref $(TARGET_ORIGIN))
3736

3837
UUID_FILE ?= ~/.config/validated-patterns/pattern-uuid
3938
UUID_HELM_OPTS ?=
@@ -50,13 +49,22 @@ TOKEN_SECRET ?=
5049
TOKEN_NAMESPACE ?=
5150

5251
ifeq ($(TOKEN_SECRET),)
53-
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)
52+
# SSH agents are not created for public repos (repos with no secret token) by the patterns operator so we convert to HTTPS
53+
TARGET_REPO := $(shell echo "$(TARGET_REPO_RAW)" | sed 's/^git@\(.*\):\(.*\)/https:\/\/\1\/\2/')
54+
SECRET_OPTS :=
5455
else
55-
# When we are working with a private repository we do not escape the git URL as it might be using an ssh secret which does not use https://
56-
TARGET_CLEAN_REPO=$(shell git ls-remote --get-url --symref $(TARGET_ORIGIN))
57-
HELM_OPTS=-f values-global.yaml --set main.tokenSecret=$(TOKEN_SECRET) --set main.tokenSecretNamespace=$(TOKEN_NAMESPACE) --set main.git.repoURL="$(TARGET_CLEAN_REPO)" --set main.git.revision=$(TARGET_BRANCH) $(TARGET_SITE_OPT) $(UUID_HELM_OPTS) $(EXTRA_HELM_OPTS)
56+
TARGET_REPO := $(TARGET_REPO_RAW)
57+
SECRET_OPTS := --set main.tokenSecret=$(TOKEN_SECRET) --set main.tokenSecretNamespace=$(TOKEN_NAMESPACE)
5858
endif
5959

60+
HELM_OPTS := -f values-global.yaml \
61+
--set main.git.repoURL="$(TARGET_REPO)" \
62+
--set main.git.revision=$(TARGET_BRANCH) \
63+
$(SECRET_OPTS) \
64+
$(TARGET_SITE_OPT) \
65+
$(UUID_HELM_OPTS) \
66+
$(EXTRA_HELM_OPTS)
67+
6068
# Helm does the right thing and fetches all the tags and detects the newest one
6169
PATTERN_INSTALL_CHART ?= oci://quay.io/hybridcloudpatterns/pattern-install
6270

@@ -138,8 +146,6 @@ token-kubeconfig: ## Create a local ~/.kube/config with password (not usually ne
138146

139147
##@ Validation Tasks
140148

141-
# We only check the remote ssh git branch's existance if we're not running inside a container
142-
# as getting ssh auth working inside a container seems a bit brittle
143149
# If the main repoUpstreamURL field is set, then we need to check against
144150
# that and not target_repo
145151
.PHONY: validate-origin
@@ -250,16 +256,14 @@ super-linter: ## Runs super linter locally
250256
-e VALIDATE_JSCPD=false \
251257
-e VALIDATE_JSON_PRETTIER=false \
252258
-e VALIDATE_MARKDOWN_PRETTIER=false \
253-
-e VALIDATE_KUBERNETES_KUBECONFORM=false \
254259
-e VALIDATE_PYTHON_PYLINT=false \
255260
-e VALIDATE_SHELL_SHFMT=false \
256-
-e VALIDATE_TEKTON=false \
257261
-e VALIDATE_YAML=false \
258262
-e VALIDATE_YAML_PRETTIER=false \
259263
$(DISABLE_LINTERS) \
260264
-v $(PWD):/tmp/lint:rw,z \
261265
-w /tmp/lint \
262-
ghcr.io/super-linter/super-linter:slim-v7
266+
ghcr.io/super-linter/super-linter@sha256:6c71bd17ab38ceb7acb5b93ef72f5c2288b5456a5c82693ded3ee8bb501bba7f # slim-v8.1.0
263267

264268
.PHONY: deploy upgrade legacy-deploy legacy-upgrade
265269
deploy upgrade legacy-deploy legacy-upgrade:

common/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
This is the `main` branch of common and it assumes that the pattern is fully
88
multisource (meaning that any used charts from VP is actually referenced from
99
either a helm chart repository or quay repository). I.e. there are no helm
10-
charts contained in this branch of common and there is no ansible code neither.
10+
charts contained in this branch of common and there is no Ansible code neither.
1111

1212
The helm charts now live in separate repositories under the VP
1313
[organization](https://github.com/validatedpatterns) on GitHub. The repositories are:
@@ -19,10 +19,10 @@ The helm charts now live in separate repositories under the VP
1919
- acm-chart
2020
- letsencrypt-chart
2121

22-
The ansible bits live in this [repository](https://github.com/validatedpatterns/rhvp.cluster_utils)
22+
The Ansible bits live in this [repository](https://github.com/validatedpatterns/rhvp.cluster_utils)
2323

2424
In order to be able to use this "slimmed-down" main branch of common you *must*
25-
use a 0.9.* clustergroup-chart that. Add the following to your `values-global.yaml`:
25+
use a 0.9.\* clustergroup-chart that. Add the following to your `values-global.yaml`:
2626

2727
```yaml
2828
main:
@@ -48,4 +48,4 @@ git merge -s subtree -Xtheirs -Xsubtree=common common-upstream/main
4848

4949
## Secrets
5050

51-
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)
51+
There are two different secret formats parsed by the Ansible bits. Both are documented [in the vault role](https://github.com/validatedpatterns/rhvp.cluster_utils/blob/main/roles/vault_utils/README.md)

0 commit comments

Comments
 (0)