From fe6e6b9cf345dcb599ad0ba31e1d4bec7924cb64 Mon Sep 17 00:00:00 2001 From: chaosinthecrd Date: Wed, 14 Aug 2024 13:42:28 +0100 Subject: [PATCH] fixed empty map issue Signed-off-by: chaosinthecrd --- attestation/oci/oci.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/attestation/oci/oci.go b/attestation/oci/oci.go index 134dbdf4..5f67ac65 100644 --- a/attestation/oci/oci.go +++ b/attestation/oci/oci.go @@ -151,14 +151,14 @@ func (a *Attestor) Attest(ctx *attestation.AttestationContext) error { if met != nil { if strings.HasPrefix(met.ContainerImageDigest, "sha256:") { - log.Debugf("setting image digest as", met.ContainerImageDigest) + log.Debugf("setting image digest as '%s'", met.ContainerImageDigest) + a.ImageDigest = map[cryptoutil.DigestValue]string{} a.ImageDigest[cryptoutil.DigestValue{Hash: crypto.SHA256}] = met.ContainerImageDigest } else { log.Warnf("found metadata file does not contain image digest of expected format: '%s'", met.ContainerImageDigest) } - a.ImageDigest = map[cryptoutil.DigestValue]string{} - log.Debugf("setting image references as", met.ImageName) + log.Debugf("setting image references as '%s'", met.ImageName) a.ImageReferences = []string{} a.ImageReferences = append(a.ImageReferences, met.ImageName) }