package kubectl
import "k8s.io/kubernetes/test/e2e/framework/kubectl"
Index ¶
- func LogFailedContainers(c clientset.Interface, ns string, logFunc func(ftm string, args ...interface{}))
- type TestKubeconfig
- func NewTestKubeconfig(certdir, host, kubeconfig, kubecontext, kubectlpath, namespace string) *TestKubeconfig
- func (tk *TestKubeconfig) KubectlCmd(args ...string) *exec.Cmd
- func (tk *TestKubeconfig) ReadFileViaContainer(podName, containerName string, path string) (string, error)
- func (tk *TestKubeconfig) WriteFileViaContainer(podName, containerName string, path string, contents string) error
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
Source Files ¶
kubectl_utils.go
- Version
- v1.23.3
- Published
- Jan 25, 2022
- Platform
- js/wasm
- Imports
- 15 packages
- Last checked
- 43 minutes ago –
Tools for package owners.