diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-10-16 16:10:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-16 16:10:02 -0400 |
commit | 9d5f28ba9e437204127e943f22e89c466dedea95 (patch) | |
tree | 028778884ef7248d78b9bda3be9d34afd0a98a8a /pkg/domain | |
parent | 9f98b3447c7a1c34d328a387993722e4e7113cd2 (diff) | |
parent | 97fec292123939d2cb505c26c327726163ff1867 (diff) | |
download | podman-9d5f28ba9e437204127e943f22e89c466dedea95.tar.gz podman-9d5f28ba9e437204127e943f22e89c466dedea95.tar.bz2 podman-9d5f28ba9e437204127e943f22e89c466dedea95.zip |
Merge pull request #8039 from zhangguanzhang/runlabel-panic
Fix panic when runlabel is missing
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/infra/abi/containers_runlabel.go | 3 |
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 { |