summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-15 15:03:58 -0400
committerGitHub <noreply@github.com>2021-09-15 15:03:58 -0400
commitf38503a1a3336a87a950c1d97bf1cb9a1a883ada (patch)
treeacbc335c68dcd6a7a2f0de5700e51f017e94348c /pkg/domain
parentf9d8301c476fcd8498930c518f04920e9e8eeac5 (diff)
parent0b1c45bc542636d48abcc3980baa02b9a65f57a9 (diff)
downloadpodman-f38503a1a3336a87a950c1d97bf1cb9a1a883ada.tar.gz
podman-f38503a1a3336a87a950c1d97bf1cb9a1a883ada.tar.bz2
podman-f38503a1a3336a87a950c1d97bf1cb9a1a883ada.zip
Merge pull request #11592 from Luap99/runlabel-name
container runlabel remove image tag from name
Diffstat (limited to 'pkg/domain')
-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 d448627dc..435baa8c8 100644
--- a/pkg/domain/infra/abi/containers_runlabel.go
+++ b/pkg/domain/infra/abi/containers_runlabel.go
@@ -133,6 +133,9 @@ func generateRunlabelCommand(runlabel string, img *libimage.Image, inputName str
}
splitImageName := strings.Split(normalize, "/")
name = splitImageName[len(splitImageName)-1]
+ // make sure to remove the tag from the image name, otherwise the name cannot
+ // be used as container name because a colon is an illegal character
+ name = strings.SplitN(name, ":", 2)[0]
}
// Append the user-specified arguments to the runlabel (command).