-
Notifications
You must be signed in to change notification settings - Fork 42
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
DRAFT: Send oci-layout formatted tars to the daemon #242
Conversation
Signed-off-by: Natalie Arellano <narellano@vmware.com>
@@ -1137,20 +1137,20 @@ func testImage(t *testing.T, when spec.G, it spec.S) { | |||
|
|||
it.Before(func() { | |||
// new base image | |||
newBase = "pack-newbase-test-" + h.RandString(10) | |||
newBase = newTestImageName() | |||
// TODO: this test consistently fails when the below line is commented in |
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.
I really don't know what to say about this
locallayout/store.go
Outdated
return err | ||
} | ||
layers, err := image.Layers() | ||
if err != nil { | ||
if err = layoutPath.AppendImage(image, layout.WithAnnotations(map[string]string{"io.containerd.image.name": withName})); err != nil { |
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 would be more efficient to add content to the tar as it's being streamed, but that requires more work
locallayout/v1_facade.go
Outdated
diffID v1.Hash | ||
optionalLayerPath string | ||
diffID v1.Hash | ||
optionalUnderlyingLayer v1.Layer |
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 allows us to return the correct digest and compressed bits
return err | ||
} | ||
|
||
func Annotate(image v1.Image, key, val string) (v1.Image, 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.
Unrelated refactor
if l.optionalUnderlyingLayer != nil { | ||
return l.optionalUnderlyingLayer.Digest() | ||
} | ||
return v1.NewHash("sha256:90e01955edcd85dac7985b72a8374545eac617ccdddcc992b732e43cd42534af") |
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.
(hard coded from busybox, used by tests as the "base")
This and Size()
below is the big bummer - we can't construct a valid manifest without it. But, we can't know it without pulling all the layers from the daemon. Many sighs
Signed-off-by: Natalie Arellano <narellano@vmware.com>
I'm going to close this PR for now. Until we have some way of getting the digest & compressed size of layers that already exist in the daemon (see moby/moby#44369), we won't be able to construct a valid manifest for the image we're trying to load. However if we do get this information, we should be able to send an OCI layout tar that simply omits existing layer data in the blobs directory to avoid re-uploading the layers. |
No description provided.