cluster

package
v2.1.155 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(kuber kube.Kuber) (*api.Context, error)

Context returns the current kube context

func GetSafeUsername

func GetSafeUsername(username string) string

GetSafeUsername returns username by checking the active configuration

func IsInCluster

func IsInCluster() bool

IsInCluster tells if we are running incluster

func Name

func Name(kuber kube.Kuber) (string, error)

Name gets the cluster name from the current context Note that this just reads the ClusterName from the local kube config, which can be renamed (but is unlikely to happen)

func ShortName

func ShortName(kuber kube.Kuber) (string, error)

ShortName returns a short clusters name. Eg, if ClusterName would return tweetypie-jenkinsx-dev, ShortClusterName would return tweetypie. This is needed because GCP has character limits on things like service accounts (6-30 chars) and combining a long cluster name and a long vault name exceeds this limit

func SimplifiedClusterName

func SimplifiedClusterName(complexClusterName string) string

SimplifiedClusterName get the simplified cluster name from the long-winded context cluster name that gets generated GKE cluster names as defined in the kube config are of the form gke_<projectname>_<region>_<clustername> This method will return <clustername> in the above

Types

This section is empty.

Jump to

Keyboard shortcuts

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