-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
So I tried to write more involved Kubernetes definitions using similar code in
Lines 120 to 132 in f62bbbf
func gvkFromMsgType(m proto.Message) (group, version, kind string, err error) { | |
t := gogo_proto.MessageName(m) | |
if !strings.HasPrefix(t, k8sAPIPrefix) { | |
err = errors.New("unexpected message type: " + t) | |
return | |
} | |
ss := strings.Split(t[len(k8sAPIPrefix):], ".") | |
if ss[0] == "core" { // Is there a better way? | |
ss[0] = "" | |
} | |
group, version, kind = ss[0], ss[1], ss[2] | |
return | |
} |
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.
Metadata
Metadata
Assignees
Labels
No labels