Documentation ¶
Index ¶
- func CreateKubeconfig(logger logr.Logger, kubeconfigContent []byte) (string, error)
- func GetCAPIKubernetesClient(ctx context.Context, logger logr.Logger, c client.Client, s *runtime.Scheme, ...) (client.Client, error)
- func GetCAPIKubernetesRestConfig(ctx context.Context, logger logr.Logger, c client.Client, ...) (*rest.Config, error)
- func GetCAPISecretData(ctx context.Context, logger logr.Logger, c client.Client, ...) ([]byte, error)
- func GetCluster(ctx context.Context, c client.Client, clusterNamespace, clusterName string, ...) (client.Object, error)
- func GetClusterType(cluster *corev1.ObjectReference) libsveltosv1alpha1.ClusterType
- func GetKubernetesClient(ctx context.Context, c client.Client, ...) (client.Client, error)
- func GetKubernetesRestConfig(ctx context.Context, c client.Client, ...) (*rest.Config, error)
- func GetListOfClusters(ctx context.Context, c client.Client, namespace string, logger logr.Logger) ([]corev1.ObjectReference, error)
- func GetListOfClustersForShardKey(ctx context.Context, c client.Client, namespace, shard string, ...) ([]corev1.ObjectReference, error)
- func GetMachinesForCluster(ctx context.Context, c client.Client, cluster *corev1.ObjectReference, ...) (*clusterv1.MachineList, error)
- func GetMatchingClusters(ctx context.Context, c client.Client, selector labels.Selector, ...) ([]corev1.ObjectReference, error)
- func GetSecretData(ctx context.Context, c client.Client, ...) ([]byte, error)
- func GetSveltosKubernetesClient(ctx context.Context, logger logr.Logger, c client.Client, s *runtime.Scheme, ...) (client.Client, error)
- func GetSveltosKubernetesRestConfig(ctx context.Context, logger logr.Logger, c client.Client, ...) (*rest.Config, error)
- func GetSveltosSecretData(ctx context.Context, logger logr.Logger, c client.Client, ...) ([]byte, error)
- func IsClusterPaused(ctx context.Context, c client.Client, clusterNamespace, clusterName string, ...) (bool, error)
- func IsClusterReadyToBeConfigured(ctx context.Context, c client.Client, cluster *corev1.ObjectReference, ...) (bool, error)
- func UpdateSveltosSecretData(ctx context.Context, logger logr.Logger, c client.Client, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateKubeconfig ¶
CreateKubeconfig creates a temporary file with the Kubeconfig to access CAPI cluster
func GetCAPIKubernetesClient ¶ added in v0.3.0
func GetCAPIKubernetesClient(ctx context.Context, logger logr.Logger, c client.Client, s *runtime.Scheme, clusterNamespace, clusterName string) (client.Client, error)
GetCAPIKubernetesClient returns a client to access CAPI Cluster clusterNamespace/clusterName c is the client to access management cluster
func GetCAPIKubernetesRestConfig ¶ added in v0.3.0
func GetCAPIKubernetesRestConfig(ctx context.Context, logger logr.Logger, c client.Client, clusterNamespace, clusterName string) (*rest.Config, error)
GetCAPIKubernetesRestConfig returns rest.Config for a CAPI Cluster clusterNamespace/clusterName c is the client to access management cluster
func GetCAPISecretData ¶ added in v0.3.0
func GetCAPISecretData(ctx context.Context, logger logr.Logger, c client.Client, clusterNamespace, clusterName string) ([]byte, error)
GetCAPISecretData verifies Cluster exists and returns the content of secret containing the kubeconfig for CAPI cluster
func GetCluster ¶ added in v0.7.0
func GetCluster(ctx context.Context, c client.Client, clusterNamespace, clusterName string, clusterType libsveltosv1alpha1.ClusterType) (client.Object, error)
getCluster returns the cluster object
func GetClusterType ¶ added in v0.7.0
func GetClusterType(cluster *corev1.ObjectReference) libsveltosv1alpha1.ClusterType
GetClusterType returns clustertype for a given cluster
func GetKubernetesClient ¶
func GetKubernetesClient(ctx context.Context, c client.Client, clusterNamespace, clusterName, adminNamespace, adminName string, clusterType libsveltosv1alpha1.ClusterType, logger logr.Logger) (client.Client, error)
GetKubernetesClient returns client to access cluster
func GetKubernetesRestConfig ¶
func GetKubernetesRestConfig(ctx context.Context, c client.Client, clusterNamespace, clusterName, adminNamespace, adminName string, clusterType libsveltosv1alpha1.ClusterType, logger logr.Logger) (*rest.Config, error)
GetKubernetesRestConfig returns restConfig for a cluster
func GetListOfClusters ¶ added in v0.7.0
func GetListOfClusters(ctx context.Context, c client.Client, namespace string, logger logr.Logger, ) ([]corev1.ObjectReference, error)
GetListOfClusters returns all existing Sveltos/CAPI Clusters. If namespace is not empty, only existing clusters in that namespace will be returned.
func GetListOfClustersForShardKey ¶ added in v0.19.0
func GetListOfClustersForShardKey(ctx context.Context, c client.Client, namespace, shard string, logger logr.Logger) ([]corev1.ObjectReference, error)
GetListOfClustersForShardKey returns all existing Sveltos/CAPI Clusters for a given shard If namespace is not empty, clusters will be further filtered by namespace.
func GetMachinesForCluster ¶
func GetMachinesForCluster( ctx context.Context, c client.Client, cluster *corev1.ObjectReference, logger logr.Logger, ) (*clusterv1.MachineList, error)
GetMachinesForCluster find all Machines for a given CAPI Cluster.
func GetMatchingClusters ¶ added in v0.7.0
func GetMatchingClusters(ctx context.Context, c client.Client, selector labels.Selector, namespace string, logger logr.Logger) ([]corev1.ObjectReference, error)
GetMatchingClusters returns all Sveltos/CAPI Clusters currently matching selector
func GetSecretData ¶
func GetSecretData(ctx context.Context, c client.Client, clusterNamespace, clusterName, adminNamespace, adminName string, clusterType libsveltosv1alpha1.ClusterType, logger logr.Logger) ([]byte, error)
GetSecretData returns Kubeconfig to access cluster
func GetSveltosKubernetesClient ¶ added in v0.3.0
func GetSveltosKubernetesClient(ctx context.Context, logger logr.Logger, c client.Client, s *runtime.Scheme, clusterNamespace, clusterName string) (client.Client, error)
GetSveltosKubernetesClient returns a client to access Sveltos Cluster clusterNamespace/clusterName c is the client to access management cluster
func GetSveltosKubernetesRestConfig ¶ added in v0.3.0
func GetSveltosKubernetesRestConfig(ctx context.Context, logger logr.Logger, c client.Client, clusterNamespace, clusterName string) (*rest.Config, error)
GetSveltosKubernetesRestConfig returns rest.Config for a Sveltos Cluster clusterNamespace/clusterName c is the client to access management cluster
func GetSveltosSecretData ¶ added in v0.3.0
func GetSveltosSecretData(ctx context.Context, logger logr.Logger, c client.Client, clusterNamespace, clusterName string) ([]byte, error)
GetSveltosSecretData verifies Cluster exists and returns the content of secret containing the kubeconfig for Sveltos cluster
func IsClusterPaused ¶ added in v0.7.0
func IsClusterPaused(ctx context.Context, c client.Client, clusterNamespace, clusterName string, clusterType libsveltosv1alpha1.ClusterType) (bool, error)
IsClusterPaused returns true if cluster is currently paused
Types ¶
This section is empty.