Documentation ¶
Index ¶
- Constants
- Variables
- func DeployRancherManager(fullVersion string, checkPods bool)
- func GetAKSLocation() string
- func GetCommonMetadataLabels() map[string]string
- func GetEKSRegion() string
- func GetGKEProjectID() string
- func GetGKEZone() string
- func VersionCompare(latestVersion, oldVersion string) int
- func WaitUntilClusterIsReady(cluster *management.Cluster, client *rancher.Client) (*management.Cluster, error)
- type Context
- type HelmChart
- type RancherVersionInfo
Constants ¶
const ( Timeout = 30 * time.Minute CattleSystemNS = "cattle-system" )
Variables ¶
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 ¶
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 ¶
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 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 }