Deployment is created containing Pod with attached Containers.
()
| 80 | |
| 81 | // Deployment is created containing Pod with attached Containers. |
| 82 | func (c *Pod) Deployment() (*deploy.Deployment, error) { |
| 83 | deployment := deploy.Deployment{} |
| 84 | |
| 85 | // create Pod from tree of Entities |
| 86 | kubePod, childObj, err := c.data() |
| 87 | if err != nil { |
| 88 | return nil, err |
| 89 | } |
| 90 | |
| 91 | // add Pod to deployment |
| 92 | err = deployment.Add(kubePod) |
| 93 | if err != nil { |
| 94 | return nil, err |
| 95 | } |
| 96 | |
| 97 | // add child objects |
| 98 | err = deployment.AddDeployment(childObj) |
| 99 | if err != nil { |
| 100 | return nil, err |
| 101 | } |
| 102 | return &deployment, nil |
| 103 | } |
| 104 | |
| 105 | // Images for all Containers in Pod |
| 106 | func (c *Pod) Images() (images []*image.Image) { |