Documentation
¶
Index ¶
- func CreateIntermediateDirsForFile(filePath string) error
- func EnsureRuntimeDependencyInstalled(_ context.Context, name string) error
- func FetchJSON(url string, dest any) error
- func FetchURLBytes(url string) ([]byte, error)
- func GetClusterDir() string
- func GetDownloadedStorageBucketContentsDir(bucketName string) string
- func GetKubeAidConfigDir() string
- func GetKubeAidDir() string
- func GetParentDirPath(filePath string) string
- func InitTempDir(ctx context.Context) error
- func IsCGroupV2() bool
- func MoveFile(src, dst string) (err error)
- func MustGetEnv(name string) string
- func MustSetEnv(name, value string)
- func ToAbsolutePath(p string) (string, error)
- func WithRetry(delay time.Duration, attempts uint8, fn func() error) error
- func WrapError(contextualErrorMessage string, err error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateIntermediateDirsForFile ¶
CreateIntermediateDirsForFile creates intermediate directories which don't exist for the given file path.
func EnsureRuntimeDependencyInstalled ¶ added in v0.12.2
Returns an error if the given runtime dependency / executable isn't found in PATH.
func FetchJSON ¶ added in v0.23.0
FetchJSON performs an HTTP GET and decodes the JSON response into the provided destination.
func FetchURLBytes ¶ added in v0.23.0
fetchURLBytes performs an HTTP GET and returns the raw response body bytes.
func GetClusterDir ¶
func GetClusterDir() string
Returns path to the directory containing cluster specific config, in the KubeAid Config dir.
func GetDownloadedStorageBucketContentsDir ¶
Returns the path to the local temp directory, where contents of the given blob storage bucket will be / is downloaded.
func GetKubeAidConfigDir ¶
func GetKubeAidConfigDir() string
Returns path to the directory where the KubeAid Config repository is cloned.
func GetKubeAidDir ¶
func GetKubeAidDir() string
Returns path to the directory where the KubeAid repository is cloned.
func GetParentDirPath ¶
Returns path to the parent dir of the given file.
func InitTempDir ¶
InitTempDir creates the temp dir where KubeAid Bootstrap Script will clone repos. If the dir already exists it is reused.
func IsCGroupV2 ¶ added in v0.21.0
func IsCGroupV2() bool
Returns whether the CGroup version on the host machine is 2.
func MoveFile ¶ added in v0.23.0
MoveFile moves the source file to the destination file. It first tries os.Rename (atomic on the same filesystem); on failure it falls back to copy + delete, which works across filesystems too.
func MustGetEnv ¶ added in v0.12.0
Returns value of the given environment variable. Panics if the environment variable isn't found.
func MustSetEnv ¶ added in v0.8.0
func MustSetEnv(name, value string)
Sets value of the given environment variable. Panics on error.
func ToAbsolutePath ¶ added in v0.8.0
ToAbsolutePath returns the canonical version of the given path. A bare "~" or a "~/" prefix is expanded to the user's home directory. REFER : https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package giturl is a tiny, dependency-free predicate package for classifying Git remote URL forms (HTTP(s) vs SSH).
|
Package giturl is a tiny, dependency-free predicate package for classifying Git remote URL forms (HTTP(s) vs SSH). |
|
Package randval generates random secret values used across kubeaid-cli — alphanumeric passwords for OIDC client secrets and Keycloak admin credentials, plus base64-encoded byte keys for symmetric crypto (e.g.
|
Package randval generates random secret values used across kubeaid-cli — alphanumeric passwords for OIDC client secrets and Keycloak admin credentials, plus base64-encoded byte keys for symmetric crypto (e.g. |