1
0
mirror of https://github.com/openshift/image-registry.git synced 2026-02-05 09:45:55 +01:00

432 Commits

Author SHA1 Message Date
Ricardo Maraschini
c2ca6fff66 chore: fix misguiding error message
the env variable name was wrong and we were showing the full env
variable and not the cipher where the validation fails.

this also replaces string.Split with strings.SplitSeq.
2026-01-15 17:51:29 +01:00
Ricardo Maraschini
94dae5f64f chore: address vet after bumping library-go
when we bump library-go the function diff.ObjectGoPrintDiff vanished. we
need to replace it with diff.ObjectGoPrintSideBySide on all test files.
2026-01-15 17:51:29 +01:00
Ricardo Maraschini
94bbf2c668 IR-350: fix cipher suite configuration conflict with docker distribution
docker distribution expects REGISTRY_HTTP_TLS_CIPHERSUITES as a json
array (e.g., '["a", "b"]'), while openshift image registry expects
comma-separated values (e.g., 'a,b'). setting this variable in the
openshift format causes the registry to crash during config parsing.

this change replaces REGISTRY_HTTP_TLS_CIPHERSUITES with
OPENSHIFT_REGISTRY_HTTP_TLS_CIPHERSUITES to use the comma-separated
format. Since the registry cannot start with the old variable set
incorrectly, there is no backward compatibility concern.
2026-01-14 18:21:33 +01:00
Flavian Missi
2026b6d81c metrics: document error codes 2024-10-21 15:10:02 +02:00
Flavian Missi
c14ef8b7f5 metrics: report filesystem errors
to help customers detect and solve errors, we specifically report
metrics on a few filesystem specific errors.

we have seen customers configure the registry with a read-only
filesystem without noticing until it's too late. more specifically, when
using the registry only as a pull-through cache, a read-only filesystem
will be imperceptible to clients unless the upstream registry
experiences an outage, then it'll be too late to fix the cache.

the file too large (EFBIG) and device out of space (ENOSPC) errors were
added just in case. there have not been (so far) reports of customers
silently running into this errors on their PVCs.
2024-09-26 17:15:48 +02:00
Flavian Missi
8317f5e28b metrics: turn error codes into constants 2024-09-24 11:49:30 +02:00
Flavian Missi
4fd4de64c6 pkg/dockerregistry/server/client: removed unused user interface
now that we rely on the SelfSubjectReview api to get user info, we no
longer need the openshfit specific user client.
2024-06-14 14:47:21 +02:00
Flavian Missi
018bd4544a pkg/dockerregistry/server: use SelfAccessReview api instead of users
the users api is specific to openshift, and is not available on every
openshift cluster, i.e when OIDC is configured with external users.
2024-06-14 14:43:41 +02:00
Flavian Missi
9a0f90d952 pkg/dockerregistry/server: gofumpt auth test file 2024-06-14 14:42:57 +02:00
Krzysztof Ostrowski
64b7965e70 p/d/server: try SAR for unauthenticated
With AUTH-509 the ability for the unauthenticated group to do
selfsubjectacessreviews (ssar) has been removed. In case that the ssar
fails, we attempt a subjectaccessreview for system:anonymous or the
system:unauthenticated group.
2024-06-04 16:22:20 +02:00
Krzysztof Ostrowski
9b3550d810 p/d/server: refactor verifyWithSAR 2024-06-04 16:10:24 +02:00
openshift-ci[bot]
855b24b7a2 Merge pull request #378 from flavianmissi/OCPBUGS-17674
IR-401: pkg/dockerregistry/server/configuration: remove OPENSHIFT_DEFAULT_REGISTRY support
2023-10-23 13:32:15 +00:00
Qi Wang
d68b0d7dfd Allow ICSP IDMS coexisting
Allow ICSP IDMS coexisting

Signed-off-by: Qi Wang <qiwan@redhat.com>
2023-10-16 21:04:28 -04:00
Flavian Missi
37f9e646f4 pkg/dockerregistry: increase rest Config QPS and Burst 2023-09-18 15:07:43 +02:00
Flavian Missi
6bd6aac4de pkg/dockerregistry/server/configuration: remove OPENSHIFT_DEFAULT_REGISTRY support
also remove support for DOCKER_REGISTRY_SERVICE_HOST and DOCKER_REGISTRY_SERVICE_PORT
env vars.
2023-09-04 17:14:25 +02:00
Flavian Missi
ecf85057be pkg/dockerregistry/server/configuration: format test file 2023-09-04 16:14:58 +02:00
Qi Wang
ec0ff6e562 [OCPNODE-1258] Migrate icsp to idms
Signed-off-by: Qi Wang <qiwan@redhat.com>
2023-08-21 15:22:25 -04:00
Stephen Benjamin
9c1c93e3b3 Revert "[OCPNODE-1258] Support both icsp and idms" 2023-07-24 15:47:29 -04:00
Qi Wang
45da6c3765 [OCPNODE-1258] Migrate icsp to idms
Signed-off-by: Qi Wang <qiwan@redhat.com>
2023-07-18 01:09:20 -04:00
Flavian Missi
51d044856c pkg/dockerregistry: stop using router in tests
distribution/distribution#3683 made the router global.
this broke all our pullthrough tests.
since TestBlobDescriptorServiceIsApplied was the only one using the
router it was easier to remove that from our code than to introduce the
router host call to every failing test.
2023-06-26 14:01:44 +02:00
Flavian Missi
bfd00a9570 use logrus-logstash default formatter
it uses time.RFC3339Nano by default
2023-06-26 14:01:44 +02:00
Flavian Missi
e836be907c pkg/cmd/dockerregistry: format file 2023-06-26 14:01:44 +02:00
Flavian Missi
c0c9012af1 pkg/dockerregistry/server: give ctx to filewriter Cancel method
also fix cache provider initialisation
2023-06-26 14:01:44 +02:00
Flavian Missi
f9d93c44be pkg,test: import distribution/distribution/v3
instead of the deprecated docker/distribution
2023-06-19 12:06:47 +02:00
Forrest Babcock
81fae2eb92 Revert "Merge pull request #370 from flavianmissi/bump-docker-distribution"
This reverts commit b095928ea9, reversing
changes made to 92c7270360.
2023-06-16 10:37:39 -04:00
Flavian Missi
e699cc2c81 pkg/dockerregistry: stop using router in tests
distribution/distribution#3683 made the router global.
this broke all our pullthrough tests.
since TestBlobDescriptorServiceIsApplied was the only one using the
router it was easier to remove that from our code than to introduce the
router host call to every failing test.
2023-06-13 12:03:24 +02:00
Flavian Missi
876b636540 use logrus-logstash default formatter
it uses time.RFC3339Nano by default
2023-06-13 12:03:24 +02:00
Flavian Missi
5a99a1cf2f pkg/cmd/dockerregistry: format file 2023-06-13 12:03:24 +02:00
Flavian Missi
80fc1891f5 pkg/dockerregistry/server: give ctx to filewriter Cancel method
also fix cache provider initialisation
2023-06-13 12:03:24 +02:00
Flavian Missi
342cc1a242 pkg,test: import distribution/distribution/v3
instead of the deprecated docker/distribution
2023-06-13 12:03:23 +02:00
Flavian Missi
d76813960c pkg/testutil: populate DockerImageManifests on CreateImage 2023-01-25 16:30:56 +01:00
Flavian Missi
d3643306b1 pkg/testutil: return sub-manifests of a manifest list in layers api fake 2023-01-25 16:30:56 +01:00
Flavian Missi
92cb1356bb pkg/dockerregistry/server: handle push by digest
to support manifest lists and oci image indexes, push by digest support
is required.

when a client pushes a manifest list, they will first push each
sub-manifest and its blobs, then finally push the manifest list.

a connection between an image and an image stream is represented via
image stream tags. an image which represents a sub-manifest of a
manifest list is however not directly connected to an image stream, and
it doesn't have an image stream tag.

because of this lack of image stream tag for images representing
sub-manifests of a manifest list, the registry needs to perform a
different action when faced with a push by digest. instead of creating
an image stream mapping between the image stream and the image, it will
simply create an image object for the sub-manifest.
2023-01-25 16:30:42 +01:00
Flavian Missi
275c011fbd pkg/dockerregistry/server/manifesthandler: add manifest list handler 2023-01-25 16:27:42 +01:00
Flavian Missi
49566f6c22 pkg/imagestream: improve readability of comments 2023-01-25 16:27:20 +01:00
Flavian Missi
3646b309a1 pkg/testutil/manifests: format file 2023-01-25 16:20:30 +01:00
Flavian Missi
ce0b4e544d pkg/dockerregistry/server/util: format file 2023-01-25 16:20:30 +01:00
Oleg Bulatov
5d5c5d2d54 Support pull-through for manifest lists
pkg/imagestream should use layers API when it needs to know about
sub-manifests.
2023-01-13 23:25:03 +01:00
OpenShift Merge Robot
ea10e9d1a5 Merge pull request #353 from flavianmissi/IR-264
IR-264: add basic tests for hard pruner
2022-11-25 02:57:23 -05:00
OpenShift Merge Robot
127349a1e5 Merge pull request #345 from dorzel/IR-268
IR-268: Support pull through with Manifest Lists
2022-11-22 10:43:40 -05:00
Flavian Missi
0a073f5212 IR-264: add basic tests for hard pruner 2022-11-22 15:32:07 +01:00
Flavian Missi
81c303d613 IR-299: use clock pkg from k8s.io/utils/clock 2022-10-17 14:40:39 +02:00
Flavian Missi
99471aafba IR-299: bump go to 1.19 and k8s to 1.25.2 2022-10-17 14:39:29 +02:00
Dylan Orzel
99b20f708c Add import to gain JSON unmarshalling for ManifestList schema types 2022-09-13 12:29:07 -06:00
OpenShift Merge Robot
c145cfb8ab Merge pull request #341 from dmage/oci-pruner
OCPBUGS-102: Keep OCI image configs when hard prune
2022-08-31 07:23:11 -04:00
Oleg Bulatov
d205a581b1 Fix security context for test pods 2022-08-23 16:55:20 +02:00
Oleg Bulatov
e527769089 Add support of OCI images to hard pruner 2022-08-18 14:51:31 +02:00
Oleg Bulatov
80e24e9dd1 Remove dead code 2022-08-18 14:33:11 +02:00
OpenShift Merge Robot
b70536befc Merge pull request #329 from flavianmissi/bz-1923536
Bug 1923536: forward http.StatusTooManyRequests to client
2022-05-13 12:04:13 +02:00
Ricardo Maraschini
5c8c0494c2 pullthrough: forward http.StatusTooManyRequests to client
makes the registry forward http.StatusTooManyRequests back
to the client during pullthrough operations.
2022-05-05 18:09:18 +02:00