oras icon indicating copy to clipboard operation
oras copied to clipboard

Enrich discover --verbose command tree output with additional data (Layers, data from Descriptor)

Open bedla opened this issue 1 year ago • 1 comments

WIP

Hi, when I was investigating why Trivy does not see SBOMs attached to Harbor Images (it was because old Harbor v2.10.2 was malformes ArtifactType of attached SBOM JSON. It always override to application/vnd.oci.empty.v1+json. In latest version of Harbor it is fixed), I found out that it is good to see (at that time only in debugger) some additional data about Images. What helped me, was to see MediaType from Descriptor, and MediaType from Layers.

What do you think about those additions to --verbose mode of discover command?

Thank you

Ivos

What this PR does / why we need it:

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

Please check the following list:

  • [ ] Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • [ ] Does this change require a documentation update?
  • [ ] Does this introduce breaking changes that would require an announcement or bumping the major version?
  • [ ] Do all new files have an appropriate license header?

Output looks like this:

localhost:8888/my-project/demo@sha256:901cf8eb9b8b4be961247fdfdcc87471b06461357a44fb05e60401b9f78670b9
└── application/vnd.cyclonedx+json
    └── sha256:23dbde23c33a226959ea7733abeed67922069d3c0a93a8d88589e6c478539817
        ├── Descriptor
        │   ├── MediaType: application/vnd.oci.image.manifest.v1+json
        │   └── Size: 821
        ├── Annotations
        │   ├── created-by: Ivos
        │   └── org.opencontainers.image.created: "2024-09-16T07:03:43Z"
        └── Layers
            └── Layer[0]
                ├── annotations
                │   └── org.opencontainers.image.title: C:\Users\bedla.czech\GolandProjects\trivy\result.json
                ├── digest: sha256:95340261766214250b2238f4a8055bbd8b9f5b6203a30ca6e0e59c9348d5c674
                ├── mediaType: application/vnd.cyclonedx+json
                └── size: 36449

bedla avatar Sep 17 '24 19:09 bedla

Hi @bedla , thanks for your contribution. Would you mind raising an issue to discuss your idea? We are also working on the verbose output improvement and defining a proposal doc in #1483

FeynmanZhou avatar Sep 19 '24 07:09 FeynmanZhou

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Nov 08 '24 02:11 github-actions[bot]

This PR was closed because it has been stalled for 30 days with no activity.

github-actions[bot] avatar Dec 08 '24 02:12 github-actions[bot]

Hi @bedla , thanks for your contribution. Would you mind raising an issue to discuss your idea? We are also working on the verbose output improvement and defining a proposal doc in #1483

Hi, sorry for late reply ... I have started discussion here https://github.com/oras-project/oras/discussions/1657

bedla avatar Mar 13 '25 14:03 bedla

Did you want to reopen this?

TerryHowe avatar Mar 13 '25 14:03 TerryHowe

I would like to, but what I understand from feedback, I should wait for approval of structure that I proposed, right?

bedla avatar Mar 13 '25 14:03 bedla