utils

package
v0.0.0-...-723a762 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyManifestsFile

func ApplyManifestsFile(dynamicClient dynamic.Interface, manifestFile string) error

ApplyManifestsFile applies all manifests in a provided file

func GetCAPIClusterNameAndContext

func GetCAPIClusterNameAndContext(data ClusterNameData) (string, string, error)

GetCAPIClusterCtxName generates a CAPI cluster context name using a template and data.

func ListAllNamespacesWithPrefix

func ListAllNamespacesWithPrefix(k8sClient *kubernetes.Clientset, prefix string) ([]string, error)

ListAllNamespaces lists all namespaces in the cluster if prefix is provided only namespace with this prefix are returned

func MergeKubeconfigs

func MergeKubeconfigs(srcKubeconfig, dstKubeconfigPath string) error

mergeKubeconfigs merges the content of srcKubeconfig into dstKubeconfigPath. srcKubeconfig is a kubeconfig file in a string form dstKubeconfigPath is the path to the destination kubeconfig file, which already contains other content. TODO - this should not be a ClusterAPI method

func RepoRoot

func RepoRoot() string

func ResourcesExist

func ResourcesExist(restConfig *rest.Config, namespace string, resourceName string, gvr schema.GroupVersionResource) (bool, error)

func WaitAllResourcesReady

func WaitAllResourcesReady(clusterAuth k8sclient.ClusterAuthInfo, namespaces []string, gvr []schema.GroupVersionResource) error

WaitAllResourcesReady waits for all specified resources to be ready in the given namespaces. If namespaces array is empty the function returns immediatelly

func WaitForCRDs

func WaitForCRDs(config *rest.Config, crds []string) error

Types

type ClusterNameData

type ClusterNameData struct {
	Name string
}

Jump to

Keyboard shortcuts

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