Documentation ¶
Index ¶
- Constants
- func BlueprintDirectoryPath(componentPath string) string
- func BlueprintFilePath(componentPath string) string
- func BuildKubeClientFromConfigOrCurrentClusterContext(kubeconfig string, scheme *runtime.Scheme) (client.Client, string, error)
- func BuildKubernetesClusterTarget(name, namespace, kubeconfigPath string) (*lsv1alpha1.Target, error)
- func CheckAndWaitUntilAllPodsAreReady(k8sClient client.Client, namespace string, sleepTime time.Duration, ...) (bool, error)
- func CheckAndWaitUntilLandscaperInstallationSucceeded(k8sClient client.Client, key types.NamespacedName, sleepTime time.Duration, ...) (bool, error)
- func CheckAndWaitUntilNoInstallationsInNamespaceExists(k8sClient client.Client, namespace string, sleepTime time.Duration, ...) (bool, error)
- func CheckAndWaitUntilObjectNotExistAnymore(k8sClient client.Client, objKey types.NamespacedName, obj client.Object, ...) (bool, error)
- func CheckConditionPeriodically(conditionFunc func() (bool, error), sleepTime time.Duration, maxRetries int) (bool, error)
- func ComponentDescriptorFilePath(componentPath string) string
- func DeleteNamespace(k8sClient client.Client, namespace string, sleepTime time.Duration, ...) error
- func ExecCommandBlocking(command string) error
- func ExecCommandNonBlocking(command string, resultCh chan<- CmdResult) (*exec.Cmd, error)
- func ExecutionFileName(executionName string) string
- func ExecutionFilePath(componentPath, executionName string) string
- func FindNodeByPath(node *yamlv3.Node, path string) (*yamlv3.Node, *yamlv3.Node)
- func GetBlueprintResource(cd *cdv2.ComponentDescriptor, blueprintResourceName string) (*cdv2.Resource, error)
- func GetK8sClientFromCurrentConfiguredCluster() (client.Client, string, error)
- func IsDirectoryEmpty(path string) (bool, error)
- func MarshalYaml(node *yamlv3.Node) ([]byte, error)
- func ResourcesFilePath(componentPath string) string
- type CmdResult
Constants ¶
const ( // LogLevelDebug : Log level constants for debug level. Larger numbers represent less important logs. LogLevelDebug = 1 // LogLevelWarning : Log level constants for warning level. Larger numbers represent less important logs. LogLevelWarning = -1 )
const ( BlueprintDirectoryName = "blueprint" BlueprintFileName = v1alpha1.BlueprintFileName ComponentDescriptorFileName = "component-descriptor.yaml" ResourcesFileName = "resources.yaml" )
Variables ¶
This section is empty.
Functions ¶
func BlueprintDirectoryPath ¶
func BlueprintFilePath ¶
func BuildKubeClientFromConfigOrCurrentClusterContext ¶ added in v0.17.0
func BuildKubernetesClusterTarget ¶
func BuildKubernetesClusterTarget(name, namespace, kubeconfigPath string) (*lsv1alpha1.Target, error)
func CheckAndWaitUntilAllPodsAreReady ¶
func CheckAndWaitUntilAllPodsAreReady(k8sClient client.Client, namespace string, sleepTime time.Duration, maxRetries int) (bool, error)
CheckAndWaitUntilAllPodsAreReady checks and wait until all pods have the ready condition set to true. Returns an error on failure or if timeout (sleepTime and maxRetries is reached). Returns a boolean indicating if all pods have the ready condition true on return.
func CheckAndWaitUntilLandscaperInstallationSucceeded ¶
func CheckAndWaitUntilLandscaperInstallationSucceeded(k8sClient client.Client, key types.NamespacedName, sleepTime time.Duration, maxRetries int) (bool, error)
CheckAndWaitUntilLandscaperInstallationSucceeded checks and wait until the installation is on status succeeded. Returns an error on failure or if timeout (sleepTime and maxRetries is reached). Returns a boolean indicating if the installation succeeded.
func CheckAndWaitUntilNoInstallationsInNamespaceExists ¶
func CheckAndWaitUntilNoInstallationsInNamespaceExists(k8sClient client.Client, namespace string, sleepTime time.Duration, maxRetries int) (bool, error)
CheckAndWaitUntilNoInstallationsInNamespaceExists periodically checks and wait until no installation in the namespace remains. Returns an error on failure or if timeout (sleepTime and maxRetries is reached). Returns a boolean indicating if no installations remains on return.
func CheckAndWaitUntilObjectNotExistAnymore ¶
func CheckAndWaitUntilObjectNotExistAnymore(k8sClient client.Client, objKey types.NamespacedName, obj client.Object, sleepTime time.Duration, maxRetries int) (bool, error)
CheckAndWaitUntilObjectNotExistAnymore periodically checks and wait until the object does not exist anymore. Returns an error on failure or if timeout (sleepTime and maxRetries is reached). Returns a boolean indicating if the object remains on return.
func CheckConditionPeriodically ¶
func CheckConditionPeriodically(conditionFunc func() (bool, error), sleepTime time.Duration, maxRetries int) (bool, error)
CheckConditionPeriodically checks the success of a function peridically. Returns timeout(bool) to indicate the success of the function and propagates possible errors of the function.
func DeleteNamespace ¶
func DeleteNamespace(k8sClient client.Client, namespace string, sleepTime time.Duration, maxRetries int) error
DeleteNamespace deletes a namespace (if it exists). First, a graceful delete will be tried with a timeout. On timeout, the namespace will be deleted forcefully by removing the finalizers on the Landscaper CRs.
func ExecCommandBlocking ¶
ExecCommandBlocking executes a command and wait for its completion.
func ExecCommandNonBlocking ¶
ExecCommandNonBlocking executes a command without without blocking. Returns a Cmd that can be used to stop the command. When the command has stopped or failed, the result is written into the channel resultCh.
func ExecutionFileName ¶
func ExecutionFilePath ¶
func FindNodeByPath ¶
func GetBlueprintResource ¶ added in v0.3.0
func GetK8sClientFromCurrentConfiguredCluster ¶ added in v0.4.0
GetK8sClientFromCurrentConfiguredCluster returns a k8sClient and a namespace from the current context of the kubectl program.