Skip to content

Commit

Permalink
fixed empty map issue
Browse files Browse the repository at this point in the history
Signed-off-by: chaosinthecrd <[email protected]>
  • Loading branch information
ChaosInTheCRD committed Aug 14, 2024
1 parent 210e3c9 commit fe6e6b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions attestation/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit fe6e6b9

Please sign in to comment.