feat: Add snapshotter label to the new snapshot for container.

add '--snapshotter-labels' in ctr run and ctr c create
which can pass labels to snappshotter on preparing new
snapshot.

Pass command label to snapshotter can help it determine
which kind of writable snapshots should be provide.

For some snapshotter, such as overlaybd:
  ( https://github.com/alibaba/accelerated-container-image ),
it can provide 2 kind of writable snapshot (overlayfs dir or
 blockdevice) by command label values.

Signed-off-by: Yifan Yuan <tuji.yyf@alibaba-inc.com>
This commit is contained in:
Yifan Yuan
2021-06-28 20:08:01 +08:00
parent e1f28659bc
commit bda7b58666
4 changed files with 15 additions and 3 deletions

View File

@@ -55,7 +55,7 @@ var createCommand = cli.Command{
Name: "create",
Usage: "create container",
ArgsUsage: "[flags] Image|RootFS CONTAINER [COMMAND] [ARG...]",
Flags: append(commands.SnapshotterFlags, commands.ContainerFlags...),
Flags: append(append(commands.SnapshotterFlags, []cli.Flag{commands.SnapshotterLabels}...), commands.ContainerFlags...),
Action: func(context *cli.Context) error {
var (
id string