Skip to content

Commit

Permalink
Log full image ref by digest when pushing an image
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh committed Dec 25, 2021
1 parent d2f3e89 commit 579ca1f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/executor/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,22 @@ 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 {
return errors.Wrap(err, fmt.Sprintf("failed to push to destination %s", destRef))
}
}
timing.DefaultRun.Stop(t)
logrus.Infof("Pushed image to %d destinations", len(destRefs))
return writeImageOutputs(image, destRefs)
}

Expand Down

0 comments on commit 579ca1f

Please sign in to comment.