MCPcopy Create free account
hub / github.com/containers/image / newOpenShiftClientConfigLoadingRules

Function newOpenShiftClientConfigLoadingRules

openshift/openshift-copies.go:100–114  ·  view source on GitHub ↗

newOpenShiftClientConfigLoadingRules is a modified copy of openshift/origin/pkg/cmd/cli/config.NewOpenShiftClientConfigLoadingRules. NewOpenShiftClientConfigLoadingRules returns file priority loading rules for OpenShift. 1. --config value 2. if KUBECONFIG env var has a value, use it. Otherwise, ~/.k

()

Source from the content-addressed store, hash-verified

98// 1. --config value
99// 2. if KUBECONFIG env var has a value, use it. Otherwise, ~/.kube/config file
100func newOpenShiftClientConfigLoadingRules() *clientConfigLoadingRules {
101 chain := []string{}
102
103 envVarFile := os.Getenv("KUBECONFIG")
104 if len(envVarFile) != 0 {
105 chain = append(chain, filepath.SplitList(envVarFile)...)
106 } else {
107 chain = append(chain, recommendedHomeFile)
108 }
109
110 return &clientConfigLoadingRules{
111 Precedence: chain,
112 // REMOVED: Migration support; run (oc login) to trigger migration
113 }
114}
115
116// deferredLoadingClientConfig is a modified copy of k8s.io/kubernetes/pkg/client/unversioned/clientcmd.DeferredLoadingClientConfig.
117// DeferredLoadingClientConfig is a ClientConfig interface that is backed by a set of loading rules

Callers 4

defaultClientConfigFunction · 0.85
TestDirectClientConfigFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestDirectClientConfigFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…