-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 import gzip support #10241
Add import gzip support #10241
Conversation
Hi @jokemanfire. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
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.
Only include the change in pkg/archive/compression
, the change to core/images/archive
is not needed.
core/images/archive/importer.go
Outdated
@@ -82,6 +80,12 @@ func ImportIndex(ctx context.Context, store content.Store, reader io.Reader, opt | |||
return ocispec.Descriptor{}, err | |||
} | |||
} | |||
s, err := compression.DecompressStream(reader) |
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 interface expects the caller to call DecompressStream
. This would cause DecompressStream
to be called twice in some cases.
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, May I do not understand (Can you explain it to me clearly? thanks). I add this code ,because when I use ctr i import any file ,not only tar , I can be imported successful. I search the code , but just image Import will call ImportIndex (Is there something I missing?) . If the reader is tar file , the DecompressStream will do nothing , I think it will not cause any problem if it is called twice.
What version are you testing and how did you create the
|
I compile containerd from main branch , make sure you have gzip file , could you check the 3 bytes front of the file is ’1f 8b 08 ‘? hexdump -C busybox.tar.gz |head .. I trace the code in import ,but there is no decomporess , If your code is from main branch now? |
|
sorry I find my mistake , my ctr use 1.7.2 version . That's such a huge mistake . When I debug , I use the latest containerd but ctr is 1.7.2 . I will change this pr , if xz and bandzip2 is need 。 thanks for u.This is a big black dragon |
#10260 I have take a new pr |
when ctr import a image file , it can be gzip
and bzip2format file.