mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-09 19:09:30 +00:00
Add a lazy discovery interface for Unstructured
Delays the error until the first call and then preserves it for others. More closely matches the intent of the Object() calls. Loaders are now lazy and don't need to return errors directly. Sets the stage for collapsing unstructured and structured builders together. Kubernetes-commit: e298aa39c3de8ad1059861b7f78d62005ca87f88
This commit is contained in:
committed by
Kubernetes Publisher
parent
f14e54e4a9
commit
9fa87b55f6
@@ -84,7 +84,7 @@ func NewObjectTyper(resources []*metav1.APIResourceList) (runtime.ObjectTyper, e
|
||||
// information.
|
||||
func (ot *ObjectTyper) ObjectKinds(obj runtime.Object) ([]schema.GroupVersionKind, bool, error) {
|
||||
if _, ok := obj.(*unstructured.Unstructured); !ok {
|
||||
return nil, false, fmt.Errorf("type %T is invalid for dynamic object typer", obj)
|
||||
return nil, false, fmt.Errorf("type %T is invalid for determining dynamic object types", obj)
|
||||
}
|
||||
return []schema.GroupVersionKind{obj.GetObjectKind().GroupVersionKind()}, false, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user