Remove runtime.Typer, reduce to ObjectKinds(1) (3)
Remove the unnecessary variants, which avoids allocations in several core paths.
This commit is contained in:
@@ -57,11 +57,11 @@ func GetReference(obj runtime.Object) (*ObjectReference, error) {
|
||||
kind := gvk.Kind
|
||||
if len(kind) == 0 {
|
||||
// TODO: this is wrong
|
||||
gvk, err := Scheme.ObjectKind(obj)
|
||||
gvks, _, err := Scheme.ObjectKinds(obj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
kind = gvk.Kind
|
||||
kind = gvks[0].Kind
|
||||
}
|
||||
|
||||
// if the object referenced is actually persisted, we can also get version from meta
|
||||
|
Reference in New Issue
Block a user