Documentation ¶
Index ¶
- Constants
- func GenerateKubeContextName(installationCodeName string) string
- func GenerateWCClientCertKubeContextName(mcKubeContextName string, wcName string) string
- func GenerateWCKubeContextName(mcKubeContextName string, wcName string) string
- func GetAuthProvider(config *clientcmdapi.Config, contextName string) (*clientcmdapi.AuthProviderConfig, bool)
- func GetClientCertContextName(identifier string) string
- func GetClusterNameFromKubeContext(c string) string
- func GetClusterServer(config *clientcmdapi.Config, contextName string) (string, bool)
- func GetCodeNameFromKubeContext(c string) string
- func GetKubeCertFilePath(clusterName string) (string, error)
- func GetKubeCertPath(clusterName string) (string, error)
- func IsCodeName(s string) bool
- func IsWCCodeName(s string) bool
- func WriteCertificate(cert, clusterName string, fs afero.Fs) error
- type AuthType
- type ContextType
Constants ¶
View Source
const ( ContextPrefix = "gs-" ClientCertSuffix = "-clientcert" )
View Source
const (
CertFileName = "k8s-ca.crt"
)
Variables ¶
This section is empty.
Functions ¶
func GenerateKubeContextName ¶
GenerateKubeContextName creates a context name, from an installation's code name.
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 GetClientCertContextName ¶
GetClientCertContextName returns the name of the client cert context name for an identifier
func GetClusterServer ¶
func GetClusterServer(config *clientcmdapi.Config, contextName string) (string, bool)
func GetCodeNameFromKubeContext ¶
GetCodeNameFromKubeContext gets an installation's code name, by knowing the context used to reference it.
func GetKubeCertFilePath ¶
func GetKubeCertPath ¶
func IsCodeName ¶
IsCodeName checks whether a provided name is an installation's code name.
func IsWCCodeName ¶
IsWCCodeName checks whether a provided name is a WC id with installation code name prefix.
Types ¶
type AuthType ¶
type AuthType int
func GetAuthType ¶
func GetAuthType(config *clientcmdapi.Config, contextName string) AuthType
type ContextType ¶
type ContextType int
const ( ContextTypeNone ContextType = iota ContextTypeMC ContextTypeWC )
func GetKubeContextType ¶
func GetKubeContextType(s string) ContextType
func IsKubeContext ¶
func IsKubeContext(s string) (bool, ContextType)
IsKubeContext checks whether the name provided, matches our pattern for naming kubernetes contexts.
Click to show internal directories.
Click to hide internal directories.