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) {
|
||||
var (
|
||||
id string
|
||||
Config = context.IsSet("config")
|
||||
config = context.IsSet("config")
|
||||
)
|
||||
if Config {
|
||||
if config {
|
||||
id = context.Args().First()
|
||||
} else {
|
||||
id = context.Args().Get(1)
|
||||
@ -57,7 +57,7 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli
|
||||
spec containerd.NewContainerOpts
|
||||
)
|
||||
|
||||
if Config {
|
||||
if config {
|
||||
opts = append(opts, oci.WithSpecFromFile(context.String("config")))
|
||||
} else {
|
||||
var (
|
||||
|
Loading…
Reference in New Issue
Block a user