vscode-openshift-tools
vscode-openshift-tools copied to clipboard
"Components" sidebar section take a while to load
When starting up, the "Components" sidebar takes a while to load (a couple of seconds).
A further investigation will need to be performed as to why (eg. which function calls take the longest).
Here's how to reproduce the slowness:
- set up your kubeconfig to point to an invalid cluster. In my case, I point it to my local
crc
instance, but don't startcrc
- launch VS Code, then open the OpenShift sidebar. All the views in the sidebar should take over a minute to load.
Here is the different layes
- We call
getAllComponents()
inactivate
- This calls
OdoWrapper.Instance.getRegistries()
to get the list of registries -
getRegistries()
usesodo preference view -o json
in order to dump the config as JSON, which contains the list of registries.
In the version of odo
that we bundle with the extension (3.15.0), this call takes ~40 seconds if the cluster is inaccessible. i.e. you can replicate this slow response on command line by calling odo preference view -o json
using odo 3.15.0 . Therefore, the root cause is an upstream issue.
However, we can mitigate the implications of this issue by not calling getAllComponents
in activate
. I don't know why we were doing this anyways, fetching and updating the list of devfile registries should be encapsulated in the registry tree view.