kubectl

package
v1.23.3-rc.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 15 Imported by: 39

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogFailedContainers

func LogFailedContainers(c clientset.Interface, ns string, logFunc func(ftm string, args ...interface{}))

LogFailedContainers runs `kubectl logs` on a failed containers.

Types

type TestKubeconfig

type TestKubeconfig struct {
	CertDir     string
	Host        string
	KubeConfig  string
	KubeContext string
	KubectlPath string
	Namespace   string // Every test has at least one namespace unless creation is skipped
}

TestKubeconfig is a struct containing the needed attributes from TestContext and Framework(Namespace).

func NewTestKubeconfig

func NewTestKubeconfig(certdir, host, kubeconfig, kubecontext, kubectlpath, namespace string) *TestKubeconfig

NewTestKubeconfig returns a new Kubeconfig struct instance.

func (*TestKubeconfig) KubectlCmd

func (tk *TestKubeconfig) KubectlCmd(args ...string) *exec.Cmd

KubectlCmd runs the kubectl executable through the wrapper script.

func (*TestKubeconfig) ReadFileViaContainer

func (tk *TestKubeconfig) ReadFileViaContainer(podName, containerName string, path string) (string, error)

ReadFileViaContainer reads a file using kubectl exec cat <path>.

func (*TestKubeconfig) WriteFileViaContainer

func (tk *TestKubeconfig) WriteFileViaContainer(podName, containerName string, path string, contents string) error

WriteFileViaContainer writes a file using kubectl exec echo <contents> > <path> via specified container because of the primitive technique we're using here, we only allow ASCII alphanumeric characters

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL