From 4e282fdec680ee8b7b6c30927cfe81fba91275bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20T=C3=BCrkal?= Date: Thu, 23 Jun 2022 15:22:30 +0300 Subject: [PATCH] sign-blob: bundle should work independently (#2016) 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 != "" {