WithInitContainerImage ensures that, if in the current status there is an init 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)
| 307 | // set to the one passed. |
| 308 | // If `overwrite` is true the image is overwritten even when it's not empty |
| 309 | func (builder *Builder) WithInitContainerImage(name, image string, overwrite bool) *Builder { |
| 310 | builder.WithInitContainer(name) |
| 311 | |
| 312 | for idx, value := range builder.status.Spec.InitContainers { |
| 313 | if value.Name == name { |
| 314 | if overwrite || value.Image == "" { |
| 315 | builder.status.Spec.InitContainers[idx].Image = image |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | return builder |
| 321 | } |
| 322 | |
| 323 | // WithInitContainerVolumeMount ensure that the passed the volume mount exist in |
| 324 | // the current status, overriding the present one when needed |
no test coverage detected