Fix status update in case of connection errors
This commit is contained in:
parent
468872b7e9
commit
fed013ab6f
11 changed files with 326 additions and 107 deletions
|
|
@ -183,8 +183,7 @@ func execInfluxDBCommand(pod *corev1.Pod, command string) (string, error) {
|
|||
execErr bytes.Buffer
|
||||
)
|
||||
|
||||
args := fmt.Sprintf("kubectl exec --namespace %v %v -- %v", pod.Namespace, pod.Name, command)
|
||||
cmd := exec.Command("/bin/bash", "-c", args)
|
||||
cmd := exec.Command("/bin/bash", "-c", fmt.Sprintf("%v exec --namespace %s %s -- %s", framework.KubectlPath, pod.Namespace, pod.Name, command))
|
||||
cmd.Stdout = &execOut
|
||||
cmd.Stderr = &execErr
|
||||
|
||||
|
|
@ -195,7 +194,7 @@ func execInfluxDBCommand(pod *corev1.Pod, command string) (string, error) {
|
|||
}
|
||||
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("could not execute: %v", err)
|
||||
return "", fmt.Errorf("could not execute '%s %s': %v", cmd.Path, cmd.Args, err)
|
||||
}
|
||||
|
||||
return execOut.String(), nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue