1
0
mirror of https://github.com/distribution/distribution synced 2024-11-12 05:45:51 +01:00
Commit Graph

12 Commits

Author SHA1 Message Date
Milos Gajdos
d5a1cf6816
cleanup: move init funcs to the top of the source (#4172) 2023-12-01 06:59:35 +00:00
Milos Gajdos
b3681c4cd3
feat: add tparallel linter to improve handling parallel tests
This linter both prevents parallel test races as well as
suggests parallel tests where appropriate:
See: https://github.com/moricho/tparallel

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
2023-11-29 21:40:20 +00:00
Milos Gajdos
f71b32894a
remove uuid package (#4157) 2023-11-29 17:42:51 +00:00
Milos Gajdos
d8ff41a344
cleanup: move init funcs to the top of the source
We make sure they're not hiding at the bottom or in the middle
which makes debugging an utter nightmare!

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
2023-11-28 06:50:48 +00:00
Milos Gajdos
f33e5a69da
fix: invalid conversion when using Content-Range in client
Fixes: https://github.com/distribution/distribution/security/code-scanning/34

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
2023-11-22 07:02:01 +00:00
gotgelf
bb15625561 remove uuid package
the `uuid` package is not used in the code base,
so it can be safely remove.

Signed-off-by: Alex Gotgelf <gotgelf@gmail.com>
Signed-off-by: gotgelf <gotgelf@gmail.com>
2023-11-16 08:55:58 +01:00
Cory Snider
f7e5eaae70 internal/dcontext: drop GetRequest() function
It is no longer used.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-10-27 10:58:37 -04:00
Cory Snider
9157226e7b Extract request utilities into its own package
The RemoteAddr and RemoteIP functions operate on *http.Request values,
not contexts. They have very low cohesion with the rest of the package.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-10-27 10:58:37 -04:00
Cory Snider
d0f5aa670b Move context package internal
Our context package predates the establishment of current best practices
regarding context usage and it shows. It encourages bad practices such
as using contexts to propagate non-request-scoped values like the
application version and using string-typed keys for context values. Move
the package internal to remove it from the API surface of
distribution/v3@v3.0.0 so we are free to iterate on it without being
constrained by compatibility.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-10-27 10:58:37 -04:00
James Hewitt
ef8651ec2a
Switch to github.com/google/uuid
Signed-off-by: James Hewitt <james.hewitt@uk.ibm.com>
2023-10-25 12:15:21 +01:00
Cory Snider
8a86dc61ff Make our UUID package internal
Nowadays there are much, much better UUID implementations to choose
from, such as github.com/google/uuid. Prevent external users from
importing our bespoke implementation so that we can change or migrate
away from it internally without introducing breaking changes.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-10-24 18:11:41 -04:00
Cory Snider
cc23fdacff Move registry client internal
Our registry client is not currently in a good place to be used as the
reference OCI Distribution client implementation. But the registry proxy
currently depends on it. Make the registry client internal to the
distribution application to remove it from the API surface area (and any
implied compatibility promises) of distribution/v3@v3.0.0 without
breaking the proxy.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-10-24 12:26:38 -04:00