container_create: set privileged on ctr only if also on sandbox
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
dacc5c3ece
commit
cde40ad5ca
1 changed files with 3 additions and 0 deletions
|
@ -419,6 +419,9 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,
|
||||||
var readOnlyRootfs bool
|
var readOnlyRootfs bool
|
||||||
if containerConfig.GetLinux().GetSecurityContext() != nil {
|
if containerConfig.GetLinux().GetSecurityContext() != nil {
|
||||||
if containerConfig.GetLinux().GetSecurityContext().Privileged {
|
if containerConfig.GetLinux().GetSecurityContext().Privileged {
|
||||||
|
if !sb.Privileged() {
|
||||||
|
return nil, fmt.Errorf("no privileged container allowed in sandbox")
|
||||||
|
}
|
||||||
specgen.SetupPrivileged(true)
|
specgen.SetupPrivileged(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue