From f90e5d564a0e3c810d139decf028ee2a565149dd Mon Sep 17 00:00:00 2001 From: "Justin Terry (VM)" Date: Fri, 23 Nov 2018 17:11:59 -0800 Subject: [PATCH] Move ctr run --isolation to Windows only Signed-off-by: Justin Terry (VM) --- cmd/ctr/commands/run/run.go | 6 +----- cmd/ctr/commands/run/run_unix.go | 2 ++ cmd/ctr/commands/run/run_windows.go | 7 +++++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cmd/ctr/commands/run/run.go b/cmd/ctr/commands/run/run.go index 5c4861e03..c3f3f3bf5 100644 --- a/cmd/ctr/commands/run/run.go +++ b/cmd/ctr/commands/run/run.go @@ -106,15 +106,11 @@ var Command = cli.Command{ Name: "fifo-dir", Usage: "directory used for storing IO FIFOs", }, - cli.BoolFlag{ - Name: "isolated", - Usage: "run the container with vm isolation", - }, cli.StringFlag{ Name: "cgroup", Usage: "cgroup path (To disable use of cgroup, set to \"\" explicitly)", }, - }, append(commands.SnapshotterFlags, commands.ContainerFlags...)...), + }, append(platformRunFlags, append(commands.SnapshotterFlags, commands.ContainerFlags...)...)...), Action: func(context *cli.Context) error { var ( err error diff --git a/cmd/ctr/commands/run/run_unix.go b/cmd/ctr/commands/run/run_unix.go index 3a0f813c5..295259614 100644 --- a/cmd/ctr/commands/run/run_unix.go +++ b/cmd/ctr/commands/run/run_unix.go @@ -32,6 +32,8 @@ import ( "github.com/urfave/cli" ) +var platformRunFlags []cli.Flag + // NewContainer creates a new container func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli.Context) (containerd.Container, error) { var ( diff --git a/cmd/ctr/commands/run/run_windows.go b/cmd/ctr/commands/run/run_windows.go index 1e2b99a2e..bd81678ee 100644 --- a/cmd/ctr/commands/run/run_windows.go +++ b/cmd/ctr/commands/run/run_windows.go @@ -29,6 +29,13 @@ import ( "github.com/urfave/cli" ) +var platformRunFlags = []cli.Flag{ + cli.BoolFlag{ + Name: "isolated", + Usage: "run the container with vm isolation", + }, +} + // NewContainer creates a new container func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli.Context) (containerd.Container, error) { var (