From 92b7bc9edcb429ba2c242b7d70b73c6b188581ae Mon Sep 17 00:00:00 2001 From: Iceber Gu Date: Wed, 18 May 2022 16:11:30 +0800 Subject: [PATCH] ctr: fix label args used in NewContainer Signed-off-by: Iceber Gu --- cmd/ctr/commands/run/run_unix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/ctr/commands/run/run_unix.go b/cmd/ctr/commands/run/run_unix.go index 796624f12..d9c892ec1 100644 --- a/cmd/ctr/commands/run/run_unix.go +++ b/cmd/ctr/commands/run/run_unix.go @@ -101,7 +101,7 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli ) if config { - cOpts = append(cOpts, containerd.WithContainerLabels(commands.LabelArgs(context.StringSlice("labels")))) + cOpts = append(cOpts, containerd.WithContainerLabels(commands.LabelArgs(context.StringSlice("label")))) opts = append(opts, oci.WithSpecFromFile(context.String("config"))) } else { var ( @@ -122,7 +122,7 @@ func NewContainer(ctx gocontext.Context, client *containerd.Client, context *cli return nil, err } opts = append(opts, oci.WithRootFSPath(rootfs)) - cOpts = append(cOpts, containerd.WithContainerLabels(commands.LabelArgs(context.StringSlice("labels")))) + cOpts = append(cOpts, containerd.WithContainerLabels(commands.LabelArgs(context.StringSlice("label")))) } else { snapshotter := context.String("snapshotter") var image containerd.Image