Documentation ¶
Index ¶
- Constants
- Variables
- func CreateConfig(credentialsName string, namespace string, clientCfg *client.Config) clientcmdapi.Config
- func FindExistingAuthInfoName(haystack clientcmdapi.Config, needle clientcmdapi.AuthInfo) string
- func FindExistingClusterName(haystack clientcmdapi.Config, needle clientcmdapi.Cluster) string
- func FindExistingContextName(haystack clientcmdapi.Config, needle clientcmdapi.Context) string
- func GenerateContextIdentifier(namespace string, cluster string, authInfo string, ...) string
- func MergeConfig(haystack, addition clientcmdapi.Config) (*clientcmdapi.Config, error)
- func NewOpenShiftClientConfigLoadingRules() *clientcmd.ClientConfigLoadingRules
- 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
func CreateConfig(credentialsName string, namespace string, clientCfg *client.Config) clientcmdapi.Config
CreatePartialConfig takes a clientCfg and builds a config (kubeconfig style) from it.
func FindExistingAuthInfoName ¶
func FindExistingAuthInfoName(haystack clientcmdapi.Config, needle clientcmdapi.AuthInfo) string
FindExistingAuthInfoName finds the nickname for the passed auth info
func FindExistingClusterName ¶
func FindExistingClusterName(haystack clientcmdapi.Config, needle clientcmdapi.Cluster) string
FindExistingClusterName finds the nickname for the passed cluster config
func FindExistingContextName ¶
func FindExistingContextName(haystack clientcmdapi.Config, needle clientcmdapi.Context) string
FindExistingContextName finds the nickname for the passed context
func GenerateContextIdentifier ¶
func GenerateContextIdentifier(namespace string, cluster string, authInfo string, existingContextIdentifiers *util.StringSet) string
GenerateContextIdentifier generates the best context identifier possible based on the information it gets.
func MergeConfig ¶
func MergeConfig(haystack, addition clientcmdapi.Config) (*clientcmdapi.Config, error)
MergeConfig takes a haystack to look for existing stanzas in (probably the merged config) and the new additions to merge in. It tries to find equivalents for the addition inside of the haystack and uses the mapping to avoid creating additional stanzas with duplicate information. It either locates or original stanzas or creates new ones for clusters and users. Then it uses the mapped names to build the correct contexts
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 RelativizeClientConfigPaths ¶ added in v0.4.4
func RelativizeClientConfigPaths(cfg *clientcmdapi.Config, base string) (err error)
TODO should me moved upstream
Types ¶
This section is empty.