Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging into the cluster does not refresh the tree #595

Closed
adietish opened this issue Oct 16, 2023 · 4 comments · Fixed by #610
Closed

Logging into the cluster does not refresh the tree #595

adietish opened this issue Oct 16, 2023 · 4 comments · Fixed by #610
Assignees
Labels
bug Something isn't working
Milestone

Comments

@adietish
Copy link
Contributor

adietish commented Oct 16, 2023

depends on redhat-developer/intellij-common#201

Steps:

  1. ASSERT: make sure that you are not logged into your current cluster
  2. EXEC: launch the plugin, unfold the root (cluster) node
  3. ASSERT: tree shows "Please log into the cluster"
  4. EXEC: pick "Log into the cluster" in the context menu and log in
  5. ASSERT: dialog is closed, look at the tree

Result:
The tree still shows "Please log in to the cluster". "Refresh" doesnt help, I have to restart the IDE.
image

@adietish adietish added bug Something isn't working critical labels Oct 16, 2023
@adietish adietish self-assigned this Nov 7, 2023
@martinszuc
Copy link
Contributor

martinszuc commented Nov 7, 2023

Earlier than Commits on Oct 5, 2023 for IJ Openshift: I used to remove /.kubo/config for a "logout" from cluster:
old-logout (1)

Nowadays after removing the kube config it just fails to load after refresh. (it doesnt default to the kubernetes.defuult link). The cluster link defaults itself only when I remove .kube/config WHILE THE PROJECT IS CLOSED!
image

As for logging in to the cluster, before Oct 5, it seemed to matter if I deleted whole .kube or just .kube/config file for logout before another login. With just the config file deleted, the login would default correctly in real time and next login would work correctly as well.
After Oct 5 this doesnt work and needs IDE restart for login.

Also closing and reopening the project seems to refresh the tree correctly just as restart.

Sooo i believe the change that affected this, was somewhere between Oct 5-6 and now. Wanted to share my findings.

@adietish
Copy link
Contributor Author

adietish commented Nov 7, 2023

Sooo i believe the change that affected this, was somewhere between Oct 5-6 and now. Wanted to share my findings.

@martinszuc thanks sharing. I'll try to fix your issue, too.

@adietish
Copy link
Contributor Author

adietish commented Nov 13, 2023

both use cases have different causes:

  • removing the config file does not trigger a refresh of the tree because of a check in the ConfigWatcher. If the config is null, no update happens (config file was deleted, config is therefore null)
  @Override
    public void run() {
        runOnConfigChange((Config config) -> {
-->       if (config != null) {
                listener.onUpdate(this, config);
            }
        });
    }

This check was introduced because of redhat-developer/intellij-common#190

  • changing the config (update the token) triggers a refresh but other flaws caused the update to fail.

@adietish
Copy link
Contributor Author

to fix this I created redhat-developer/intellij-common#201

adietish added a commit to adietish/intellij-openshift-connector that referenced this issue Nov 14, 2023
adietish added a commit to adietish/intellij-openshift-connector that referenced this issue Nov 14, 2023
adietish added a commit to adietish/intellij-openshift-connector that referenced this issue Nov 14, 2023
adietish added a commit to adietish/intellij-openshift-connector that referenced this issue Nov 14, 2023
adietish added a commit to adietish/intellij-openshift-connector that referenced this issue Nov 15, 2023
adietish added a commit to adietish/intellij-openshift-connector that referenced this issue Nov 16, 2023
adietish added a commit to adietish/intellij-openshift-connector that referenced this issue Nov 17, 2023
adietish added a commit to adietish/intellij-openshift-connector that referenced this issue Nov 20, 2023
adietish added a commit to adietish/intellij-openshift-connector that referenced this issue Nov 22, 2023
adietish added a commit to adietish/intellij-openshift-connector that referenced this issue Nov 22, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in IDE Cloudaptors Nov 24, 2023
sbouchet pushed a commit that referenced this issue Nov 24, 2023
…610)

* fix: refreshing tree upon config change or kubeconfig removal (#595)

Signed-off-by: Andre Dietisheim <[email protected]>

* display default-/first namespace if current doesnt exist

Signed-off-by: Andre Dietisheim <[email protected]>

* correct type of parent to CreateComponentLinkNode

Signed-off-by: Andre Dietisheim <[email protected]>

* fix: dont 'fatal IDE error' when cluster is not reachable (#621)

Signed-off-by: Andre Dietisheim <[email protected]>

---------

Signed-off-by: Andre Dietisheim <[email protected]>
@sbouchet sbouchet added this to the 1.7.0 milestone Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
3 participants