Documentation ¶
Index ¶
- Variables
- func CopyToPod(ctx context.Context, podName, namespace string, buffer *bytes.Buffer, ...) error
- func ErrFromStderr(stderr bytes.Buffer) error
- func ExecCommandInContainer(ctx context.Context, pod, container, namespace string, cmd ...string) (io.Reader, io.Reader, error)
- func ExecCommandInPod(ctx context.Context, podName, namespace string, cmd ...string) (io.Reader, io.Reader, error)
- func ExecShellInContainer(ctx context.Context, podName, containerName, namespace string, cmd string) (io.Reader, io.Reader, error)
- func ExecShellInPod(ctx context.Context, podName, namespace string, cmd string) (io.Reader, io.Reader, error)
- func FormShellCommand(cmd ...string) string
- func GetLastLine(reader io.Reader) string
- func PromptStderrView(stderr io.Reader) bool
- func ValuesFromFile(path string) (map[string]interface{}, error)
- func WaitForEvent(ctx context.Context, cancel context.CancelFunc, watcher watch.Interface, ...) (bool, error)
- func WaitForJobComplete(ctx context.Context, name *string, selector string, namespace string) (bool, error)
- func WaitForPodReady(ctx context.Context, name *string, selector string, namespace string) (bool, error)
- func WrapWithStderrViewPrompt(err error, stderr io.Reader, printErrPriorPrompt bool) error
- func WriteBytesToTar(targetPath string, reader SizedReader, writer io.Writer) error
- func WriteBytesToTarGzip(targetPath string, reader SizedReader, writer io.Writer) error
- type SecretInterface
- type SizedReader
Constants ¶
This section is empty.
Variables ¶
var (
ErrRemoteCmdFailed = errors.New("remote command failed")
)
Functions ¶
func ErrFromStderr ¶
ErrFromStderr parses stderr to find last error message, which would be returned as error or <nil> otherwise.
func ExecCommandInContainer ¶
func ExecCommandInContainer( ctx context.Context, pod, container, namespace string, cmd ...string, ) (io.Reader, io.Reader, error)
ExecCommandInContainer executes a command in the given `container` of `pod` and return stdout, stderr as error.
func ExecCommandInPod ¶
func ExecCommandInPod(ctx context.Context, podName, namespace string, cmd ...string) (io.Reader, io.Reader, error)
ExecCommandInPod executes a command in the default container of the given `pod` and return stdout, stderr and error.
func ExecShellInContainer ¶
func ExecShellInContainer( ctx context.Context, podName, containerName, namespace string, cmd string, ) (io.Reader, io.Reader, error)
ExecShellInContainer executes a `sh` shell command in the given `container` of `pod` and return stdout, stderr and error.
func ExecShellInPod ¶
func ExecShellInPod(ctx context.Context, podName, namespace string, cmd string) (io.Reader, io.Reader, error)
ExecShellInPod executes a `sh` shell command in the default container of the given `pod` and return stdout, stderr and error.
func FormShellCommand ¶
FormShellCommand forms command for shell execution `sh -c "cmd"`.
func GetLastLine ¶
func PromptStderrView ¶
PromptStderrView asks whether the full log output from stderr should be viewed.
func ValuesFromFile ¶
ValuesFromFile retrieves value from file on given `path` structured as map.
func WaitForEvent ¶
func WaitForEvent( ctx context.Context, cancel context.CancelFunc, watcher watch.Interface, onEvent func(watch.Event) bool, msgStart, msgSuccess, msgWarning, msgTimeout func() string, ) (bool, error)
WaitForEvent waits for custom event occurrence.
func WaitForJobComplete ¶
func WaitForJobComplete( ctx context.Context, name *string, selector string, namespace string, ) (bool, error)
WaitForJobComplete waits for job with given 'selector' and 'name' in given 'namespace' to complete.
func WaitForPodReady ¶
func WaitForPodReady( ctx context.Context, name *string, selector string, namespace string, ) (bool, error)
WaitForPodReady waits for pod with given 'selector' and 'name' in given 'namespace' to become ready.
func WrapWithStderrViewPrompt ¶
WrapWithStderrViewPrompt wraps `err` from remote container with `msg`, and asks whether the full log output from stderr should be viewed.
func WriteBytesToTar ¶
func WriteBytesToTar(targetPath string, reader SizedReader, writer io.Writer) error
WriteBytesToTar puts bytes from `reader` into the `targetPath` file in tar archive.
func WriteBytesToTarGzip ¶
func WriteBytesToTarGzip(targetPath string, reader SizedReader, writer io.Writer) error
WriteBytesToTarGzip puts bytes from `reader` into the `targetPath` file in tar.gz archive, by performing pipeline write to WriteBytesToTar.
Types ¶
type SecretInterface ¶
type SecretInterface struct {
v1.SecretInterface
}
SecretInterface provides additional methods for dealing with Kubernetes secrets.
func SecretAdapter ¶
func SecretAdapter(i v1.SecretInterface) *SecretInterface
SecretAdapter constructs new SecretInterface adapter instance.
func (*SecretInterface) CreateOrUpdate ¶
func (i *SecretInterface) CreateOrUpdate(ctx context.Context, secret corev1.Secret) (*corev1.Secret, error)
CreateOrUpdate takes the representation of a secret and either creates it or update existing one.