kubeconfig

package
v4.2.0-alpha.0+incompa... Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConfig

func CreateConfig(namespace string, clientCfg *restclient.Config) (*clientcmdapi.Config, error)

CreateConfig takes a clientCfg and builds a config (kubeconfig style) from it.

func GetClusterNicknameFromURL

func GetClusterNicknameFromURL(apiServerLocation string) (string, error)

GetClusterNicknameFromURL returns host:port of the apiServerLocation, with .'s replaced by -'s

func GetContextNickname

func GetContextNickname(namespace, clusterNick, userNick string) string

func GetUserNicknameFromCert

func GetUserNicknameFromCert(clusterNick string, chain ...*x509.Certificate) (string, error)

func MakeRelative

func MakeRelative(path, base string) (string, error)

TODO should use library-go's version or even better upstream above

func MergeConfig

func MergeConfig(startingConfig, addition clientcmdapi.Config) (*clientcmdapi.Config, error)

MergeConfig adds the additional Config stanzas to the startingConfig. It blindly stomps clusters and users, but it searches for a matching context before writing a new one.

func NewPathOptions

func NewPathOptions(cmd *cobra.Command) *kclientcmd.PathOptions

func NewPathOptionsWithConfig

func NewPathOptionsWithConfig(configPath string) *kclientcmd.PathOptions

func NormalizeServerURL

func NormalizeServerURL(s string) (string, error)

NormalizeServerURL is opinionated normalization of a string that represents a URL. Returns the URL provided matching the format expected when storing a URL in a config. Sets a scheme and port if not present, removes unnecessary trailing slashes, etc. Can be used to normalize a URL provided by user input.

func RelativizeClientConfigPaths

func RelativizeClientConfigPaths(cfg *clientcmdapi.Config, base string) (err error)

TODO should be moved upstream

Types

This section is empty.

Jump to

Keyboard shortcuts

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