Documentation ¶
Index ¶
- func CreateConfig(namespace string, clientCfg *restclient.Config) (*clientcmdapi.Config, error)
- func GetClusterNicknameFromURL(apiServerLocation string) (string, error)
- func GetContextNickname(namespace, clusterNick, userNick string) string
- func GetUserNicknameFromCert(clusterNick string, chain ...*x509.Certificate) (string, error)
- func MakeRelative(path, base string) (string, error)
- func MergeConfig(startingConfig, addition clientcmdapi.Config) (*clientcmdapi.Config, error)
- func NewPathOptions(cmd *cobra.Command) *kclientcmd.PathOptions
- func NewPathOptionsWithConfig(configPath string) *kclientcmd.PathOptions
- func NormalizeServerURL(s string) (string, error)
- func RelativizeClientConfigPaths(cfg *clientcmdapi.Config, base string) (err error)
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 ¶
GetClusterNicknameFromURL returns host:port of the apiServerLocation, with .'s replaced by -'s
func GetContextNickname ¶
func GetUserNicknameFromCert ¶
func GetUserNicknameFromCert(clusterNick string, chain ...*x509.Certificate) (string, error)
func MakeRelative ¶
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 ¶
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.