Merge pull request #8878 from mheon/no_edit_config

Ensure we do not edit container config in Exec
This commit is contained in:
OpenShift Merge Robot 2021-01-04 21:11:27 -05:00 committed by GitHub
commit 618c35570d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1195,7 +1195,10 @@ func prepareProcessExec(c *Container, options *ExecOptions, env []string, sessio
if err != nil {
return nil, err
}
pspec := c.config.Spec.Process
pspec := new(spec.Process)
if err := JSONDeepCopy(c.config.Spec.Process, pspec); err != nil {
return nil, err
}
pspec.SelinuxLabel = c.config.ProcessLabel
pspec.Args = options.Cmd
for _, cap := range options.CapAdd {