kubeconfig

package
v1.60.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CertFileName = "k8s-ca.crt"
)
View Source
const (
	ContextPrefix = "gs-"
)

Variables

This section is empty.

Functions

func GenerateKubeContextName added in v0.5.5

func GenerateKubeContextName(installationCodeName string) string

GenerateKubeContextName creates a context name, from an installation's code name.

func GenerateWCKubeContextName added in v1.44.0

func GenerateWCKubeContextName(mcKubeContextName string, wcName string) string

func GetAuthProvider

func GetAuthProvider(config *clientcmdapi.Config, contextName string) (*clientcmdapi.AuthProviderConfig, bool)

GetAuthProvider fetches the authentication provider from kubeconfig, for a desired context name.

func GetClusterNameFromKubeContext added in v1.44.0

func GetClusterNameFromKubeContext(c string) string

func GetClusterServer added in v1.48.0

func GetClusterServer(config *clientcmdapi.Config, contextName string) (string, bool)

func GetCodeNameFromKubeContext added in v0.5.5

func GetCodeNameFromKubeContext(c string) string

GetCodeNameFromKubeContext gets an installation's code name, by knowing the context used to reference it.

func GetKubeCertFilePath

func GetKubeCertFilePath(clusterName string) (string, error)

func GetKubeCertPath

func GetKubeCertPath(clusterName string) (string, error)

func IsCodeName added in v0.5.5

func IsCodeName(s string) bool

IsCodeName checks whether a provided name is an installation's code name.

func WriteCertificate

func WriteCertificate(cert, clusterName string, fs afero.Fs) error

Types

type AuthType added in v1.48.0

type AuthType int
const (
	AuthTypeUnknown AuthType = iota
	AuthTypeServiceAccount
	AuthTypeAuthProvider
	AuthTypeClientCertificate
)

func GetAuthType added in v1.48.0

func GetAuthType(config *clientcmdapi.Config, contextName string) AuthType

type ContextType added in v1.44.0

type ContextType int
const (
	ContextTypeNone ContextType = iota
	ContextTypeMC
	ContextTypeWC
)

func GetKubeContextType added in v1.44.0

func GetKubeContextType(s string) ContextType

func IsKubeContext added in v0.5.5

func IsKubeContext(s string) (bool, ContextType)

IsKubeContext checks whether the name provided, matches our pattern for naming kubernetes contexts.

Jump to

Keyboard shortcuts

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