-
Notifications
You must be signed in to change notification settings - Fork 80
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
containerd client needs a to_any() helper #362
Comments
I dug Type URLs are generated by combining domain name and type's full name. We don't configure the domain part in rust extensions (but we can), so it's empty and hence all type urls start with {domain_name}/{full_name} In case of Go implementation, by default, Protobuf's well known types all start with Adding domain prefix to containerd API types doesn't sound like a terrible idea to me and feels like the "right" way. So we could get Though, given that containerd 2.0 is out, I'm not sure of compatibility consequences. So I don't mind adding a small helper on client's side as an easy path forward. |
This makes sense to me to, but apparently we didn't in the early days of containerd, and I don't have any info on why/how those choices were made or if something was different given we were using that now deprecated gogo impl? Have no idea if that even matters to this discussion.. anyway. Regardless, it does look like I think anything more invasive about full type URLs would need yet-another major version boundary, unless we add some interim code for allowing either? @dmcgowan thoughts? |
Would it be possible in |
In trying to use the transfer service in containerd, which uses opaque any->any interfaces for source and destination, I found that using the Rust containerd client failed as the types weren't recognized.
After some digging it appears that the
containerd/typeurl
package generates its notion of the "type_url" of a protobuf from theFullName
entry. In Rust,prost
generates both the fullname fn and the typeurl fn, but the typeurl starts with a '/
' character, I think to meet the requirement that type Urls are supposed to contain at least one forward slash according to Google's protobuf documentation.Given the use of
FullName
in Go incontainerd/typeurl
(ref the code here), I think a helper in the containerd client would make sense.I came up with this code and tested it, and it works, but wanted feedback before I open a PR in case there is a better way to solve this. Using this helper, I can use the transfer service successfully when passing these Any types to the gRPC call via the transfer API.
Ref: #282 (hopefully when complete, I can provide a nice example of using the transfer service to pull an image via a Rust client)
The text was updated successfully, but these errors were encountered: