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

tree: only report artifacts that are present #1872

Merged
merged 2 commits into from May 17, 2022

Conversation

ribbybibby
Copy link
Contributor

Summary

Only returns artifacts in the tree if they actually exist. I think this matches the expectations a user would have when using this command.

Also tweaks how we're using the references:

  • Use the actual references we added to the map when checking them during the print phase
  • Use the tag suffix from the ociremote package rather than redefining it in cli

Ticket Link

N/A

Release Note

Modifies 'cosign tree' to only return artifacts that exist

We were adding entries for artifacts, regardless of whether that
artifact was present or had any layers.

I think the expectation of the user would be for this command to show
only the artifacts that actually exist.

Signed-off-by: Rob Best <robertbest89@gmail.com>
We're already fetching the references and using them in the map, so
might as well check those when we come to print them out.

Use the SBOM suffix from ociremote rather than redefining it.

Signed-off-by: Rob Best <robertbest89@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented May 13, 2022

Codecov Report

Merging #1872 (997a01f) into main (aad7c5f) will increase coverage by 0.01%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #1872      +/-   ##
==========================================
+ Coverage   33.37%   33.38%   +0.01%     
==========================================
  Files         146      146              
  Lines        9378     9375       -3     
==========================================
  Hits         3130     3130              
+ Misses       5875     5872       -3     
  Partials      373      373              
Impacted Files Coverage Δ
cmd/cosign/cli/tree.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aad7c5f...997a01f. Read the comment docs.

@ribbybibby
Copy link
Contributor Author

Both CI failures seem unrelated to the changes in this PR.

Copy link
Contributor

@hectorj2f hectorj2f left a comment

Choose a reason for hiding this comment

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

lgtm, thanks @ribbybibby

@hectorj2f
Copy link
Contributor

It seems there are some linting issues.

@ribbybibby
Copy link
Contributor Author

ribbybibby commented May 13, 2022

It seems there are some linting issues.

@hectorj2f Looks like a timeout issue. When I run golangci-lint run locally it doesn't report any linting errors.

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.

None yet

4 participants