Documentation
¶
Index ¶
- type KubeClient
- func (kc *KubeClient) CreateMultiClusterService(ctx context.Context, multiClusterService *unstructured.Unstructured) func() error
- func (kc *KubeClient) GetAzureASOManagedCluster(ctx context.Context, name string) (*unstructured.Unstructured, error)
- func (kc *KubeClient) GetAzureASOManagedControlPlane(ctx context.Context, name string) (*unstructured.Unstructured, error)
- func (kc *KubeClient) GetCluster(ctx context.Context, clusterName string) (*unstructured.Unstructured, error)
- func (kc *KubeClient) GetDynamicClient(gvr schema.GroupVersionResource, namespaced bool) dynamic.ResourceInterface
- func (kc *KubeClient) GetGCPManagedCluster(ctx context.Context, name string) (*unstructured.Unstructured, error)
- func (kc *KubeClient) GetGCPManagedControlPlanes(ctx context.Context, name string) ([]unstructured.Unstructured, error)
- func (kc *KubeClient) GetKubeconfigSecretData(ctx context.Context, clusterName string) ([]byte, error)
- func (kc *KubeClient) GetMultiClusterService(ctx context.Context, name string) (*unstructured.Unstructured, error)
- func (kc *KubeClient) GetSveltosCluster(ctx context.Context, name string) (*unstructured.Unstructured, error)
- func (kc *KubeClient) ListAWSManagedControlPlanes(ctx context.Context, clusterName string) ([]unstructured.Unstructured, error)
- func (kc *KubeClient) ListAzureASOManagedMachinePools(ctx context.Context, clusterName string) ([]unstructured.Unstructured, error)
- func (kc *KubeClient) ListClusterTemplates(ctx context.Context) ([]unstructured.Unstructured, error)
- func (kc *KubeClient) ListGCPManagedMachinePools(ctx context.Context, clusterName string) ([]unstructured.Unstructured, error)
- func (kc *KubeClient) ListK0sControlPlanes(ctx context.Context, clusterName string) ([]unstructured.Unstructured, error)
- func (kc *KubeClient) ListK0smotronControlPlanes(ctx context.Context, clusterName string) ([]unstructured.Unstructured, error)
- func (kc *KubeClient) ListMachineDeployments(ctx context.Context, clusterName string) ([]unstructured.Unstructured, error)
- func (kc *KubeClient) ListMachines(ctx context.Context, clusterName string) ([]unstructured.Unstructured, error)
- func (kc *KubeClient) ListRemoteMachines(ctx context.Context, clusterName string) ([]unstructured.Unstructured, error)
- func (kc *KubeClient) NewFromCluster(ctx context.Context, namespace, clusterName string) *KubeClient
- func (kc *KubeClient) WriteKubeconfig(ctx context.Context, clusterName string) (path, b64Raw string, cleanup func() error, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KubeClient ¶
type KubeClient struct {
Client kubernetes.Interface
CrClient crclient.Client
ExtendedClient apiextensionsclientset.Interface
Config *rest.Config
Namespace string
}
func NewFromLocal ¶
func NewFromLocal(namespace string) *KubeClient
NewFromLocal creates a new instance of KubeClient from a given namespace using the locally found kubeconfig.
func (*KubeClient) CreateMultiClusterService ¶ added in v0.1.0
func (kc *KubeClient) CreateMultiClusterService( ctx context.Context, multiClusterService *unstructured.Unstructured, ) func() error
func (*KubeClient) GetAzureASOManagedCluster ¶ added in v0.2.0
func (kc *KubeClient) GetAzureASOManagedCluster(ctx context.Context, name string) (*unstructured.Unstructured, error)
GetAzureASOManagedCluster returns an AzureASOManagedCluster resource by name.
func (*KubeClient) GetAzureASOManagedControlPlane ¶ added in v0.2.0
func (kc *KubeClient) GetAzureASOManagedControlPlane(ctx context.Context, name string) (*unstructured.Unstructured, error)
GetAzureASOManagedControlPlane returns an AzureASOManagedControlPlane resource by name.
func (*KubeClient) GetCluster ¶
func (kc *KubeClient) GetCluster(ctx context.Context, clusterName string) (*unstructured.Unstructured, error)
GetCluster returns a Cluster resource by name.
func (*KubeClient) GetDynamicClient ¶
func (kc *KubeClient) GetDynamicClient(gvr schema.GroupVersionResource, namespaced bool) dynamic.ResourceInterface
GetDynamicClient returns a dynamic client for the given GroupVersionResource.
func (*KubeClient) GetGCPManagedCluster ¶ added in v0.3.0
func (kc *KubeClient) GetGCPManagedCluster(ctx context.Context, name string) (*unstructured.Unstructured, error)
GetGCPManagedCluster returns GCPManagedCluster resource by name.
func (*KubeClient) GetGCPManagedControlPlanes ¶ added in v0.3.0
func (kc *KubeClient) GetGCPManagedControlPlanes(ctx context.Context, name string) ([]unstructured.Unstructured, error)
GetGCPManagedControlPlanes returns an GCPManagedControlPlane resource by name.
func (*KubeClient) GetKubeconfigSecretData ¶ added in v0.1.0
func (*KubeClient) GetMultiClusterService ¶ added in v1.4.0
func (kc *KubeClient) GetMultiClusterService(ctx context.Context, name string) (*unstructured.Unstructured, error)
func (*KubeClient) GetSveltosCluster ¶ added in v0.1.0
func (kc *KubeClient) GetSveltosCluster(ctx context.Context, name string) (*unstructured.Unstructured, error)
func (*KubeClient) ListAWSManagedControlPlanes ¶ added in v0.1.0
func (kc *KubeClient) ListAWSManagedControlPlanes( ctx context.Context, clusterName string, ) ([]unstructured.Unstructured, error)
func (*KubeClient) ListAzureASOManagedMachinePools ¶ added in v0.2.0
func (kc *KubeClient) ListAzureASOManagedMachinePools( ctx context.Context, clusterName string, ) ([]unstructured.Unstructured, error)
func (*KubeClient) ListClusterTemplates ¶ added in v0.1.0
func (kc *KubeClient) ListClusterTemplates(ctx context.Context) ([]unstructured.Unstructured, error)
func (*KubeClient) ListGCPManagedMachinePools ¶ added in v0.3.0
func (kc *KubeClient) ListGCPManagedMachinePools( ctx context.Context, clusterName string, ) ([]unstructured.Unstructured, error)
func (*KubeClient) ListK0sControlPlanes ¶
func (kc *KubeClient) ListK0sControlPlanes( ctx context.Context, clusterName string, ) ([]unstructured.Unstructured, error)
func (*KubeClient) ListK0smotronControlPlanes ¶ added in v0.2.0
func (kc *KubeClient) ListK0smotronControlPlanes( ctx context.Context, clusterName string, ) ([]unstructured.Unstructured, error)
func (*KubeClient) ListMachineDeployments ¶
func (kc *KubeClient) ListMachineDeployments( ctx context.Context, clusterName string, ) ([]unstructured.Unstructured, error)
ListMachineDeployments returns a list of MachineDeployment resources for the given cluster.
func (*KubeClient) ListMachines ¶
func (kc *KubeClient) ListMachines(ctx context.Context, clusterName string) ([]unstructured.Unstructured, error)
ListMachines returns a list of Machine resources for the given cluster.
func (*KubeClient) ListRemoteMachines ¶ added in v0.2.0
func (kc *KubeClient) ListRemoteMachines(ctx context.Context, clusterName string) ([]unstructured.Unstructured, error)
ListRemoteMachines returns a list of RemoteMachine resources for the given cluster.
func (*KubeClient) NewFromCluster ¶
func (kc *KubeClient) NewFromCluster(ctx context.Context, namespace, clusterName string) *KubeClient
NewFromCluster creates a new KubeClient using the kubeconfig stored in the secret affiliated with the given clusterName. Since it relies on fetching the kubeconfig from secret it needs an existing kubeclient.
func (*KubeClient) WriteKubeconfig ¶
func (kc *KubeClient) WriteKubeconfig(ctx context.Context, clusterName string) (path, b64Raw string, cleanup func() error, err error)
WriteKubeconfig writes the kubeconfig for the given clusterName to the test/e2e directory returning the path to the file and a function to delete it later.