mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
make DefaultRESTMapper use GroupVersion
This commit is contained in:
@@ -30,6 +30,7 @@ type GroupVersionKind struct {
|
||||
Kind string
|
||||
}
|
||||
|
||||
// TODO remove this
|
||||
func NewGroupVersionKind(gv GroupVersion, kind string) GroupVersionKind {
|
||||
return GroupVersionKind{Group: gv.Group, Version: gv.Version, Kind: kind}
|
||||
}
|
||||
@@ -84,6 +85,10 @@ func ParseGroupVersionOrDie(gv string) GroupVersion {
|
||||
return ret
|
||||
}
|
||||
|
||||
func (gv GroupVersion) WithKind(kind string) GroupVersionKind {
|
||||
return GroupVersionKind{Group: gv.Group, Version: gv.Version, Kind: kind}
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaller interface.
|
||||
func (gv GroupVersion) MarshalJSON() ([]byte, error) {
|
||||
s := gv.String()
|
||||
|
||||
Reference in New Issue
Block a user