feat: format-based image registry rewrite (replaces scion-* heuristic)#8
Open
zeroasterisk wants to merge 1 commit into
Open
feat: format-based image registry rewrite (replaces scion-* heuristic)#8zeroasterisk wants to merge 1 commit into
zeroasterisk wants to merge 1 commit into
Conversation
…ction Use Docker/OCI convention to detect fully-qualified image references: if the first path component contains a '.' or ':' it's a registry domain, so keep the image as-is. Bare names and relative paths are rewritten to the configured image_registry. This is more correct than the scion-* prefix heuristic because: - Fully-qualified scion-* images from external registries are preserved - Non-scion bare names are now also rewritten (previously skipped) - No need for an image_pinned workaround flag Resolves ptone#265
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Alternative A from ptone#265: format-based image registry rewrite detection.
.or:) are kept as-is — e.g.ghcr.io/myorg/scion-elixir:latest,us-docker.pkg.dev/proj/repo/scion-claude:latest,localhost:5000/myimage:devimage_registry— e.g.scion-claude:latest,my-custom-agent:v2library/scion-claude:latestThis replaces the
scion-*prefix heuristic which broke when template authors used fully-qualifiedscion-*images from external registries. It also deprecates theimage_pinnedworkaround from PR GoogleCloudPlatform#425 — that flag is no longer needed since the format-based detection handles the use case natively.Changes
pkg/config/settings_v1.go: RewroteRewriteImageRegistry()— now uses Docker/OCI convention (.or:in first path component = registry domain) instead ofscion-*basename prefix checkpkg/config/settings_v1_test.go: Replaced test suite with 20 test cases covering bare scion names, bare non-scion names, relative paths, fully-qualified images (ghcr.io, us-docker.pkg.dev, docker.io, localhost:5000, custom.registry:5000), sha256 digests, and edge casesTest plan
go test ./pkg/config/... -run TestRewriteImageRegistry— all 20 cases passgo vet ./...— cleango build ./...— cleanResolves ptone#265