MCPcopy
hub / github.com/redspread/spread / AsKubeObject

Function AsKubeObject

pkg/deploy/cluster.go:428–434  ·  view source on GitHub ↗

asKubeObject attempts use the object as a KubeObject. It will return an error if not possible.

(runtimeObj runtime.Object)

Source from the content-addressed store, hash-verified

426
427// asKubeObject attempts use the object as a KubeObject. It will return an error if not possible.
428func 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
436func resourceError(action, namespace, name string, mapping *meta.RESTMapping, err error) error {
437 if mapping == nil || mapping.GroupVersionKind.IsEmpty() {

Callers 4

updateMethod · 0.85
GetMethod · 0.85
getMethod · 0.85
createMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected