From 779333e741d26e4fb50a162dd14ea7c801a055d1 Mon Sep 17 00:00:00 2001 From: karta0807913 Date: Sat, 26 Nov 2022 14:10:38 +0800 Subject: [PATCH] fix an override logic in Inherit function Signed-off-by: karta0807913 --- pkg/specgen/generate/container_create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go index 35928a57fd..11ef1fc358 100644 --- a/pkg/specgen/generate/container_create.go +++ b/pkg/specgen/generate/container_create.go @@ -612,7 +612,7 @@ func Inherit(infra libpod.Container, s *specgen.SpecGenerator, rt *libpod.Runtim } // this causes errors when shmSize is the default value, it will still get passed down unless we manually override. - if s.IpcNS.NSMode == specgen.Host && (compatibleOptions.ShmSize != nil && compatibleOptions.IsDefaultShmSize()) { + if inheritSpec.IpcNS.NSMode == specgen.Host && (compatibleOptions.ShmSize != nil && compatibleOptions.IsDefaultShmSize()) { s.ShmSize = nil } return options, infraSpec, compatibleOptions, nil