MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / WithLivenessProbe

Method WithLivenessProbe

pkg/podspec/builder.go:194–207  ·  view source on GitHub ↗

WithLivenessProbe add the provided liveness probe to a container

(name string, livenessProbe *corev1.Probe, overwrite bool)

Source from the content-addressed store, hash-verified

192
193// WithLivenessProbe add the provided liveness probe to a container
194func (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
210func (builder *Builder) WithReadinessProbe(name string, readinessProbe *corev1.Probe, overwrite bool) *Builder {

Callers

nothing calls this directly

Calls 1

WithContainerMethod · 0.95

Tested by

no test coverage detected