Skip to content

Commit

Permalink
Warn when unable to pull image
Browse files Browse the repository at this point in the history
  • Loading branch information
wdesouza committed Apr 11, 2020
1 parent 252aba8 commit ee655dc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func Connect() (*Docker, error) {
// Run runs a container
func (d *Docker) Run(ctx context.Context, container *pb.Container) error {
if err := d.pullImage(container.Image, ioutil.Discard); err != nil {
return err
log.WithError(err).WithField("image", container.Image).Warn("Unable to pull image.")
}

var env []string
Expand Down Expand Up @@ -111,8 +111,7 @@ func asTimestamp(s string) *timestamp.Timestamp {
func (d *Docker) pullImage(image string, w io.Writer) error {
reader, err := d.client.ImagePull(context.Background(), image, types.ImagePullOptions{})
if err != nil {
log.WithError(err).Warn("Unable to pull image.")
return nil
return err
}
defer func() {
if err := reader.Close(); err != nil {
Expand Down

0 comments on commit ee655dc

Please sign in to comment.