WithContainerCommand ensures that, if in the current status there is a 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)
| 227 | // set to the one passed. |
| 228 | // If `overwrite` is true the command is overwritten even when it's not empty |
| 229 | func (builder *Builder) WithContainerCommand(name string, command []string, overwrite bool) *Builder { |
| 230 | builder.WithContainer(name) |
| 231 | |
| 232 | for idx, value := range builder.status.Spec.Containers { |
| 233 | if value.Name == name { |
| 234 | if overwrite || len(value.Command) == 0 { |
| 235 | builder.status.Spec.Containers[idx].Command = command |
| 236 | } |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | return builder |
| 241 | } |
| 242 | |
| 243 | // WithContainerPort ensures that, if in the current status there is |
| 244 | // a container with the passed name the passed container port will be |
no test coverage detected