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
fix: validate format before special handling #2204
The --format flag handles unsupported formats inconsistently
oras discover --format text returns:
Error: unsupported format type: text
while "text" is not supported by discover
Also, oras repo tags --format table prints the table deprecation warning even though table is not supported by repo tags
Users get misleading errors or warnings when they provide an unsupported --format value, making it harder to understand which formats are actually supported by the command.
What did you expect to happen?
The CLI should first check whether the given format is supported by the command.
If it isn't supported, it should show a clear error with the supported formats and avoid showing unrelated warnings.
How can we reproduce it?
Case 1: oras discover
Create or use an OCI layout at /tmp/layout:v1.
Run:
oras discover --oci-layout /tmp/layout:v1 --format text
The CLI returns:
Error: unsupported format type: text
Case 2: oras repo tags
Run:
oras repo tags <repository> --format table
The CLI first prints:
Format "table" is deprecated and will be removed in a future release.
It then returns:
Error: invalid format type: "table"
supported types: json, go-template, text
Since table is not supported by oras repo tags, the deprecation warning should not be printed.
Activity