jx: github.com/jenkins-x/jx/pkg/kube/cluster Index | Files

package cluster

import "github.com/jenkins-x/jx/pkg/kube/cluster"


Package Files


func Context Uses

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

Context returns the current kube context

func GetSafeUsername Uses

func GetSafeUsername(username string) string

GetSafeUsername returns username by checking the active configuration

func IsInCluster Uses

func IsInCluster() bool

IsInCluster tells if we are running incluster

func Name Uses

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 Uses

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 Uses

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

Package cluster imports 6 packages (graph). Updated 2020-06-03. Refresh now. Tools for package owners.