camallo / dkregistry-rs

A pure-Rust asynchronous library for Docker Registry API v2
Apache License 2.0
62 stars 39 forks source link

v2/manifest: add a function to fetch content-digest for a tag #148

Closed vrutkovs closed 4 years ago

vrutkovs commented 4 years ago

This is a lightweight alternative for get_manifest_and_ref, which doesn't fetch the whole manifest. It can be used to ensure tag didn't change content-digest.

This is a precondition to cache manifests in Cincinnati if the tag didn't change content digest.

Ref: https://issues.redhat.com/browse/OTA-167

lucab commented 4 years ago

Code looks good! CI for the PR is green, but for some reason the notification had an hiccup.

Can you please add some integration tests at https://github.com/camallo/dkregistry-rs/tree/master/tests/net? If this works with an anonymous client, we can cover all of quay + dockerhub + GCR. If it requires an authenticated user, the test-net-private feature is wired in Travis so that it can login to quay.io.

vrutkovs commented 4 years ago

Hmm, this got a bit complicated.

I didn't add tests to unauth registries as we can't hardcode sha256 for the repos we don't control. Should I pick coreos/alpine-sh and hope it won't change?

In quay tests I don't have access to quay.io/steveej/cincinnati-test:0.0.1 and it appears Travis won't run these tests in my fork, so I can't fish it out of the output :)

lucab commented 4 years ago

@vrutkovs I'm fine with just going for a test on the private image we control, I've left the ref in a comment.

(I've no idea what's up with GitHub, I see the incoming webhook from Travis but the status is never updated)

lucab commented 4 years ago

@vrutkovs I had to uninstall and redo the whole Travis setup, but now it seems to work. Tests are failing, Travis output has the expected values.

vrutkovs commented 4 years ago

Done, had to remove a part of the test which verifies the error message - but I don't think its really necessary