Reuse cached client config for exec requests in e2e

This commit is contained in:
Tim Allclair 2024-10-29 10:00:11 -07:00
parent 53aa727708
commit 2407a49956

View File

@ -58,8 +58,6 @@ func ExecWithOptionsContext(ctx context.Context, f *framework.Framework, options
if !options.Quiet {
framework.Logf("ExecWithOptions %+v", options)
}
config, err := framework.LoadConfig()
framework.ExpectNoError(err, "failed to load restclient config")
const tty = false
@ -80,7 +78,7 @@ func ExecWithOptionsContext(ctx context.Context, f *framework.Framework, options
var stdout, stderr bytes.Buffer
framework.Logf("ExecWithOptions: execute(POST %s)", req.URL())
err = execute(ctx, "POST", req.URL(), config, options.Stdin, &stdout, &stderr, tty)
err := execute(ctx, "POST", req.URL(), f.ClientConfig(), options.Stdin, &stdout, &stderr, tty)
if options.PreserveWhitespace {
return stdout.String(), stderr.String(), err