Identify helper image config errors during tests
What does this MR do?
Identify helper image config errors during tests
Adds much stricter configuration of component tags. This includes explicitly enumerating the various flavors, architectures, etc that we allow in tags, which increases the maintenance burden.
An invalid tag format makes ./pusher -gen-indexes helper-images.json registry.test:8443/sandbox/gitlab-runner/gitlab-runner-helper bleeding print a warning, but does not prevent it from pushing the content. It does fail a unit test run by make pusher-test, so the CI/CD pipeline would fail before images are pushed.
Why was this MR needed?
During the development of !5316 (merged), a separate MR (!6033 (merged)) was merged which violated some of the implicit and unchecked assumptions for component tag formatting. Specifically, it added tag x86_64-binary-arm64-platform-%-servercore24H2. That was later revised to a tag that does follow conventions, so the current configuration is well-formed, but it raised a concern. Because the logic for creating helper image indexes is based on assumptions about how to infer the content of the image based on the naming conventions for its tag, parsing that image tag too loosely could result in an image index referencing an inappropriate image.
This MR is one way we could resolve that tension, but it could be argued that it swings the pendulum too far in the other direction. Before the logic in this MR, when the concrete flavor was added (which used tags that followed the pre-existing conventions), it was handled appropriately with no changes being needed to the in-progress !5316 (merged) MR. If this MR had been in place before concrete was added, it would have required the developer to update the knownLinuxFlavors constant in scripts/pusher/indexes.go. Conversely, if this had been merged before !6033 (merged), the CI pipeline would have failed, because x86_64-binary-arm64-platform-%-servercore24H2 was not a supported tag format.
What's the best way to test this MR?
Update scripts/pusher/helper-images.json, and change any of the component tags to violate the conventions. For example:
diff --git a/scripts/pusher/helper-images.json b/scripts/pusher/helper-images.json
index 4510dbe75..fe22732ba 100644
--- a/scripts/pusher/helper-images.json
+++ b/scripts/pusher/helper-images.json
@@ -115,7 +115,7 @@
"x86_64-%-servercore24H2"
],
"windows-servercore-ltsc2025-arm64": [
- "arm64-%-servercore24H2"
+ "x86_64-binary-arm64-platform-%-servercore24H2"
],
"concrete-arm64": [
"concrete-arm64-%"Then run make pusher-test and note the test failure:
--- FAIL: TestHelperImagesRejectedTags (0.00s)
indexes_test.go:372: Unexpected error reading helper-images.json (-want +got):
[]string(
- nil,
+ {"x86_64-binary-arm64-platform-%-servercore24H2"},
)
FAIL
exit status 1
FAIL gitlab.com/gitlab-org/gitlab-runner/scripts/pusher 0.240sWhat are the relevant issue numbers?
Closes: #39544 (closed)