fix: sanitize colon in container name for tag+digest package refs#313
Merged
jcogilvie merged 1 commit intoMay 5, 2026
Conversation
39d745b to
0efc56b
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes invalid Docker container names generated for function package references that include both a tag and a SHA256 digest (e.g. name:tag@sha256:...) by sanitizing the tag separator (:) into a hyphen in the digest-handling code path.
Changes:
- Replace
:with-in thename:tagportion when building container names for@sha256:references. - Add a unit test covering tag+digest package refs to prevent regressions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
cmd/diff/diffprocessor/function_provider.go |
Sanitizes name:tag to name-tag when generating container names for @sha256: package refs. |
cmd/diff/diffprocessor/function_provider_test.go |
Adds coverage for tag+digest refs ensuring generated container names contain no : and match the expected format. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
Thanks again @cahillsf! Can you do a quick rebase so I can merge? (DCO checker doesn't like it if I do that for you.) |
…st package refs When a function package ref has both a tag and a digest (e.g., func:v0.6.1-0@sha256:751a...), the SHA256 branch of generateContainerName split on @sha256: but left the colon from the tag in the function name, producing an invalid Docker container name. Signed-off-by: Stephen Cahill <cahillsf9@gmail.com>
0efc56b to
cc93bda
Compare
jcogilvie
approved these changes
May 5, 2026
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.
Description of your changes
When a function package ref contains both a tag and a digest (e.g.
registry.io/path/function-auto-ready:v0.6.1-0@sha256:751a4afb...), the tag's colon was leaking into the generated Docker container name, producing names likefunction-auto-ready:v0.6.1-0-751a4afb65f1-comp-test1234. Docker rejects colons in container names.This sanitizes the function-name portion (before
@sha256:) by replacing:with-so the resulting container name is valid for refs that carry both a tag and a digest.Fixes #
I have:
earthly -P +reviewableto ensure this PR is ready for review.Added or updated e2e tests.Documented this change as needed.Followed the API promotion workflow if this PR introduces, removes, or promotes an API.Need help with this checklist? See the cheat sheet.