-
Story
-
Resolution: Done
-
Normal
-
None
We have Group, Version and Resource in different types. We should use GroupVersionResource instead.
An example is the code below that can be found in our repository:
type ApplicationSelector struct {
MatchLabels map[string]string `json:"matchLabels"`
Group string `json:"group,omitempty"`
Version string `json:"version"`
Resource string `json:"resource"`
ResourceRef string `json:"resourceRef"`
}
An implementation could be having a field that's inlined only in the presentation layer by using the inline json modifier:
type ApplicationSelector struct {
GroupVersionResource metav1.GroupVersionResource `json:",inline"`
MatchLabels map[string]string `json:"matchLabels"`
ResourceRef string `json:"resourceRef"`
}
Another option I believe would be embed GroupVersionResource in ApplicationSelector, so the call sites are preserved.