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

Function ensureCustomProbesConfiguration

pkg/specs/pods.go:329–340  ·  view source on GitHub ↗

ensureCustomProbesConfiguration applies the custom probe configuration if specified inside the cluster specification

(cluster *apiv1.Cluster, container *corev1.Container)

Source from the content-addressed store, hash-verified

327// ensureCustomProbesConfiguration applies the custom probe configuration
328// if specified inside the cluster specification
329func ensureCustomProbesConfiguration(cluster *apiv1.Cluster, container *corev1.Container) {
330 // No probes configuration
331 if cluster.Spec.Probes == nil {
332 return
333 }
334
335 // There's no need to check for nils here because a nil probe specification
336 // will result in no change in the Kubernetes probe.
337 cluster.Spec.Probes.Liveness.ApplyInto(container.LivenessProbe)
338 cluster.Spec.Probes.Readiness.ApplyInto(container.ReadinessProbe)
339 cluster.Spec.Probes.Startup.ApplyInto(container.StartupProbe)
340}
341
342// getFailureThreshold get the startup probe failure threshold
343// FAILURE_THRESHOLD = ceil(startDelay / periodSeconds) and minimum value is 1

Callers 1

createPostgresContainersFunction · 0.85

Calls 1

ApplyIntoMethod · 0.45

Tested by

no test coverage detected