WithInitContainerCommand ensures that, if in the current status there is an init container with the passed name and the command is empty, the command will be set to the one passed. If `overwrite` is true the command is overwritten even when it's not empty
(name string, command []string, overwrite bool)
| 352 | // set to the one passed. |
| 353 | // If `overwrite` is true the command is overwritten even when it's not empty |
| 354 | func (builder *Builder) WithInitContainerCommand(name string, command []string, overwrite bool) *Builder { |
| 355 | builder.WithInitContainer(name) |
| 356 | |
| 357 | for idx, value := range builder.status.Spec.InitContainers { |
| 358 | if value.Name == name { |
| 359 | if overwrite || len(value.Command) == 0 { |
| 360 | builder.status.Spec.InitContainers[idx].Command = command |
| 361 | } |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | return builder |
| 366 | } |
| 367 | |
| 368 | // WithInitContainerSecurityContext ensures that, if in the current status there is |
| 369 | // an init container with the passed name and the securityContext is empty, the securityContext will be |
no test coverage detected