summaryrefslogtreecommitdiff
path: root/pkg/specgen/specgen.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-10-11 19:52:13 +0200
committerGitHub <noreply@github.com>2021-10-11 19:52:13 +0200
commit00ebf3cf1885fc95c3c36021e717db1f1e7d63be (patch)
tree46d5e51466495e19c092edc646d3c398a65ae3e9 /pkg/specgen/specgen.go
parentdd9c9172af28942cada45d7e0b63343abf863601 (diff)
parent54471acba8fa6a6298615cff9c2130d9c3bc7b2c (diff)
downloadpodman-00ebf3cf1885fc95c3c36021e717db1f1e7d63be.tar.gz
podman-00ebf3cf1885fc95c3c36021e717db1f1e7d63be.tar.bz2
podman-00ebf3cf1885fc95c3c36021e717db1f1e7d63be.zip
Merge pull request #11912 from chenk008/fix_roofs_path_contains_colon
support rootfs contains colon
Diffstat (limited to 'pkg/specgen/specgen.go')
-rw-r--r--pkg/specgen/specgen.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/specgen/specgen.go b/pkg/specgen/specgen.go
index dbb669291..07995b2df 100644
--- a/pkg/specgen/specgen.go
+++ b/pkg/specgen/specgen.go
@@ -552,10 +552,10 @@ func NewSpecGenerator(arg string, rootfs bool) *SpecGenerator {
if rootfs {
csc.Rootfs = arg
// check if rootfs is actually overlayed
- parts := strings.SplitN(csc.Rootfs, ":", 2)
- if len(parts) > 1 && parts[1] == "O" {
+ lastColonIndex := strings.LastIndex(csc.Rootfs, ":")
+ if lastColonIndex != -1 && lastColonIndex+1 < len(csc.Rootfs) && csc.Rootfs[lastColonIndex+1:] == "O" {
csc.RootfsOverlay = true
- csc.Rootfs = parts[0]
+ csc.Rootfs = csc.Rootfs[:lastColonIndex]
}
} else {
csc.Image = arg