MCPcopy Create free account
hub / github.com/NVIDIA/gpu-operator / setContainerProbe

Function setContainerProbe

controllers/object_controls.go:2763–2792  ·  view source on GitHub ↗
(container *corev1.Container, probe *gpuv1.ContainerProbeSpec, probeType ContainerProbe)

Source from the content-addressed store, hash-verified

2761}
2762
2763func setContainerProbe(container *corev1.Container, probe *gpuv1.ContainerProbeSpec, probeType ContainerProbe) {
2764 var containerProbe *corev1.Probe
2765
2766 // determine probe type to update
2767 switch probeType {
2768 case Startup:
2769 containerProbe = container.StartupProbe
2770 case Liveness:
2771 containerProbe = container.LivenessProbe
2772 case Readiness:
2773 containerProbe = container.ReadinessProbe
2774 }
2775
2776 // set probe parameters if specified
2777 if probe.InitialDelaySeconds != 0 {
2778 containerProbe.InitialDelaySeconds = probe.InitialDelaySeconds
2779 }
2780 if probe.TimeoutSeconds != 0 {
2781 containerProbe.TimeoutSeconds = probe.TimeoutSeconds
2782 }
2783 if probe.FailureThreshold != 0 {
2784 containerProbe.FailureThreshold = probe.FailureThreshold
2785 }
2786 if probe.SuccessThreshold != 0 {
2787 containerProbe.SuccessThreshold = probe.SuccessThreshold
2788 }
2789 if probe.PeriodSeconds != 0 {
2790 containerProbe.PeriodSeconds = probe.PeriodSeconds
2791 }
2792}
2793
2794// applies MIG related configuration env to container spec
2795func applyMIGConfiguration(c *corev1.Container, strategy gpuv1.MIGStrategy) {

Callers 1

transformDriverContainerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected