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.
This commit is contained in:
Mitchell Friedman
2020-05-08 14:18:43 +01:00
parent cb11a9982c
commit 6978fab45c
2 changed files with 11 additions and 2 deletions
+2 -1
View File
@@ -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