Hide Forgot
Created attachment 1146701 [details] login_ose.log Description of problem: When user login, it'll load config way too many times. Version-Release number of selected component (if applicable): oc v3.2.0.14 openshift v3.2.0.14 kubernetes v1.2.0-36-g4a3f9c5 How reproducible: Always Steps to Reproduce: oc login with loglevel=8 and check Actual results: It'll take a while to load config over again and again. Log shows as below: I0413 13:04:12.645794 6295 loader.go:242] Config loaded from file /root/.kube/config Refer to "login_ose.log" Expected results: Shouldn't be so many times to load config Additional info: From origin: "login_origin.log"
Created attachment 1146702 [details] login_origin.log
The way it reproduced is there are so many content on local .kube/config. Will not reproduced if clear the config.
Looks like the code(https://github.com/openshift/origin/blob/388478c40e751c4295dcb9a44dd69e5ac65d0e3b/pkg/cmd/cli/cmd/loginoptions.go#L235) will load multiple time for the for loop on the contexts. And better move the following logic out of the for loops: clientcmdConfig := kclientcmd.NewDefaultClientConfig(kubeconfig, &kclientcmd.ConfigOverrides{CurrentContext: key}) if kubeconfigClientConfig, err := clientcmdConfig.ClientConfig(); err == nil {
Closing due to age, also it was addressed in one of the later releases.