-
Notifications
You must be signed in to change notification settings - Fork 562
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
load: import all platforms (--all-platforms) #316
Conversation
1870063
to
3489e72
Compare
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 should be gated with --all-platforms
as in nerdctl image convert --all-platforms OLD NEW
.
nerdctl/cmd/nerdctl/image_convert.go
Lines 80 to 89 in 06f236d
// platform flags | |
&cli.StringSliceFlag{ | |
Name: "platform", | |
Usage: "Convert content for a specific platform", | |
Value: &cli.StringSlice{}, | |
}, | |
&cli.BoolFlag{ | |
Name: "all-platforms", | |
Usage: "Convert content for all platforms", | |
}, |
In addition to nerdctl load
, nerdctl pull
should follow the same semantics, though PR for nerdctl pull
can be worked out separately
(Obviously nobody wants all the platforms to be pulled by default)
Hello, @cpuguy83 I do not agree with you. the import retrieves the platform to import from the client which is the platform is applied on the client here : Line 58 in 47a4917
so then the I agree with @AkihiroSuda making |
Either way is fine. |
3489e72
to
de85baa
Compare
Added the |
LGTM |
cmd/nerdctl/load.go
Outdated
@@ -38,6 +38,10 @@ var loadCommand = &cli.Command{ | |||
Aliases: []string{"i"}, | |||
Usage: "Read from tar archive file, instead of STDIN", | |||
}, | |||
&cli.BoolFlag{ | |||
Name: "all-platforms", | |||
Usage: "Imports content for all platforms, false by default", |
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.
"false by default" can be removed, as urfave/cli/v2
appends (default: false)
automatically
Currently if you try to import a non-native image the blobs will get GC'd and unpack fails with with "not found" on the blobs. Import doesn't really have a way to select which platforms to important, so I don't think it makes sense to make this optional. After all the tar could just be modified with the desired platforms. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
de85baa
to
c860843
Compare
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.
Thanks
Currently if you try to import a non-native image the blobs will get
GC'd and unpack fails with with "not found" on the blobs.
Import doesn't really have a way to select which platforms to important,
so I don't think it makes sense to make this optional. After all the tar
could just be modified with the desired platforms.