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

fix: allow to refresh all contexts (#809) #811

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

adietish
Copy link
Collaborator

@adietish adietish commented Jan 21, 2025

depends on #809

The refresh that's available in the context menu has no effect if no context is selected.

The refresh action should not return without doing anything. It should call ResourceModel.invalidate() instead, which then should refresh the whole tree.

private fun invalidate() {
logger<ResourceModel>().debug("Invalidating all contexts.")
allContexts.refresh()

I dont know how to test this other than by debugging with breakpoints and looking at the code. Updates on the cluster are watched and acted upon. Same for the config files. I am not aware of a use case where a refresh would change the state of the resource tree :(

@adietish adietish self-assigned this Jan 21, 2025
@adietish adietish marked this pull request as draft January 21, 2025 11:20
@adietish adietish force-pushed the refresh-all-contexts branch 2 times, most recently from db32faa to fba3c31 Compare January 21, 2025 14:16
@adietish adietish force-pushed the refresh-all-contexts branch from fba3c31 to 8c974a5 Compare January 23, 2025 19:16
@adietish adietish requested a review from sbouchet January 23, 2025 19:18
@adietish adietish marked this pull request as ready for review January 23, 2025 19:18
Copy link
Collaborator

@sbouchet sbouchet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. refresh action seems to refresh all context if nothing selected.

@adietish adietish merged commit c089bae into redhat-developer:main Jan 24, 2025
14 checks passed
@adietish adietish deleted the refresh-all-contexts branch January 24, 2025 11:49
@adietish adietish added this to the 1.5.0 milestone Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants