Commit Graph

2855 Commits

Author SHA1 Message Date
Wayne Warren
a10b3a9ab4 s3: don't use s3.ListObjectsV2Output.KeyCount 2020-10-20 16:51:33 -05:00
wayne
6255476b3b
Merge pull request #11 from waynr/fix-azure-autorest-dependencies
vendor: Update github.com/Azure/go-autorest
2020-09-03 12:41:29 -05:00
Wayne Warren
37be5b31d2 vendor: Update github.com/Azure/go-autorest 2020-09-03 16:27:22 +00:00
wayne
0e6ff0e95e
Merge pull request #1 from waynr/add-vacuum-removelayerlink-func
Add Vacuum.RemoveLayerLink function
2020-09-03 09:05:16 -05:00
Wayne Warren
28166f7383 simplify RemoveLayerLink function 2020-09-02 21:54:36 +00:00
Wayne Warren
ec64b15a77 fix signature on RemoveLayerLink 2020-09-02 21:53:48 +00:00
Wayne Warren
5fcc8f55e2 need schema2 import 2020-09-02 21:53:48 +00:00
Wayne Warren
3b7741805d Remove layer links along with manifest 2020-09-02 21:53:48 +00:00
Wayne Warren
4366eee39a add Vacuum.RemoveLayerLink function 2020-09-02 21:53:48 +00:00
Adam Wolfe Gordon
1e1c67e13f
Merge pull request #10 from digitalocean/awg/resume-commit-race
Return a sensible error in races between blob upload completions
2020-08-24 14:59:01 -06:00
Adam Wolfe Gordon
611f55e79a Return a sensible error in races between blob upload completions
Completing a blob upload is a multi-step process, especially on a storage
backend like S3 which lacks a "move" primitive. If a client times out (or
disconnects) during a commit, then retries immediately, we'll end up invoking
the "resume" logic for the blob upload while the completion from the previous
request is still in progress. The resume tries to find the upload's data, but
the commit has already moved it to its new location, resulting in a PathNotFound
error from the storage driver.

Previously, this error was passed back to the HTTP handler and translated into a
500 Internal Server Error. Return ErrBlobUploadUnknown instead, so that the HTTP
handler will return a 404.
2020-08-24 13:49:09 -06:00
Adam Wolfe Gordon
d9adf97319
Merge pull request #9 from digitalocean/awg/fix-unlinked-blobs
Revert "OCI: GET request to deleted blob URL should yield 404 response"
2020-08-17 11:02:58 -06:00
Adam Wolfe Gordon
37ab304645 Revert "OCI: GET request to deleted blob URL should yield 404 response"
Using the linked blob store for blob requests fixes a conformance issue and
works correctly for newly-pushed images. However, any images that were pushed
before the change could be missing layer links (since previously it was possible
to fetch a blob without the layer link existing) and it's not possible to pull
these iamges after the change.

Revert the change to use the linked blob store, for now, until we can figure out
how to fix this without breaking existing repositories.

This reverts commit 71f1c25220.
2020-08-17 10:37:50 -06:00
wayne
3796bf3c1a
Merge pull request #8 from digitalocean/wwarren/s3-storage-driver_log-s3-api-requests
s3: log s3 api requests
2020-08-13 19:48:06 -05:00
Wayne Warren
f3d61f1000 s3: log S3 api requests
Adds "Completed" handler for S3 requests that logs critical HTTP request/response fields necessary to understand problems between registry and underlying S3 api.

Signed-off-by: Wayne Warren <wayne.warren.s@gmail.com>
2020-08-14 00:45:57 +00:00
wayne
04e669847f
Merge pull request #7 from digitalocean/wwarren/merge-upstream-master
merge upstream/master branch into digitalocean/master
2020-08-07 10:23:15 -05:00
Wayne Warren
3ebc5127c2 restore upstream merge change that broke log tests 2020-07-31 23:17:45 +00:00
Wayne Warren
a4ac140fd3 Merge remote-tracking branch 'docker/master' into wwarren/merge-upstream-master 2020-07-31 22:47:21 +00:00
wayne
a68e2a8111
Merge pull request #6 from digitalocean/wwarren/oci-compliance-post-request-wtih-digest-and-blob-should-yield-201
OCI: POST request with digest and blob should yield 201
2020-07-31 17:38:00 -05:00
Wayne Warren
2ff5f5bf80 OCI: POST request with digest and blob should yield 201 2020-07-31 22:37:31 +00:00
wayne
f747a0f2f7
Merge pull request #5 from digitalocean/wwarren/oci-compliance-get-request-to-deleted-blob-url
OCI: GET request to deleted blob URL should yield 404 response
2020-07-31 17:35:57 -05:00
Manish Tomar
1d0ea8ed7b
Merge pull request #3140 from linux-on-ibm-z/travis-s390x
Add s390x support for travis
2020-07-30 16:15:55 -07:00
Wayne Warren
71f1c25220 OCI: GET request to deleted blob URL should yield 404 response 2020-07-29 22:36:40 +00:00
Derek McGowan
208d68bd5c
Merge pull request #3209 from zhipengzuo/master
clean up code because err is always nil
2020-07-22 09:18:06 -07:00
zhipengzuo
f361d443b7 clean up code because err is always nil
Signed-off-by: zhipengzuo <zuozhipeng@baidu.com>
2020-07-22 10:54:46 +08:00
Derek McGowan
53e18a9d9b
Merge pull request #3196 from thaJeztah/add_redirect
docs: add redirect for old URL
2020-07-08 16:08:24 -07:00
Sebastiaan van Stijn
7728c5e445
docs: add redirect for old URL
Looks like there's some projects refering to this old URL:
https://grep.app/search?q=https%3A//docs.docker.com/reference/api/registry_api/

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-08 12:18:31 +02:00
Sebastiaan van Stijn
62d0fd45e7
Merge pull request #3187 from bloodorangeio/fix-ci
Fix CI failures, upgrade to Go 1.14+
2020-06-29 19:14:34 +02:00
jdolitsky
81ba770eff Fix CI failures, upgrade to Go 1.14+
- Modify Travis manifest to use Go 1.14.x
- Hardcode version of golangci-lint in setup script
- Hardcode version of go-md2man in setup script

Signed-off-by: jdolitsky <393494+jdolitsky@users.noreply.github.com>
2020-06-26 10:59:50 -05:00
Adam Wolfe Gordon
f8c65fc7c5
Merge pull request #3 from digitalocean/awg/catalog-no-layers
catalog: List repositories with no unique layers
2020-06-02 16:46:22 -06:00
Adam Wolfe Gordon
7796e5f437
Merge pull request #4 from digitalocean/awg/manifest-delete-by-tag
manifests: Return UNSUPPORTED when deleting manifests by tag
2020-06-02 16:46:11 -06:00
Adam Wolfe Gordon
2a047e994a manifests: Return UNSUPPORTED when deleting manifests by tag
The OCI distribution spec allows implementations to support deleting manifests
by tag, but also permits returning the `UNSUPPORTED` error code for such
requests. docker/distribution has never supported deleting manifests by tag, but
previously returned `DIGEST_INVALID`.

The `Tag` and `Digest` fields of the `manifestHandler` are already correctly
populated based on which kind of reference was given in the request URL. Return
`UNSUPPORTED` if the `Tag` field is populated.

Signed-off-by: Adam Wolfe Gordon <awg@digitalocean.com>
2020-06-02 15:30:59 -06:00
Adam Wolfe Gordon
5bda069243 catalog: List repositories with no unique layers
A repository need not contain any unique layers, if its images use only layers
mounted from other repositories. But, the catalog endpoint was looking for the
_layers directory to indicate that a directory was a repository.

Use the _manifests directory as the marker instead, since any repository with
revisions will contain a _manifests directory.
2020-05-28 13:42:43 -06:00
srajmane
a2ed1b5e80 Added dist: bionic, updated go version to 1.14.x and set GO111MODULE=on
Signed-off-by: Snehal Rajmane <srajmane@us.ibm.com>
2020-04-29 03:25:24 -07:00
srajmane
55f88c35b9 Adding s390x support.
Signed-off-by: Snehal Rajmane <srajmane@us.ibm.com>
2020-04-07 07:59:19 -07:00
Adam Wolfe Gordon
2518abfebe
Merge pull request #2 from digitalocean/awg/consistent-log-fields
log: Include configured fields in all logs
2020-04-01 11:29:20 -06:00
Adam Wolfe Gordon
5e7dac8f47 log: Include configured fields in all logs
It's possible to configure log fields in the configuration file, and we would
like these fields to be included in all logs. Previously these fields were
included only in logs produced using the main routine's context, meaning that
any logs from a request handler were missing the fields since those use a
context based on the HTTP request's context.

Add a configurable default logger to the `context` package, and set it when
configuring logging at startup time.

Signed-off-by: Adam Wolfe Gordon <awg@digitalocean.com>
2020-03-31 16:29:02 -06:00
Derek McGowan
742aab907b
Merge pull request #3127 from dmage/err-shadow
Fix err shadowing in gcs driver
2020-03-19 10:36:57 -07:00
Derek McGowan
17a394f9af
Merge pull request #3128 from dmcgowan/gosimple-fix
Fix gosimple checks
2020-03-18 16:06:17 -07:00
Derek McGowan
78c2ab6646
Fix gosimple checks
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2020-03-18 15:52:34 -07:00
Oleg Bulatov
cdb4ba947a
Fix err shadowing in gcs driver
Signed-off-by: Oleg Bulatov <oleg@bulatov.me>
2020-03-18 11:41:34 +01:00
Derek McGowan
303f1899bb
Merge pull request #3121 from wy65701436/upgrade-oci-library
Update oci library
2020-03-10 14:58:43 -07:00
wang yan
bf56f348be Update oci library
1, update go-digest to v1.0.0-rc1
2, update image-spec to v1.0.1

Signed-off-by: wang yan <wangyan@vmware.com>
2020-03-10 23:19:29 +08:00
Derek McGowan
581be91482
Merge pull request #3113 from dmcgowan/upstream-redis-fixes
Redis cache fixes and metrics
2020-03-09 13:36:53 -07:00
Derek McGowan
be29c05a1e
Remove deprecated cache metrics code
The metrics tracker in cached blob statter was replaced with prometheus
metrics and no longer needed.
Remove unused log wrapping.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2020-03-09 13:11:54 -07:00
Derek McGowan
495a4af7cf
Fix goimports
Separate fix for cherry-picked code

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2020-03-04 17:51:37 -08:00
Grant Watters
74d442a058
Consider redis.ErrNil as distribution.ErrBlobUnknown for Stat HGET
* Update redis.go

If the dgst key does not exist in the cache when calling HGET, `redis.String` will return an `ErrNil` which we need to translate into `distribution.ErrBlobUnknown` so that the error being returned can be properly handled. This will ensure that `SetDescriptor` is properly called from `cachedBlobStatter::Stat` for `repositoryScopedRedisBlobDescriptorService` which will update the redis cache and be considered as a Miss rather than an Error.

cc @manishtomar

* Update suite.go

Add unit test to ensure missing blobs for scoped repo properly return ErrBlobUnknown when HGET returns redis.ErrNil.

(cherry picked from commit dca6b9526a1d30dd218a9f321c4f84ecc4b5e62e)
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2020-03-04 17:51:37 -08:00
Manish Tomar
795892662b
redis metrics
* redis metrics

it is working but metrics are not very useful since default buckets
start from 5ms and almost all of them are in that range.

* remove extra comment

(cherry picked from commit ba1a1d74e7eb047dd1056548ccf0695e8846782c)
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2020-03-04 17:51:37 -08:00
Manish Tomar
ce101280fe
fix redis caching issue
* fix redis caching issue

earlier redis cache was updated when there was any error including any
temporary connectivity issue. This would trigger set calls which would
further increase load and possibly connectivity errors from redis
leaving the system with continuous errors and high latency. Now the
cache is updated only when it is genuine cache miss. Other errors do not
trigger a cache update.

* add back tracker Hit() and Miss() calls

*squashed commits*
(cherry picked from commit 6f3e1c10260ef59ba4e9c42e939329fad9fdd8c3)
(cherry picked from commit 6738ff3320cf82cc2df919a95a1bde2f7789a501)

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2020-03-04 17:51:37 -08:00
Derek McGowan
4c7c63b557
Add cache unit test
Test base functionality of the cache statter

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2020-03-04 17:51:37 -08:00