helper

package
v0.0.0-...-df9e5e2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNodePool

func AddNodePool(cluster *management.Cluster, client *rancher.Client, increaseBy int, imageType string, wait, checkClusterConfig bool) (*management.Cluster, error)

AddNodePool adds a nodepool to the list; it uses the nodepool template defined in CATTLE_TEST_CONFIG file if wait is set to true, it waits until the update is complete; if checkClusterConfig is true, it validates the update TODO(pvala): Enhance this method to accept a nodepool with different configuration

func AddNodePoolOnGCloud

func AddNodePoolOnGCloud(clusterName, zone, project, npName string, extraArgs ...string) error

AddNodePoolOnGCloud adds a nodepool to the GKE cluster via gcloud CLI

func ClusterExistsOnGCloud

func ClusterExistsOnGCloud(clusterName, project, zone string) (bool, error)

ClusterExistsOnGCloud gets a list of cluster based on the name filter and returns true if the cluster is in RUNNING or PROVISIONING state; it returns false if the cluster does not exist or is in STOPPING state.

func CreateGKEClusterOnGCloud

func CreateGKEClusterOnGCloud(zone string, clusterName string, project string, k8sVersion string, extraArgs ...string) error

Create Google GKE cluster using gcloud CLI

func CreateGKEHostedCluster

func CreateGKEHostedCluster(client *rancher.Client, displayName, cloudCredentialID, k8sVersion, zone, region, project string, updateFunc func(clusterConfig *gke.ClusterConfig)) (*management.Cluster, error)

CreateGKEHostedCluster creates the GKE cluster

func DeleteGKEClusterOnGCloud

func DeleteGKEClusterOnGCloud(zone, project, clusterName string) error

Complete cleanup steps for Google GKE

func DeleteGKEHostCluster

func DeleteGKEHostCluster(cluster *management.Cluster, client *rancher.Client) error

DeleteGKEHostCluster deletes the GKE cluster

func DeleteNodePool

func DeleteNodePool(cluster *management.Cluster, client *rancher.Client, wait, checkClusterConfig bool) (*management.Cluster, error)

DeleteNodePool deletes a nodepool from the list if wait is set to true, it waits until the update is complete; if checkClusterConfig is true, it validates the update TODO: Modify this method to delete a custom qty of nodepool, perhaps by adding an `decreaseBy int` arg

func DeleteNodePoolOnGCloud

func DeleteNodePoolOnGCloud(zone, project, clusterName, poolName string) error

DeleteNodePoolOnGCloud deletes a node pool to GKE using gcloud cli

func GetK8sVersion

func GetK8sVersion(client *rancher.Client, projectID, cloudCredentialID, zone, region string, forUpgrade bool) (string, error)

GetK8sVersion returns the k8s version to be used by the test; this value can either be a variant of envvar DOWNSTREAM_K8S_MINOR_VERSION or the highest available version or second-highest minor version in case of upgrade scenarios

func GetK8sVersionVariantGKE

func GetK8sVersionVariantGKE(minorVersion string, client *rancher.Client, projectID, cloudCrendetialID, zone, region string) (string, error)

GetK8sVersionVariantGKE returns a variant of a given minor K8s version

func ImportGKEHostedCluster

func ImportGKEHostedCluster(client *rancher.Client, displayName, cloudCredentialID, zone, project string) (*management.Cluster, error)

ImportGKEHostedCluster imports the GKE cluster

func ListGKEAvailableVersions

func ListGKEAvailableVersions(client *rancher.Client, clusterID string) ([]string, error)

ListGKEAvailableVersions is a function to list and return only available GKE versions for a specific cluster.

func ListSingleVariantGKEAvailableVersions

func ListSingleVariantGKEAvailableVersions(client *rancher.Client, projectID, cloudCredentialID, zone, region string) (availableVersions []string, err error)

ListSingleVariantGKEAvailableVersions returns a list of single variants of minor versions For e.g 1.27.5-gke.1700, 1.26.6-gke.2100, 1.25.8-gke.200

func ScaleNodePool

func ScaleNodePool(cluster *management.Cluster, client *rancher.Client, nodeCount int64, wait, checkClusterConfig bool) (*management.Cluster, error)

ScaleNodePool modifies the number of initialNodeCount of all the nodepools as defined by nodeCount if wait is set to true, it waits until the update is complete; if checkClusterConfig is true, it validates the update

func UpdateAutoScaling

func UpdateAutoScaling(cluster *management.Cluster, client *rancher.Client, enabled, wait, checkClusterConfig bool) (*management.Cluster, error)

UpdateAutoScaling updates the management.GKENodePoolAutoscaling for all the node pools of a GKE cluster if wait is set to true, it waits until the update is complete; if checkClusterConfig is true, it validates the update TODO: Facilitate passing minCount and maxCount values when autoscaling is enabled.

func UpdateCluster

func UpdateCluster(cluster *management.Cluster, client *rancher.Client, updateFunc func(*management.Cluster)) (*management.Cluster, error)

UpdateCluster is a generic function to update a cluster

func UpdateMonitoringAndLoggingService

func UpdateMonitoringAndLoggingService(cluster *management.Cluster, client *rancher.Client, monitoringService, loggingService string, wait, checkClusterConfig bool) (*management.Cluster, error)

UpdateMonitoringAndLoggingService updates the monitoring and loggingService of a GKE cluster if wait is set to true, it waits until the update is complete; if checkClusterConfig is true, it validates the update

func UpgradeGKEClusterOnGCloud

func UpgradeGKEClusterOnGCloud(zone, clusterName, project, k8sVersion string, upgradeNodePool bool, nodePoolName string, exrtaArgs ...string) error

UpgradeGKEClusterOnGCloud upgrades the k8s version of a given GKE cluster; if upgradeNodePool is true, it only upgrades the nodepool version

func UpgradeKubernetesVersion

func UpgradeKubernetesVersion(cluster *management.Cluster, upgradeToVersion string, client *rancher.Client, upgradeNodePool, wait, checkClusterConfig bool) (*management.Cluster, error)

UpgradeKubernetesVersion upgrades the k8s version to the value defined by upgradeToVersion; if upgradeNodePool is true, it also upgrades nodepool k8s version; if wait is set to true, it waits until the update is complete; if checkClusterConfig is true, it validates the update

func UpgradeNodeKubernetesVersion

func UpgradeNodeKubernetesVersion(cluster *management.Cluster, upgradeToVersion string, client *rancher.Client, wait, checkClusterConfig bool) (*management.Cluster, error)

UpgradeNodeKubernetesVersion upgrades the k8s version of nodepool to the value defined by upgradeToVersion; if wait is set to true, it will wait until the cluster finishes upgrading; if checkClusterConfig is set to true, it will validate that nodepool has been upgraded successfully

Types

This section is empty.

Jump to

Keyboard shortcuts

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