mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Replace execdrivers with containerd implementation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> Signed-off-by: Anusha Ragunathan <anusha@docker.com>
This commit is contained in:
parent
cc83031ade
commit
9c4570a958
89 changed files with 5696 additions and 1252 deletions
38
libcontainerd/container.go
Normal file
38
libcontainerd/container.go
Normal file
|
@ -0,0 +1,38 @@
|
|||
package libcontainerd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/docker/docker/restartmanager"
|
||||
)
|
||||
|
||||
const (
|
||||
// InitFriendlyName is the name given in the lookup map of processes
|
||||
// for the first process started in a container.
|
||||
InitFriendlyName = "init"
|
||||
configFilename = "config.json"
|
||||
)
|
||||
|
||||
type containerCommon struct {
|
||||
process
|
||||
restartManager restartmanager.RestartManager
|
||||
restarting bool
|
||||
processes map[string]*process
|
||||
}
|
||||
|
||||
// WithRestartManager sets the restartmanager to be used with the container.
|
||||
func WithRestartManager(rm restartmanager.RestartManager) CreateOption {
|
||||
return restartManager{rm}
|
||||
}
|
||||
|
||||
type restartManager struct {
|
||||
rm restartmanager.RestartManager
|
||||
}
|
||||
|
||||
func (rm restartManager) Apply(p interface{}) error {
|
||||
if pr, ok := p.(*container); ok {
|
||||
pr.restartManager = rm.rm
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("WithRestartManager option not supported for this client")
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue