Initial v1.0.0 commit

This commit is contained in:
Jakub Vavřík
2021-01-28 17:37:47 +01:00
commit 1481d27782
4164 changed files with 1264675 additions and 0 deletions

24
pkg/controller/utils.go Normal file
View File

@@ -0,0 +1,24 @@
package controller
import (
"io/ioutil"
"os"
)
func writeKubeconfigToTempFile(kubeconfig []byte) (path string, error error) {
tmpFile, err := ioutil.TempFile(os.TempDir(), "kubeconfig-")
if err != nil {
return "", err
}
if _, err = tmpFile.Write(kubeconfig); err != nil {
return "", err
}
// Close the file
if err := tmpFile.Close(); err != nil {
return "", err
}
return tmpFile.Name(), nil
}