From 4f07add373f3eedd04b04846ed650b576cc28ab1 Mon Sep 17 00:00:00 2001 From: Michael Lin Date: Wed, 11 Nov 2026 19:07:17 +0000 Subject: [PATCH] migrator: decouple image unit test from release-rewritten values Releases rewrite sourcegraph.image.repository and migrator.image.defaultTag in values.yaml to the internal registry for internal builds, so asserting the chart default index.docker.io image failed every internal release build (first hit by 8.2.0). Pin the repository and tag in the test instead, matching charts/sourcegraph/tests/imageRepository_test.yaml. Amp-Thread-ID: https://ampcode.com/threads/T-ca0eafc9-7175-4232-bd12-abd4f121842f Co-authored-by: Amp --- .../tests/migrator_test.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/charts/sourcegraph-migrator/tests/migrator_test.yaml b/charts/sourcegraph-migrator/tests/migrator_test.yaml index 126d7c2a1..abadb2e92 100644 --- a/charts/sourcegraph-migrator/tests/migrator_test.yaml +++ b/charts/sourcegraph-migrator/tests/migrator_test.yaml @@ -9,9 +9,6 @@ tests: - matchRegex: path: metadata.name pattern: "^migrator-[a-z0-9]{5}$" - - matchRegex: - path: spec.template.spec.containers[0].image - pattern: "^index.docker.io/sourcegraph/migrator:" - equal: path: spec.template.spec.containers[0].args value: @@ -21,6 +18,21 @@ tests: path: spec.template.spec.restartPolicy value: Never + # Releases rewrite sourcegraph.image.repository and migrator.image.defaultTag + # in values.yaml, so pin both here instead of asserting the chart defaults. + - it: should build the image from the global repository and migrator.image + set: + sourcegraph: + image: + repository: my.registry.example/sg + migrator: + image: + defaultTag: test + asserts: + - equal: + path: spec.template.spec.containers[0].image + value: my.registry.example/sg/migrator:test + - it: should use migrator.name and migrator.args when set set: migrator: