Update engine api with required arguments#21657
Conversation
There was a problem hiding this comment.
This message is there since at least 1.8, so I think it could be removed. If yes, then the tag variable is no more needed and the Tag attribute in ImageImportOptions neither.
|
Looks like CI is failing: |
0f4441d to
27a8c82
Compare
There was a problem hiding this comment.
oh you are right, something is missing in the ImagePush in remote API (the same check done in ImageTag in fact)
There was a problem hiding this comment.
Looks like it was resolved https://github.com/docker/engine-api/pull/162/files#diff-af7c2f642033c3058dc4c26810d875a4R27
|
I like the direction this is going. My main question is about references being passed as strings into engine-api functions. Would it be better to use the actual I think there are advantages to passing in actual references to the API functions. It prevents you from making mistakes like passing in a tag where you're really supposed to pass a fully-qualified reference. Are there reasons not to expose these types at the API level? Or do we plan to do that, with this PR as an intermediate step on the way there? @stevvooe WDYT? |
|
@aaronlehmann I'm not sure that the
I agree 100% with the sentiment here but we may want to consider this PR to be an intermediate step. Ideally, these all become completely server-side, avoiding the need to parse and validate them client-side. |
I agree with @stevvooe, "Ideally, these all become completely server-side, avoiding the need to parse and validate them client-side.". It make it simpler for a user of the And yes, I see this PR as a first step on moving towards having the reference parsing handling server-side (but it's a little more work and it would make the PR bigger). |
46ae5f2 to
2db3c07
Compare
|
Updated the code (here and in the engine-api PR) and fixed the build 😸 |
04c3702 to
bc1658c
Compare
|
@vdemeester the change in engine-api was merged this morning. Feel free to update this PR. Moving to code review. |
bc1658c to
3cfbda8
Compare
|
Updated. Win2Lin is green : Userns is not 😓 |
|
LGTM |
There was a problem hiding this comment.
Do we not have a way to assemble canonical references? https://godoc.org/github.com/docker/distribution/reference#WithDigest
May have to use the docker/docker/reference version.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Using new methods from engine-api, that make it clearer which element is required when consuming the API. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
3cfbda8 to
b9c94b7
Compare
|
@stevvooe updated (using |
|
LGTM |
This PR is related to docker/engine-ap#162 and is it's inclusion in
docker/docker. It's still a little bit a work in progress but I wanted to have both PR opened at the same time to make sure it's ok for everybody and to measure the impact of the change on the code here 👼.The docker-archive-public/docker.engine-api#162 (docker-archive-public/docker.engine-api#137 for the related issue) changes some
clientsignature to add the required arguments in the signature (to make it easier to use by telling the consumer what is required and what is not) 🐯.It also tries to remove the
image/tagdistinction from the client side for now, and replace it with thereferenceinstead.This has some impact on the content trust code (
api/client/trust.go).This is also a very small step to remove the
referencepackage (or at least reduce the usage) from this repository (and usedocker/distribution/referencein the future, once distribution/distribution#1277 is merged) 🐳./cc @calavera @stevvooe @MHBauer @dmcgowan @aaronlehmann @tonistiigi @LK4D4
It's a little bit a chicken-and-egg problem, as depending on the review here, the code in the API will have to be updated. Anyway, we have to wait for docker-archive-public/docker.engine-api#162 to get merged first but we will merge it once it's green, reviewed and OK here 👼 .
Let's hope it's green first 😅.
🐸