Skip to content

Commit

Permalink
Merge branch 'workflow' of github.com:packethost/rover into workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
parauliya committed Nov 12, 2019
2 parents b658edc + 955b4a1 commit e9eb5a8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions worker/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ func pullActionImage(ctx context.Context, action *pb.WorkflowAction) error {
}
authStr := base64.URLEncoding.EncodeToString(encodedJSON)

_, err = cli.ImagePull(ctx, registry+"/"+action.GetImage(), types.ImagePullOptions{RegistryAuth: authStr})
out, err := cli.ImagePull(ctx, registry+"/"+action.GetImage(), types.ImagePullOptions{RegistryAuth: authStr})
if err != nil {
return errors.Wrap(err, "DOCKER PULL")
}
defer out.Close()
io.Copy(os.Stdout, out)
return nil
}

Expand All @@ -117,7 +119,10 @@ func createContainer(ctx context.Context, action *pb.WorkflowAction) (string, er
Image: registry + "/" + action.GetImage(),
AttachStdout: true,
AttachStderr: true,
Cmd: []string{action.Command},
}

if action.Command != "" {
config.Cmd = []string{action.Command}
}

resp, err := cli.ContainerCreate(ctx, config, nil, nil, action.GetName())
Expand Down

0 comments on commit e9eb5a8

Please sign in to comment.