Use maps.Clone from stdlib
This commit is contained in:
@@ -3,6 +3,7 @@ package attestation
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"maps"
|
||||||
|
|
||||||
v1 "github.com/google/go-containerregistry/pkg/v1"
|
v1 "github.com/google/go-containerregistry/pkg/v1"
|
||||||
"github.com/google/go-containerregistry/pkg/v1/partial"
|
"github.com/google/go-containerregistry/pkg/v1/partial"
|
||||||
@@ -64,10 +65,7 @@ func GetAttestationsFromImage(image v1.Image) ([]AttestationLayer, error) {
|
|||||||
return nil, fmt.Errorf("failed to get descriptor for layer: %w", err)
|
return nil, fmt.Errorf("failed to get descriptor for layer: %w", err)
|
||||||
}
|
}
|
||||||
// copy original annotations
|
// copy original annotations
|
||||||
ann := make(map[string]string)
|
ann := maps.Clone(layerDesc.Annotations)
|
||||||
for k, v := range layerDesc.Annotations {
|
|
||||||
ann[k] = v
|
|
||||||
}
|
|
||||||
// only decode intoto statements
|
// only decode intoto statements
|
||||||
var stmt = new(intoto.Statement)
|
var stmt = new(intoto.Statement)
|
||||||
if mt == types.MediaType(intoto.PayloadType) {
|
if mt == types.MediaType(intoto.PayloadType) {
|
||||||
|
|||||||
Reference in New Issue
Block a user