Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Commit

Permalink
Show digest of pushed images (#1737)
Browse files Browse the repository at this point in the history
* Show digest of pushed images

* Non-fatal log

* Make easier to copy and paste
  • Loading branch information
illicitonion committed Jan 24, 2022
1 parent b74ef7f commit c27194b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion container/go/cmd/pusher/pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,21 @@ func main() {
log.Printf("Destination %s was resolved to %s after stamping.", *dst, stamped)
}

digest, err := img.Digest()
if err != nil {
log.Printf("Failed to digest image: %v", err)
}

if err := push(stamped, img); err != nil {
log.Fatalf("Error pushing image to %s: %v", stamped, err)
}

log.Printf("Successfully pushed %s image to %s", *format, stamped)
digestStr := ""
if !strings.Contains(stamped, "@") {
digestStr = fmt.Sprintf(" - %s@%s", strings.Split(stamped, ":")[0], digest)
}

log.Printf("Successfully pushed %s image to %s%s", *format, stamped, digestStr)
}

// digestExists checks whether an image's digest exists in a repository.
Expand Down

0 comments on commit c27194b

Please sign in to comment.