Skip to content

Commit

Permalink
adding warning to pin to digest (#2311)
Browse files Browse the repository at this point in the history
Signed-off-by: chaosinthecrd <[email protected]>

Signed-off-by: chaosinthecrd <[email protected]>
  • Loading branch information
Tom Meadows committed Oct 5, 2022
1 parent 4f82d96 commit 91b03f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/cosign/cli/sign/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ func SignCmd(ro *options.RootOptions, ko options.KeyOpts, regOpts options.Regist
return fmt.Errorf("unable to resolve attachment %s for image %s", attachment, inputImg)
}

if _, ok := ref.(name.Tag); ok {
fmt.Println("Warning: Tag used in reference to identify the image. Consider supplying the digest for immutability.")
}

if digest, ok := ref.(name.Digest); ok && !recursive {
se, err := ociremote.SignedEntity(ref, opts...)
if err != nil {
Expand Down

0 comments on commit 91b03f2

Please sign in to comment.