Skip to content

Commit 193073e

Browse files
author
Frederic Spiers
committed
Merge commit '3191aa5' into fspiers/ENT-3334/incremental-sync-batch-2
2 parents ad8ca54 + 3191aa5 commit 193073e

File tree

98 files changed

+1567
-853
lines changed

Some content is hidden

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

98 files changed

+1567
-853
lines changed

.github/workflows/pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
python-version: 3.11
5050

5151
- name: Set up chart-testing-action
52-
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b # v2.7.0
52+
uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f # v2.8.0
5353

5454
- name: Get changed charts
5555
id: list-changed

.github/workflows/release.yaml

Lines changed: 70 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
required: false
1212
type: boolean
1313
default: false
14+
chart:
15+
description: 'Specific chart to release (optional, e.g. "charts/my-chart")'
16+
required: false
17+
type: string
1418

1519
concurrency:
1620
group: release
@@ -48,6 +52,22 @@ jobs:
4852
username: ${{ github.actor }}
4953
password: ${{ secrets.GITHUB_TOKEN }}
5054

55+
- name: Update chart dependencies
56+
run: |
57+
set -euo pipefail
58+
echo "Updating dependencies for all charts..."
59+
for chart_dir in charts/*; do
60+
if [ -f "$chart_dir/Chart.yaml" ]; then
61+
echo "Processing $chart_dir..."
62+
if grep -q "^dependencies:" "$chart_dir/Chart.yaml"; then
63+
echo " → Updating dependencies for $chart_dir"
64+
helm dependency update "$chart_dir"
65+
else
66+
echo " → No dependencies found, skipping"
67+
fi
68+
fi
69+
done
70+
5171
- name: Run chart-releaser
5272
id: chart-releaser
5373
uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0
@@ -56,9 +76,33 @@ jobs:
5676
env:
5777
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
5878

79+
- name: Package manually specified chart
80+
if: ${{ github.event.inputs.chart != '' }}
81+
run: |
82+
set -euo pipefail
83+
CHART_DIR="${{ github.event.inputs.chart }}"
84+
85+
if [ ! -d "$CHART_DIR" ]; then
86+
echo "ERROR: Chart directory $CHART_DIR does not exist"
87+
exit 1
88+
fi
89+
90+
# Update dependencies if they exist
91+
if grep -q "^dependencies:" "$CHART_DIR/Chart.yaml"; then
92+
echo "Updating dependencies for $CHART_DIR..."
93+
helm dependency update "$CHART_DIR"
94+
fi
95+
96+
echo "Packaging chart from $CHART_DIR..."
97+
mkdir -p .cr-release-packages
98+
helm package "$CHART_DIR" --destination .cr-release-packages
99+
100+
echo "Packaged charts:"
101+
ls -lh .cr-release-packages/
102+
59103
- name: Install cosign
60104
uses: sigstore/[email protected]
61-
if: ${{ steps.chart-releaser.outputs.changed_charts }}
105+
if: ${{ steps.chart-releaser.outputs.changed_charts || github.event.inputs.chart != '' }}
62106

63107
- id: github-repo-owner-name
64108
uses: ASzc/change-string-case-action@d0603cd0a7dd490be678164909f65c7737470a7f # v6
@@ -67,129 +111,81 @@ jobs:
67111

68112
- name: Upload charts to OCI registries
69113
id: upload
70-
if: ${{ steps.chart-releaser.outputs.changed_charts }}
114+
if: ${{ steps.chart-releaser.outputs.changed_charts || github.event.inputs.chart != '' }}
71115
env:
72116
COSIGN_KEY: ${{ secrets.COSIGN_KEY }}
73117
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
74118
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
75119
run: |
76120
set -euo pipefail
77121
78-
CHANGED_CHARTS="${{ steps.chart-releaser.outputs.changed_charts }}"
122+
# Determine which charts to release
123+
if [ -n "${{ github.event.inputs.chart }}" ]; then
124+
echo "Manual chart specified: ${{ github.event.inputs.chart }}"
125+
CHANGED_CHARTS="${{ github.event.inputs.chart }}"
126+
else
127+
CHANGED_CHARTS="${{ steps.chart-releaser.outputs.changed_charts }}"
128+
fi
129+
130+
131+
if [ -z "$CHANGED_CHARTS" ]; then
132+
echo "No charts to release."
133+
exit 0
134+
fi
79135
80136
# Retry function for network operations
81137
retry() {
82138
local max_attempts=3
83139
local attempt=1
84140
local delay=5
85-
86141
while [ $attempt -le $max_attempts ]; do
87-
if "$@"; then
88-
return 0
89-
else
90-
echo "Attempt $attempt failed. Retrying in ${delay}s..."
91-
sleep $delay
92-
delay=$((delay * 2))
93-
attempt=$((attempt + 1))
94-
fi
142+
if "$@"; then return 0; fi
143+
echo "Attempt $attempt failed. Retrying in ${delay}s..."
144+
sleep $delay
145+
delay=$((delay * 2))
146+
attempt=$((attempt + 1))
95147
done
96-
97148
echo "ERROR: All $max_attempts attempts failed"
98149
return 1
99150
}
100151
101-
# Login to primary registry with retry
102152
echo "Logging into primary registry..."
103153
retry helm registry login --username $REGISTRY_USER --password ${{ secrets.REGISTRY_PASSWORD }} https://${{ vars.REGISTRY }}
104154
105-
# Login to GHCR with retry
106155
echo "Logging into GHCR..."
107156
retry helm registry login --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} https://ghcr.io
108157
109158
RELEASED_CHARTS=""
110159
for chart_directory in ${CHANGED_CHARTS//,/ }; do
111160
CHART_NAME=${chart_directory#charts/}
112-
113161
cd $chart_directory
114162
115-
# Extract version and appVersion from Chart.yaml
116163
CHART_VERSION=$(yq eval '.version' "Chart.yaml")
117164
APP_VERSION=$(yq eval '.appVersion' "Chart.yaml")
118165
119-
# Push to primary registry (Docker Hub) with retry
120166
echo "Pushing Helm chart $CHART_NAME-$CHART_VERSION.tgz to oci://${{ vars.REGISTRY }}/${{ vars.REPOSITORY }}"
121167
if retry helm push ${{ github.workspace }}/.cr-release-packages/${CHART_NAME}-${CHART_VERSION}.tgz oci://${{ vars.REGISTRY }}/${{ vars.REPOSITORY }} 2>&1 | tee ${CHART_NAME}-output.log; then
122-
123-
# Extract digest and sign chart
124-
# More robust parsing: looks for "Digest: sha256:..." pattern
125168
DIGEST=$(grep -oP 'Digest:\s*\K(sha256:[a-f0-9]+)' ${CHART_NAME}-output.log || echo "")
126-
127-
if [ -z "$DIGEST" ]; then
128-
echo "ERROR: Failed to extract digest from helm push output"
129-
echo "Output was:"
130-
cat ${CHART_NAME}-output.log
131-
exit 1
132-
fi
133-
134-
echo "Extracted digest: $DIGEST"
135-
echo "Signing chart at ${{ vars.REGISTRY }}/${{ vars.REPOSITORY }}/${CHART_NAME}:${CHART_VERSION}@$DIGEST"
136-
137-
if ! cosign sign -y --upload=true --key env://COSIGN_KEY ${{ vars.REGISTRY }}/${{ vars.REPOSITORY }}/${CHART_NAME}:${CHART_VERSION}@$DIGEST; then
138-
echo "ERROR: Failed to sign chart"
139-
exit 1
140-
fi
141-
169+
[ -z "$DIGEST" ] && echo "ERROR: Failed to extract digest" && cat ${CHART_NAME}-output.log && exit 1
170+
cosign sign -y --upload=true --key env://COSIGN_KEY ${{ vars.REGISTRY }}/${{ vars.REPOSITORY }}/${CHART_NAME}:${CHART_VERSION}@$DIGEST
142171
RELEASED_CHARTS="$RELEASED_CHARTS ${CHART_NAME}"
143-
echo "Successfully released $CHART_NAME-$CHART_VERSION to primary registry"
144-
else
145-
echo "ERROR: Failed to push $CHART_NAME-$CHART_VERSION to primary registry"
146-
cat ${CHART_NAME}-output.log
147-
exit 1
148172
fi
149173
150-
# Push to GHCR with retry
151-
echo "Pushing Helm chart $CHART_NAME-$CHART_VERSION.tgz to oci://ghcr.io/${{ steps.github-repo-owner-name.outputs.lowercase }}/helm-charts"
174+
echo "Pushing Helm chart $CHART_NAME-$CHART_VERSION.tgz to GHCR..."
152175
if retry helm push ${{ github.workspace }}/.cr-release-packages/${CHART_NAME}-${CHART_VERSION}.tgz oci://ghcr.io/${{ steps.github-repo-owner-name.outputs.lowercase }}/helm-charts 2>&1 | tee ${CHART_NAME}-ghcr-output.log; then
153-
154-
# Extract digest and sign GHCR chart
155-
# More robust parsing: looks for "Digest: sha256:..." pattern
156176
GHCR_DIGEST=$(grep -oP 'Digest:\s*\K(sha256:[a-f0-9]+)' ${CHART_NAME}-ghcr-output.log || echo "")
157-
158-
if [ -z "$GHCR_DIGEST" ]; then
159-
echo "ERROR: Failed to extract digest from helm push output"
160-
echo "Output was:"
161-
cat ${CHART_NAME}-ghcr-output.log
162-
exit 1
163-
fi
164-
165-
echo "Extracted digest: $GHCR_DIGEST"
166-
echo "Signing chart at ghcr.io/${{ steps.github-repo-owner-name.outputs.lowercase }}/helm-charts/${CHART_NAME}:${CHART_VERSION}@$GHCR_DIGEST"
167-
168-
if ! cosign sign -y --upload=true --key env://COSIGN_KEY ghcr.io/${{ steps.github-repo-owner-name.outputs.lowercase }}/helm-charts/${CHART_NAME}:${CHART_VERSION}@$GHCR_DIGEST; then
169-
echo "ERROR: Failed to sign chart"
170-
exit 1
171-
fi
172-
173-
echo "Successfully released $CHART_NAME-$CHART_VERSION to GHCR"
174-
else
175-
echo "ERROR: Failed to push $CHART_NAME-$CHART_VERSION to GHCR"
176-
cat ${CHART_NAME}-ghcr-output.log
177-
exit 1
177+
[ -z "$GHCR_DIGEST" ] && echo "ERROR: Failed to extract GHCR digest" && cat ${CHART_NAME}-ghcr-output.log && exit 1
178+
cosign sign -y --upload=true --key env://COSIGN_KEY ghcr.io/${{ steps.github-repo-owner-name.outputs.lowercase }}/helm-charts/${CHART_NAME}:${CHART_VERSION}@$GHCR_DIGEST
178179
fi
179180
180181
cd ${{ github.workspace }}
181182
done
182-
echo "released_charts=$RELEASED_CHARTS" >> "$GITHUB_OUTPUT"
183183
184-
# Generate job summary
184+
echo "released_charts=$RELEASED_CHARTS" >> "$GITHUB_OUTPUT"
185185
echo "## 📦 Helm Charts Released" >> $GITHUB_STEP_SUMMARY
186-
echo "" >> $GITHUB_STEP_SUMMARY
187-
echo "Successfully released the following charts:" >> $GITHUB_STEP_SUMMARY
188-
echo "" >> $GITHUB_STEP_SUMMARY
189186
for chart in $RELEASED_CHARTS; do
190187
echo "- ✅ **$chart**" >> $GITHUB_STEP_SUMMARY
191188
done
192-
echo "" >> $GITHUB_STEP_SUMMARY
193189
echo "### 📍 Registries" >> $GITHUB_STEP_SUMMARY
194190
echo "- Primary: \`${{ vars.REGISTRY }}/${{ vars.REPOSITORY }}\`" >> $GITHUB_STEP_SUMMARY
195191
echo "- GHCR: \`ghcr.io/${{ steps.github-repo-owner-name.outputs.lowercase }}/helm-charts\`" >> $GITHUB_STEP_SUMMARY

charts/clusterpirate/Chart.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ dependencies:
44
version: 2.0.0
55
- name: valkey
66
repository: oci://registry-1.docker.io/cloudpirates
7-
version: 0.9.2
8-
digest: sha256:f2091174754807696e0633286f5498061b7816d8084e3161bcbb19d05b455ef6
9-
generated: "2025-11-04T10:17:14.827792567Z"
7+
version: 0.10.0
8+
digest: sha256:3577965d83abf44b24131494401cae4f1176284373b8a42581317602a77430dc
9+
generated: "2025-11-12T14:04:15.897660697Z"

charts/clusterpirate/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
version: "2.x.x"
2323
repository: oci://registry-1.docker.io/cloudpirates
2424
- name: valkey
25-
version: "0.9.2"
25+
version: "0.10.0"
2626
repository: oci://registry-1.docker.io/cloudpirates
2727
condition: valkey.enabled
2828
icon: https://a.storyblok.com/f/143071/512x512/88dc07809a/cluster-pirate-logo.svg

charts/common/Chart.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: common
33
description: A library chart for common templates and helper functions
44
type: library
5-
version: 2.0.0
6-
appVersion: "2.0.0"
5+
version: 2.1.0
6+
appVersion: "2.1.0"
77
home: https://www.cloudpirates.io
88
sources:
99
- https://github.com/CloudPirates-io/helm-charts/tree/main/charts/common
@@ -12,4 +12,10 @@ maintainers:
1212
1313
url: https://www.cloudpirates.io
1414
annotations:
15-
license: Apache-2.0
15+
license: Apache-2.0
16+
artifacthub.io/changes: |2
17+
- kind: changed
18+
description: "rename templates from common.* to cloudpirates.* to prevent collisions (#377)"
19+
links:
20+
- name: "Commit 07c6560"
21+
url: "https://github.com/CloudPirates-io/helm-charts/commit/07c6560"

charts/common/templates/_helpers.tpl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ Useful for multi-namespace deployments in combined charts.
3232
{{- default .Release.Namespace .Values.namespaceOverride | trunc 63 | trimSuffix "-" }}
3333
{{- end }}
3434

35+
{{/*
36+
Create a fully qualified app name adding the installation's namespace.
37+
*/}}
38+
{{- define "cloudpirates.fullname.namespace" -}}
39+
{{- printf "%s-%s" (include "cloudpirates.fullname" .) (include "cloudpirates.namespace" .) | trunc 63 | trimSuffix "-" -}}
40+
{{- end -}}
41+
3542
{{/*
3643
Create chart name and version as used by the chart label.
3744
*/}}
@@ -224,6 +231,20 @@ Render a value that contains template perhaps
224231
{{- end }}
225232
{{- end -}}
226233
234+
{{/*
235+
Merge a list of values that contains template after rendering them.
236+
Merge precedence is consistent with http://masterminds.github.io/sprig/dicts.html#merge-mustmerge
237+
Usage:
238+
{{ include "cloudpirates.tplvalues.merge" ( dict "values" (list .Values.path.to.the.Value1 .Values.path.to.the.Value2) "context" $ ) }}
239+
*/}}
240+
{{- define "cloudpirates.tplvalues.merge" -}}
241+
{{- $dst := dict -}}
242+
{{- range .values -}}
243+
{{- $dst = include "cloudpirates.tplvalues.render" (dict "value" . "context" $.context "scope" $.scope) | fromYaml | merge $dst -}}
244+
{{- end -}}
245+
{{ $dst | toYaml }}
246+
{{- end -}}
247+
227248
{{/*
228249
Return the proper Docker Image Registry Secret Names evaluating values as templates
229250
{{ include "cloudpirates.images.renderPullSecrets" ( dict "images" (list .Values.path.to.the.image1, .Values.path.to.the.image2) "context" $) }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{/*
2+
Reuses the value from an existing secret, otherwise sets its value to a default value.
3+
4+
Usage:
5+
{{ include "cloudpirates.secrets.lookup" (dict "secret" "secret-name" "key" "keyName" "defaultValue" .Values.myValue "context" $) }}
6+
7+
Params:
8+
- secret - String - Required - Name of the 'Secret' resource where the password is stored.
9+
- key - String - Required - Name of the key in the secret.
10+
- defaultValue - String - Required - The path to the validating value in the values.yaml, e.g: "mysql.password". Will pick first parameter with a defined value.
11+
- context - Context - Required - Parent context.
12+
13+
*/}}
14+
{{- define "cloudpirates.secrets.lookup" -}}
15+
{{- $value := "" -}}
16+
{{- $secretData := (lookup "v1" "Secret" (include "cloudpirates.namespace" .context) .secret).data -}}
17+
{{- if and $secretData (hasKey $secretData .key) -}}
18+
{{- $value = index $secretData .key -}}
19+
{{- else if .defaultValue -}}
20+
{{- $value = .defaultValue | toString | b64enc -}}
21+
{{- end -}}
22+
{{- if $value -}}
23+
{{- printf "%s" $value -}}
24+
{{- end -}}
25+
{{- end -}}

charts/etcd/Chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: etcd
33
description: etcd is a distributed reliable key-value store for the most critical data of a distributed system
44
type: application
5-
version: 0.3.1
5+
version: 0.3.3
66
appVersion: "3.6.5"
77
keywords:
88
- etcd
@@ -41,7 +41,7 @@ annotations:
4141
url: https://www.cloudpirates.io
4242
artifacthub.io/changes: |2
4343
- kind: changed
44-
description: "[etcd, rabbitmq, redis, zookeeper] add signature verification documentation to readme (#476)"
44+
description: " [etcd] Use http for probes (#622)"
4545
links:
46-
- name: "Commit 91c7310"
47-
url: "https://github.com/CloudPirates-io/helm-charts/commit/91c7310"
46+
- name: "Commit c9d2054"
47+
url: "https://github.com/CloudPirates-io/helm-charts/commit/c9d2054"

0 commit comments

Comments
 (0)