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

Add max-depth flag to describe #521

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

netiperher
Copy link

When a bundle contains a large set of nested bundles the describe command on the root bundle can take a long time.

This change introduces a --max-depth flag to the describe command in order to limit the depth of recursion that is performed on the bundle. This is similar to the --no-recursion flag discussed in #204 .

Signed-off-by: Per Hermansson <[email protected]>
@netiperher netiperher temporarily deployed to TanzuNet Registry Dev e2e May 18, 2023 10:02 — with GitHub Actions Inactive
@netiperher netiperher temporarily deployed to GCR e2e May 18, 2023 10:02 — with GitHub Actions Inactive
Copy link
Member

@joaopapereira joaopapereira left a comment

Choose a reason for hiding this comment

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

The PR looks pretty good, just have 1 change that I would like to see before we merge this PR

@@ -98,7 +99,7 @@ func DescribeWithRegistryAndSignatureFetcher(bundleImage string, opts DescribeOp
return Description{}, fmt.Errorf("Only bundles can be described, and %s is not a bundle", bundleImage)
}

allBundles, err := newBundle.FetchAllImagesRefs(opts.Concurrency, opts.Logger, sigFetcher)
allBundles, err := newBundle.FetchAllImagesRefs(opts.Concurrency, opts.MaxDepth, opts.Logger, sigFetcher)
Copy link
Member

Choose a reason for hiding this comment

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

Before we call FetchAllImagesRefs do you mind checking that the depth is >= 0? Just to ensure people do not try to get a negative number in

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants