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

Blob Pusher missing required from parameter #703

Closed
briandealwis opened this issue Jul 24, 2018 · 2 comments
Closed

Blob Pusher missing required from parameter #703

briandealwis opened this issue Jul 24, 2018 · 2 comments

Comments

@briandealwis
Copy link
Member

Description of the issue:

In testing #698, I discovered that quay.io rejects our layer pushes with an INVALID_REQUEST.

Tried to push BLOB for quay.io/briandealwis/foo with digest sha256:8f125ded1b483229a567e48eece98cc8867c2bee55fb73e9cd65ceecc448b7c7 but failed because: unknown: Invalid request | If this is a bug, please file an issue at https://github.com/GoogleContainerTools/jib/issues/new: 400 BAD REQUEST
[ERROR] {"errors":[{"code":"INVALID_REQUEST","detail":{},"message":"Invalid request"}]}

BlobPusher is not fully implementing the Cross Repository Blob Mount request which specifies that the POST request should have both a mount and a from.

To issue a blob mount instead of an upload, a POST request should be issued in the following format:

POST /v2/<name>/blobs/uploads/?mount=<digest>&from=<repository name>
Content-Length: 0

Pushing to quay.io (#500) still fails due to #601.

@briandealwis
Copy link
Member Author

Maybe we should track the provenance of blobs, and provide mount and from only when they are from the same registry. It would seem as simple as modifying BlobDescriptor to carry the corresponding image reference. If a BlobDescriptor has no provenance information, then we don't provide mount and from.

@coollog
Copy link
Contributor

coollog commented Jul 24, 2018

Nice find! This is related to #169. We originally did not set the from because it only supports repository name (so it would have to be on the same registry), but I think we can implement this now. The logic could be:

  1. If using the same registry for push and pull, then set mount and from accordingly.
  2. If not using the same registry, don't set mount or from.

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

No branches or pull requests

2 participants