Check upstream GCS driver implementation and integrate any worthy improvements
Since our codebases diverged, distribution/distribution made some progress/improvements. It would be great if we could review these changes and see if any of them is worthy of backporting to our codebase. For example:
> note: it seems there is some change in the GCS API and the `distribution/distribution` already caught up (example [them](https://github.com/distribution/distribution/blob/7271d882c06246d7f91802b95f5708035aa83908/registry/storage/driver/gcs/gcs.go#L308-L327) vs [us](https://gitlab.com/gitlab-org/container-registry/-/blob/8476efe55a4f9bae3c60431cf151a069697088d3/registry/storage/driver/gcs/gcs.go#L357-378)). I did the absolute minimum to keep the tests pass, adjusting checks in other places requires deeper investigation.
Candidates:
-
https://github.com/distribution/distribution/pull/4586 - Enable MD5 check on GCS driver (we apparently do some of this already, doublecheck if we need it in other places too). -
https://github.com/distribution/distribution/pull/4203 - addition of user-agent config option -
https://github.com/distribution/distribution/pull/4120 - make writer use context for Commit(), Close(), and Write() operations. Use http.NewRequestWithContextinstead ofhttp.NewRequest. Be carefull aboutretry-wrapped calls, as they do not recognize cancelled contexts. -
https://github.com/distribution/distribution/pull/4120 - instead of sorting the list, iterate in the reverse order -
rewrite DeleteFilesto errGroup - not a real backport, but seems like a nice cleanup -
rewrite googleapi.Error to ErrorAs()
Edited by Pawel Rozlach