code optimization after review
Signed-off-by: Lifubang <lifubang@acmcoder.com>
This commit is contained in:
parent
1d9b96988f
commit
48fe63511a
@ -35,9 +35,9 @@ import (
|
|||||||
func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli.Context) (containerd.Container, error) {
|
func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli.Context) (containerd.Container, error) {
|
||||||
var (
|
var (
|
||||||
id string
|
id string
|
||||||
Config = context.IsSet("config")
|
config = context.IsSet("config")
|
||||||
)
|
)
|
||||||
if Config {
|
if config {
|
||||||
id = context.Args().First()
|
id = context.Args().First()
|
||||||
} else {
|
} else {
|
||||||
id = context.Args().Get(1)
|
id = context.Args().Get(1)
|
||||||
@ -57,7 +57,7 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
|
|||||||
spec containerd.NewContainerOpts
|
spec containerd.NewContainerOpts
|
||||||
)
|
)
|
||||||
|
|
||||||
if Config {
|
if config {
|
||||||
opts = append(opts, oci.WithSpecFromFile(context.String("config")))
|
opts = append(opts, oci.WithSpecFromFile(context.String("config")))
|
||||||
} else {
|
} else {
|
||||||
var (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user