Skip to content

Commit 201365f

Browse files
Shuffle generated layer types
1 parent 7ffe5e7 commit 201365f

29 files changed

Lines changed: 311 additions & 304 deletions

internal/api/keppel/fixtures/after-delete-repo.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ INSERT INTO accounts (name, auth_tenant_id) VALUES ('test2', 'tenant2');
44
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, next_validation_at) VALUES (1, 'test1', 'sha256:0f8191f0b7f4d878acd87097ff96e338a21a5420343221d60a135de41c721782', 2000, '', 1010, 605810);
55
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, next_validation_at) VALUES (10, 'test1', 'sha256:99d139f8e68d538eaea0dd594c42503631e46a90296431b43f09fd122df37094', 20000, '', 1100, 605900);
66
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, media_type, next_validation_at) VALUES (11, 'test1', 'sha256:74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b', 4, '6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b', 0, 'application/vnd.oci.image.manifest.v1+json', 604800);
7-
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, media_type, next_validation_at) VALUES (12, 'test1', 'sha256:e71747696f20d12278c13f4311e127db96d886b091e6f1d01b0415ce598c94a3', 1048919, 'd4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35', 0, 'application/vnd.docker.image.rootfs.diff.tar.gzip', 604800);
8-
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, media_type, next_validation_at) VALUES (13, 'test1', 'sha256:0b2558e2d9ae6720adbbe3b605c19217e5d1e6e74d540d4627e498f8a9988168', 1257, '4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce', 0, 'application/vnd.docker.container.image.v1+json', 604800);
7+
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, media_type, next_validation_at) VALUES (12, 'test1', 'sha256:26ecd86a3a5d7f73fd26b4cae87edd8d53cdb8dfc68c3f92378023e7a70d8cf8', 1048613, 'd4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35', 0, 'application/vnd.docker.image.rootfs.diff.tar.zstd', 604800);
8+
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, media_type, next_validation_at) VALUES (13, 'test1', 'sha256:aada1d8bd56a08e276d2612c7a50f591641ad3bdcd3187dc2d313cc5d12ec025', 1257, '4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce', 0, 'application/vnd.docker.container.image.v1+json', 604800);
99
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, next_validation_at) VALUES (2, 'test1', 'sha256:648f958255f6c400e6d202c510234b53558d0739b556912ae7f9c6dbcbb68e92', 4000, '', 1020, 605820);
1010
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, next_validation_at) VALUES (3, 'test1', 'sha256:cd6a25c2ca3f53fdbbb4beb357ec3b82ec0b4a2abb5eacb93bdc0d2ddc21aa10', 6000, '', 1030, 605830);
1111
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, next_validation_at) VALUES (4, 'test1', 'sha256:576d7e58c644f5640145f49d26e81d485a903b0c571b948b1288415447b5a9f7', 8000, '', 1040, 605840);

internal/api/keppel/fixtures/before-delete-repo.sql

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ INSERT INTO blob_mounts (blob_id, repo_id) VALUES (9, 5);
1818
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, next_validation_at) VALUES (1, 'test1', 'sha256:0f8191f0b7f4d878acd87097ff96e338a21a5420343221d60a135de41c721782', 2000, '', 1010, 605810);
1919
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, next_validation_at) VALUES (10, 'test1', 'sha256:99d139f8e68d538eaea0dd594c42503631e46a90296431b43f09fd122df37094', 20000, '', 1100, 605900);
2020
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, media_type, next_validation_at) VALUES (11, 'test1', 'sha256:74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b', 4, '6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b', 0, 'application/vnd.oci.image.manifest.v1+json', 604800);
21-
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, media_type, next_validation_at) VALUES (12, 'test1', 'sha256:e71747696f20d12278c13f4311e127db96d886b091e6f1d01b0415ce598c94a3', 1048919, 'd4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35', 0, 'application/vnd.docker.image.rootfs.diff.tar.gzip', 604800);
22-
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, media_type, next_validation_at) VALUES (13, 'test1', 'sha256:0b2558e2d9ae6720adbbe3b605c19217e5d1e6e74d540d4627e498f8a9988168', 1257, '4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce', 0, 'application/vnd.docker.container.image.v1+json', 604800);
21+
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, media_type, next_validation_at) VALUES (12, 'test1', 'sha256:26ecd86a3a5d7f73fd26b4cae87edd8d53cdb8dfc68c3f92378023e7a70d8cf8', 1048613, 'd4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35', 0, 'application/vnd.docker.image.rootfs.diff.tar.zstd', 604800);
22+
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, media_type, next_validation_at) VALUES (13, 'test1', 'sha256:aada1d8bd56a08e276d2612c7a50f591641ad3bdcd3187dc2d313cc5d12ec025', 1257, '4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce', 0, 'application/vnd.docker.container.image.v1+json', 604800);
2323
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, next_validation_at) VALUES (2, 'test1', 'sha256:648f958255f6c400e6d202c510234b53558d0739b556912ae7f9c6dbcbb68e92', 4000, '', 1020, 605820);
2424
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, next_validation_at) VALUES (3, 'test1', 'sha256:cd6a25c2ca3f53fdbbb4beb357ec3b82ec0b4a2abb5eacb93bdc0d2ddc21aa10', 6000, '', 1030, 605830);
2525
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, next_validation_at) VALUES (4, 'test1', 'sha256:576d7e58c644f5640145f49d26e81d485a903b0c571b948b1288415447b5a9f7', 8000, '', 1040, 605840);
@@ -30,26 +30,26 @@ INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at,
3030
INSERT INTO blobs (id, account_name, digest, size_bytes, storage_id, pushed_at, next_validation_at) VALUES (9, 'test1', 'sha256:ae77c2ac9b830873195a42fd24c0001b2906da9e25a429dde9a67b6f8611d1ec', 18000, '', 1090, 605890);
3131

3232
INSERT INTO manifest_blob_refs (repo_id, digest, blob_id) VALUES (5, 'sha256:846dc180d9b05c084ba40cfcbf833c055041f2a48d6ef2e5e9b73baf590fea03', 11);
33-
INSERT INTO manifest_blob_refs (repo_id, digest, blob_id) VALUES (5, 'sha256:a1e9009ae84682acdf0e93957db7675eabfbf2846a841122c0bbc4d3d54b31cf', 12);
34-
INSERT INTO manifest_blob_refs (repo_id, digest, blob_id) VALUES (5, 'sha256:a1e9009ae84682acdf0e93957db7675eabfbf2846a841122c0bbc4d3d54b31cf', 13);
33+
INSERT INTO manifest_blob_refs (repo_id, digest, blob_id) VALUES (5, 'sha256:ed616071bd63e18b49d507f9c03507f4789d2bfa2f9e56b1ed4d64acd096876c', 12);
34+
INSERT INTO manifest_blob_refs (repo_id, digest, blob_id) VALUES (5, 'sha256:ed616071bd63e18b49d507f9c03507f4789d2bfa2f9e56b1ed4d64acd096876c', 13);
3535

36-
INSERT INTO manifest_contents (repo_id, digest, content) VALUES (5, 'sha256:02999eb4b2aa16094c7081c9f71a5dc728a7e4de598a8e314ecce42b96d12f01', '{"manifests":[{"digest":"sha256:a1e9009ae84682acdf0e93957db7675eabfbf2846a841122c0bbc4d3d54b31cf","mediaType":"application/vnd.docker.distribution.manifest.v2+json","platform":{"architecture":"amd64","os":"linux"},"size":428}],"mediaType":"application/vnd.docker.distribution.manifest.list.v2+json","schemaVersion":2}');
3736
INSERT INTO manifest_contents (repo_id, digest, content) VALUES (5, 'sha256:846dc180d9b05c084ba40cfcbf833c055041f2a48d6ef2e5e9b73baf590fea03', '{"schemaVersion":2,"mediaType":"application/vnd.oci.image.manifest.v1+json","config":{"mediaType":"application/vnd.oci.image.manifest.v1+json","digest":"sha256:74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b","size":4},"layers":[],"subject":{"mediaType":"application/vnd.oci.image.manifest.v1+json","digest":"sha256:040a5a009f9b9d5e4771742174142e74fa2d3e0aaa3df5717f01ade338d75d0e","size":0}}');
38-
INSERT INTO manifest_contents (repo_id, digest, content) VALUES (5, 'sha256:a1e9009ae84682acdf0e93957db7675eabfbf2846a841122c0bbc4d3d54b31cf', '{"config":{"digest":"sha256:0b2558e2d9ae6720adbbe3b605c19217e5d1e6e74d540d4627e498f8a9988168","mediaType":"application/vnd.docker.container.image.v1+json","size":1257},"layers":[{"digest":"sha256:e71747696f20d12278c13f4311e127db96d886b091e6f1d01b0415ce598c94a3","mediaType":"application/vnd.docker.image.rootfs.diff.tar.gzip","size":1048919}],"mediaType":"application/vnd.docker.distribution.manifest.v2+json","schemaVersion":2}');
37+
INSERT INTO manifest_contents (repo_id, digest, content) VALUES (5, 'sha256:ed616071bd63e18b49d507f9c03507f4789d2bfa2f9e56b1ed4d64acd096876c', '{"config":{"digest":"sha256:aada1d8bd56a08e276d2612c7a50f591641ad3bdcd3187dc2d313cc5d12ec025","mediaType":"application/vnd.docker.container.image.v1+json","size":1257},"layers":[{"digest":"sha256:26ecd86a3a5d7f73fd26b4cae87edd8d53cdb8dfc68c3f92378023e7a70d8cf8","mediaType":"application/vnd.docker.image.rootfs.diff.tar.zstd","size":1048613}],"mediaType":"application/vnd.docker.distribution.manifest.v2+json","schemaVersion":2}');
38+
INSERT INTO manifest_contents (repo_id, digest, content) VALUES (5, 'sha256:faf89383ebb4c8881c0b02f3da1dbd1d67dbd1a9d1d0f2715c6bf28855b84012', '{"manifests":[{"digest":"sha256:ed616071bd63e18b49d507f9c03507f4789d2bfa2f9e56b1ed4d64acd096876c","mediaType":"application/vnd.docker.distribution.manifest.v2+json","platform":{"architecture":"amd64","os":"linux"},"size":428}],"mediaType":"application/vnd.docker.distribution.manifest.list.v2+json","schemaVersion":2}');
3939

40-
INSERT INTO manifest_manifest_refs (repo_id, parent_digest, child_digest) VALUES (5, 'sha256:02999eb4b2aa16094c7081c9f71a5dc728a7e4de598a8e314ecce42b96d12f01', 'sha256:a1e9009ae84682acdf0e93957db7675eabfbf2846a841122c0bbc4d3d54b31cf');
40+
INSERT INTO manifest_manifest_refs (repo_id, parent_digest, child_digest) VALUES (5, 'sha256:faf89383ebb4c8881c0b02f3da1dbd1d67dbd1a9d1d0f2715c6bf28855b84012', 'sha256:ed616071bd63e18b49d507f9c03507f4789d2bfa2f9e56b1ed4d64acd096876c');
4141

42-
INSERT INTO manifests (repo_id, digest, media_type, size_bytes, pushed_at, next_validation_at) VALUES (5, 'sha256:02999eb4b2aa16094c7081c9f71a5dc728a7e4de598a8e314ecce42b96d12f01', 'application/vnd.docker.distribution.manifest.list.v2+json', 1050921, 0, 86400);
4342
INSERT INTO manifests (repo_id, digest, media_type, size_bytes, pushed_at, next_validation_at) VALUES (5, 'sha256:04abc8821a06e5a30937967d11ad10221cb5ac3b5273e434f1284ee87129a061', '', 8000, 10080, 96480);
4443
INSERT INTO manifests (repo_id, digest, media_type, size_bytes, pushed_at, next_validation_at) VALUES (5, 'sha256:27ecd0a598e76f8a2fd264d427df0a119903e8eae384e478902541756f089dd1', '', 4000, 10040, 96440);
4544
INSERT INTO manifests (repo_id, digest, media_type, size_bytes, pushed_at, next_validation_at) VALUES (5, 'sha256:377a23f52c6b357696238c3318f677a082dd3430bb6691042bd550a5cda28ebb', '', 5000, 10050, 96450);
4645
INSERT INTO manifests (repo_id, digest, media_type, size_bytes, pushed_at, next_validation_at) VALUES (5, 'sha256:4bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a', '', 1000, 10010, 96410);
4746
INSERT INTO manifests (repo_id, digest, media_type, size_bytes, pushed_at, next_validation_at) VALUES (5, 'sha256:75c8fd04ad916aec3e3d5cb76a452b116b3d4d0912a0a485e9fb8e3d240e210c', '', 3000, 10030, 96430);
4847
INSERT INTO manifests (repo_id, digest, media_type, size_bytes, pushed_at, next_validation_at, artifact_type, subject_digest) VALUES (5, 'sha256:846dc180d9b05c084ba40cfcbf833c055041f2a48d6ef2e5e9b73baf590fea03', 'application/vnd.oci.image.manifest.v1+json', 413, 0, 86400, 'application/vnd.oci.image.manifest.v1+json', 'sha256:040a5a009f9b9d5e4771742174142e74fa2d3e0aaa3df5717f01ade338d75d0e');
4948
INSERT INTO manifests (repo_id, digest, media_type, size_bytes, pushed_at, next_validation_at) VALUES (5, 'sha256:9dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2', '', 2000, 10020, 96420);
50-
INSERT INTO manifests (repo_id, digest, media_type, size_bytes, pushed_at, next_validation_at) VALUES (5, 'sha256:a1e9009ae84682acdf0e93957db7675eabfbf2846a841122c0bbc4d3d54b31cf', 'application/vnd.docker.distribution.manifest.v2+json', 1050604, 0, 86400);
5149
INSERT INTO manifests (repo_id, digest, media_type, size_bytes, pushed_at, next_validation_at) VALUES (5, 'sha256:c36336f242c655c52fa06c4d03f665ca9ea0bb84f20f1b1f90976aa58ca40a4a', '', 7000, 10070, 96470);
5250
INSERT INTO manifests (repo_id, digest, media_type, size_bytes, pushed_at, next_validation_at) VALUES (5, 'sha256:dfea2964b5deedea7b1ef077de529c3959e6788bdbb3441e70c77a1ae875bb48', '', 6000, 10060, 96460);
51+
INSERT INTO manifests (repo_id, digest, media_type, size_bytes, pushed_at, next_validation_at) VALUES (5, 'sha256:ed616071bd63e18b49d507f9c03507f4789d2bfa2f9e56b1ed4d64acd096876c', 'application/vnd.docker.distribution.manifest.v2+json', 1050298, 0, 86400);
52+
INSERT INTO manifests (repo_id, digest, media_type, size_bytes, pushed_at, next_validation_at) VALUES (5, 'sha256:faf89383ebb4c8881c0b02f3da1dbd1d67dbd1a9d1d0f2715c6bf28855b84012', 'application/vnd.docker.distribution.manifest.list.v2+json', 1050615, 0, 86400);
5353

5454
INSERT INTO quotas (auth_tenant_id, manifests) VALUES ('tenant1', 100);
5555
INSERT INTO quotas (auth_tenant_id, manifests) VALUES ('tenant2', 100);
@@ -70,14 +70,14 @@ INSERT INTO tags (repo_id, name, digest, pushed_at) VALUES (5, 'tag1', 'sha256:4
7070
INSERT INTO tags (repo_id, name, digest, pushed_at) VALUES (5, 'tag2', 'sha256:9dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2', 20020);
7171
INSERT INTO tags (repo_id, name, digest, pushed_at) VALUES (5, 'tag3', 'sha256:75c8fd04ad916aec3e3d5cb76a452b116b3d4d0912a0a485e9fb8e3d240e210c', 20030);
7272

73-
INSERT INTO trivy_security_info (repo_id, digest, vuln_status, message, next_check_at) VALUES (5, 'sha256:02999eb4b2aa16094c7081c9f71a5dc728a7e4de598a8e314ecce42b96d12f01', 'Pending', '', 0);
7473
INSERT INTO trivy_security_info (repo_id, digest, vuln_status, message, next_check_at) VALUES (5, 'sha256:04abc8821a06e5a30937967d11ad10221cb5ac3b5273e434f1284ee87129a061', 'Pending', '', 0);
7574
INSERT INTO trivy_security_info (repo_id, digest, vuln_status, message, next_check_at) VALUES (5, 'sha256:27ecd0a598e76f8a2fd264d427df0a119903e8eae384e478902541756f089dd1', 'Pending', '', 0);
7675
INSERT INTO trivy_security_info (repo_id, digest, vuln_status, message, next_check_at) VALUES (5, 'sha256:377a23f52c6b357696238c3318f677a082dd3430bb6691042bd550a5cda28ebb', 'Pending', '', 0);
7776
INSERT INTO trivy_security_info (repo_id, digest, vuln_status, message, next_check_at) VALUES (5, 'sha256:4bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a', 'Pending', '', 0);
7877
INSERT INTO trivy_security_info (repo_id, digest, vuln_status, message, next_check_at) VALUES (5, 'sha256:75c8fd04ad916aec3e3d5cb76a452b116b3d4d0912a0a485e9fb8e3d240e210c', 'Pending', '', 0);
7978
INSERT INTO trivy_security_info (repo_id, digest, vuln_status, message, next_check_at) VALUES (5, 'sha256:846dc180d9b05c084ba40cfcbf833c055041f2a48d6ef2e5e9b73baf590fea03', 'Pending', '', 0);
8079
INSERT INTO trivy_security_info (repo_id, digest, vuln_status, message, next_check_at) VALUES (5, 'sha256:9dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2', 'Pending', '', 0);
81-
INSERT INTO trivy_security_info (repo_id, digest, vuln_status, message, next_check_at) VALUES (5, 'sha256:a1e9009ae84682acdf0e93957db7675eabfbf2846a841122c0bbc4d3d54b31cf', 'Pending', '', 0);
8280
INSERT INTO trivy_security_info (repo_id, digest, vuln_status, message, next_check_at) VALUES (5, 'sha256:c36336f242c655c52fa06c4d03f665ca9ea0bb84f20f1b1f90976aa58ca40a4a', 'Pending', '', 0);
8381
INSERT INTO trivy_security_info (repo_id, digest, vuln_status, message, next_check_at) VALUES (5, 'sha256:dfea2964b5deedea7b1ef077de529c3959e6788bdbb3441e70c77a1ae875bb48', 'Pending', '', 0);
82+
INSERT INTO trivy_security_info (repo_id, digest, vuln_status, message, next_check_at) VALUES (5, 'sha256:ed616071bd63e18b49d507f9c03507f4789d2bfa2f9e56b1ed4d64acd096876c', 'Pending', '', 0);
83+
INSERT INTO trivy_security_info (repo_id, digest, vuln_status, message, next_check_at) VALUES (5, 'sha256:faf89383ebb4c8881c0b02f3da1dbd1d67dbd1a9d1d0f2715c6bf28855b84012', 'Pending', '', 0);

internal/api/keppel/repos_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func TestReposAPI(t *testing.T) {
110110
renderedRepos := []jsonmatch.Object{
111111
{"name": "repo1-1", "manifest_count": 0, "tag_count": 0},
112112
{"name": "repo1-2", "manifest_count": 0, "tag_count": 0},
113-
{"name": "repo1-3", "manifest_count": 11, "tag_count": 4, "size_bytes": 1160180, "pushed_at": 20030},
113+
{"name": "repo1-3", "manifest_count": 11, "tag_count": 4, "size_bytes": 1159874, "pushed_at": 20030},
114114
{"name": "repo1-4", "manifest_count": 0, "tag_count": 0},
115115
{"name": "repo1-5", "manifest_count": 0, "tag_count": 0},
116116
}

0 commit comments

Comments
 (0)