Skip to content

Commit

Permalink
Merge branch 'main' into standalone-cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
itay-grudev committed Sep 30, 2023
2 parents 35f3a7b + 3ebfc22 commit 9fe69cc
Show file tree
Hide file tree
Showing 22 changed files with 972 additions and 250 deletions.
6 changes: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"prConcurrentLimit": 5,
"semanticCommits": "enabled",
"regexManagers": [
{
"fileMatch": ["charts\\/cloudnative-pg\\/Chart\\.yaml$"],
"matchStrings": [
"appVersion: \"(?<currentValue>.*?)\"",
],
"datasourceTemplate": "docker",
"depNameTemplate": "ghcr.io/cloudnative-pg/cloudnative-pg",
"versioningTemplate": "loose"
},
],
"packageRules": [
{
"matchDepTypes": [
"action"
],
"pinDigests": true
},
]
}
10 changes: 5 additions & 5 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ on:

jobs:
install_deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3.3.0
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/[email protected]
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.6.2

- name: Create kind cluster
uses: helm/kind-action@v1.5.0
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0

- name: Deploy using helm chart
run: |
helm upgrade --install cnpg --namespace cnpg-system \
--create-namespace charts/cloudnative-pg --wait
- name: Install kubectl
uses: azure/[email protected]
uses: azure/setup-kubectl@901a10e89ea615cf61f57ac05cecdf23e7de06d8 # v3.2

- name: Deploy a cluster
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ on:

jobs:
linter:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3.3.0
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/[email protected]
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.4.0

- uses: actions/setup-python@v4
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.3.1
uses: helm/chart-testing-action@e8788873172cb653a90ca2e819d79d65a66d4e76 # v2.4.0

- name: Run chart-testing (list-changed)
id: list-changed
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ on:

jobs:
pull-request:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
-
name: Checkout
uses: actions/checkout@v3.3.0
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
-
name: Get tag
run: |
echo "TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV
-
name: Pull Request
id: open-pr
uses: repo-sync/pull-request@v2.6.2
uses: repo-sync/pull-request@7e79a9f5dc3ad0ce53138f01df2fad14a04831c5 # v2.12.1
with:
destination_branch: "main"
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ on:

jobs:
release:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3.3.0
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
fetch-depth: 0

- name: Publish Helm charts
uses: stefanprodan/[email protected]
uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 # v1.7.0
with:
helm_version: 3.4.0
token: "${{ secrets.REPO_GHA_PAT }}"
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ on:

jobs:
tag:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
-
name: Checkout
uses: actions/checkout@v3.3.0
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
-
name: Temporarily disable "include administrators" branch protection
if: ${{ always() && github.ref == 'refs/heads/main' }}
id: disable_include_admins
uses: benjefferies/[email protected].7
uses: benjefferies/branch-protection-bot@a37e132671409118a53e37e9c81d63fd534bb2e7 # 1.0.9
with:
access_token: ${{ secrets.REPO_GHA_PAT }}
branch: main
enforce_admins: false
-
name: Create tag
if: github.event.pull_request.merged == true && startsWith(${{ github.head_ref }}, "release/")
uses: christophebedard/[email protected]
uses: christophebedard/tag-version-commit@ea0363ff76cae3e81c21695cdd21218204be290b # v1.6.3
with:
token: ${{ secrets.REPO_GHA_PAT }}
version_regex: '^Release ([a-z-]+-v[0-9]+\.[0-9]+\.[0-9]+)'
dry_run: false
-
name: Enable "include administrators" branch protection
uses: benjefferies/[email protected].7
uses: benjefferies/branch-protection-bot@a37e132671409118a53e37e9c81d63fd534bb2e7 # 1.0.9
if: ${{ always() && github.ref == 'refs/heads/main' }}
with:
access_token: ${{ secrets.REPO_GHA_PAT }}
Expand Down
64 changes: 15 additions & 49 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ follow these steps:
1. update everything else as required, e.g. if releasing due to a new
cloudnative-pg version being released, you might want to update the
following:
1. `.appVersion` in the [Chart.yaml](./charts/cloudnative-pg/Chart.yaml) file
1. [crds.yaml](./charts/cloudnative-pg/templates/crds/crds.yaml), whose
1. `.appVersion` in the [Chart.yaml](./charts/cloudnative-pg/Chart.yaml) file
1. [crds.yaml](./charts/cloudnative-pg/templates/crds/crds.yaml), whose
content can be built using [kustomize](https://kustomize.io/) from the
cloudnative-pg repo using kustomize
[remoteBuild](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/remoteBuild.md)
Expand All @@ -39,65 +39,31 @@ follow these steps:
It might be easier to run `kustomize build config/helm` from the
`cloudnative-pg` repo, with the desired release branch checked out, and
copy the result to `./charts/cloudnative-pg/templates/crds/crds.yaml`.
1. NOTE: please keep the guards for `.Values.crds.create`, i.e.
1. NOTE: please keep the guards for `.Values.crds.create`, i.e.
`{{- if .Values.crds.create }}` and `{{- end }}` after you copy the CRD
into `templates/crds/crds.yaml`.
1. to update the files in the
1. to update the files in the
[templates](./charts/cloudnative-pg/templates) directory, you can diff
the previous CNPG release yaml against the new one, to find what
should be updated (e.g. `vimdiff
https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/releases/cnpg-1.15.0.yaml
https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/releases/cnpg-1.15.1.yaml`) \
Or, from the `cloudnative-pg` repo, with the desired release branch checked out,
`vimdiff releases/cnpg-1.15.0.yaml releases/cnpg-1.15.1.yaml`
1. update [values.yaml](./charts/cloudnative-pg/values.yaml) if needed
1. NOTE: updating `values.yaml` just for the CNPG verision may not be
1. update [values.yaml](./charts/cloudnative-pg/values.yaml) if needed
1. NOTE: updating `values.yaml` just for the CNPG verision may not be
necessary, as the value should default to the `appVersion` in `Chart.yaml`
1. run `make docs schema` to regenerate the docs and the values schema in case it is needed
1. `git commit -S -s -m "Release cloudnative-pg-vX.Y.Z" --edit` and add all
1. run `make docs schema` to regenerate the docs and the values schema in case it is needed
1. `git commit -S -s -m "Release cloudnative-pg-vX.Y.Z" --edit` and add all
the informations you wish below the commit message.
1. `git push --set-upstream origin release/coudnative-pg-vX.Y.Z`
1. a PR named `Release cloudnative-pg-vX.Y.Z` will be automatically created
1. wait for all the checks to pass
1. two approvals are required in order to merge the PR, if you are a
1. `git push --set-upstream origin release/cloudnative-pg-vX.Y.Z`
1. a PR named `Release cloudnative-pg-vX.Y.Z` will be automatically created
1. wait for all the checks to pass
1. two approvals are required in order to merge the PR, if you are a
maintainer approve the PR yourself and ask for another approval, otherwise
ask for two approvals directly.
1. merge the pr squashing all commits and **taking care to keep the commit
1. merge the pr squashing all commits and **taking care to keep the commit
message to be `Release cloudnative-pg-vX.Y.Z`**
1. a tag `cloudnative-pg-vX.Y.Z` will be automatically created by an action,
1. a tag `cloudnative-pg-vX.Y.Z` will be automatically created by an action,
which will ten trigger the release action, check they both are successful.
1. once done you should be able to run helm repo `helm repo add cnpg https://cloudnative-pg.github.io/charts; helm repo update; helm search repo cnpg` and be able to see the new version `vX.Y.Z` as `CHART VERSION` for `cloudnative-pg`

## How to release cnpg-sandbox

cnpg-sandbox is an umbrella chart which depends on the cloudnative-pg chart, therefore in case the only change required is bumping cloudnative-pg version, its release should be done only once its dependency has been successfully released.

In order to create a new release of the `cnpg-sandbox` chart, follow
these steps:

1. take note of the current value of the release: see `.version`
in `charts/cnpg-sandbox/Chart.yaml`
1. decide which version to create, depending on the kind of jump of the
cloudnative-pg chart release, following semver semantics.
For this document, let's call it `X.Y.Z`
1. create a branch `release/cnpg-sandbox-vX.Y.Z` and switch to it
1. update the `.version` in the [Chart.yaml](./charts/cnpg-sandbox/Chart.yaml) file to `"X.Y.Z"`
1. update everything else as required, e.g. if releasing due to a new cloudnative-pg chart being released:
1. bump the `.appVersion` in `Chart.yaml`
1. bump `.dependecies[0].version` for the `cloudnative-pg` chart in the aforementioned `Chart.yaml` file
1. update the [values.yaml](./charts/cnpg-sandbox/Chart.yaml) file if needed
1. run `helm dependency update charts/cnpg-sandbox` to sync the [Chart.lock](./charts/cnpg-sandbox/Chart.lock) to the new dependencies
1. run `make docs schema` to regenerate the docs and the values schema in case it is needed
1. `git commit -S -s -m "Release cnpg-sandbox-vX.Y.Z" --edit` and add all
the informations you wish below the commit message.
1. `git push --set-upstream origin release/cnpg-sandbox-vX.Y.Z`
1. a PR named `Release cnpg-sandbox-vX.Y.Z` will be automatically created
1. wait for all the checks to pass
1. two approvals are required in order to merge the PR, if you are a
maintainer approve the PR yourself and ask for another approval, otherwise
ask for two approvals directly.
1. merge the pr squashing all commits and **taking care to keep the commit
message to be `Release cnpg-sandbox-vX.Y.Z`**
1. a tag `cnpg-sandbox-vX.Y.Z` will be automatically created by an action,
which will ten trigger the release action, check they both are successful.
1. once done you should be able to run helm repo `helm repo add cnpg https://cloudnative-pg.github.io/charts; helm repo update; helm search repo cnpg` and be able to see the new version `vX.Y.Z` as `CHART VERSION` for `cnpg-sandbox`
1. once done you should be able to run helm repo `helm repo add cnpg https://cloudnative-pg.github.io/charts; helm repo update; helm search repo cnpg` and be able to see the new version `vX.Y.Z` as `CHART VERSION` for `cloudnative-pg`
4 changes: 2 additions & 2 deletions charts/cloudnative-pg/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ name: cloudnative-pg
description: CloudNativePG Operator Helm Chart
icon: https://raw.githubusercontent.com/cloudnative-pg/artwork/main/cloudnativepg-logo.svg
type: application
version: "0.17.0"
version: "0.18.2"
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning, they should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.19.0"
appVersion: "1.20.2"
sources:
- https://github.com/cloudnative-pg/charts
keywords:
Expand Down
55 changes: 25 additions & 30 deletions charts/cloudnative-pg/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion charts/cloudnative-pg/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ metadata:
data:
{{- toYaml .Values.config.data | nindent 2 }}
{{- end }}
{{- else -}}
{{- else }}
apiVersion: v1
kind: Secret
type: Opaque
Expand Down
Loading

0 comments on commit 9fe69cc

Please sign in to comment.