skycfg icon indicating copy to clipboard operation
skycfg copied to clipboard

Integrate groupVersion info into `proto.package`.

Open dilyevsky opened this issue 6 years ago • 2 comments

So I tried to write more involved Kubernetes definitions using similar code in https://github.com/stripe/skycfg/blob/f62bbbf9f13ee5cb51d433902a5816e7694fe367/_examples/k8s/main.go#L120-L132 and it appears to be failing spectacularly for apiGroups like rbac.authorization.k8s.io and so on because authorization.k8s.io part is not actually encoded anywhere in generated proto packages.

I'm thinking to pass this via proto.package (perhaps, proto.k8s_package) import definitions instead via additional argument and store groupVersion info inside skyProtoMessage.

Opening as issue first to discuss since this implies an api change.

dilyevsky avatar Nov 27 '18 01:11 dilyevsky

I don't think we want to add Kubernetes API group directly into the protobuf handling, but it might be worth adding a skycfg/kubernetes package to hold all this k8s-specific magic. Given how irregular the Kubernetes API group names are, it might require a hardcoded lookup table to fully implement gvkFromMsgType().

jmillikin-stripe avatar Nov 27 '18 20:11 jmillikin-stripe

I don't think we want to add Kubernetes API group directly into the protobuf handling, but it might be worth adding a skycfg/kubernetes package to hold all this k8s-specific magic

👍 I'll sketch out some interfaces and send a wip pr.

Given how irregular the Kubernetes API group names are, it might require a hardcoded lookup table...

This is basically what I'm trying to avoid by having the user do all the hardcoding =)

dilyevsky avatar Nov 27 '18 21:11 dilyevsky