summaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-06-07 14:46:35 -0400
committerGitHub <noreply@github.com>2022-06-07 14:46:35 -0400
commitf459c197bdce6c6d6056c7214ce186f360599c94 (patch)
tree461f0c546a886539e840093ea318627cbf66ec7e /pkg/specgen
parent96578a26c343aac0f7dfbbf16d9da509cded9ff3 (diff)
parented1e4f94fb35bc727a921c28cea3ba0f94fc9121 (diff)
downloadpodman-f459c197bdce6c6d6056c7214ce186f360599c94.tar.gz
podman-f459c197bdce6c6d6056c7214ce186f360599c94.tar.bz2
podman-f459c197bdce6c6d6056c7214ce186f360599c94.zip
Merge pull request #14512 from cdoern/infraInherit
Infra Inheritance patch
Diffstat (limited to 'pkg/specgen')
-rw-r--r--pkg/specgen/generate/container_create.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index 04e24d625..f3093ae33 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -542,6 +542,16 @@ func Inherit(infra libpod.Container, s *specgen.SpecGenerator, rt *libpod.Runtim
infraConf := infra.Config()
infraSpec := infraConf.Spec
+ // need to set compatOptions to the currently filled specgenOptions so we do not overwrite
+ compatibleOptions.CapAdd = append(compatibleOptions.CapAdd, s.CapAdd...)
+ compatibleOptions.CapDrop = append(compatibleOptions.CapDrop, s.CapDrop...)
+ compatibleOptions.HostDeviceList = append(compatibleOptions.HostDeviceList, s.HostDeviceList...)
+ compatibleOptions.ImageVolumes = append(compatibleOptions.ImageVolumes, s.ImageVolumes...)
+ compatibleOptions.Mounts = append(compatibleOptions.Mounts, s.Mounts...)
+ compatibleOptions.OverlayVolumes = append(compatibleOptions.OverlayVolumes, s.OverlayVolumes...)
+ compatibleOptions.SelinuxOpts = append(compatibleOptions.SelinuxOpts, s.SelinuxOpts...)
+ compatibleOptions.Volumes = append(compatibleOptions.Volumes, s.Volumes...)
+
compatByte, err := json.Marshal(compatibleOptions)
if err != nil {
return nil, nil, nil, err