config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2015 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpenShiftConfigPathEnvVar      = "OPENSHIFTCONFIG"
	OpenShiftConfigFlagName        = "config"
	OpenShiftConfigHomeDir         = ".config/openshift"
	OpenShiftConfigHomeFileName    = "config"
	OpenShiftConfigHomeDirFileName = OpenShiftConfigHomeDir + "/" + OpenShiftConfigHomeFileName
)

Variables

View Source
var OldRecommendedHomeFile = path.Join(os.Getenv("HOME"), ".config/openshift/.config")
View Source
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 NewPathOptions added in v0.5.1

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

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.

Jump to

Keyboard shortcuts

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