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

Function DeploymentFromDocMap

pkg/deploy/deployment.go:15–31  ·  view source on GitHub ↗

DeploymentFromDocMap produces a new Deployment from a map of Documents.

(docs map[string]*pb.Document)

Source from the content-addressed store, hash-verified

13
14// DeploymentFromDocMap produces a new Deployment from a map of Documents.
15func DeploymentFromDocMap(docs map[string]*pb.Document) (deploy *Deployment, err error) {
16 var obj KubeObject
17 deploy = new(Deployment)
18 for path, doc := range docs {
19 doc.GetInfo().Path = path
20 obj, err = KubeObjectFromDocument(path, doc)
21 if err != nil {
22 return
23 }
24
25 err = deploy.Add(obj)
26 if err != nil {
27 return
28 }
29 }
30 return
31}
32
33// A Deployment is a representation of a Kubernetes cluster's object registry.
34// It can be used to specify objects to be deployed and is how the current state of a deployment is returned.

Callers

nothing calls this directly

Calls 3

KubeObjectFromDocumentFunction · 0.85
GetInfoMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected