Merge execution and container service

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2016-12-07 14:00:20 -08:00
parent ac3cc32dbc
commit 5a86eae247
8 changed files with 3912 additions and 4315 deletions

View file

@ -61,10 +61,6 @@ var runCommand = cli.Command{
if err != nil {
return err
}
containerService, err := getContainerService(context)
if err != nil {
return err
}
tmpDir, err := getTempDir(id)
if err != nil {
@ -90,7 +86,7 @@ var runCommand = cli.Command{
return err
}
if _, err := containerService.Start(gocontext.Background(), &execution.StartContainerRequest{
if _, err := executionService.Start(gocontext.Background(), &execution.StartContainerRequest{
ID: cr.Container.ID,
}); err != nil {
return err
@ -98,7 +94,7 @@ var runCommand = cli.Command{
// wait for it to die
for {
gcr, err := containerService.Get(gocontext.Background(), &execution.GetContainerRequest{
gcr, err := executionService.Get(gocontext.Background(), &execution.GetContainerRequest{
ID: cr.Container.ID,
})
if err != nil {
@ -210,14 +206,6 @@ func getExecutionService(context *cli.Context) (execution.ExecutionServiceClient
return execution.NewExecutionServiceClient(conn), nil
}
func getContainerService(context *cli.Context) (execution.ContainerServiceClient, error) {
conn, err := getGRPCConnection(context)
if err != nil {
return nil, err
}
return execution.NewContainerServiceClient(conn), nil
}
func getTempDir(id string) (string, error) {
err := os.MkdirAll(filepath.Join(os.TempDir(), "ctr"), 0700)
if err != nil {