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

Method create

pkg/deploy/cluster.go:225–237  ·  view source on GitHub ↗

create adds the object to the cluster.

(obj KubeObject, mapping *meta.RESTMapping)

Source from the content-addressed store, hash-verified

223
224// create adds the object to the cluster.
225func (c *KubeCluster) create(obj KubeObject, mapping *meta.RESTMapping) (KubeObject, error) {
226 meta := obj.GetObjectMeta()
227 req := c.Client.RESTClient.Post().Body(obj)
228
229 setRequestObjectInfo(req, meta.GetNamespace(), mapping)
230
231 runtimeObj, err := req.Do().Get()
232 if err != nil {
233 return nil, resourceError("create", meta.GetName(), meta.GetNamespace(), mapping, err)
234 }
235
236 return AsKubeObject(runtimeObj)
237}
238
239func (c *KubeCluster) deletePods(rc *kube.ReplicationController) error {
240 if rc == nil {

Callers 2

deployMethod · 0.95
updateMethod · 0.95

Calls 4

setRequestObjectInfoFunction · 0.85
resourceErrorFunction · 0.85
AsKubeObjectFunction · 0.85
GetMethod · 0.45

Tested by

no test coverage detected