oras-project / oras

OCI registry client - managing content like artifacts, images, packages
https://oras.land
Apache License 2.0
1.33k stars 161 forks source link

support pushing artifact with customized config media type #1298

Closed qweeah closed 3 months ago

qweeah commented 3 months ago

What is the version of your ORAS CLI

oras v1.1.0

What would you like to be added?

As an ORAS user, I would like to customize the media type of config without specifying the config data.

E.g. in the K8S CRI blogs, it's suggested to

echo "{}" > config.json
oras push \
    --config config.json:application/vnd.cncf.seccomp-profile.config.v1+json \
     quay.io/crio/seccomp:v2 seccomp.json

The experience can be more ideal if echo can be skipped and the config media type can be specified directly via

oras push \
    --config-media-type application/vnd.cncf.seccomp-profile.config.v1+json \
    quay.io/crio/seccomp:v2 seccomp.json

Why is this needed for ORAS?

1) This feature complete ORAS' support for artifacts with config. 2) echo acts differently on Windows. See similar discussion in #1069.

Are you willing to submit PRs to contribute to this feature?

qweeah commented 3 months ago

Closing as the right usage should be --artifact-type + --image-spec v1.0. E.g.

oras push --artifact-type application/vnd.cncf.seccomp-profile.config.v1+json  quay.io/crio/seccomp:v2 seccomp.json --image-spec v1.0