WithReadinessProbe add the provided readiness probe to a container
(name string, readinessProbe *corev1.Probe, overwrite bool)
| 208 | |
| 209 | // WithReadinessProbe add the provided readiness probe to a container |
| 210 | func (builder *Builder) WithReadinessProbe(name string, readinessProbe *corev1.Probe, overwrite bool) *Builder { |
| 211 | builder.WithContainer(name) |
| 212 | |
| 213 | for idxContainer, container := range builder.status.Spec.Containers { |
| 214 | if container.Name == name { |
| 215 | if container.ReadinessProbe == nil || overwrite { |
| 216 | builder.status.Spec.Containers[idxContainer].ReadinessProbe = readinessProbe |
| 217 | } |
| 218 | return builder |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | return builder |
| 223 | } |
| 224 | |
| 225 | // WithContainerCommand ensures that, if in the current status there is |
| 226 | // a container with the passed name and the command is empty, the command will be |
no test coverage detected