mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-13 11:25:19 +00:00
ExecProbes should be able to do simple env var substitution
For containers that don't have bash, we should support env substitution like we do on command and args. However, without major refactoring valueFrom is not supportable from inside the prober. For now, implement substitution based on hardcoded env and leave TODOs for future work.
This commit is contained in:
@@ -143,7 +143,8 @@ func (pb *prober) runProbe(p *v1.Probe, pod *v1.Pod, status v1.PodStatus, contai
|
||||
timeout := time.Duration(p.TimeoutSeconds) * time.Second
|
||||
if p.Exec != nil {
|
||||
glog.V(4).Infof("Exec-Probe Pod: %v, Container: %v, Command: %v", pod, container, p.Exec.Command)
|
||||
return pb.exec.Probe(pb.newExecInContainer(container, containerID, p.Exec.Command, timeout))
|
||||
command := kubecontainer.ExpandContainerCommandOnlyStatic(p.Exec.Command, container.Env)
|
||||
return pb.exec.Probe(pb.newExecInContainer(container, containerID, command, timeout))
|
||||
}
|
||||
if p.HTTPGet != nil {
|
||||
scheme := strings.ToLower(string(p.HTTPGet.Scheme))
|
||||
|
||||
Reference in New Issue
Block a user