aboutsummaryrefslogtreecommitdiff
path: root/pkg/domain/infra
diff options
context:
space:
mode:
authorzhangguanzhang <zhangguanzhang@qq.com>2020-10-16 11:05:44 +0800
committerzhangguanzhang <zhangguanzhang@qq.com>2020-10-16 11:09:21 +0800
commit97fec292123939d2cb505c26c327726163ff1867 (patch)
treef0fa6f0017af8982791ad8d5c1773d5f0e234f52 /pkg/domain/infra
parentc3ecdd09ed6a9b17da9879d7f2765a6f5f3ace8a (diff)
downloadpodman-97fec292123939d2cb505c26c327726163ff1867.tar.gz
podman-97fec292123939d2cb505c26c327726163ff1867.tar.bz2
podman-97fec292123939d2cb505c26c327726163ff1867.zip
Fix panic when runlabel is missing
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r--pkg/domain/infra/abi/containers_runlabel.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/containers_runlabel.go b/pkg/domain/infra/abi/containers_runlabel.go
index 30a5a55b8..41fdf8f34 100644
--- a/pkg/domain/infra/abi/containers_runlabel.go
+++ b/pkg/domain/infra/abi/containers_runlabel.go
@@ -28,6 +28,9 @@ func (ic *ContainerEngine) ContainerRunlabel(ctx context.Context, label string,
if err != nil {
return err
}
+ if runlabel == "" {
+ return errors.Errorf("cannot find the value of label: %s in image: %s", label, imageRef)
+ }
cmd, env, err := generateRunlabelCommand(runlabel, img, args, options)
if err != nil {