Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oras discover with output tree format #297

Merged
merged 3 commits into from
Aug 25, 2021

Conversation

mnltejaswini
Copy link

Add support for tree output to oras discover command. This output format traverses all the references and display them in a hierarchy tree structure.

Fixes #295

@mnltejaswini
Copy link
Author

@SteveLasker please review

@@ -17,12 +17,13 @@ import (
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/xlab/treeprint"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently under MIT. Is that a concern or can we take dependency on this?
/cc @lachie83 @SteveLasker

Copy link
Contributor

@lachie83 lachie83 Aug 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of dependencies with permissive licenses is fine in the CNCF. It's copyleft licenses like MPL and GPL that you need to explicitly ask for an exception to be granted. Here is the doc from the CNCF stating that MIT is allowed - https://github.com/cncf/foundation/blob/master/allowed-third-party-license-policy.md#approved-licenses-for-allowlist

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also - thanks for paying attention to this @sajayantony! It's not easy.

Copy link
Contributor

@SteveLasker SteveLasker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The treeview experience in the CLI really helps visualize the graph. Thanks @mnltejaswini for the great experience.

@sajayantony
Copy link
Contributor

LGTM.
As a note this removes the --output-json and once moved to main breaking changes SHOULD be discussed in the PR upfront. For now this is in a referrers types branch only and is considered as prototype.

@sajayantony sajayantony merged commit 01bc2b4 into oras-project:reference-types Aug 25, 2021
sajayantony pushed a commit to sajayantony/oras that referenced this pull request Sep 13, 2021
* oras discover with tree output format

Signed-off-by: Tejaswini Duggaraju <[email protected]>

* oras discover with tree output format

Signed-off-by: Tejaswini Duggaraju <[email protected]>

* Apply artifact type filter only on the root node

Signed-off-by: Tejaswini Duggaraju <[email protected]>
Signed-off-by: Sajay Antony <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants