Skip to content

Commit

Permalink
Add retries to image push.
Browse files Browse the repository at this point in the history
This uses the default provided retry transport by
go-containerregistry as this originally had no retries
built in.

This is useful to avoid intermittent failures of image
registries when returning a retryable status code.
  • Loading branch information
mitchfriedman committed May 8, 2020
1 parent cb11a99 commit 3b557ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/executor/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"github.com/google/go-containerregistry/pkg/v1/layout"
"github.com/google/go-containerregistry/pkg/v1/mutate"
"github.com/google/go-containerregistry/pkg/v1/remote"
"github.com/google/go-containerregistry/pkg/v1/remote/transport"
"github.com/google/go-containerregistry/pkg/v1/tarball"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -311,7 +312,7 @@ func makeTransport(opts *config.KanikoOptions, registryName string, loader syste
}
}
}
return tr
return transport.NewRetry(tr)
}

// pushLayerToCache pushes layer (tagged with cacheKey) to opts.Cache
Expand Down

0 comments on commit 3b557ac

Please sign in to comment.