summaryrefslogtreecommitdiff
path: root/pkg/specgen/specgen.go
diff options
context:
space:
mode:
authorflouthoc <flouthoc.git@gmail.com>2021-08-25 16:13:17 +0530
committerAditya Rajan <arajan@redhat.com>2021-09-14 13:31:39 +0530
commita55e2a00fcb82485333eeec55aa2eaee338782d7 (patch)
treed465835a368c7f78239d7abd1c2912347bf23d4c /pkg/specgen/specgen.go
parentb603c7a4b91d30b33ce987740156f46804f24074 (diff)
downloadpodman-a55e2a00fcb82485333eeec55aa2eaee338782d7.tar.gz
podman-a55e2a00fcb82485333eeec55aa2eaee338782d7.tar.bz2
podman-a55e2a00fcb82485333eeec55aa2eaee338782d7.zip
rootfs: Add support for rootfs-overlay and bump to buildah v1.22.1-0.202108
Allows users to specify a readonly rootfs with :O, in exchange podman will create a writable overlay. bump builah to v1.22.1-0.20210823173221-da2b428c56ce [NO TESTS NEEDED] Signed-off-by: flouthoc <flouthoc.git@gmail.com>
Diffstat (limited to 'pkg/specgen/specgen.go')
-rw-r--r--pkg/specgen/specgen.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkg/specgen/specgen.go b/pkg/specgen/specgen.go
index 0c30c498a..e0609c5bc 100644
--- a/pkg/specgen/specgen.go
+++ b/pkg/specgen/specgen.go
@@ -2,6 +2,7 @@ package specgen
import (
"net"
+ "strings"
"syscall"
"github.com/containers/image/v5/manifest"
@@ -209,6 +210,8 @@ type ContainerStorageConfig struct {
// Conflicts with Image.
// At least one of Image or Rootfs must be specified.
Rootfs string `json:"rootfs,omitempty"`
+ // RootfsOverlay tells if rootfs is actuall an overlay on top of base path
+ RootfsOverlay bool `json:"rootfs_overlay,omitempty"`
// ImageVolumeMode indicates how image volumes will be created.
// Supported modes are "ignore" (do not create), "tmpfs" (create as
// tmpfs), and "anonymous" (create as anonymous volumes).
@@ -528,6 +531,12 @@ func NewSpecGenerator(arg string, rootfs bool) *SpecGenerator {
csc := ContainerStorageConfig{}
if rootfs {
csc.Rootfs = arg
+ // check if rootfs is actually overlayed
+ parts := strings.SplitN(csc.Rootfs, ":", 2)
+ if len(parts) > 1 && parts[1] == "O" {
+ csc.RootfsOverlay = true
+ csc.Rootfs = parts[0]
+ }
} else {
csc.Image = arg
}