ctr images import: add --no-unpack option
Signed-off-by: Benjamin Elder <bentheelder@google.com>
This commit is contained in:
		| @@ -68,6 +68,10 @@ If foobar.tar contains an OCI ref named "latest" and anonymous ref "sha256:deadb | |||||||
| 			Name:  "all-platforms", | 			Name:  "all-platforms", | ||||||
| 			Usage: "imports content for all platforms, false by default", | 			Usage: "imports content for all platforms, false by default", | ||||||
| 		}, | 		}, | ||||||
|  | 		cli.BoolFlag{ | ||||||
|  | 			Name:  "no-unpack", | ||||||
|  | 			Usage: "skip unpacking the images, false by default", | ||||||
|  | 		}, | ||||||
| 	}, commands.SnapshotterFlags...), | 	}, commands.SnapshotterFlags...), | ||||||
|  |  | ||||||
| 	Action: func(context *cli.Context) error { | 	Action: func(context *cli.Context) error { | ||||||
| @@ -119,6 +123,7 @@ If foobar.tar contains an OCI ref named "latest" and anonymous ref "sha256:deadb | |||||||
| 			return closeErr | 			return closeErr | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | 		if !context.Bool("no-unpack") { | ||||||
| 			log.G(ctx).Debugf("unpacking %d images", len(imgs)) | 			log.G(ctx).Debugf("unpacking %d images", len(imgs)) | ||||||
|  |  | ||||||
| 			for _, img := range imgs { | 			for _, img := range imgs { | ||||||
| @@ -133,6 +138,7 @@ If foobar.tar contains an OCI ref named "latest" and anonymous ref "sha256:deadb | |||||||
| 				} | 				} | ||||||
| 				fmt.Println("done") | 				fmt.Println("done") | ||||||
| 			} | 			} | ||||||
|  | 		} | ||||||
| 		return nil | 		return nil | ||||||
| 	}, | 	}, | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Benjamin Elder
					Benjamin Elder