Skip to content

util: Preserve registry ports when splitting image names - #561

Open
snehaapratap wants to merge 1 commit into
nextstrain:masterfrom
snehaapratap:fix/560-registry-port-image-name
Open

snehaapratap wants to merge 1 commit into
nextstrain:masterfrom
snehaapratap:fix/560-registry-port-image-name

Conversation

@snehaapratap

Copy link
Copy Markdown

Fixes #560.

split_image_name() currently treats a registry port as a tag separator, and raises ValueError when an explicit image tag adds another colon. Only treat colons after the final slash as a tag separator, then split from the right. Registries with ports, including bracketed IPv6 addresses, now keep their full repository name with either explicit or implicit tags.

Adds five doctest examples covering tagged and untagged localhost and IPv6 registries, including implicit_latest=False. The tagged localhost example failed before the fix.

Validation: ./devel/pytest -q passed all 74 tests (including doctests, Flake8, Pyright and generated-doc checks); source and wheel builds passed on Python 3.12. No live registry was needed for this parser change.

AI assistance: implemented and validated with OpenAI Codex.

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.

[docker] --image localhost:5000/nextstrain/base:latest fails with ValueError

1 participant