Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKubeConfigPath ¶
Types ¶
type ExecKubectlFunc ¶
var ExecKubectl ExecKubectlFunc = func(kubectl *Kubectl, args ...string) error { osCmd := exec.Command("kubectl", args...) osCmd.Env = append(os.Environ(), fmt.Sprintf("KUBECONFIG=%s", kubectl.KubeconfigPath)) osCmd.Stdin = os.Stdin osCmd.Stdout = os.Stdout osCmd.Stderr = os.Stderr return osCmd.Run() }
type GetInKubectlFunc ¶
var GetInKubectl GetInKubectlFunc = func(kubectl *Kubectl, stdin string, args ...string) (string, error) { osCmd := exec.Command("kubectl", args...) osCmd.Env = append(os.Environ(), fmt.Sprintf("KUBECONFIG=%s", kubectl.KubeconfigPath)) osCmd.Stdin = strings.NewReader(stdin) osCmd.Stderr = os.Stderr outputBytes, err := osCmd.Output() return string(outputBytes), err }
type GetKubectlFunc ¶
var GetKubectl GetKubectlFunc = func(kubectl *Kubectl, args ...string) (string, error) { osCmd := exec.Command("kubectl", args...) osCmd.Env = append(os.Environ(), fmt.Sprintf("KUBECONFIG=%s", kubectl.KubeconfigPath)) osCmd.Stdin = os.Stdin osCmd.Stderr = os.Stderr outputBytes, err := osCmd.Output() return string(outputBytes), err }
type InKubectlFunc ¶
var InKubectl InKubectlFunc = func(kubectl *Kubectl, stdin string, args ...string) error { osCmd := exec.Command("kubectl", args...) osCmd.Env = append(os.Environ(), fmt.Sprintf("KUBECONFIG=%s", kubectl.KubeconfigPath)) osCmd.Stdin = strings.NewReader(stdin) osCmd.Stdout = os.Stdout osCmd.Stderr = os.Stderr return osCmd.Run() }
type Kubectl ¶
type Kubectl struct {
KubeconfigPath string
}
Kubectl struct allows for execution of a kubectl command with a
non-environment set kubeconfig path.
TODO: Move more uses of kubeutil.ExecKubectl/GetKubectl/etc to use this
structure.
func NewKubectl ¶
func NewKubectlFromNode ¶ added in v0.12.0
Click to show internal directories.
Click to hide internal directories.