Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/align-otel-collector-tag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"helm-charts": patch
---

fix: align otel-collector image tag with chart appVersion
26 changes: 26 additions & 0 deletions .github/workflows/helm-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,32 @@ jobs:
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm dependency build charts/clickstack

- name: Validate appVersion matches collector image tag
run: |
set -euo pipefail
APP_VERSION=$(awk '$1 == "appVersion:" { print $2 }' charts/clickstack/Chart.yaml)
COLLECTOR_TAG=$(awk '
$1 == "repository:" && $2 == "docker.clickhouse.com/clickhouse/clickstack-otel-collector" { in_image = 1; next }
in_image && $1 == "tag:" {
gsub(/"/, "", $2)
print $2
exit
}
' charts/clickstack/values.yaml)

if [ -z "$APP_VERSION" ] || [ -z "$COLLECTOR_TAG" ]; then
echo "Could not read appVersion or otel-collector image tag"
exit 1
fi

if [ "$APP_VERSION" != "$COLLECTOR_TAG" ]; then
echo "appVersion ($APP_VERSION) does not match otel-collector.image.tag ($COLLECTOR_TAG)"
exit 1
fi

EXPECTED_COLLECTOR_IMAGE="image: \"docker.clickhouse.com/clickhouse/clickstack-otel-collector:${APP_VERSION}\""
helm template clickstack-version-check charts/clickstack | grep -F "$EXPECTED_COLLECTOR_IMAGE"

- name: Validate example values render
run: |
helm template clickstack-example charts/clickstack \
Expand Down
47 changes: 45 additions & 2 deletions .github/workflows/update-app-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,50 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Update appVersion in Chart.yaml
env:
TAG: ${{ github.event.inputs.tag }}
run: |
sed -i "s/^appVersion: .*/appVersion: ${{ github.event.inputs.tag }}/" charts/clickstack/Chart.yaml
set -euo pipefail
tmp=$(mktemp)
awk -v tag="$TAG" '
/^appVersion:/ { $0 = "appVersion: " tag; updated = 1 }
{ print }
END { exit updated ? 0 : 1 }
' charts/clickstack/Chart.yaml > "$tmp"
mv "$tmp" charts/clickstack/Chart.yaml

- name: Update otel-collector image tag in values.yaml
env:
TAG: ${{ github.event.inputs.tag }}
run: |
set -euo pipefail
tmp=$(mktemp)
awk -v tag="$TAG" '
/repository: docker\.clickhouse\.com\/clickhouse\/clickstack-otel-collector[[:space:]]*$/ {
in_collector_image = 1
print
next
}
in_collector_image && /^[[:space:]]{0,2}[[:alnum:]_-]+:/ {
in_collector_image = 0
}
in_collector_image && /^[[:space:]]*tag:/ {
sub(/tag: .*/, "tag: \"" tag "\"")
updated = 1
in_collector_image = 0
}
{ print }
END { exit updated ? 0 : 1 }
' charts/clickstack/values.yaml > "$tmp"
mv "$tmp" charts/clickstack/values.yaml
awk -v tag="$TAG" '
/repository: docker\.clickhouse\.com\/clickhouse\/clickstack-otel-collector/ { in_image = 1; next }
in_image && /^[[:space:]]*tag:/ {
if ($0 ~ "tag: \"" tag "\"") found = 1
in_image = 0
}
END { exit found ? 0 : 1 }
' charts/clickstack/values.yaml

- name: Create changeset
run: |
Expand All @@ -43,8 +85,9 @@ jobs:
commit-message: "chore: Update appVersion to ${{ github.event.inputs.tag }}"
title: "Update appVersion to ${{ github.event.inputs.tag }}"
body: |
This PR updates the appVersion in Chart.yaml to `${{ github.event.inputs.tag }}`.
This PR updates the appVersion in Chart.yaml to `${{ github.event.inputs.tag }}` and aligns the otel-collector image tag in values.yaml.

- Updated `charts/clickstack/Chart.yaml`
- Updated `otel-collector.image.tag` in `charts/clickstack/values.yaml`
branch: update-app-version-${{ github.event.inputs.tag }}
delete-branch: true
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ tests:
| Helm Chart Tests | `helm-test.yaml` | push/PR to main | Unit tests + example validation |
| Integration Test | `chart-test.yml` | push/PR/nightly | Kind-based integration suites |
| Release | `release.yml` | after tests pass on main | Changeset version + chart release |
| Update App Version | `update-app-version.yml` | workflow_dispatch | Bump `appVersion` in Chart.yaml |
| Update App Version | `update-app-version.yml` | workflow_dispatch | Bump `appVersion` in Chart.yaml and align `otel-collector.image.tag` in values.yaml |

## Key File Locations

Expand All @@ -163,5 +163,5 @@ tests:
- Unit tests: `charts/clickstack/tests/*_test.yaml`
- Integration suites: `integration-tests/*/`
- Example values: `examples/*/values.yaml`
- Version sync script: `scripts/update-chart-versions.js`
- Chart version sync script: `scripts/update-chart-versions.js`
- Smoke test: `scripts/smoke-test.sh`
3 changes: 1 addition & 2 deletions charts/clickstack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ otel-collector:
mode: deployment
image:
repository: docker.clickhouse.com/clickhouse/clickstack-otel-collector
tag: "2.19.0"
tag: "2.28.0"
extraEnvsFrom:
- configMapRef:
name: clickstack-config
Expand Down Expand Up @@ -412,4 +412,3 @@ otel-collector:
enabled: false
zipkin:
enabled: false

Loading