WithLivenessProbe add the provided liveness probe to a container
(name string, livenessProbe *corev1.Probe, overwrite bool)
| 192 | |
| 193 | // WithLivenessProbe add the provided liveness probe to a container |
| 194 | func (builder *Builder) WithLivenessProbe(name string, livenessProbe *corev1.Probe, overwrite bool) *Builder { |
| 195 | builder.WithContainer(name) |
| 196 | |
| 197 | for idxContainer, container := range builder.status.Spec.Containers { |
| 198 | if container.Name == name { |
| 199 | if container.LivenessProbe == nil || overwrite { |
| 200 | builder.status.Spec.Containers[idxContainer].LivenessProbe = livenessProbe |
| 201 | } |
| 202 | return builder |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | return builder |
| 207 | } |
| 208 | |
| 209 | // WithReadinessProbe add the provided readiness probe to a container |
| 210 | func (builder *Builder) WithReadinessProbe(name string, readinessProbe *corev1.Probe, overwrite bool) *Builder { |
nothing calls this directly
no test coverage detected