From 1881c6994e7bb043c543637ad6b091619be44be7 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Thu, 23 Dec 2021 11:06:12 -0500 Subject: [PATCH] Log full image ref by digest when pushing an image --- pkg/executor/push.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/executor/push.go b/pkg/executor/push.go index d504025165..e4fe030022 100644 --- a/pkg/executor/push.go +++ b/pkg/executor/push.go @@ -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) }