Skip to content

Commit

Permalink
Always print pushed digest in crane push (#1860)
Browse files Browse the repository at this point in the history
  • Loading branch information
aw185176 authored Jan 8, 2024
1 parent 55ffb00 commit a0658aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/crane/cmd/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ func NewCmdPush(options *[]crane.Option) *cobra.Command {

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

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

0 comments on commit a0658aa

Please sign in to comment.