Documentation ¶
Index ¶
- func CreateTmpFile(contents string) (string, error)
- func DownloadFile(url, name, directory string) error
- func ExecToSuccessWithTimeout(funk ExternalCommandFunc, timeout, interval time.Duration) (string, error)
- func ExtractFile(filePath string) (string, error)
- func Kubectl(command string) (string, error)
- func KubectlApplyEmbeddedYaml(yamlPath string) (string, error)
- func KubectlDeleteEmbeddedYaml(yamlPath string, ignoreMissing bool) (string, error)
- func OpenSSLSubjectHash(cert string) (string, error)
- func RunProc(cmd, dir string, toStdout bool) (string, error)
- func RunProcNoErr(cmd, dir string, toStdout bool) (string, error)
- func Untar(tarFile, targetDir string) error
- func WaitForCommandCompletion(ui *ui.UI, message string, funk ExternalCommandFunc) (string, error)
- type ExternalCommandFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTmpFile ¶
CreateTmpFile creates a temporary file on the disk with the given contents and returns the path to it and an error if something goes wrong.
func DownloadFile ¶
DownloadFile downloads the given url as a file with "name" under "directory"
func ExecToSuccessWithTimeout ¶
func ExecToSuccessWithTimeout(funk ExternalCommandFunc, timeout, interval time.Duration) (string, error)
ExecToSuccessWithTimeout retries the given function until it either succeeds of the timeout is reached. It retries every "interval" duration.
func ExtractFile ¶
ExtractFile creates a file in a temporary directory on disk from a file embedded with statik. It returns the path to the created file. Caller should make sure the file is deleted after usage (possibly with a defer).
func Kubectl ¶
Kubectl invoces the `kubectl` command in PATH, running the specified command. It returns the command output and/or error.
func KubectlApplyEmbeddedYaml ¶
KubectlApplyEmbeddedYaml un-embeds the given yaml file and calls `kubectl apply` on it. It returns the command output and an error (if there is one)
func KubectlDeleteEmbeddedYaml ¶
KubectlDeleteEmbeddedYaml un-embeds the given yaml file and calls `kubectl delete` on it. It returns the command output and an error (if there is one)
func OpenSSLSubjectHash ¶
OpenSSLSubjectHash return the subject_hash of the given CA certificate as returned by this command: openssl x509 -hash -noout https://www.openssl.org/docs/man1.0.2/man1/x509.html TODO: The way this function is implemented, it makes a system call to openssl thus making openssl a dependency. There must be a way to calculate the hash in Go so we don't need openssl.
func Untar ¶
Untar takes a path to a tar file and a destination path and untars the file to the destination