oras-project / oras

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

feat: --output for `oras manifest index create` #1490

Closed wangxiaoxuan273 closed 2 months ago

wangxiaoxuan273 commented 3 months ago

What this PR does / why we need it:

current output:

oras manifest index create myregistry.azurecr.io/test sha256:42c524c48e0672568dbd2842d3a0cb34a415347145ee9fe1c8abaf65e7455b46 --output - --pretty
Fetching sha256:42c524c48e0672568dbd2842d3a0cb34a415347145ee9fe1c8abaf65e7455b46
Fetched  sha256:42c524c48e0672568dbd2842d3a0cb34a415347145ee9fe1c8abaf65e7455b46
Packed   f16df862b7e3 application/vnd.oci.image.index.v1+json
Digest: sha256:f16df862b7e3d4f13c03d59655ed25a71a68e01e4aeec0d921d7310d6c67a360
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.index.v1+json",
  "manifests": [
    {
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "digest": "sha256:42c524c48e0672568dbd2842d3a0cb34a415347145ee9fe1c8abaf65e7455b46",
      "size": 1239,
      "platform": {
        "architecture": "amd64",
        "os": "linux"
      }
    }
  ]
}

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Part of #1053

Please check the following list:

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 85.83%. Comparing base (0baec35) to head (d7055ad). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1490 +/- ## ========================================== + Coverage 85.73% 85.83% +0.09% ========================================== Files 116 116 Lines 4059 4073 +14 ========================================== + Hits 3480 3496 +16 + Misses 347 345 -2 Partials 232 232 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

qweeah commented 2 months ago

Shouldn't --output - forbids status output?

wangxiaoxuan273 commented 2 months ago

Shouldn't --output - forbids status output?

Is it necessary?

qweeah commented 2 months ago

I think it's intuitive and conventional. E.g. curl turns off status output when using -o -.