utils

package
v0.4.3-RC1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2019 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecCommand

func ExecCommand(cmd string) (string, error)

ExecCommand runs a command on the host and get the output

func ExecCommandWithPipe

func ExecCommandWithPipe(cmd1, cmd2 string) (string, error)

ExecCommandWithPipe runs 2 commands, pipe the output of first command to second, and returns output from the second

func ExecCommandWithSudo

func ExecCommandWithSudo(cmd string) (string, error)

ExecCommandWithSudo runs a command with sudo permissions and return the output as a string

func GetConfigPath

func GetConfigPath() (string, error)

GetConfigPath returns the filepath of kubeconfig file

func GetHomeDir

func GetHomeDir() (string, error)

GetHomeDir gets the home directory for the system. It is required to locate the .kube/config file

func GetYAMLString

func GetYAMLString(fileName string) (string, error)

GetYAMLString gets the yaml-string from the given YAML file

func RunCommand

func RunCommand(cmd string) error

RunCommand runs a command on the host

func RunCommandWithSudo

func RunCommandWithSudo(cmd string) error

RunCommandWithSudo runs a command with sudo permissions

Types

This section is empty.

Jump to

Keyboard shortcuts

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