You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bad UX of --oci-layout-path flag working with oras repo tags #1612
I have an OCI layout that contains several tags, some are in format of FQDN. I can list the tags by running oras repo tags --oci-layout $dirName, for example:
Hi @bupd , thank you showing interest! Before jumping directly to the implementation, you may propose a design here in the issue comment, and the community can discuss it together.
As oci-layout-path flag is now in option.Target, 16 commands has it. The flag is created to address the case of a tag containing colons. As all these 16 commands accept tag input, the flag is indeed needed for all of them.
Here is a possible use case in which oci-layout-path is needed for oras repo tags. It is similar to #1505 and #1686.
As shown in the repo tags help doc, repo tags has the following usage which accepts a tag:
Example - [Experimental] Show tags associated with a particular tagged resource:
oras repo tags localhost:5000/hello:latest
Example - [Experimental] Show tags associated with a digest:
oras repo tags localhost:5000/hello@sha256:c551125a624189cece9135981621f3f3144564ddabe14b523507bf74c2281d9b
If I want to check the tags associated with my.tag.with:colon, the correct way is to use the following command: oras repo tags --oci-layout-path ~/my-oci my.tag.with:colon
Without the oci-layout-path flag, the following command will give an error:
oras repo tags --oci-layout ~/my-oci:my.tag.with:colon
Error: invalid argument "/root/temp-oci:my.tag.with:colon": failed to find path "/root/temp-oci:my.tag.with": stat /root/temp-oci:my.tag.with: no such file or directory
This is the same error the users got in #1505 and #1686, and the reason the --oci-layout-path is introduced.
Given the above, the error message posted in this issue is correct:
Given that --oci-layout-path is necessary and should not be removed from option.Target, now the issue is: we need to improve the UX when the destination target reference argument is empty.
For example, when pushing a file without a tag to an oci layout: oras push --oci-layout-path ./my-oci/ "" file.md
When using oras repo tags without a tag, as mentioned in this issue: oras repo tags --oci-layout-path ./my-oci/ ""
Given that --oci-layout-path is necessary and should not be removed from option.Target, now the issue is: we need to improve the UX when the destination target reference argument is empty.
For example, when pushing a file without a tag to an oci layout: oras push --oci-layout-path ./my-oci/ "" file.md
When using oras repo tags without a tag, as mentioned in this issue: oras repo tags --oci-layout-path ./my-oci/ ""
@wangxiaoxuan273 Thanks for the summary. In your example, when pushing a file without a tag to an oci layout, should we use --oci-layout instead? Is "" an empty positional parameter that is supposed to be a reference?
$ oras repo tags --oci-layout ./repo
example.registry.com/foo:latest
test.com/bar:v1
v2
My expected behavior would be
$ oras repo tags --oci-layout-path ./repo example.registry.com/foo
latest
$ oras repo tags --oci-layout-path ./repo test.com/bar
v1
It is still oras repo tags --oci-layout-path <path> <name> where <name> is the full repository name.
@mauriciovasquezbernal Thanks for the response. We will implement it as @shizhMSFT proposed above. As this flag is still experimental, it's subject to be changed once we received feedback from the community.
Activity
bupd commentedon Feb 16, 2025
I hope I can help you with this. Should I open a PR?
cc // @Wwwsylvia, @FeynmanZhou
Wwwsylvia commentedon Feb 21, 2025
Hi @bupd , thank you showing interest! Before jumping directly to the implementation, you may propose a design here in the issue comment, and the community can discuss it together.
github-actions commentedon Apr 23, 2025
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.
wangxiaoxuan273 commentedon May 16, 2025
Origin of the oci-layout-path flag: #1505 , #1507
It is created to address the case of a tag having colons.
wangxiaoxuan273 commentedon May 19, 2025
As
oci-layout-pathflag is now inoption.Target, 16 commands has it. The flag is created to address the case of a tag containing colons. As all these 16 commands accept tag input, the flag is indeed needed for all of them.Here is a possible use case in which
oci-layout-pathis needed fororas repo tags. It is similar to #1505 and #1686.As shown in the
repo tagshelp doc,repo tagshas the following usage which accepts a tag:Consider an oci layout with the following tags:
If I want to check the tags associated with
my.tag.with:colon, the correct way is to use the following command:oras repo tags --oci-layout-path ~/my-oci my.tag.with:colonWithout the
oci-layout-pathflag, the following command will give an error:This is the same error the users got in #1505 and #1686, and the reason the
--oci-layout-pathis introduced.Given the above, the error message posted in this issue is correct:
wangxiaoxuan273 commentedon May 22, 2025
Given that
--oci-layout-pathis necessary and should not be removed fromoption.Target, now the issue is: we need to improve the UX when the destination target reference argument is empty.For example, when pushing a file without a tag to an oci layout:
oras push --oci-layout-path ./my-oci/ "" file.mdWhen using
oras repo tagswithout a tag, as mentioned in this issue:oras repo tags --oci-layout-path ./my-oci/ ""shizhMSFT commentedon May 22, 2025
Given
My expected behavior would be
It is still
oras repo tags --oci-layout-path <path> <name>where<name>is the full repository name.FeynmanZhou commentedon May 23, 2025
@wangxiaoxuan273 Thanks for the summary. In your example, when pushing a file without a tag to an oci layout, should we use
--oci-layoutinstead? Is""an empty positional parameter that is supposed to be a reference?FeynmanZhou commentedon May 23, 2025
@shizhMSFT 's proposal looks intuitive enough to me.
wangxiaoxuan273 commentedon May 23, 2025
Yes, we should recommend users to use
--oci-layout.Correct.
FeynmanZhou commentedon May 28, 2025
@mauriciovasquezbernal could you also take a look at this proposed behavior?
mauriciovasquezbernal commentedon May 30, 2025
I don't have the time right now, but I could give it a try in about two weeks
FeynmanZhou commentedon Jun 2, 2025
@mauriciovasquezbernal Thanks for the response. We will implement it as @shizhMSFT proposed above. As this flag is still experimental, it's subject to be changed once we received feedback from the community.