From 619ee6ac61e2af02eaa9dac15bca10c2c1914719 Mon Sep 17 00:00:00 2001 From: Jim Bugwadia Date: Wed, 6 Oct 2021 09:55:23 -0700 Subject: [PATCH] fix loop Signed-off-by: Jim Bugwadia --- pkg/cosign/client.go | 2 +- pkg/engine/imageVerify.go | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/cosign/client.go b/pkg/cosign/client.go index c8a2a41085..39bdfb3432 100644 --- a/pkg/cosign/client.go +++ b/pkg/cosign/client.go @@ -16,7 +16,7 @@ type driver struct { } func (d *driver) Verify(ctx context.Context, signedImgRef name.Reference, co *cosign.CheckOpts) ([]cosign.SignedPayload, error) { - return d.Verify(ctx, signedImgRef, co) + return cosign.Verify(ctx, signedImgRef, co) } diff --git a/pkg/engine/imageVerify.go b/pkg/engine/imageVerify.go index fb2fd8007a..731f4e0434 100644 --- a/pkg/engine/imageVerify.go +++ b/pkg/engine/imageVerify.go @@ -190,14 +190,17 @@ func (iv *imageVerifier) attestImage(repository, key string, imageInfo *context. } if !val { - msg := fmt.Sprintf("attestation check failed for %s and predicate %s", imageInfo.String(), predicateType) + msg := fmt.Sprintf("attestation checks failed for %s and predicate %s", imageInfo.String(), predicateType) + iv.logger.Info(msg) return ruleResponse(iv.rule, msg, response.RuleStatusFail) } } } } - return ruleResponse(iv.rule, "attestation checks passed", response.RuleStatusPass) + msg := fmt.Sprintf("attestation checks passed for %s", imageInfo.String()) + iv.logger.V(2).Info(msg) + return ruleResponse(iv.rule, msg, response.RuleStatusPass) } func (iv *imageVerifier) checkAttestations(a *v1.Attestation, s map[string]interface{}, img *context.ImageInfo ) (bool, error) {