Log full image ref by digest when pushing an image (#1857)

This commit is contained in:
Jason Hall 2021-12-28 08:13:11 -05:00 committed by GitHub
parent 7207dca03a
commit 129df249c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -244,7 +244,15 @@ func DoPush(image v1.Image, opts *config.KanikoOptions) error {
logrus.Infof("Pushing image to %s", destRef.String())
retryFunc := func() error {
return remote.Write(destRef, image, remote.WithAuth(pushAuth), remote.WithTransport(rt))
dig, err := image.Digest()
if err != nil {
return err
}
if err := remote.Write(destRef, image, remote.WithAuth(pushAuth), remote.WithTransport(rt)); err != nil {
return err
}
logrus.Infof("Pushed %s", destRef.Context().Digest(dig.String()))
return nil
}
if err := util.Retry(retryFunc, opts.PushRetry, 1000); err != nil {
@ -252,7 +260,6 @@ func DoPush(image v1.Image, opts *config.KanikoOptions) error {
}
}
timing.DefaultRun.Stop(t)
logrus.Infof("Pushed image to %d destinations", len(destRefs))
return writeImageOutputs(image, destRefs)
}