Modify WithDiscardUnpackedLayers
Modify the WithDiscardUnpackedLayers function such that it does not require any parameters. Signed-off-by: James Jenkins <James.Jenkins@ibm.com>
This commit is contained in:
parent
2432b54a56
commit
9d18b57469
@ -136,10 +136,12 @@ If foobar.tar contains an OCI ref named "latest" and anonymous ref "sha256:deadb
|
|||||||
|
|
||||||
opts = append(opts, containerd.WithAllPlatforms(context.Bool("all-platforms")))
|
opts = append(opts, containerd.WithAllPlatforms(context.Bool("all-platforms")))
|
||||||
|
|
||||||
if context.Bool("discard-unpacked-layers") && context.Bool("no-unpack") {
|
if context.Bool("discard-unpacked-layers") {
|
||||||
return fmt.Errorf("--discard-unpacked-layers and --no-unpack are incompatible options")
|
if context.Bool("no-unpack") {
|
||||||
|
return fmt.Errorf("--discard-unpacked-layers and --no-unpack are incompatible options")
|
||||||
|
}
|
||||||
|
opts = append(opts, containerd.WithDiscardUnpackedLayers())
|
||||||
}
|
}
|
||||||
opts = append(opts, containerd.WithDiscardUnpackedLayers(context.Bool("discard-unpacked-layers")))
|
|
||||||
|
|
||||||
client, ctx, cancel, err := commands.NewClient(context)
|
client, ctx, cancel, err := commands.NewClient(context)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -108,9 +108,9 @@ func WithImportCompression() ImportOpt {
|
|||||||
|
|
||||||
// WithDiscardUnpackedLayers allows the garbage collector to clean up
|
// WithDiscardUnpackedLayers allows the garbage collector to clean up
|
||||||
// layers from content store after unpacking.
|
// layers from content store after unpacking.
|
||||||
func WithDiscardUnpackedLayers(discard bool) ImportOpt {
|
func WithDiscardUnpackedLayers() ImportOpt {
|
||||||
return func(c *importOpts) error {
|
return func(c *importOpts) error {
|
||||||
c.discardLayers = discard
|
c.discardLayers = true
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user