Make supervisor.go to compile without libcontainer.
Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
parent
b823ce9149
commit
05f20c993d
3 changed files with 23 additions and 2 deletions
|
@ -8,7 +8,6 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/docker/containerd/linux"
|
||||
"github.com/docker/containerd/runtime"
|
||||
"github.com/opencontainers/runc/libcontainer"
|
||||
)
|
||||
|
@ -19,7 +18,7 @@ func NewSupervisor(stateDir string, concurrency int) (*Supervisor, error) {
|
|||
return nil, err
|
||||
}
|
||||
// register counters
|
||||
r, err := linux.NewRuntime(stateDir)
|
||||
r, err := newRuntime(stateDir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
9
supervisor_linux.go
Normal file
9
supervisor_linux.go
Normal file
|
@ -0,0 +1,9 @@
|
|||
// +build libcontainer
|
||||
|
||||
package containerd
|
||||
|
||||
import "github.com/docker/containerd/runtime"
|
||||
|
||||
func newRuntime(stateDir string) (runtime.Runtime, error) {
|
||||
return linux.NewRuntime(stateDir)
|
||||
}
|
13
supervisor_unsupported.go
Normal file
13
supervisor_unsupported.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
// +build !libcontainer
|
||||
|
||||
package containerd
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/docker/containerd/runtime"
|
||||
)
|
||||
|
||||
func newRuntime(stateDir string) (runtime.Runtime, error) {
|
||||
return nil, errors.New("Unsupported runtime")
|
||||
}
|
Loading…
Reference in a new issue