-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proxy: Add GetConfig
, add manifest list support, add an integration test
#1495
Conversation
Blah. Annoying when Windows/MacOS come to rain on my Linux happy place. |
) | ||
|
||
// This image is known to be x86_64 only right now | ||
const knownNotManifestListedImage_x8664 = "docker://quay.io/coreos/11bot" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure there's a better image for this, maybe something in quay.io/libpod
?
Thanks, @cgwalters! I will have a look at this PR tomorrow morning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a minor nit. Could you sign (git commit -s
) your commits? I am not sure why the CI isn't barking on that but our contributing guidelines require that.
d4c90db
to
e02e864
Compare
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of these I think 982aa51 could use specific review. I find the c/image APIs here a bit confusing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good overall.
Do note the DiffID comment.
Looks fine to me. |
e02e864
to
4870c1e
Compare
While the caller could fetch this today as a blob, it'd be in either docker or oci schema. In keeping with the model of having this proxy only expose OCI, add an API which uses the c/image logic to do the conversion. This is necessary for callers to get the diffIDs, and in general to implement something like an external `skopeo copy`. Signed-off-by: Colin Walters <walters@verbum.org>
Since this is shared between the manifest and config paths. Signed-off-by: Colin Walters <walters@verbum.org>
Just noticed while scrolling past the code. Signed-off-by: Colin Walters <walters@verbum.org>
I debated adding "reverse dependency testing" using https://crates.io/crates/containers-image-proxy but I think it's easier to reuse the test infrastructure here. This also starts fleshing out a Go client for the proxy (not that this is going to be something most Go projects would want versus vendoring c/image...but hey, maybe it'll be useful). Now what I hit in trying to use the main test images is currently the proxy fails on manifest lists, so I'll need to fix that. Signed-off-by: Colin Walters <walters@verbum.org>
We need to support manifest lists. I'm not sure how I missed this originally. At least now we have integration tests that cover this. The issue here is fairly subtle - the way c/image works right now, `image.FromUnparsedImage` does pick a matching image from a list by default. But it also overrides `GetManifest()` to return the original manifest list, which defeats our goal here. Handle this by adding explicit manifest list support code. We'll want this anyways for future support for `GetRawManifest` or so which exposes OCI manifest lists to the client. Signed-off-by: Colin Walters <walters@verbum.org>
To verify in one place. Signed-off-by: Colin Walters <walters@verbum.org>
Prep for testing `GetConfig`. Signed-off-by: Colin Walters <walters@verbum.org>
Now that we have a test suite, let's use it more. Signed-off-by: Colin Walters <walters@verbum.org>
To fix compilation on MacOS. I think actually we want to use this pervasively in our tests on Linux; it doesn't really matter when run inside a transient container, but `PDEATHSIG` is useful for persistent containers (e.g.) toolbox and when running outside of a pid namespace, e.g. on a host system shell directly or in systemd. Signed-off-by: Colin Walters <walters@verbum.org>
By Go convention. Signed-off-by: Colin Walters <walters@verbum.org>
4870c1e
to
05a2ed4
Compare
CI failure looks unrelated, is there a way to retrigger or should I just repush? |
I retriggered, let's see what's going on. |
And one more time |
proxy: Add an API to fetch the config upconverted to OCI
While the caller could fetch this today as a blob, it'd be in
either docker or oci schema. In keeping with the model of having
this proxy only expose OCI, add an API which uses the c/image logic
to do the conversion.
This is necessary for callers to get the diffIDs, and in general
to implement something like an external
skopeo copy
.proxy: Add a helper to return a byte array
Since this is shared between the manifest and config paths.
proxy: Use float → int helper for pipeid
Just noticed while scrolling past the code.
tests/integration/proxy_test: New test that exercises
proxy.go
I debated adding "reverse dependency testing" using
https://crates.io/crates/containers-image-proxy
but I think it's easier to reuse the test infrastructure here.
This also starts fleshing out a Go client for the proxy (not
that this is going to be something most Go projects would want
versus vendoring c/image...but hey, maybe it'll be useful).
Now what I hit in trying to use the main test images is currently
the proxy fails on manifest lists, so I'll need to fix that.
proxy: Add support for manifest lists
We need to support manifest lists. I'm not sure how I missed this
originally. At least now we have integration tests that cover this.
The issue here is fairly subtle - the way c/image works right now,
image.FromUnparsedImage
does pick a matching image from a listby default. But it also overrides
GetManifest()
to return theoriginal manifest list, which defeats our goal here.
Handle this by adding explicit manifest list support code. We'll
want this anyways for future support for
GetRawManifest
or sowhich exposes OCI manifest lists to the client.
proxy_test: Add a helper method to call without fd
To verify in one place.
proxy_test: Add helper to read all from a reply
Prep for testing
GetConfig
.proxy_test: Test
GetConfig
Now that we have a test suite, let's use it more.