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

Method WithReadinessProbe

pkg/podspec/builder.go:210–223  ·  view source on GitHub ↗

WithReadinessProbe add the provided readiness probe to a container

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

Source from the content-addressed store, hash-verified

208
209// WithReadinessProbe add the provided readiness probe to a container
210func (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

Callers 1

DeploymentFunction · 0.80

Calls 1

WithContainerMethod · 0.95

Tested by

no test coverage detected