From 36a4785bc7d69b5e3098fd978e442e92fdd43baf Mon Sep 17 00:00:00 2001 From: Furkan Date: Wed, 22 Jun 2022 23:13:22 +0300 Subject: [PATCH] sign-blob: bundle should work independently Fixes #1821 Fixes #2005 Signed-off-by: Furkan --- cmd/cosign/cli/sign/sign_blob.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/cosign/cli/sign/sign_blob.go b/cmd/cosign/cli/sign/sign_blob.go index f623613c78c..446959af3d2 100644 --- a/cmd/cosign/cli/sign/sign_blob.go +++ b/cmd/cosign/cli/sign/sign_blob.go @@ -91,7 +91,10 @@ func SignBlobCmd(ro *options.RootOptions, ko options.KeyOpts, regOpts options.Re if err != nil { return nil, err } - return []byte(signedPayload.Base64Signature), os.WriteFile(ko.BundlePath, contents, 0600) + if err := os.WriteFile(ko.BundlePath, contents, 0600); err != nil { + return nil, fmt.Errorf("create bundle file: %w", err) + } + fmt.Printf("Bundle wrote in the file %s\n", ko.BundlePath) } if outputSignature != "" {