Commit graph

2792 commits

Author SHA1 Message Date
James Hewitt
31f5cd4865
Handle rand deprecations in go 1.20
Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
(cherry picked from commit 1a3e73cb84)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-12 00:35:52 +02:00
James Hewitt
29b8ba0b93
Update to go 1.20
Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
(cherry picked from commit 0eb8fee87e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-12 00:35:05 +02:00
Ben Manuel
3316b19810
Update to golang 1.19.10
This addresses CVE-2023-29402, CVE-2023-29403, CVE-2023-29404, CVE-2023-29405
which were patched in 1.19.10.

Signed-off-by: Ben Manuel <ben.manuel@procore.com>
(cherry picked from commit 36dd5b79ca)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-12 00:35:05 +02:00
Sebastiaan van Stijn
444d053e12
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>
(cherry picked from commit dec03ea3d8)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-12 00:34:52 +02:00
Sebastiaan van Stijn
b800af4409
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>
(cherry picked from commit ebe9d67446)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-12 00:33:27 +02:00
Sebastiaan van Stijn
0a98a00d17
Ignore SA1019: SplitHostname is deprecated.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 84a85a4048)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-12 00:32:54 +02:00
Hayley Swimelar
2897284284
Merge pull request #4054 from thaJeztah/2.8_backport_nonjson-error-client
[release/2.8 backport] Dont parse errors as JSON unless Content-Type is set to JSON
2023-09-11 13:18:23 -07:00
Milos Gajdos
2ec0471bb5
Dont parse errors as JSON unless Content-Type is set to JSON
Client attempts to parse the body of every error it receives as JSON
regardless of the content-type. This commit rectifies by only parsing
he error body as JSON if the Content-Type header is set to
either "application/json" or "application/vnd.api+json".

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
(cherry picked from commit 45b7b9cec3)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-08 14:54:21 +02:00
Milos Gajdos
10a7e4c483
Merge pull request #4032 from thaJeztah/2.8_backport_ref_replace_deprecated
[release/2.8 backport] reference: replace deprecated function SplitHostname
2023-08-31 15:20:59 +01:00
Sebastiaan van Stijn
b57133cc21
referene: fix formatting of "deprecated" comment.
Go requires "deprecated" comments to have an empty line before them,
and to not be all-caps.

This updates to the comment so that it's correctly picked up as deprecated.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3c71f4933d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-31 12:58:15 +02:00
zounengren
2c4bf1a664
replace deprecated function
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 79d1901549)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-31 12:58:04 +02:00
Milos Gajdos
27206bcd3b
Merge pull request #4009 from thaJeztah/2.8_backport_enable_build_tags
[release/2.8 backport] Enable Go build tags
2023-08-22 15:10:59 +01:00
Milos Gajdos
110cb7538d
Enable build tags in 2.8
It would appear we were missing the Go build tags on 2.8.X branch so the
images would not have the necessary support for some storage drivers
causing breakages to end users trying to use them.

This commit fixes both the build and linting issues.

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
2023-08-21 13:58:10 +02:00
Sebastiaan van Stijn
2d62a4027a
s3: add interface assertion
This was added for the other drivers in 6b388b1ba6,
but it missed the s3 storage driver.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 5b3be39870)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-21 13:57:02 +02:00
Milos Gajdos
2548973b1d
Enable Go build tags
This enables go build tags so the GCS and OSS driver support is
available in the binary distributed via the image build by Dockerfile.

This led to quite a few fixes in the GCS and OSS packages raised as
warning by golang-ci linter.

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
(cherry picked from commit 6b388b1ba6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-21 13:50:24 +02:00
Milos Gajdos
8728c52ef2
Merge pull request #3926 from marcusirgens/use-build-tags
Pass `BUILDTAGS` argument to `go build`
2023-06-07 09:53:15 +01:00
Marcus Pettersen Irgens
ab7178cc0a
Pass BUILDTAGS argument to go build
Signed-off-by: Marcus Pettersen Irgens <m@mrcus.dev>
2023-05-19 18:38:27 +02:00
Milos Gajdos
7c354a4b40
Merge pull request #3915 from distribution/2.8.2-release-notes
Add v2.8.2 release notes
2023-05-11 11:11:57 +01:00
Milos Gajdos
a173a9c625
Add v2.8.2 release notes
Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
2023-05-11 10:47:17 +01:00
Milos Gajdos
4894d35ecc
Merge pull request #3914 from vvoland/handle-forbidden-28
[release/2.8 backport] registry/errors: Parse http forbidden as denied
2023-05-11 10:00:25 +01:00
Milos Gajdos
f067f66d3d
Merge pull request #3783 from ndeloof/accept-encoding-28
[release/2.8 backport] revert "registry/client: set Accept: identity header when getting layers
2023-05-11 09:54:18 +01:00
Paweł Gronowski
483ad69da3
registry/errors: Parse http forbidden as denied
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 5f1df02149)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-05-11 10:45:46 +02:00
Nicolas De Loof
2b0f84df21
Revert "registry/client: set Accept: identity header when getting layers"
This reverts commit 16f086a0ec.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-05-10 23:00:15 +02:00
Milos Gajdos
320d6a141f
Merge pull request #3912 from distribution/2.8.2-beta.2-release-notes
Add 2.8.2 beta.2 release notes
2023-05-10 00:16:38 +01:00
Milos Gajdos
5f3ca1b2fb
Add release notes for 2.8.2-beta.2 release
Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
2023-05-10 00:12:20 +01:00
Milos Gajdos
cb840f63b3
Merge pull request #3911 from thaJeztah/2.8_backport_fix_releaser_filenames
[release/2.8 backport] Dockerfile: fix filenames of artifacts
2023-05-09 23:43:34 +01:00
Sebastiaan van Stijn
e884644fff
Dockerfile: fix filenames of artifacts
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 435c7b9a7b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-10 00:27:45 +02:00
Milos Gajdos
963c19952a
Merge pull request #3909 from distribution/2.8.2-beta-release-notes
Add 2.8.2-beta.1 release notes
2023-05-09 22:39:59 +01:00
Milos Gajdos
ac6c72b25f
Add 2.8.2-beta.1 release notes
Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
2023-05-09 22:22:05 +01:00
Milos Gajdos
dcb637d6ea
Merge pull request from GHSA-hqxw-f8mx-cpmw
[release/2.8] Fix runaway allocation on /v2/_catalog
2023-05-09 21:21:54 +01:00
Milos Gajdos
08f5645587
Merge pull request #3893 from pluralsh/part-pagination
[release/2.8] Add code to handle pagination of parts. Fixes max layer size of 10GB bug
2023-05-09 20:58:24 +01:00
Milos Gajdos
4a35c451a0
Merge pull request #3908 from thaJeztah/2.8_backport_bump_go1.19.9
[release/2.8 backport] update to go1.19.9
2023-05-09 19:16:47 +01:00
Milos Gajdos
ae58bde985
Fix gofmt warnings
Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
2023-05-09 18:58:38 +01:00
Sebastiaan van Stijn
3f2a4e24a7
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>
(cherry picked from commit 322eb4eecf)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 17:57:57 +02:00
Sebastiaan van Stijn
9c04409fdb
[release/2.8] ignore deprecation of io/ioutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 17:57:28 +02:00
Milos Gajdos
b791fdc2c6
Merge pull request #3907 from thaJeztah/2.8_backport_update_xx
[release/2.8 backport] Dockerfile: update xx to v1.2.1
2023-05-09 15:58:05 +01:00
Sebastiaan van Stijn
3d8f3cc4a5
Dockerfile: update xx to v1.2.1
full diff: https://github.com/tonistiigi/xx/compare/v1.1.1...v1.2.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 8c4d2b9d65)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 15:32:28 +02:00
Milos Gajdos
d3fac541b1
Merge pull request #3903 from thaJeztah/2.8_bump_go_118
[release/2.8] bump up golang version (alternative)
2023-05-09 13:59:02 +01:00
Wang Yan
70db3a46d9
bump up golang version
upgrade go version to v1.18.8

Signed-off-by: Wang Yan <wangyan@vmware.com>
2023-05-09 10:59:43 +02:00
CrazyMax
db1389e043
dockerfiles: formatting
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 0e17e54091)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 10:59:43 +02:00
CrazyMax
018472de2d
dockerfiles: set ALPINE_VERSION
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit b066451b40)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 10:59:42 +02:00
CrazyMax
19b3feb5df
Update to xx 1.1.1
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 52a88c596b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 10:59:42 +02:00
CrazyMax
14bd72bcf8
Dockerfile: switch to xx
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
(cherry picked from commit 87f93ede9e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 10:59:42 +02:00
Wang Yan
2392893bcf
bump up golang v1.17
Signed-off-by: Wang Yan <wangyan@vmware.com>
(cherry picked from commit 3f4c558dac)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 10:59:38 +02:00
Sebastiaan van Stijn
092a2197ff
[release/2.8] fix package name in Dockerfile
The 2.8 release is still named github.com/docker/distribution.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-09 10:53:15 +02:00
David van der Spek
22a805033a fix(ci): use go install instead of go get
Signed-off-by: David van der Spek <vanderspek.david@gmail.com>
2023-05-08 23:21:18 -05:00
Derek McGowan
1d52366d2c Merge pull request #2815 from bainsy88/issue_2814
Add code to handle pagination of parts. Fixes max layer size of 10GB bug

Signed-off-by: David van der Spek <vanderspek.david@gmail.com>
2023-05-08 23:21:18 -05:00
Jose D. Gomez R
521ea3d973
Fix runaway allocation on /v2/_catalog
Introduced a Catalog entry in the configuration struct. With it,
it's possible to control the maximum amount of entries returned
by /v2/catalog (`GetCatalog` in registry/handlers/catalog.go).

It's set to a default value of 1000.

`GetCatalog` returns 100 entries by default if no `n` is
provided. When provided it will be validated to be between `0`
and `MaxEntries` defined in Configuration. When `n` is outside
the aforementioned boundary, ErrorCodePaginationNumberInvalid is
returned.

`GetCatalog` now handles `n=0` gracefully with an empty response
as well.

Signed-off-by: José D. Gómez R. <1josegomezr@gmail.com>
Co-authored-by: Cory Snider <corhere@gmail.com>
2023-04-24 18:53:43 +02:00
Milos Gajdos
82d6c3d007
Merge pull request #3815 from wy65701436/release/2.8-cp-3615
[release/2.8] Fix panic in inmemory driver
2023-04-17 15:58:21 +01:00
Shengjing Zhu
ad5991de09 Fix panic in inmemory driver
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2022-12-04 22:47:15 +08:00