asKubeObject attempts use the object as a KubeObject. It will return an error if not possible.
(runtimeObj runtime.Object)
| 426 | |
| 427 | // asKubeObject attempts use the object as a KubeObject. It will return an error if not possible. |
| 428 | func AsKubeObject(runtimeObj runtime.Object) (KubeObject, error) { |
| 429 | kubeObj, ok := runtimeObj.(KubeObject) |
| 430 | if !ok { |
| 431 | return nil, errors.New("was unable to use runtime.Object as deploy.KubeObject") |
| 432 | } |
| 433 | return kubeObj, nil |
| 434 | } |
| 435 | |
| 436 | func resourceError(action, namespace, name string, mapping *meta.RESTMapping, err error) error { |
| 437 | if mapping == nil || mapping.GroupVersionKind.IsEmpty() { |