From 6c3adc9c0567a8a4131dab4e8afb617b31cff5ee Mon Sep 17 00:00:00 2001 From: Furkan Date: Thu, 17 Feb 2022 14:31:11 +0300 Subject: [PATCH] fix(sign): kms unspported message Signed-off-by: Furkan --- pkg/signature/keys.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/signature/keys.go b/pkg/signature/keys.go index 6f8afde04bff..c64d4f672224 100644 --- a/pkg/signature/keys.go +++ b/pkg/signature/keys.go @@ -145,12 +145,13 @@ func SignerVerifierFromKeyRef(ctx context.Context, keyRef string, pf cosign.Pass } return cosign.LoadPrivateKey([]byte(pk), []byte(pass)) - case strings.Contains(keyRef, "://"): - return nil, fmt.Errorf("unsupported provider given") } - sv, err := kms.Get(ctx, keyRef, crypto.SHA256) - if err == nil { + if strings.Contains(keyRef, "://") { + sv, err := kms.Get(ctx, keyRef, crypto.SHA256) + if err != nil { + return nil, fmt.Errorf("kms get: %v", err) + } return sv, nil }