Bug 1326569 - User login will take time to load kube config repeatly way too many times.
Summary: User login will take time to load kube config repeatly way too many times.
Keywords:
Status: CLOSED EOL
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Maciej Szulik
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-13 05:55 UTC by XiaochuanWang
Modified: 2019-08-21 08:41 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-21 08:41:43 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description XiaochuanWang 2016-04-13 05:55:23 UTC
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"

Comment 1 XiaochuanWang 2016-04-13 05:56:40 UTC
Created attachment 1146702 [details]
login_origin.log

Comment 2 XiaochuanWang 2016-04-13 09:23:50 UTC
The way it reproduced is there are so many content on local .kube/config. Will not reproduced if clear the config.

Comment 3 weiwei jiang 2016-04-13 10:03:40 UTC
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 {

Comment 4 Maciej Szulik 2019-08-21 08:41:43 UTC
Closing due to age, also it was addressed in one of the later releases.


Note You need to log in before you can comment on or make changes to this bug.