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
Add From/ToProto helpers #8757
Add From/ToProto helpers #8757
Conversation
Helpers to convert from containerd's [Mount] to its protobuf structure for [Mount] and vice-versa appear three times. It seems sane to just expose this facility in /mount. Signed-off-by: Danny Canter <danny@dcantah.dev>
Helpers to convert from the OCI image specs [Descriptor] to its protobuf structure for Descriptor and vice-versa appear three times. It seems sane to just expose this facility in /oci. Signed-off-by: Danny Canter <danny@dcantah.dev>
Helpers to convert from snapshot types to their protobuf structures and vice-versa appear three times. It seems sane to just expose this facility in the snapshots pkg. From/ToKind weren't used anywhere but doesn't hurt to round out the types by exposing them. Signed-off-by: Danny Canter <danny@dcantah.dev>
5a948bc
to
f632b92
Compare
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.
LGTM (just left a typo and a nit), thanks!
Helpers to convert from a slice of platforms to our protobuf representation and vice-versa appear a couple times. It seems sane to just expose this facility in the platforms pkg. Signed-off-by: Danny Canter <danny@dcantah.dev>
f632b92
to
f3b7436
Compare
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.
LGTM
|
Oof: |
In many of the core packages we have local types, and then their corresponding over the wire structures used for folks interacting via GRPC. In all these cases we have duplicated code that handles the conversions from our internal types to the generated structures. Ideally these conversions could just live next to the definitions for the internal types, and that's what this change sets out to do. I split this into four commits to make it easier if some of these aren't wanted, but the commits contain helpers to do conversions for: