Skip to content

Commit 3859ee6

Browse files
committed
test(monitoring): assert the collector image goes through cozy-lib.image, not its name
The previous assertion listed the image names a release build may leave in values.yaml. Set the cluster images-registry instead and check that it lands in front of the rendered image and that the image stays digest-pinned: that is the helper's behaviour, and it holds on main and on a release branch alike. Removing the helper from the template makes the case fail; the old regex did not notice. Assisted-by: LLM Signed-off-by: Marian Koreniuk <[email protected]> (cherry picked from commit e05c6af)
1 parent eec4098 commit 3859ee6

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎packages/system/monitoring/tests/vtraces_collector_test.yaml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,12 +473,18 @@ tests:
473473
path: spec.template.spec.containers[0].securityContext.capabilities.drop
474474
content: ALL
475475

476+
# The image name is not asserted: a release build swaps the upstream
477+
# collector for the first-party otelcol-tracing one and restamps the tag.
478+
# What must hold is that the value goes through cozy-lib.image (the cluster
479+
# images-registry lands in front of it) and stays digest-pinned.
476480
- it: pins the collector image through the cozy-lib.image helper
481+
set:
482+
_cluster:
483+
images-registry: mirror.example.com
477484
documentSelector:
478485
path: kind
479486
value: Deployment
480487
asserts:
481488
- matchRegex:
482489
path: spec.template.spec.containers[0].image
483-
# A release build swaps the upstream image for the first-party otelcol-tracing one.
484-
pattern: "(opentelemetry-collector-contrib|otelcol-tracing):.*@sha256:"
490+
pattern: '^mirror\.example\.com/.+@sha256:[0-9a-f]{64}$'

0 commit comments

Comments
 (0)