ExecBufferedCombined starts a new exec request, waits for it to finish and returns the output to the caller
(ctx context.Context, pod *corev1.Pod, container string, command []string, stdin io.Reader)
| 168 | |
| 169 | // ExecBufferedCombined starts a new exec request, waits for it to finish and returns the output to the caller |
| 170 | func (client *client) ExecBufferedCombined(ctx context.Context, pod *corev1.Pod, container string, command []string, stdin io.Reader) ([]byte, error) { |
| 171 | stdoutBuffer := &bytes.Buffer{} |
| 172 | kubeExecError := client.ExecStream(ctx, &ExecStreamOptions{ |
| 173 | Pod: pod, |
| 174 | Container: container, |
| 175 | Command: command, |
| 176 | Stdin: stdin, |
| 177 | Stdout: stdoutBuffer, |
| 178 | Stderr: stdoutBuffer, |
| 179 | }) |
| 180 | if kubeExecError != nil { |
| 181 | if _, ok := kubeExecError.(kubectlExec.CodeExitError); !ok { |
| 182 | return nil, kubeExecError |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | return stdoutBuffer.Bytes(), kubeExecError |
| 187 | } |
nothing calls this directly
no test coverage detected