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 static.NewLayer #1093

Merged
merged 4 commits into from
Jul 30, 2021
Merged

Add static.NewLayer #1093

merged 4 commits into from
Jul 30, 2021

Conversation

imjasonh
Copy link
Collaborator

Mainly copied from cosign, with basic tests, and a sync.Once around Digest().

@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2021

Codecov Report

Merging #1093 (d81fc7c) into main (eca1cd8) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1093      +/-   ##
==========================================
+ Coverage   75.44%   75.49%   +0.05%     
==========================================
  Files         107      108       +1     
  Lines        5159     5170      +11     
==========================================
+ Hits         3892     3903      +11     
  Misses        714      714              
  Partials      553      553              
Impacted Files Coverage Δ
pkg/v1/static/layer.go 100.00% <100.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 eca1cd8...d81fc7c. Read the comment docs.

l := NewLayer(b, types.OCILayer)

// This does basically nothing.
if err := validate.Layer(l, validate.Fast); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why fast? You can drop half this test if you do standard.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

    static_test.go:33: gzip: invalid header

Copy link
Collaborator

Choose a reason for hiding this comment

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

Of course :(

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should maybe fix that to actually look at media types (for +gzip)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you want to do that? I'm fine just manually validating in this test for now.

pkg/v1/static/static_test.go Outdated Show resolved Hide resolved
@jonjohnsonjr jonjohnsonjr merged commit 092caf0 into google:main Jul 30, 2021
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

3 participants