Commit graph

4883 commits

Author SHA1 Message Date
Bracken Dawson
28e95f73b6
OCI image-spec v1.1RC3 deprecated non-dist layers
We need to keep supporting them, dismiss the linter.

Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 12:38:10 +01:00
Bracken Dawson
a883f79cc0
Remove duplicated text from comment
Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 12:00:25 +01:00
Bracken Dawson
27a96320b9
Changes for OCI 1.1RC3
Artifact Manifest was deleted ¯\_(ツ)_/¯, Image manifest keeps the
subject field, gains an artifactType field, and the rules for what the
artifactType actually is change.

Keeping a lot of the framework that came of the Artifact Manifest
because I think it lead to some worthwhile abstractions.

Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:53:25 +01:00
Bracken Dawson
3b1947a38d
Support OCI Image Manifests with subject property
Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:53:25 +01:00
Bracken Dawson
eb2f108df2
OCI manifest verification error should be generic
We do no know that we were handling a PUT request here.

Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:52:46 +01:00
Bracken Dawson
35eae60995
Include a test for an artifact with blobs
Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:52:46 +01:00
Bracken Dawson
db324a4fab
Algorithm in referrer link path is a parameter
Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:52:46 +01:00
Bracken Dawson
27b69055d1
Document the reason for unversioned
Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:52:46 +01:00
Bracken Dawson
35c22d3333
Remove unlinker for now
It may likely be needed by garbage collect later.

Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:52:46 +01:00
Bracken Dawson
d9b286937b
Remove duplication of manifest.Unversioned
Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:52:46 +01:00
Bracken Dawson
2f078b7aa9
Remove stutter from artifact filenames
Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:52:46 +01:00
Bracken Dawson
baa392bd3d
Test additional artifact manifest cases
Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:52:46 +01:00
Bracken Dawson
92a5cff29c
Test subject field in a manifest that can't refer
If a manifest which cannot refer to a subject has a subject field then
we should ignore that field and not make a referrer link on that
subject.

Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:52:46 +01:00
Bracken Dawson
19033a370a
Test artifact manifest deletion
Deletion already works. Referrers links are left dangling so that
deletions don't have to try to parse the content. The artifact listing
API will need to validate each artifact and GC may want to clean up
dangling referrer links.

Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:52:46 +01:00
Bracken Dawson
d65591944a
Implement GET of artifact manifests
Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:52:46 +01:00
Bracken Dawson
3b4919b50d
Artifact manifest package should ba named OCI
Future non-OCI artifacts would not be able to live in the same package

Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:52:46 +01:00
Bracken Dawson
a9fafba86b
Create referrer links on subjects of artifacts
When an artifact is uploaded link its subject back to the artifact, even
if the subject does not exist yet.

Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:49:17 +01:00
Bracken Dawson
cd0c26c33c
Implement the Referrers interface on Artifact
Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:49:17 +01:00
Bracken Dawson
608a5708d5
Artifact subject should be a pointer field
So that one can easily tell if it was not set or was set invalidly.

Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:49:17 +01:00
Bracken Dawson
758f8ae00b
Add failing test for artifact referrers links
Subjects of referrers should link back to those referrers

Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:49:16 +01:00
Bracken Dawson
30015b3c6d
Parsing and storing of OCI Artifact Manifests
Does not yet make referrers link from the subject to the referrer

Signed-off-by: Bracken Dawson <abdawson@gmail.com>
2023-05-23 11:49:16 +01:00
Milos Gajdos
983358f8e2
Merge pull request #3896 from pluralsh/clean-blobstore-rebase
Remove blobstore from manifest builder
2023-05-19 15:05:16 +01:00
David van der Spek
f3eb91cf85 Update testutil/manifests.go
Co-authored-by: Kyle Squizzato <ksquizz@gmail.com>
Signed-off-by: David van der Spek <vanderspek.david@gmail.com>
2023-05-19 13:47:17 +00:00
glefloch
61e576f3d0 Remove blobstore from manifest builder
Signed-off-by: glefloch <glfloch@gmail.com>
Signed-off-by: David van der Spek <vanderspek.david@gmail.com>
2023-05-19 13:47:17 +00:00
Milos Gajdos
f7717b7855
Merge pull request #3917 from ecormaksin/ecormaksin/patch-2 2023-05-11 17:37:43 +01:00
Makoto Oda
6a4296128a vallye typo again and ignore section table layout is broken
Signed-off-by: Makoto Oda <truth_jp_4133@yahoo.co.jp>
2023-05-11 23:42:29 +09:00
Milos Gajdos
8e29e870a4
Merge pull request #3910 from thaJeztah/fix_releaser_filenames
Dockerfile: fix filenames of artifacts
2023-05-09 23:39:58 +01:00
Sebastiaan van Stijn
435c7b9a7b
Dockerfile: fix filenames of artifacts
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-10 00:26:02 +02:00
Milos Gajdos
f55a6552b0
Merge pull request from GHSA-hqxw-f8mx-cpmw
Fix runaway allocation on /v2/_catalog
2023-05-09 21:21:54 +01:00
Milos Gajdos
2b13387884
Merge pull request #3898 from ecormaksin/patch-1
Update configuration.md
2023-05-09 17:05:25 +01:00
Milos Gajdos
ada0064ab9
Merge pull request #3905 from thaJeztah/bump_go_1.19.9
update to go1.19.9
2023-05-09 16:45:31 +01:00
Makoto Oda
5d301a9b3b
Update configuration.md
I think that `valye` is typo.

Signed-off-by: Makoto Oda <truth_jp_4133@yahoo.co.jp>
2023-05-09 17:40:20 +02:00
Sebastiaan van Stijn
322eb4eecf
update to go1.19.9
Added back minor versions in these, so that we have a somewhat more
reproducible state in the repository when tagging releases.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 17:29:31 +02:00
Milos Gajdos
681d7dcbb3
Merge pull request #3906 from thaJeztah/update_golangci_lint
update golangci-lint to v1.52, fix linting issues
2023-05-09 16:21:02 +01:00
Milos Gajdos
4fd8ad520d
Merge pull request #3904 from thaJeztah/update_xx
Dockerfile: update xx to v1.2.1
2023-05-09 15:20:12 +01:00
Sebastiaan van Stijn
dec03ea3d8
update golangci-lint to v1.52
Removing the "structcheck" and "varcheck" linters as they've been deprecated.

    level=warning msg="[runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused."
    level=warning msg="[runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused."

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 16:04:17 +02:00
Sebastiaan van Stijn
ebe9d67446
ignore SA1019: ac.(*accessController).rootCerts.Subjects has been deprecated
We need to look into this; can we remove it, or is there a replacement?

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 16:04:17 +02:00
Sebastiaan van Stijn
84a85a4048
Ignore SA1019: SplitHostname is deprecated.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 16:04:17 +02:00
Sebastiaan van Stijn
999527f978
Ignore SA1019: "schema1 is deprecated" linting errors
We need to use this for backward compatibility.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 16:04:17 +02:00
Sebastiaan van Stijn
3c144f2264
registry/auth/token: fix the surrounding loop is unconditionally terminate
registry/auth/token/types_test.go:83:3: SA4004: the surrounding loop is unconditionally terminated (staticcheck)
                   return
                   ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 16:04:17 +02:00
Sebastiaan van Stijn
4052d269f5
reference, registry: fix loop variable captured by func literal (govet)
reference/normalize_test.go:274:40: loopclosure: loop variable r captured by func literal (govet)
                                   named, err := ParseNormalizedNamed(r)
                                                                      ^
    reference/normalize_test.go:276:29: loopclosure: loop variable r captured by func literal (govet)
                        t.Fatalf("ref=%s: %v", r, err)
                                               ^
    registry/api/errcode/errors_test.go:45:7: loopclosure: loop variable ec captured by func literal (govet)
                if ec != desc.Code {
                   ^
    registry/api/errcode/errors_test.go:46:66: loopclosure: loop variable ec captured by func literal (govet)
                    t.Fatalf("error code in descriptor isn't correct, %q != %q", ec, desc.Code)
                                                                                 ^
    registry/api/errcode/errors_test.go:49:23: loopclosure: loop variable desc captured by func literal (govet)
                if idToDescriptors[desc.Value].Code != ec {
                                   ^
    registry/api/errcode/errors_test.go:50:80: loopclosure: loop variable desc captured by func literal (govet)
                    t.Fatalf("error code in idToDesc isn't correct, %q != %q", idToDescriptors[desc.Value].Code, ec)
                                                                                               ^
    registry/api/errcode/errors_test.go:53:7: loopclosure: loop variable ec captured by func literal (govet)
                if ec.Message() != desc.Message {
                   ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 16:04:08 +02:00
Milos Gajdos
c9b844e533
Merge pull request #3885 from thaJeztah/rename_table_tests
assorted test updates
2023-05-09 13:58:29 +01:00
Sebastiaan van Stijn
f03d966ef7
cloudfront: use consistent names for test-tables, t.Parallel()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 14:39:58 +02:00
Sebastiaan van Stijn
5301ae14bf
cloudfront: rename vars that collided with type
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 14:00:17 +02:00
Sebastiaan van Stijn
85028a801b
registry/handlers: use consistent names for test-tables
Also marked assertBlobUploadStateEquals as t.Helper()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 14:00:17 +02:00
Sebastiaan van Stijn
f4acd98865
registry/api/v2: checkTestRouter(): use sub-tests, t.Parallel()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 14:00:05 +02:00
Sebastiaan van Stijn
2444c3282d
registry/api/v2: use consistent names for test-tables
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 13:55:16 +02:00
Sebastiaan van Stijn
9266220c2a
registry/auth/token: TestAudienceList_Unmarshal: t.Parallel()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 13:55:16 +02:00
Sebastiaan van Stijn
5e67a40e08
registry/auth/token: use consistent names for test-tables
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 13:55:16 +02:00
Sebastiaan van Stijn
f884a079df
registry/api/errorcode: TestErrorCodes: use sub-tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 13:55:11 +02:00