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

Method AddDeployment

pkg/deploy/deployment.go:71–83  ·  view source on GitHub ↗

AddDeployment inserts the contents of one Deployment into another.

(deployment Deployment)

Source from the content-addressed store, hash-verified

69
70// AddDeployment inserts the contents of one Deployment into another.
71func (d *Deployment) AddDeployment(deployment Deployment) (err error) {
72 // this is inefficient-it results in two deep copies being made, ones that's thrown out
73 // if this becomes frequently used it should be reimplemented
74
75 // TODO: perform check for collisions before mutation to prevent incomplete additions
76 for _, obj := range deployment.Objects() {
77 err = d.Add(obj)
78 if err != nil {
79 return fmt.Errorf("could not add `%s`: %v", obj.GetObjectMeta().GetName(), err)
80 }
81 }
82 return nil
83}
84
85// Get returns the object with the given path from the Deployment. Error is returned if object does not exist.
86func (d *Deployment) Get(name string) (KubeObject, error) {

Callers 10

DeploymentMethod · 0.95
dataMethod · 0.80
dataMethod · 0.80
DeploymentMethod · 0.80
dataMethod · 0.80
DeploymentMethod · 0.80
dataMethod · 0.80
TestRCAttachImageFunction · 0.80
TestRCAttachContainerFunction · 0.80
TestRCAttachPodFunction · 0.80

Calls 2

AddMethod · 0.95
ObjectsMethod · 0.65

Tested by 3

TestRCAttachImageFunction · 0.64
TestRCAttachContainerFunction · 0.64
TestRCAttachPodFunction · 0.64