Documentation ¶
Index ¶
- Constants
- Variables
- func CurrentMigrationRules() map[string]string
- func GetClusterNicknameFromURL(apiServerLocation string) (string, error)
- func GetContextNickname(namespace, clusterNick, userNick string) string
- func GetUserNicknameFromCert(clusterNick string, chain ...*x509.Certificate) (string, error)
- func NewOpenShiftClientConfigLoadingRules() *clientcmd.ClientConfigLoadingRules
- func NormalizeServerURL(s string) (string, error)
Constants ¶
const ( OpenShiftConfigPathEnvVar = "KUBECONFIG" OpenShiftConfigFlagName = "config" OpenShiftConfigHomeDir = ".kube" OpenShiftConfigHomeFileName = "config" OpenShiftConfigHomeDirFileName = OpenShiftConfigHomeDir + "/" + OpenShiftConfigHomeFileName )
Variables ¶
var RecommendedHomeFile = path.Join(homedir.HomeDir(), OpenShiftConfigHomeDirFileName)
Functions ¶
func CurrentMigrationRules ¶
currentMigrationRules returns a map that holds the history of recommended home directories used in previous versions. Any future changes to RecommendedHomeFile and related are expected to add a migration rule here, in order to make sure existing config files are migrated to their new locations properly.
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 NewOpenShiftClientConfigLoadingRules ¶
func NewOpenShiftClientConfigLoadingRules() *clientcmd.ClientConfigLoadingRules
NewOpenShiftClientConfigLoadingRules returns file priority loading rules for OpenShift. 1. --config value 2. if KUBECONFIG env var has a value, use it. Otherwise, ~/.kube/config file
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.
Types ¶
This section is empty.