Documentation ¶
Index ¶
- Constants
- Variables
- func CreateConfig(namespace string, clientCfg *client.Config) (*clientcmdapi.Config, error)
- func FindExistingContextName(haystack clientcmdapi.Config, needle clientcmdapi.Context) string
- func MergeConfig(startingConfig, addition clientcmdapi.Config) (*clientcmdapi.Config, error)
- func NewOpenShiftClientConfigLoadingRules() *clientcmd.ClientConfigLoadingRules
- func NewPathOptions(cmd *cobra.Command) *kubecmdconfig.PathOptions
- func NormalizeServerURL(s string) (string, error)
- func RelativizeClientConfigPaths(cfg *clientcmdapi.Config, base string) (err error)
Constants ¶
const ( OpenShiftConfigPathEnvVar = "OPENSHIFTCONFIG" OpenShiftConfigFlagName = "config" OpenShiftConfigHomeDir = ".config/openshift" OpenShiftConfigHomeFileName = "config" OpenShiftConfigHomeDirFileName = OpenShiftConfigHomeDir + "/" + OpenShiftConfigHomeFileName )
Variables ¶
var OldRecommendedHomeFile = path.Join(os.Getenv("HOME"), ".config/openshift/.config")
var RecommendedHomeFile = path.Join(os.Getenv("HOME"), OpenShiftConfigHomeDirFileName)
Functions ¶
func CreateConfig ¶ added in v0.4.4
CreatePartialConfig takes a clientCfg and builds a config (kubeconfig style) from it.
func FindExistingContextName ¶
func FindExistingContextName(haystack clientcmdapi.Config, needle clientcmdapi.Context) string
FindExistingContextName finds the nickname for the passed context
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 NewOpenShiftClientConfigLoadingRules ¶
func NewOpenShiftClientConfigLoadingRules() *clientcmd.ClientConfigLoadingRules
File priority loading rules for OpenShift. 1. --config value 2. if OPENSHIFTCONFIG env var has a value, use it. Otherwise, ~/.config/openshift/config file
func NewPathOptions ¶ added in v0.5.1
func NewPathOptions(cmd *cobra.Command) *kubecmdconfig.PathOptions
func NormalizeServerURL ¶ added in v0.5.3
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 ¶ added in v0.4.4
func RelativizeClientConfigPaths(cfg *clientcmdapi.Config, base string) (err error)
TODO should be moved upstream
Types ¶
This section is empty.