WithContainerImage ensures that, if in the current status there is a container with the passed name and the image is empty, the image will be set to the one passed. If `overwrite` is true the image is overwritten even when it's not empty
(name, image string, overwrite bool)
| 116 | // set to the one passed. |
| 117 | // If `overwrite` is true the image is overwritten even when it's not empty |
| 118 | func (builder *Builder) WithContainerImage(name, image string, overwrite bool) *Builder { |
| 119 | builder.WithContainer(name) |
| 120 | |
| 121 | for idx, value := range builder.status.Spec.Containers { |
| 122 | if value.Name == name { |
| 123 | if overwrite || value.Image == "" { |
| 124 | builder.status.Spec.Containers[idx].Image = image |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | return builder |
| 130 | } |
| 131 | |
| 132 | // WithContainerVolumeMount ensure that the passed the volume mount exist in |
| 133 | // the current status, overriding the present one when needed |
no test coverage detected