Skip to content

Commit 8b70c76

Browse files
authored
Merge branch 'main' into imagecatalogs-rbac
Signed-off-by: Dmitry Grigoryev <[email protected]>
2 parents aff1b8f + b271884 commit 8b70c76

File tree

67 files changed

+2159
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2159
-216
lines changed

.github/actions/setup-kind/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212
steps:
1313
- id: helm
1414
name: Set up Helm
15-
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
15+
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
1616
with:
1717
version: v3.16.2
1818

@@ -21,4 +21,4 @@ runs:
2121
uses: azure/setup-kubectl@901a10e89ea615cf61f57ac05cecdf23e7de06d8 # v3.2
2222

2323
- name: Create kind cluster
24-
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
24+
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0

.github/workflows/lint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ jobs:
1919
fetch-depth: 0
2020

2121
- name: Set up Helm
22-
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
22+
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
2323
with:
2424
version: v3.16.2
2525

26-
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
26+
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
2727
with:
2828
python-version: 3.12
2929

3030
- name: Set up chart-testing
31-
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
31+
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0
3232

3333
- name: Run chart-testing (list-changed)
3434
id: list-changed

.github/workflows/release-publish.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
echo "${{ secrets.PGP_KEY_PASSPHRASE }}" > /tmp/passphrase-file.txt
3434
3535
- name: Set up Helm
36-
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
36+
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
3737
with:
3838
version: v3.16.2
3939

@@ -42,7 +42,7 @@ jobs:
4242
helm repo add cnpg-grafana-dashboard https://cloudnative-pg.github.io/grafana-dashboards
4343
4444
- name: Run chart-releaser
45-
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # v1.6.0
45+
uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0
4646
env:
4747
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
4848
@@ -58,14 +58,14 @@ jobs:
5858
run: shred --remove=wipesync /tmp/keyring.gpg /tmp/passphrase-file.txt
5959

6060
- name: Login to GitHub Container Registry
61-
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
61+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
6262
with:
6363
registry: ghcr.io
6464
username: ${{ github.actor }}
6565
password: ${{ secrets.GITHUB_TOKEN }}
6666

6767
- name: Install sigstore/cosign
68-
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
68+
uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3.8.1
6969

7070
- name: Push charts to GHCR
7171
env:

.github/workflows/tests-cluster-chainsaw.yaml

+21-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
1-
name: tests-cluster-chainsaw
1+
name: test( cluster )
22

33
on:
44
pull_request:
55
branches-ignore:
66
- 'gh-pages'
77

88
jobs:
9-
test-cluster-standalone:
9+
test-list:
1010
runs-on: ubuntu-24.04
11+
outputs:
12+
tests: ${{ steps.listTests.outputs.tests }}
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
with:
17+
fetch-depth: 1
18+
- id: listTests
19+
run: |
20+
echo "tests=$(ls charts/cluster/test -1 | jq -cRn '{ include: [inputs | { test: "\(.)" }]}')" >> $GITHUB_OUTPUT
21+
test:
22+
needs: test-list
23+
runs-on: ubuntu-24.04
24+
strategy:
25+
fail-fast: false
26+
matrix: ${{ fromJson(needs.test-list.outputs.tests) }}
27+
name: ${{matrix.test}}
1128
steps:
1229
- name: Checkout
1330
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1431
with:
1532
fetch-depth: 0
1633

1734
- name: Install Cosign
18-
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da # v3.7.0
35+
uses: sigstore/cosign-installer@d7d6bc7722e3daa8354c50bcb52f4837da5e9b6a # v3.8.1
1936

2037
- name: Setup kind
2138
uses: ./.github/actions/setup-kind
@@ -51,4 +68,4 @@ jobs:
5168
tenant minio-operator/tenant
5269
5370
- name: Run Kyverno/Chainsaw
54-
run: chainsaw test
71+
run: chainsaw test charts/cluster/test/${{matrix.test}}

RELEASE.md

+24-17
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ In order to create a new release of the `cloudnative-pg` chart, follow these ste
2323

2424
1. Take note of the current value of the release: see `.version` in `charts/cloudnative-pg/Chart.yaml`
2525
```bash
26-
yq -r '.version' charts/cloudnative-pg/Chart.yaml
26+
OLD_VERSION=$(yq -r '.version' charts/cloudnative-pg/Chart.yaml)
27+
OLD_CNPG_VERSION=$(yq -r '.appVersion' charts/cloudnative-pg/Chart.yaml)
28+
echo $OLD_VERSION
2729
```
2830
2. Decide which version to create, depending on the kind of jump of the CloudNativePG release, following semver
2931
semantics. For this document, let's call it `X.Y.Z`
@@ -39,36 +41,41 @@ In order to create a new release of the `cloudnative-pg` chart, follow these ste
3941
sed -i -E "s/^version: \"([0-9]+.?)+\"/version: \"$NEW_VERSION\"/" charts/cloudnative-pg/Chart.yaml
4042
```
4143
5. Update everything else as required, e.g. if releasing due to a new `cloudnative-pg` version being released, you might
42-
want to update the following:
43-
1. `.appVersion` in the [Chart.yaml](./charts/cloudnative-pg/Chart.yaml) file
44-
2. [crds.yaml](./charts/cloudnative-pg/templates/crds/crds.yaml), which can be built using
44+
want to:
45+
1. Find the latest `cloudnative-pg` version by running:
46+
```bash
47+
NEW_CNPG_VERSION=$(curl "https://api.github.com/repos/cloudnative-pg/cloudnative-pg/tags" | jq -r '.[0].name | ltrimstr("v")')
48+
echo $NEW_CNPG_VERSION
49+
```
50+
2. Update `.appVersion` in the [Chart.yaml](./charts/cloudnative-pg/Chart.yaml) file
51+
```bash
52+
sed -i -E "s/^appVersion: \"([0-9]+.?)+\"/appVersion: \"$NEW_CNPG_VERSION\"/" charts/cloudnative-pg/Chart.yaml
53+
```
54+
3. Update [crds.yaml](./charts/cloudnative-pg/templates/crds/crds.yaml), which can be built using
4555
[kustomize](https://kustomize.io/) from the `cloudnative-pg` repo using kustomize
4656
[remoteBuild](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md)
4757
running:
58+
59+
Verify the version is correct. Edit it if incorrect, then run:
4860
```bash
49-
VERSION=v1.16.0
50-
kustomize build https://github.com/cloudnative-pg/cloudnative-pg/tree/release-1.16/config/helm/\?ref=v1.16.0
61+
echo '{{- if .Values.crds.create }}' > ./charts/cloudnative-pg/templates/crds/crds.yaml
62+
kustomize build https://github.com/cloudnative-pg/cloudnative-pg/config/helm/\?ref\=v$NEW_CNPG_VERSION >> ./charts/cloudnative-pg/templates/crds/crds.yaml
63+
echo '{{- end }}' >> ./charts/cloudnative-pg/templates/crds/crds.yaml
5164
```
52-
It might be easier to run `kustomize build config/helm` from the `cloudnative-pg` repo, with the desired release
53-
branch checked out, and copy the result to `./charts/cloudnative-pg/templates/crds/crds.yaml`.
54-
3. NOTE: please keep the guards for `.Values.crds.create`, i.e.
55-
`{{- if .Values.crds.create }}` and `{{- end }}` after you copy the CRD into `templates/crds/crds.yaml`.
5665
4. To update the files in the [templates](./charts/cloudnative-pg/templates) directory, you can diff the previous
5766
CNPG release yaml against the new one, to find what should be updated (e.g.
5867
```bash
59-
OLD_VERSION=1.15.0
60-
NEW_VERSION=1.15.1
6168
vimdiff \
62-
"https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/releases/cnpg-${OLD_VERSION}.yaml" \
63-
"https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/releases/cnpg-${NEW_VERSION}.yaml"
69+
"https://github.com/cloudnative-pg/cloudnative-pg/releases/download/v${OLD_CNPG_VERSION}/cnpg-${OLD_CNPG_VERSION}.yaml" \
70+
"https://github.com/cloudnative-pg/cloudnative-pg/releases/download/v${NEW_CNPG_VERSION}/cnpg-${NEW_CNPG_VERSION}.yaml"
6471
```
6572
Or from the `cloudnative-pg` repo, with the desired release branch checked out:
6673
```bash
6774
vimdiff releases/cnpg-1.15.0.yaml releases/cnpg-1.15.1.yaml
6875
```
69-
5. Update [values.yaml](./charts/cloudnative-pg/values.yaml) if needed
70-
6. NOTE: updating `values.yaml` just for the CNPG version may not be necessary, as the value should default to the
71-
`appVersion` in `Chart.yaml`
76+
5. Update [values.yaml](./charts/cloudnative-pg/values.yaml) if needed
77+
6. NOTE: updating `values.yaml` just for the CNPG version may not be necessary, as the value should default to the
78+
`appVersion` in `Chart.yaml`
7279
6. Run `make docs schema` to regenerate the docs and the values schema in case it is needed
7380
```bash
7481
make docs schema

charts/cloudnative-pg/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ name: cloudnative-pg
1818
description: CloudNativePG Operator Helm Chart
1919
icon: https://raw.githubusercontent.com/cloudnative-pg/artwork/main/cloudnativepg-logo.svg
2020
type: application
21-
version: "0.22.1"
21+
version: "0.23.2"
2222
# This is the version number of the application being deployed. This version number should be
2323
# incremented each time you make changes to the application. Versions are not expected to
2424
# follow Semantic Versioning, they should reflect the version the application is using.
2525
# It is recommended to use it with quotes.
26-
appVersion: "1.24.1"
26+
appVersion: "1.25.1"
2727
sources:
2828
- https://github.com/cloudnative-pg/charts
2929
keywords:

charts/cloudnative-pg/README.md

+5-3
Large diffs are not rendered by default.

charts/cloudnative-pg/templates/NOTES.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
CloudNativePG operator should be installed in namespace "{{ .Release.Namespace }}".
2+
CloudNativePG operator should be installed in namespace "{{ include "cloudnative-pg.namespace" . }}".
33
You can now create a PostgreSQL cluster with 3 nodes as follows:
44

55
cat <<EOF | kubectl apply -f -
@@ -9,7 +9,7 @@ kind: Cluster
99
metadata:
1010
name: cluster-example
1111
{{if not .Values.config.clusterWide -}}
12-
namespace: {{ .Release.Namespace }}
12+
namespace: {{ include "cloudnative-pg.namespace" . }}
1313
{{- end }}
1414
spec:
1515
instances: 3

charts/cloudnative-pg/templates/_helpers.tpl

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
{{/*
2+
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
3+
*/}}
4+
{{- define "cloudnative-pg.namespace" -}}
5+
{{- if .Values.namespaceOverride -}}
6+
{{- .Values.namespaceOverride -}}
7+
{{- else -}}
8+
{{- .Release.Namespace -}}
9+
{{- end -}}
10+
{{- end -}}
11+
112
{{/*
213
Expand the name of the chart.
314
*/}}
@@ -185,8 +196,11 @@ namespace scope or clusterwide
185196
resources:
186197
- backups
187198
- clusters
199+
- databases
188200
- poolers
201+
- publications
189202
- scheduledbackups
203+
- subscriptions
190204
verbs:
191205
- create
192206
- delete
@@ -199,7 +213,10 @@ namespace scope or clusterwide
199213
- postgresql.cnpg.io
200214
resources:
201215
- backups/status
216+
- databases/status
217+
- publications/status
202218
- scheduledbackups/status
219+
- subscriptions/status
203220
verbs:
204221
- get
205222
- patch

charts/cloudnative-pg/templates/config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ apiVersion: v1
1919
kind: ConfigMap
2020
metadata:
2121
name: {{ .Values.config.name }}
22+
namespace: {{ include "cloudnative-pg.namespace" . }}
2223
labels:
2324
{{- include "cloudnative-pg.labels" . | nindent 4 }}
2425
{{- with .Values.commonAnnotations }}

0 commit comments

Comments
 (0)