mirror of
https://github.com/rancher/os.git
synced 2025-09-03 15:54:24 +00:00
Bump libcompose and sync dependencies
This commit is contained in:
43
vendor/github.com/docker/containerd/supervisor/add_process.go
generated
vendored
43
vendor/github.com/docker/containerd/supervisor/add_process.go
generated
vendored
@@ -1,43 +0,0 @@
|
||||
package supervisor
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/docker/containerd/runtime"
|
||||
"github.com/docker/containerd/specs"
|
||||
)
|
||||
|
||||
type AddProcessTask struct {
|
||||
baseTask
|
||||
ID string
|
||||
PID string
|
||||
Stdout string
|
||||
Stderr string
|
||||
Stdin string
|
||||
ProcessSpec *specs.ProcessSpec
|
||||
StartResponse chan StartResponse
|
||||
}
|
||||
|
||||
func (s *Supervisor) addProcess(t *AddProcessTask) error {
|
||||
start := time.Now()
|
||||
ci, ok := s.containers[t.ID]
|
||||
if !ok {
|
||||
return ErrContainerNotFound
|
||||
}
|
||||
process, err := ci.container.Exec(t.PID, *t.ProcessSpec, runtime.NewStdio(t.Stdin, t.Stdout, t.Stderr))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.monitorProcess(process); err != nil {
|
||||
return err
|
||||
}
|
||||
ExecProcessTimer.UpdateSince(start)
|
||||
t.StartResponse <- StartResponse{}
|
||||
s.notifySubscribers(Event{
|
||||
Timestamp: time.Now(),
|
||||
Type: StateStartProcess,
|
||||
PID: t.PID,
|
||||
ID: t.ID,
|
||||
})
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user