fix the --no-pivot flag being ignored by ctr tasks start
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
This commit is contained in:
parent
99ee82d0b6
commit
48daccb4dd
@ -31,7 +31,7 @@ var startCommand = cli.Command{
|
|||||||
Name: "start",
|
Name: "start",
|
||||||
Usage: "start a container that has been created",
|
Usage: "start a container that has been created",
|
||||||
ArgsUsage: "CONTAINER",
|
ArgsUsage: "CONTAINER",
|
||||||
Flags: []cli.Flag{
|
Flags: append(platformStartFlags, []cli.Flag{
|
||||||
cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "null-io",
|
Name: "null-io",
|
||||||
Usage: "send all IO to /dev/null",
|
Usage: "send all IO to /dev/null",
|
||||||
@ -52,7 +52,7 @@ var startCommand = cli.Command{
|
|||||||
Name: "detach,d",
|
Name: "detach,d",
|
||||||
Usage: "detach from the task after it has started execution",
|
Usage: "detach from the task after it has started execution",
|
||||||
},
|
},
|
||||||
},
|
}...),
|
||||||
Action: func(context *cli.Context) error {
|
Action: func(context *cli.Context) error {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
|
@ -34,11 +34,11 @@ import (
|
|||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
var platformStartFlags = []cli.Flag{
|
||||||
startCommand.Flags = append(startCommand.Flags, cli.BoolFlag{
|
cli.BoolFlag{
|
||||||
Name: "no-pivot",
|
Name: "no-pivot",
|
||||||
Usage: "disable use of pivot-root (linux only)",
|
Usage: "disable use of pivot-root (linux only)",
|
||||||
})
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// HandleConsoleResize resizes the console
|
// HandleConsoleResize resizes the console
|
||||||
|
@ -29,6 +29,8 @@ import (
|
|||||||
"github.com/urfave/cli"
|
"github.com/urfave/cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var platformStartFlags = []cli.Flag{}
|
||||||
|
|
||||||
// HandleConsoleResize resizes the console
|
// HandleConsoleResize resizes the console
|
||||||
func HandleConsoleResize(ctx gocontext.Context, task resizer, con console.Console) error {
|
func HandleConsoleResize(ctx gocontext.Context, task resizer, con console.Console) error {
|
||||||
// do an initial resize of the console
|
// do an initial resize of the console
|
||||||
|
Loading…
Reference in New Issue
Block a user