Merge pull request #967 from crosbymichael/task-ns

Namespace tasks via runc --root
This commit is contained in:
Kenfe-Mickaël Laventure
2017-06-07 07:31:14 -07:00
committed by GitHub
6 changed files with 94 additions and 40 deletions

View File

@@ -40,6 +40,10 @@ func main() {
Name: "debug",
Usage: "enable debug output in logs",
},
cli.StringFlag{
Name: "namespace,n",
Usage: "namespace that owns the task",
},
}
app.Before = func(context *cli.Context) error {
if context.GlobalBool("debug") {
@@ -61,10 +65,11 @@ func main() {
if err != nil {
return err
}
var (
server = grpc.NewServer()
sv = shim.New(path)
)
server := grpc.NewServer()
sv, err := shim.New(path, context.GlobalString("namespace"))
if err != nil {
return err
}
logrus.Debug("registering grpc server")
shimapi.RegisterShimServer(server, sv)
if err := serve(server, "shim.sock"); err != nil {