From 3b557ac18b6540bd6173352fc0d10d6ecad3acb1 Mon Sep 17 00:00:00 2001 From: Mitchell Friedman Date: Fri, 8 May 2020 08:45:54 +0100 Subject: [PATCH] Add retries to image push. 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. --- pkg/executor/push.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/executor/push.go b/pkg/executor/push.go index ff81409e3b..7bc69f8ca5 100644 --- a/pkg/executor/push.go +++ b/pkg/executor/push.go @@ -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" @@ -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