daemon: Daemon.getPidContainer: change to accept "id" argument
This function didn't need the whole container, only its ID, so let's use that as argument. This also makes it consistent with getIpcContainer. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
bc7f341f29
commit
3d94eb9bcd
2 changed files with 2 additions and 3 deletions
|
@ -86,8 +86,7 @@ func (daemon *Daemon) getIpcContainer(id string) (*container.Container, error) {
|
|||
return ctr, nil
|
||||
}
|
||||
|
||||
func (daemon *Daemon) getPidContainer(ctr *container.Container) (*container.Container, error) {
|
||||
id := ctr.HostConfig.PidMode.Container()
|
||||
func (daemon *Daemon) getPIDContainer(id string) (*container.Container, error) {
|
||||
ctr, err := daemon.GetContainer(id)
|
||||
if err != nil {
|
||||
return nil, errdefs.InvalidParameter(err)
|
||||
|
|
|
@ -326,7 +326,7 @@ func WithNamespaces(daemon *Daemon, c *container.Container) coci.SpecOpts {
|
|||
}
|
||||
switch {
|
||||
case pidMode.IsContainer():
|
||||
pc, err := daemon.getPidContainer(c)
|
||||
pc, err := daemon.getPIDContainer(pidMode.Container())
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to join PID namespace")
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue