cluster

package
v1.3.1119 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context added in v1.3.937

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

Context returns the current kube context

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 ShortClusterName added in v1.3.937

func ShortClusterName(clusterName string) string

ShortClusterName shrinks the cluster name

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 ShortNameN added in v1.3.937

func ShortNameN(clusterName string, maxLen int) string

ShortNameN shrinks the name to a max length

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