helpers

package
v0.0.0-...-a39b65d Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Timeout        = 30 * time.Minute
	CattleSystemNS = "cattle-system"
)

Variables

View Source
var (
	RancherPassword = os.Getenv("RANCHER_PASSWORD")
	RancherHostname = os.Getenv("RANCHER_HOSTNAME")
	RancherChannel  = func() string {
		if channel := os.Getenv("RANCHER_CHANNEL"); channel != "" {
			return channel
		} else {
			return "latest"
		}
	}()
	Provider = os.Getenv("PROVIDER")

	ClusterNamePrefix = func() string {
		if clusterCleanup {
			return fmt.Sprintf("%s-hp-ci", Provider)
		} else {
			return fmt.Sprintf("%s-%s-hp-ci", Provider, testuser.Username)
		}
	}()
	RancherVersion          = os.Getenv("RANCHER_VERSION")
	RancherUpgradeVersion   = os.Getenv("RANCHER_UPGRADE_VERSION")
	Kubeconfig              = os.Getenv("KUBECONFIG")
	K8sUpgradedMinorVersion = os.Getenv("K8S_UPGRADE_MINOR_VERSION")
)

Functions

func DeployRancherManager

func DeployRancherManager(fullVersion string, checkPods bool)

DeployRancherManager deploys Rancher. If checkPods is true, it waits until all the necessary pods are running fullVersion: devel/2.8, 2.8.2, 2.8.1-rc3

func GetAKSLocation

func GetAKSLocation() string

GetAKSLocation fetches the value of AKS Region; it first obtains the value from env var AKS_REGION, if the value is empty, it fetches the information from config file(cattle_config-import.yaml/cattle_config-provisioning.yaml) if none of the sources can provide a value, it returns the default value

func GetCommonMetadataLabels

func GetCommonMetadataLabels() map[string]string

GetCommonMetadataLabels returns a list of common metadata labels/tabs

func GetEKSRegion

func GetEKSRegion() string

GetEKSRegion fetches the value of EKS Region; it first obtains the value from env var EKS_REGION, if the value is empty, it fetches the information from config file(cattle_config-import.yaml/cattle_config-provisioning.yaml) if none of the sources can provide a value, it returns the default value

func GetGKEProjectID

func GetGKEProjectID() string

GetGKEProjectID returns the value of GKE project by fetching the value of env var GKE_PROJECT_ID

func GetGKEZone

func GetGKEZone() string

GetGKEZone fetches the value of GKE zone; it first obtains the value from env var GKE_ZONE, if the value is empty, it fetches the information from config file(cattle_config-import.yaml/cattle_config-provisioning.yaml) if none of the sources can provide a value, it returns the default value

func VersionCompare

func VersionCompare(latestVersion, oldVersion string) int

func WaitUntilClusterIsReady

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

WaitUntilClusterIsReady waits until the cluster is in a Ready state, fetch the cluster again once it's ready so that it has everything up to date and then return it. For e.g. once the cluster has been updated, it contains information such as Version.GitVersion which it does not have before it's ready

Types

type Context

type Context struct {
	CloudCred      *cloudcredentials.CloudCredential
	RancherClient  *rancher.Client
	Session        *session.Session
	ClusterCleanup bool
}

func CommonBeforeSuite

func CommonBeforeSuite(cloud string) (Context, error)

type HelmChart

type HelmChart struct {
	Name           string `json:"name"`
	Chart          string `json:"chart"`
	AppVersion     string `json:"app_version"`
	DerivedVersion string `json:"version"`
}

func ListOperatorChart

func ListOperatorChart() (operatorCharts []HelmChart)

type RancherVersionInfo

type RancherVersionInfo struct {
	Version      string
	GitCommit    string
	RancherPrime string
	Devel        bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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