Documentation ¶
Index ¶
- func Logf(str string, args ...interface{})
- func Retry(t *testing.T, callback func() error, d time.Duration, attempts int) (err error)
- func WaitForBusyboxRunning(t *testing.T, namespace string) error
- func WaitForFailedCreatePodSandBoxEvent() error
- func WaitForGvisorControllerDeleted() error
- func WaitForGvisorControllerRunning(t *testing.T) error
- func WaitForIngressControllerRunning(t *testing.T) error
- func WaitForIngressDefaultBackendRunning(t *testing.T) error
- func WaitForNginxRunning(t *testing.T) error
- func WaitForUntrustedNginxRunning() error
- type KubectlRunner
- type MinikubeRunner
- func (m *MinikubeRunner) CheckStatus(desired string)
- func (m *MinikubeRunner) CheckStatusNoFail(desired string) error
- func (m *MinikubeRunner) CombinedOutput(cmd string) (string, error)
- func (m *MinikubeRunner) Copy(f assets.CopyableFile) error
- func (m *MinikubeRunner) EnsureRunning()
- func (m *MinikubeRunner) GetLogs() string
- func (m *MinikubeRunner) GetStatus() string
- func (m *MinikubeRunner) ParseEnvCmdOutput(out string) map[string]string
- func (m *MinikubeRunner) Remove(f assets.CopyableFile) error
- func (m *MinikubeRunner) Run(cmd string) error
- func (m *MinikubeRunner) RunCommand(command string, checkError bool) string
- func (m *MinikubeRunner) RunDaemon(command string) (*exec.Cmd, *bufio.Reader)
- func (m *MinikubeRunner) RunDaemon2(command string) (*exec.Cmd, *bufio.Reader, *bufio.Reader)
- func (m *MinikubeRunner) RunWithContext(ctx context.Context, command string) (string, string, error)
- func (m *MinikubeRunner) SSH(command string) (string, error)
- func (m *MinikubeRunner) Start(opts ...string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Logf ¶ added in v0.32.0
func Logf(str string, args ...interface{})
Logf writes logs to stdout if -v is set.
func Retry ¶ added in v0.22.0
Retry tries the callback for a number of attempts, with a delay between attempts
func WaitForBusyboxRunning ¶ added in v0.22.0
WaitForBusyboxRunning waits until busybox pod to be running
func WaitForFailedCreatePodSandBoxEvent ¶ added in v0.31.0
func WaitForFailedCreatePodSandBoxEvent() error
WaitForFailedCreatePodSandBoxEvent waits for a FailedCreatePodSandBox event to appear
func WaitForGvisorControllerDeleted ¶ added in v0.31.0
func WaitForGvisorControllerDeleted() error
WaitForGvisorControllerDeleted waits for the gvisor controller pod to be deleted
func WaitForGvisorControllerRunning ¶ added in v0.31.0
WaitForGvisorControllerRunning waits for the gvisor controller pod to be running
func WaitForIngressControllerRunning ¶ added in v0.25.0
WaitForIngressControllerRunning waits until ingress controller pod to be running
func WaitForIngressDefaultBackendRunning ¶ added in v0.25.0
WaitForIngressDefaultBackendRunning waits until ingress default backend pod to be running
func WaitForNginxRunning ¶ added in v0.25.0
WaitForNginxRunning waits for nginx service to be up
func WaitForUntrustedNginxRunning ¶ added in v0.31.0
func WaitForUntrustedNginxRunning() error
WaitForUntrustedNginxRunning waits for the untrusted nginx pod to start running
Types ¶
type KubectlRunner ¶
KubectlRunner runs a command using kubectl
func NewKubectlRunner ¶
func NewKubectlRunner(t *testing.T) *KubectlRunner
NewKubectlRunner creates a new KubectlRunner
func (*KubectlRunner) CreateRandomNamespace ¶
func (k *KubectlRunner) CreateRandomNamespace() string
CreateRandomNamespace creates a random namespace
func (*KubectlRunner) DeleteNamespace ¶
func (k *KubectlRunner) DeleteNamespace(namespace string) error
DeleteNamespace deletes the namespace
func (*KubectlRunner) RunCommand ¶
func (k *KubectlRunner) RunCommand(args []string) (stdout []byte, err error)
RunCommand runs a command, returning stdout
func (*KubectlRunner) RunCommandParseOutput ¶
func (k *KubectlRunner) RunCommandParseOutput(args []string, outputObj interface{}) error
RunCommandParseOutput runs a command and parses the JSON output
type MinikubeRunner ¶
type MinikubeRunner struct { T *testing.T BinaryPath string Args string StartArgs string MountArgs string Runtime string }
MinikubeRunner runs a command
func (*MinikubeRunner) CheckStatus ¶
func (m *MinikubeRunner) CheckStatus(desired string)
CheckStatus makes sure the service has the desired status, or cause fatal error
func (*MinikubeRunner) CheckStatusNoFail ¶ added in v0.17.0
func (m *MinikubeRunner) CheckStatusNoFail(desired string) error
CheckStatusNoFail makes sure the service has the desired status, returning error
func (*MinikubeRunner) CombinedOutput ¶ added in v0.22.0
func (m *MinikubeRunner) CombinedOutput(cmd string) (string, error)
CombinedOutput executes a command, returning the combined stdout and stderr
func (*MinikubeRunner) Copy ¶ added in v0.22.0
func (m *MinikubeRunner) Copy(f assets.CopyableFile) error
Copy copies a file
func (*MinikubeRunner) EnsureRunning ¶
func (m *MinikubeRunner) EnsureRunning()
EnsureRunning makes sure the container runtime is running
func (*MinikubeRunner) GetLogs ¶ added in v0.22.2
func (m *MinikubeRunner) GetLogs() string
GetLogs returns the logs of a service
func (*MinikubeRunner) GetStatus ¶
func (m *MinikubeRunner) GetStatus() string
GetStatus returns the status of a service
func (*MinikubeRunner) ParseEnvCmdOutput ¶ added in v0.31.0
func (m *MinikubeRunner) ParseEnvCmdOutput(out string) map[string]string
ParseEnvCmdOutput parses the output of `env` (assumes bash)
func (*MinikubeRunner) Remove ¶ added in v0.22.0
func (m *MinikubeRunner) Remove(f assets.CopyableFile) error
Remove removes a file
func (*MinikubeRunner) Run ¶ added in v0.22.0
func (m *MinikubeRunner) Run(cmd string) error
Run executes a command
func (*MinikubeRunner) RunCommand ¶
func (m *MinikubeRunner) RunCommand(command string, checkError bool) string
RunCommand executes a command, optionally checking for error
func (*MinikubeRunner) RunDaemon ¶ added in v0.18.0
RunDaemon executes a command, returning the stdout
func (*MinikubeRunner) RunDaemon2 ¶ added in v0.34.0
RunDaemon2 executes a command, returning the stdout and stderr
func (*MinikubeRunner) RunWithContext ¶ added in v0.31.0
func (m *MinikubeRunner) RunWithContext(ctx context.Context, command string) (string, string, error)
RunWithContext calls the minikube command with a context, useful for timeouts.
func (*MinikubeRunner) SSH ¶
func (m *MinikubeRunner) SSH(command string) (string, error)
SSH returns the output of running a command using SSH
func (*MinikubeRunner) Start ¶
func (m *MinikubeRunner) Start(opts ...string)
Start starts the container runtime