Repository navigation
Conversation
`oras push <registry>/<repo> <file> --format json` reports
"referenceAsTags": ["<registry>/<repo>:"] although nothing was tagged,
and `--format go-template='{{len .referenceAsTags}}'` prints 1. The
same happens for an untagged OCI layout push.
OnCopied in the JSON and go-template push handlers records the target
reference as a tag when the raw reference is not empty and the
reference is not a digest. The raw reference of a push is the
destination argument and is never empty, while the reference is empty
when no tag is given. The empty reference is recorded as a tag and
rendered as "<repo>:".
Check the reference itself instead. The existing untagged tests did not
catch this because they build a target with an empty raw reference,
which the CLI never produces.
Signed-off-by: Max Freedom Pollard <[email protected]>
MaxFreedomPollard
requested review from
TerryHowe,
Wwwsylvia,
sabre1041,
sajayantony and
shizhMSFT
as code owners
November 10, 2026 05:00
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2328 +/- ##
=======================================
Coverage 73.51% 73.51%
=======================================
Files 157 157
Lines 6582 6582
=======================================
Hits 4839 4839
Misses 1454 1454
Partials 289 289 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
TanvirTian
reviewed
Nov 10, 2026
TanvirTian
left a comment
Contributor
There was a problem hiding this comment.
Hey, i checked your PR, everything looks good to me. Optionally, you could add a couple more E2E tests for untagged pushes with JSON output and OCI layouts, but it's not necessary. Looks good overall 🐈
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.
oras push <registry>/<repo> <file> --format jsonreports "referenceAsTags": ["/:"] although nothing was tagged, and--format go-template='{{len .referenceAsTags}}'prints 1. The same happens for an untagged OCI layout push.OnCopied in the JSON and go-template push handlers records the target reference as a tag when the raw reference is not empty and the reference is not a digest. The raw reference of a push is the destination argument and is never empty, while the reference is empty when no tag is given. The empty reference is recorded as a tag and rendered as ":".
Check the reference itself instead. The existing untagged tests did not catch this because they build a target with an empty raw reference, which the CLI never produces.
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Please check the following list: