cmd: don't alias context package, and use cliContext for cli.Context
Unfortunately, this is a rather large diff, but perhaps worth a one-time "rip off the bandaid" for v2. This patch removes the use of "gocontext" as alias for stdLib's "context", and uses "cliContext" for uses of cli.context. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -44,16 +44,16 @@ var checkpointCommand = &cli.Command{
|
||||
Usage: "Checkpoint container task",
|
||||
},
|
||||
},
|
||||
Action: func(context *cli.Context) error {
|
||||
id := context.Args().First()
|
||||
Action: func(cliContext *cli.Context) error {
|
||||
id := cliContext.Args().First()
|
||||
if id == "" {
|
||||
return errors.New("container id must be provided")
|
||||
}
|
||||
ref := context.Args().Get(1)
|
||||
ref := cliContext.Args().Get(1)
|
||||
if ref == "" {
|
||||
return errors.New("ref must be provided")
|
||||
}
|
||||
client, ctx, cancel, err := commands.NewClient(context)
|
||||
client, ctx, cancel, err := commands.NewClient(cliContext)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -62,13 +62,13 @@ var checkpointCommand = &cli.Command{
|
||||
containerd.WithCheckpointRuntime,
|
||||
}
|
||||
|
||||
if context.Bool("image") {
|
||||
if cliContext.Bool("image") {
|
||||
opts = append(opts, containerd.WithCheckpointImage)
|
||||
}
|
||||
if context.Bool("rw") {
|
||||
if cliContext.Bool("rw") {
|
||||
opts = append(opts, containerd.WithCheckpointRW)
|
||||
}
|
||||
if context.Bool("task") {
|
||||
if cliContext.Bool("task") {
|
||||
opts = append(opts, containerd.WithCheckpointTask)
|
||||
}
|
||||
container, err := client.LoadContainer(ctx, id)
|
||||
|
Reference in New Issue
Block a user