-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Verify layer sizes in the integrated registry #16885
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
Conversation
|
@dmage is this prepared for a review? |
|
@bparees I’m going to add some code to test this fix. Now it has a bug. |
cd8e7dd to
4f98282
Compare
4f98282 to
166ca8c
Compare
|
/retest |
|
/test extended_image_registry |
miminar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise.
| _, err = repo.Blobs(ctx).Stat(ctx, fsLayer.Digest) | ||
| desc, err = repo.Blobs(ctx).Stat(ctx, fsLayer.Digest) | ||
| if err == nil && fsLayer.Size != desc.Size { | ||
| errs = append(errs, ErrManifestBlobBadSize{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The err is appended twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which err?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️ sorry, I guess I wasn't reading.
|
|
||
| target := h.manifest.Target() | ||
| _, err := repo.Blobs(ctx).Stat(ctx, target.Digest) | ||
| desc, err := repo.Blobs(ctx).Stat(ctx, target.Digest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Target() is already verified within .References() loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds like we can delete this whole block since .References() will include the digest.
| } | ||
| } | ||
|
|
||
| // Start runs the Docker registry. Start always returns a non-nil error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment makes it sounds like Start will never return nil, but i don't think that's what you mean, is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will never return nil. It acts like http.ListenAndServe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it.
|
|
||
| switch manifest.SchemaVersion { | ||
| case 0: | ||
| // legacy config object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on what basis are we confident/safe to remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for Docker before v1.3.0. Our code relies on DockerImageMetadata and this function for will leave it unfilled for schema 0 without any errors. We need to fix our code if we still want to have support for schema 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it.
|
@dmage sounds like a couple minor nits and we can get this on the merge queue today. |
166ca8c to
0a77353
Compare
|
@michojel: changing LGTM is restricted to assignees, and only openshift org members may be assigned issues. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/lgtm |
|
/test extended_image_registry |
|
/lgtm |
|
/lgtm |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
2 similar comments
|
/retest Please review the full test history for this PR and help us cut down flakes. |
|
/retest Please review the full test history for this PR and help us cut down flakes. |
0a77353 to
fd23261
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bparees, dmage, legionus, miminar The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
|
Automatic merge from submit-queue. |
cc @miminar @legionus
fixes bug https://bugzilla.redhat.com/show_bug.cgi?id=1491589