Documentation ¶
Overview ¶
Package tkg exports constants and functions to help evaluate the state of a TKG cluster.
Index ¶
- Constants
- Variables
- type CloudProvider
- type DiscoveryClient
- func (dc *DiscoveryClient) HasCloudProvider(ctx context.Context, cloudProvider CloudProvider) (bool, error)
- func (dc *DiscoveryClient) HasInfrastructureProvider(ctx context.Context, infraProvider InfrastructureProvider) (bool, error)
- func (dc *DiscoveryClient) HasNSX(ctx context.Context) (bool, error)
- func (dc *DiscoveryClient) HasTanzuKubernetesClusterV1alpha1(ctx context.Context) (bool, error)
- func (dc *DiscoveryClient) HasTanzuKubernetesReleaseV1alpha1(ctx context.Context) (bool, error)
- func (dc *DiscoveryClient) HasTanzuRunGroup(ctx context.Context, versions ...string) (bool, error)
- func (dc *DiscoveryClient) IsManagementCluster(ctx context.Context) (bool, error)
- func (dc *DiscoveryClient) IsTKGS(ctx context.Context) (bool, error)
- func (dc *DiscoveryClient) IsTKGm(ctx context.Context) (bool, error)
- func (dc *DiscoveryClient) IsWorkloadCluster(ctx context.Context) (bool, error)
- type InfrastructureProvider
Constants ¶
const ( // CloudProviderAWS is the AWS cloud provider. CloudProviderAWS = CloudProvider("aws") // CloudProviderAzure is the Azure cloud provider. CloudProviderAzure = CloudProvider("azure") // CloudProviderVsphere is the Vsphere cloud provider. CloudProviderVsphere = CloudProvider("vsphere") )
const ( // InfrastructureProviderAWS is the AWS infrastructure provider. InfrastructureProviderAWS = InfrastructureProvider("aws") // InfrastructureProviderAzure is the Azure infrastructure provider. InfrastructureProviderAzure = InfrastructureProvider("azure") // InfrastructureProviderVsphere is the Vsphere infrastructure provider. InfrastructureProviderVsphere = InfrastructureProvider("vsphere") )
Variables ¶
var Scheme = runtime.NewScheme()
Scheme is a scheme that knows about TKG resources that are used to determine capabilities.
Functions ¶
This section is empty.
Types ¶
type CloudProvider ¶
type CloudProvider string
CloudProvider represents the cloud provider of the cluster.
type DiscoveryClient ¶
type DiscoveryClient struct {
// contains filtered or unexported fields
}
DiscoveryClient allows clients to determine capabilities of a TKG cluster.
func NewDiscoveryClient ¶
func NewDiscoveryClient(c client.Client, clusterQueryClient *discovery.ClusterQueryClient) *DiscoveryClient
NewDiscoveryClient returns a DiscoveryClient for a controller-runtime Client and ClusterQueryClient.
func NewDiscoveryClientForConfig ¶
func NewDiscoveryClientForConfig(config *rest.Config) (*DiscoveryClient, error)
NewDiscoveryClientForConfig returns a DiscoveryClient for a rest.Config.
func (*DiscoveryClient) HasCloudProvider ¶
func (dc *DiscoveryClient) HasCloudProvider(ctx context.Context, cloudProvider CloudProvider) (bool, error)
HasCloudProvider checks if the cluster is configured with the given cloud provider.
func (*DiscoveryClient) HasInfrastructureProvider ¶
func (dc *DiscoveryClient) HasInfrastructureProvider(ctx context.Context, infraProvider InfrastructureProvider) (bool, error)
HasInfrastructureProvider checks the cluster's CAPI infrastructure provider.
func (*DiscoveryClient) HasNSX ¶
func (dc *DiscoveryClient) HasNSX(ctx context.Context) (bool, error)
HasNSX indicates if a cluster has NSX capabilities.
func (*DiscoveryClient) HasTanzuKubernetesClusterV1alpha1 ¶
func (dc *DiscoveryClient) HasTanzuKubernetesClusterV1alpha1(ctx context.Context) (bool, error)
HasTanzuKubernetesClusterV1alpha1 checks if the cluster has TanzuKubernetesCluster v1alpha1 resource.
func (*DiscoveryClient) HasTanzuKubernetesReleaseV1alpha1 ¶
func (dc *DiscoveryClient) HasTanzuKubernetesReleaseV1alpha1(ctx context.Context) (bool, error)
HasTanzuKubernetesReleaseV1alpha1 checks if the cluster has TanzuKubernetesRelease v1alpha1 resource.
func (*DiscoveryClient) HasTanzuRunGroup ¶
HasTanzuRunGroup checks if run.tanzu.vmware.com API group exists and optionally checks versions.
func (*DiscoveryClient) IsManagementCluster ¶
func (dc *DiscoveryClient) IsManagementCluster(ctx context.Context) (bool, error)
IsManagementCluster returns true if the cluster is a TKG management cluster.
func (*DiscoveryClient) IsTKGS ¶
func (dc *DiscoveryClient) IsTKGS(ctx context.Context) (bool, error)
IsTKGS returns true if the cluster is a TKGS cluster. Checks for the existence of any TKC API version.
func (*DiscoveryClient) IsTKGm ¶
func (dc *DiscoveryClient) IsTKGm(ctx context.Context) (bool, error)
IsTKGm returns true if the cluster is a TKGm cluster.
func (*DiscoveryClient) IsWorkloadCluster ¶
func (dc *DiscoveryClient) IsWorkloadCluster(ctx context.Context) (bool, error)
IsWorkloadCluster returns true if the cluster is a TKG workload cluster.
type InfrastructureProvider ¶
type InfrastructureProvider string
InfrastructureProvider represents the CAPI infrastructure provider of the cluster.