Documentation ¶
Index ¶
- type TestShell
- func (tc *TestShell) Command(name string, args ...string) *exec.Cmd
- func (tc *TestShell) Docker(args ...string) ([]byte, error)
- func (tc *TestShell) ExecWithDebug(name string, args ...string) ([]byte, error)
- func (tc *TestShell) Git(args ...string) ([]byte, error)
- func (tc *TestShell) Helm(args ...string) ([]byte, error)
- func (tc *TestShell) Kubectl(args ...string) ([]byte, error)
- func (tc *TestShell) KubectlContext(ctx context.Context, args ...string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestShell ¶
type TestShell struct { // Context to use, if not specified by the method. Context context.Context // KubeConfigPath is the path to the kubeconfig file for the cluster, // used for kubectl commands. KubeConfigPath string // Logger for methods to use. Logger *testlogger.TestLogger }
TestShell is a helper utility to execute shell commands in a test. Handles logging and injection of the KUBECONFIG as argument or env var.
func (*TestShell) Command ¶
Command is a convenience method for invoking a subprocess with the KUBECONFIG environment variable set. Setting the environment variable directly in the test process is not thread safe.
func (*TestShell) Docker ¶
Docker is a convenience method for calling docker. Returns STDOUT & STDERR combined, and an error if docker exited abnormally.
func (*TestShell) ExecWithDebug ¶ added in v1.17.0
ExecWithDebug is a convenience method for invoking a subprocess with the KUBECONFIG environment variable and debug logging.
func (*TestShell) Git ¶
Git is a convenience method for calling git. Returns STDOUT & STDERR combined, and an error if git exited abnormally.
func (*TestShell) Helm ¶ added in v1.16.0
Helm is a convenience method for calling helm. Returns STDOUT & STDERR combined, and an error if helm exited abnormally.