oras
oras copied to clipboard
feat: Support pulling arbitrary manifest config
#274 enables the CLI to pull manifest config. However, the user must provide the desired media type of the config or use the default. This PR allows pulling arbitrary manifest config.
If the user does not specify the desired media type, the code will get the 0th indexed node as the manifest config if its parent node is a manifest. Note: For a manifest, the 0th indexed element is always a manifest config. ref: https://github.com/oras-project/oras-go/blob/6a09a65fcc0b96c3448e988c1727ed154c2388ea/content/graph.go#L58
Examples:
$ oras pull --manifest-config config.json localhost:5000/hello:latest
Downloaded 3ad08644ab5a artifact.txt
Downloaded 98df5c495df6 config.json
Pulled localhost:5000/hello:latest
Digest: sha256:8627dfe823698a566e105d961045eafcaa9115b6faf1f625edd85df558421bd5
Resolves: #275 Signed-off-by: Zoey Li [email protected]
@shizhMSFT Do we need to print warning if: no config media type is specified and there is already a name(title annotation) in the config descriptor?
Recommend simplifying this to to just oras pull --config
. I don't believe there is any other object in OCI that is called config.
Codecov Report
Merging #480 (e098299) into main (7c6fbdb) will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## main #480 +/- ##
=======================================
Coverage 55.69% 55.69%
=======================================
Files 6 6
Lines 237 237
=======================================
Hits 132 132
Misses 90 90
Partials 15 15
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
--config
is already reserved for auth config.
See
-c, --config stringArray auth config path
@lizMSFT @sajayantony @qweeah There is another option that we can rename --config
to --auth-config
and use --config
for --manifest-config
.
@lizMSFT @sajayantony @qweeah There is another option that we can rename
--config
to--auth-config
and use--config
for--manifest-config
.
How about --cred-file
? Previously we used --config
to align with the naming of docker config but it's not easy to understand out of the docker context.
We can still use -c for short.
This is tricky. If you have a config file that’s for auth and config file for manifest. Im ok with manifest config or auth config. since —config /auth-config is a global flag and if it was there before then we might not want to break previous non alpha - releases. Basically you folks decide. 😁
Yes, I am feeling the same. It would be better not change the name for now since it will bring breaking changes and it currently doesn't bring additional value. Besides, consumers will need to adjust accordingly, which might make them confused.
Create a new issue for rename --manifest-config
: https://github.com/oras-project/oras/issues/495
cc @shizhMSFT @qweeah @sajayantony
@sajayantony Let's continue the discussion in #495.
@shizhMSFT Do we need to print warning if: no config media type is specified and there is already a name(title annotation) in the config descriptor?
No, we don't.