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

Remove option to disable kube caching #5599

Closed
nrfox opened this issue Nov 1, 2022 · 3 comments · Fixed by #6364
Closed

Remove option to disable kube caching #5599

nrfox opened this issue Nov 1, 2022 · 3 comments · Fixed by #6364
Assignees
Labels
backlog Triaged Issue added to backlog enhancement This is the preferred way to describe new end-to-end features. test-add-coverage 📎 this needs test coverage

Comments

@nrfox
Copy link
Contributor

nrfox commented Nov 1, 2022

Caching has been enabled by default for some time now. This issue is to remove the option to disable kube caching. Kiali may still query the kube api directly in some cases but will largely rely on the local cache. Some supported kube types are not currently cached like CronJob but these should be added as well.

This is a followup to #5319 and #4678.

@nrfox nrfox added the enhancement This is the preferred way to describe new end-to-end features. label Nov 1, 2022
@nrfox nrfox self-assigned this Nov 1, 2022
@jshaughn jshaughn added the backlog Triaged Issue added to backlog label Nov 18, 2022
@nrfox
Copy link
Contributor Author

nrfox commented Jan 27, 2023

Rather than blocking making the cache mandatory on refactoring all the backend unit tests, @israel-hdez had the idea of removing the external config option while keeping the internal cfg option that the unit tests can still set. I think this is a better way forward and we should do this while the test refactoring is on-going.

@israel-hdez I'm assigning you to this task but feel free to unassign yourself or assign someone else.

@nrfox nrfox assigned israel-hdez and unassigned nrfox Jan 27, 2023
israel-hdez added a commit to israel-hdez/swscore that referenced this issue Jan 31, 2023
This small change will prevent reading (unmarshalling) the kubernetes_config.cache_enabled configuration from a YAML file (i.e. from a Kubernetes ConfigMap).

This effectively makes it impossible to disable Kiali's kube cache via the usual configuration mechanism. This will allow to write new code under the assumption that the kube cache is always enabled (i.e. no more if/else conditionals around this configuration variable).

The kube cache can still be disabled programmatically. This will allow to gradually update existing code to stop relying on the removed configuration (most notably, unit tests need to be adapted).

Related kiali#5599
israel-hdez added a commit to israel-hdez/swscore that referenced this issue Feb 14, 2023
The adaptation moves from using mocks to using a fake client. This allows for starting a cache where the underlying client is a fake, making it possible to allow the code to use "caching" as with the real client.

Related kiali#5599
@israel-hdez
Copy link
Member

Transferring this issue to @leandroberetta as the new Ωwner.

@nrfox
Copy link
Contributor Author

nrfox commented May 25, 2023

The gist of this work is just removing kialiCache != nil references and updating any unit tests that break. After removing the references locally and running the test suite, there's 21 tests that need to be updated. It's possible though that there would be additional failures after fixing some tests since many test failures cause panics and these can mask additional failures once the failing test is fixed.

nrfox pushed a commit to kiali/kiali-operator that referenced this issue Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Triaged Issue added to backlog enhancement This is the preferred way to describe new end-to-end features. test-add-coverage 📎 this needs test coverage
Projects
Development

Successfully merging a pull request may close this issue.

5 participants