Return warnings from service create/update when digest pinning fails#28421
Return warnings from service create/update when digest pinning fails#28421aaronlehmann merged 1 commit intomoby:masterfrom
Conversation
|
@aaronlehmann can you please update swagger and use it to generate types ? /cc @dnephin |
|
@vieux: Can you please point me to some information on how to do that? |
api/types/client.go
Outdated
There was a problem hiding this comment.
It seems like the only use case for the Warning right now is a failure to pin by digest. Should we make it a general string field then, as opposed to maybe a boolean or something else?
There was a problem hiding this comment.
Not in favor of a boolean because it's important to communicate the actual error message. I think a general string field is necessary. However, we could add a boolean in addition to indicate whether pinning by digest happened if people think it's a good idea.
There was a problem hiding this comment.
I don't think another field is necessary in addition to a string Warning field, particularly because we're not taking any specific action if the pinning by digest fails.
|
ping @dnephin can you help with the Swagger changes? |
|
|
@dnephin: Can you confirm that it's correct to generate |
acbdad9 to
ccfa9bc
Compare
|
Yes, that's correct. We're slowly migrating everything to the swagger generation in #27919. It would be good to any any new things using the new pattern. |
|
@dnephin: I've made some progress but am stuck on a few things. Currently I'm getting this output:
|
ccfa9bc to
f0d2912
Compare
|
I think I figured it out. PTAL |
f0d2912 to
252994e
Compare
|
Just occurred to me - should |
|
@aaronlehmann should this be considered for 1.13? |
|
Yes please. |
252994e to
a77a3a4
Compare
|
Updated to return an array of warnings. This matches other API endpoints like PTAL |
There was a problem hiding this comment.
don't forget to add a bullet to the API changes; https://github.com/docker/docker/blob/master/docs/reference/api/docker_remote_api.md#v125-api-changes
There was a problem hiding this comment.
Also; should this change be versioned (and only return warnings on API >= 1.25
There was a problem hiding this comment.
re versioning: I'm not sure what our normal policy is on this kind of change, but it seems like a lot of extra complexity to do this unless we have a good reason. I expect that older clients would just ignore this field.
There was a problem hiding this comment.
Hm, you may be right here; we document that additional fields may be returned by the API, so clients should ignore them.
a77a3a4 to
b63d861
Compare
b63d861 to
5e6adf6
Compare
|
Updatd PTAL |
|
(docs LGTM) |
|
@aaronlehmann needs a rebase 😓 |
…nning fails Modify the service update and create APIs to return optional warning messages as part of the response. Populate these messages with an informative reason when digest resolution fails. This is a small API change, but significantly improves the UX. The user can now get immediate feedback when they've specified a nonexistent image or unreachable registry. Signed-off-by: Aaron Lehmann <[email protected]>
5e6adf6 to
948e606
Compare
|
Rebased |
Modify the service update and create APIs to return optional warning
messages as part of the response. Populate these messages with an
informative reason when digest resolution fails.
This is a small API change, but significantly improves the UX. The user
can now get immediate feedback when they've specified a nonexistent
image or unreachable registry.
cc @nishanttotla @dnephin