Skip to content

Commit a0658aa

Browse files
authored
Always print pushed digest in crane push (#1860)
1 parent 55ffb00 commit a0658aa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/crane/cmd/push.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ func NewCmdPush(options *[]crane.Option) *cobra.Command {
7171

7272
digest := ref.Context().Digest(h.String())
7373
if imageRefs != "" {
74-
return os.WriteFile(imageRefs, []byte(digest.String()), 0600)
74+
if err := os.WriteFile(imageRefs, []byte(digest.String()), 0600); err != nil {
75+
return fmt.Errorf("failed to write image refs to %s: %w", imageRefs, err)
76+
}
7577
}
7678

7779
// Print the digest of the pushed image to stdout to facilitate command composition.

0 commit comments

Comments
 (0)