MCPcopy Create free account
hub / github.com/devspace-sh/devspace / ExecBufferedCombined

Method ExecBufferedCombined

pkg/devspace/kubectl/exec.go:170–187  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

168
169// ExecBufferedCombined starts a new exec request, waits for it to finish and returns the output to the caller
170func (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}

Callers

nothing calls this directly

Calls 1

ExecStreamMethod · 0.95

Tested by

no test coverage detected