Documentation ¶
Index ¶
- Constants
- func ApplyCAPIYaml(ctx context.Context, r runtimeclient.Client, yamlContent []byte) error
- func ApplyK8sVersionUpgrade(ctx context.Context, r runtimeclient.Client, capiYaml string, tkgMapKey string, ...) (string, error)
- func CheckRdeEntityNonExisted(ctx context.Context, client *vcdsdk.Client, rdeID, clusterName string) error
- func ConstructCAPVCDTestClient(ctx context.Context, vcdCluster *v1beta2.VCDCluster, ...) (*testingsdk.TestClient, error)
- func CreateAuthSecret(ctx context.Context, cs *kubernetes.Clientset, namespace string, ...) error
- func CreateCCMConfigMap(ctx context.Context, cs *kubernetes.Clientset, ...) error
- func CreateCSIConfigMap(ctx context.Context, cs *kubernetes.Clientset, ...) error
- func CreateClientConfig(kubeConfigBytes []byte) (*rest.Config, *kubernetes.Clientset, error)
- func CreateClusterIDSecret(ctx context.Context, cs *kubernetes.Clientset, namespace string, ...) error
- func CreateOrGetNameSpace(ctx context.Context, cs *kubernetes.Clientset, namespace string) error
- func CreateWorkloadClusterResources(ctx context.Context, workloadClientSet *kubernetes.Clientset, ...) error
- func DeleteCAPIYaml(ctx context.Context, r runtimeclient.Client, yamlContent []byte) error
- func GetClusterNameAndNamespaceFromCAPIYaml(yamlContent []byte) (string, string, error)
- func GetMapBySpecName(specMap map[string]interface{}, specName string, sectionName string) (map[string]interface{}, error)
- func GetSecret(_ context.Context, capiYaml string) (*corev1.Secret, error)
- func GetUserOrgAndName(_ context.Context, org, username string) (string, string)
- func GetVCDClusterFromCluster(ctx context.Context, client runtimeclient.Client, namespace string, ...) (*v1beta2.VCDCluster, error)
- func MonitorK8sNodePools(testClient *testingsdk.TestClient, runtimeClient runtimeclient.Client, ...) error
- func MonitorK8sUpgrade(testClient *testingsdk.TestClient, runtimeClient runtimeclient.Client, ...) error
- func NewTestClient(host, org, userOrg, vdcName, username, token, clusterId string, ...) (*testingsdk.TestClient, error)
- func ScaleNodePool(ctx context.Context, r runtimeclient.Client, desiredNodePoolSize int64, ...) error
- func UpgradeCluster(ctx context.Context, r runtimeclient.Client, ...) (string, error)
- func ValidateKubeConfig(ctx context.Context, kubeConfigBytes []byte) (*kubernetes.Clientset, error)
- func WaitForClusterDelete(ctx context.Context, client runtimeclient.Client, ...) error
- func WaitForClusterProvisioned(ctx context.Context, client runtimeclient.Client, ...) error
- func WaitForMachinesRunning(ctx context.Context, client runtimeclient.Client, ...) error
- type ConfigMapInput
Constants ¶
const ( CAPIObjectVersion = "v1beta1" CAPVCDObjectVersion = "v1beta2" FieldManager = "rdeProjector" )
const ( VCDCluster = "VCDCluster" MachineDeployment = "MachineDeployment" Cluster = "Cluster" KubeadmControlPlane = "KubeadmControlPlane" VCDMachineTemplate = "VCDMachineTemplate" SECRET = "Secret" )
Variables ¶
This section is empty.
Functions ¶
func ApplyCAPIYaml ¶
ApplyCAPIYaml applies the Kubernetes YAML content to create objects using the provided runtime client. It reads the YAML content, decodes each object, and creates them in the cluster using the runtime client. If an error occurs during decoding or creation, it returns the error.
func ApplyK8sVersionUpgrade ¶
func ApplyK8sVersionUpgrade(ctx context.Context, r runtimeclient.Client, capiYaml string, tkgMapKey string, tkgMap map[string]interface{}, vappTemplate *types.QueryResultVappTemplateType) (string, error)
ApplyK8sVersionUpgrade returns a new capiyaml with the target state that the cluster should have after upgrading to the specified TKG and Kubernetes version.
Parameters: - capiYaml: The cluster's current capiyaml. - tkgMapKey: The key to a specific upgrade path in tkg_map.json. - tkgMap: The tkg_map.json marshalled into a map[string]interface{}. - vappTemplate: The vApp Template that matches the specific upgrade path.
Returns: - string: The Kubernetes version that the cluster is being upgraded to. - error: nil if there is no error, otherwise the encountered error.
func ConstructCAPVCDTestClient ¶
func ConstructCAPVCDTestClient(ctx context.Context, vcdCluster *v1beta2.VCDCluster, workloadClientSet *kubernetes.Clientset, capiYaml, clusterNameSpace, clusterName, rdeId string, getVdcClient bool) (*testingsdk.TestClient, error)
func CreateAuthSecret ¶
func CreateCCMConfigMap ¶
func CreateCSIConfigMap ¶
func CreateClientConfig ¶
func CreateClusterIDSecret ¶
func CreateOrGetNameSpace ¶
func CreateWorkloadClusterResources ¶
func CreateWorkloadClusterResources(ctx context.Context, workloadClientSet *kubernetes.Clientset, capiYaml, rdeID string, vcdcluster *v1beta2.VCDCluster) error
func DeleteCAPIYaml ¶
func GetMapBySpecName ¶
func GetUserOrgAndName ¶
func GetVCDClusterFromCluster ¶
func GetVCDClusterFromCluster(ctx context.Context, client runtimeclient.Client, namespace string, name string) (*v1beta2.VCDCluster, error)
func MonitorK8sNodePools ¶
func MonitorK8sNodePools(testClient *testingsdk.TestClient, runtimeClient runtimeclient.Client, expectedWorkNodeCount int64) error
func MonitorK8sUpgrade ¶
func MonitorK8sUpgrade( testClient *testingsdk.TestClient, runtimeClient runtimeclient.Client, targetK8sVersion string, ) error
MonitorK8sUpgrade polls the current cluster, checking if all nodes have been upgraded to a specified k8s version and then if all machines have reached running phase. @param testClient - test client needed to access the cluster using common testing core @param runtimeClient - k8s client needed to check if machines have reached running phase @param targetK8sVersion - the specified k8s version that we are checking for the nodes to be upgraded to @return error - null if there is no error, the error otherwise
func NewTestClient ¶
func NewTestClient(host, org, userOrg, vdcName, username, token, clusterId string, getVdcClient bool) (*testingsdk.TestClient, error)
func ScaleNodePool ¶
func UpgradeCluster ¶
func UpgradeCluster(ctx context.Context, r runtimeclient.Client, capiYaml, currK8sVersion, targetK8sVersion, targetTkgVersion string, tkgMap map[string]interface{}, allVappTemplates []*types.QueryResultVappTemplateType) (string, error)
UpgradeCluster performs all the necessary steps and calls the required functions to upgrade the current cluster. It takes the following parameters: - ctx: the context for the operation - r: the runtime client used to access the cluster using common testing core - capiYaml: the current capiyaml - currK8sVersion: the cluster's current Kubernetes version - targetK8sVersion: the target Kubernetes version for the upgrade - targetTkgVersion: the target Tanzu Kubernetes Grid (TKG) version for the upgrade - tkgMap: tkg_map.json marshalled into map[string]interface{} - allVappTemplates: a list of vApp Templates installed in each catalog in the current organization
The function returns the following values: - string: the updated capiyaml (for stringing operations, if necessary) - error: nil if there is no error, otherwise the encountered error