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

Function setRequestObjectInfo

pkg/deploy/cluster.go:360–366  ·  view source on GitHub ↗

setRequestObjectInfo adds necessary type information to requests.

(req *rest.Request, namespace string, mapping *meta.RESTMapping)

Source from the content-addressed store, hash-verified

358
359// setRequestObjectInfo adds necessary type information to requests.
360func setRequestObjectInfo(req *rest.Request, namespace string, mapping *meta.RESTMapping) {
361 // if namespace scoped resource, set namespace
362 req.NamespaceIfScoped(namespace, isNamespaceScoped(mapping))
363
364 // set resource name
365 req.Resource(mapping.Resource)
366}
367
368// alreadyExists checks if the error is for a resource already existing.
369func alreadyExists(err error) bool {

Callers 3

updateMethod · 0.85
getMethod · 0.85
createMethod · 0.85

Calls 1

isNamespaceScopedFunction · 0.85

Tested by

no test coverage detected