Skip to content

fix(config): scope library/ prefix to Docker Hub#4022

Open
louis-kauer wants to merge 1 commit into
loft-sh:mainfrom
louis-kauer:fix/image-string-library-prefix
Open

fix(config): scope library/ prefix to Docker Hub#4022
louis-kauer wants to merge 1 commit into
loft-sh:mainfrom
louis-kauer:fix/image-string-library-prefix

Conversation

@louis-kauer

Copy link
Copy Markdown

What issue type does this pull request address?
/kind bugfix

What does this pull request do? Which issues does it resolve?
resolves #4021

Gates the library/ namespace injection in Image.String() on the registry actually being Docker Hub (docker.io or index.docker.io). Previously, any non-empty registry plus a slashless repository got library/ prepended, producing invalid references like ghcr.io/library/alpine:3.20. Round-trip via ParseImageRef is preserved.

Please provide a short message that should be published in the vcluster release notes

Fixed `Image.String()` injecting a `library/` namespace prefix on non-Docker-Hub registries, producing invalid references like `ghcr.io/library/alpine:3.20`. The prefix is now only applied when the registry is Docker Hub.

What else do we need to know?
Tests pass locally (go test ./config/...). Updates one existing test case (omit repo but not registry is library) that encoded the bug as expected output, plus six new cases covering Docker Hub canonical/alias and non-Docker-Hub registries. No API or config changes.

E2E Tests

Default Test Execution

The mandatory PR suite runs automatically. Only specify additional test suites below if needed.

Additional test suites

none

@louis-kauer
louis-kauer requested a review from a team as a code owner June 17, 2026 00:10
@louis-kauer louis-kauer reopened this Jun 17, 2026
@louis-kauer louis-kauer changed the title fix(config): scope "library/" prefix to Docker Hub fix(config): scope library/ prefix to Docker Hub Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image.String() injects library/ prefix on non-Docker-Hub registries, producing invalid references

1 participant