(p *Process, cmd *exec.Cmd, comm *processComm)
| 652 | } |
| 653 | |
| 654 | func (c *Container) newSetnsProcess(p *Process, cmd *exec.Cmd, comm *processComm) (*setnsProcess, error) { |
| 655 | cmd.Env = append(cmd.Env, "_LIBCONTAINER_INITTYPE="+string(initSetns)) |
| 656 | state := c.currentState() |
| 657 | // for setns process, we don't have to set cloneflags as the process namespaces |
| 658 | // will only be set via setns syscall |
| 659 | data, err := c.bootstrapData(0, state.NamespacePaths) |
| 660 | if err != nil { |
| 661 | return nil, err |
| 662 | } |
| 663 | proc := &setnsProcess{ |
| 664 | containerProcess: containerProcess{ |
| 665 | cmd: cmd, |
| 666 | comm: comm, |
| 667 | manager: c.cgroupManager, |
| 668 | config: c.newInitConfig(p), |
| 669 | process: p, |
| 670 | bootstrapData: data, |
| 671 | container: c, |
| 672 | }, |
| 673 | rootlessCgroups: c.config.RootlessCgroups, |
| 674 | intelRdtPath: state.IntelRdtPath, |
| 675 | initProcessPid: state.InitProcessPid, |
| 676 | } |
| 677 | return proc, nil |
| 678 | } |
| 679 | |
| 680 | func (c *Container) newInitConfig(process *Process) *initConfig { |
| 681 | // Set initial properties. For those properties that exist |
no test coverage detected