DeploymentFromDocMap produces a new Deployment from a map of Documents.
(docs map[string]*pb.Document)
| 13 | |
| 14 | // DeploymentFromDocMap produces a new Deployment from a map of Documents. |
| 15 | func 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. |
nothing calls this directly
no test coverage detected