mirror of
https://github.com/containers/podman.git
synced 2025-08-01 16:24:58 +08:00
Infra Inheritance patch
infra was overriding options that it should be appending rather than resetting. fix this by appending the given container's spec to the compatible options before marshaling/unmarshaling resolves #14454 Signed-off-by: cdoern <cdoern@redhat.com>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user