Support images as well as indexes in ImageDetailResolvers (#183)

* build: Generate test data for unsigned and no provenance image indexes
* feat: Add function to build index without SBOM or provenance for linux/amd64 platform
* feat: add build_image function to build image without SBOM or provenance for linux/amd64
* feat: Rename NO_SBOM_NO_PROVENANCE_INDEX_DIR to UNSIGNED_IMAGE_DIR
* feat: support images in details resolvers
This commit is contained in:
James Carnegie
2024-09-30 20:53:13 +01:00
committed by GitHub
parent 5e16b97e02
commit c0510fb76c
78 changed files with 159 additions and 86 deletions

View File

@@ -15,7 +15,7 @@ import (
)
var (
NoProvenanceImage = filepath.Join("test", "testdata", "no-provenance-image")
NoProvenanceImage = filepath.Join("test", "testdata", "no-provenance-index")
PassPolicyDir = filepath.Join("test", "testdata", "local-policy-pass")
PassMirrorPolicyDir = filepath.Join("test", "testdata", "local-policy-mirror")
PassNoTLPolicyDir = filepath.Join("test", "testdata", "local-policy-no-tl")
@@ -35,8 +35,8 @@ func TestSignVerifyOCILayout(t *testing.T) {
expectedAttestations int
replace bool
}{
{"signed replaced", test.UnsignedTestImage(), 0, 4, true},
{"without replace", test.UnsignedTestImage(), 4, 4, false},
{"signed replaced", test.UnsignedTestIndex(), 0, 4, true},
{"without replace", test.UnsignedTestIndex(), 4, 4, false},
// image without provenance doesn't fail
{"no provenance (replace)", NoProvenanceImage, 0, 2, true},
{"no provenance (no replace)", NoProvenanceImage, 2, 2, false},