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

[Feature]: Enhance Caching Functionality #944

Open
2 tasks done
amitamrutiya opened this issue Feb 10, 2024 · 3 comments · May be fixed by #948
Open
2 tasks done

[Feature]: Enhance Caching Functionality #944

amitamrutiya opened this issue Feb 10, 2024 · 3 comments · May be fixed by #948
Labels
backend enhancement New feature or request

Comments

@amitamrutiya
Copy link
Contributor

Checklist

  • I've searched for similar issues and couldn't find anything matching
  • I've discussed this feature request in the K8sGPT Slack and got positive feedback

Is this feature request related to a problem?

None

Problem Description

Consistency is key for K8sGPT, as it ensures ease of use and speed. Therefore, it would be beneficial to implement Cmd logging functionality for cache similar to what is done for auth, integration, and filter commands.

While the current implementation of adding caching functionality is commendable, there are some necessary improvements that can be made:

Issues with the current caching setup include:

  • Lack of visibility into which cache provider stores the data.
  • Ability to add the same cache provider multiple times.
  • Ability to remove the same cache provider multiple times without adding.

Solution Description

  1. Implement a list command for caching that functions similarly to other commands.
  2. Introduce a command to retrieve all cache data along with the cache provider's name.
  3. Prevent the addition and removal of the same cache provider multiple times.

1) List command:
Update a list command for caching that functions similarly to auth, filter, and integration list commands.
k8sgpt cache list

Default:
> local
Active:
> local
Unused:
> s3
> azure
> gcs

2) Data command:
Introduce a command that retrieves all cache data along with the name of the used cache provider.
k8sgpt cache data

File Based Cache
+------------------------------------------------------------------+--------------------------------+
|                               NAME                               |           UPDATEDAT            |
+------------------------------------------------------------------+--------------------------------+
| 08145659bd5319a43e3a1c156ea8577f748406b58f8f5bc8bf8140a635a18b88 | 2024-01-28 11:15:46.237219005  |
|                                                                  | +0530 IST                      |
| 1154421dd90eb4b87accb40fc87547c2a101bd8c1f757ba4972746c161227a56 | 2024-02-07 14:30:50.632951629  |
|                                                                  | +0530 IST                      |
+------------------------------------------------------------------+--------------------------------+

3) Add & Remove command:
Prevent the addition and removal of the same cache provider multiple times.

Benefits

Improved visibility: Users will have better insight into which cache provider stores the data, enhancing transparency.

Prevents redundancy: By disallowing the addition of the same cache provider multiple times, we can avoid redundancy in caching, leading to better resource utilization.

Enhanced user experience: Implementing these improvements will streamline the caching process, resulting in a smoother user experience and improved performance.

Potential Drawbacks

No response

Additional Information

Feel free to provide any further context or insights related to this caching enhancement request. Your feedback and suggestions are highly valued as we work towards improving our project's caching functionality for the benefit of all users.

@AlexsJones
Copy link
Member

Can you help us understand what the actual use case might be for this?

@AlexsJones AlexsJones added enhancement New feature or request backend labels Feb 18, 2024
@amitamrutiya
Copy link
Contributor Author

Yeah, sure,

  • I encountered some difficulties while using the cache provider :

    • When using the auth, filter, and integration commands, I usually used the list command to view all available options and view active and deactivate status. However, with caching, it returns all cached data.
    • If I forget which cache provider I integrated last time, there is no way to check it, and I have to re-add the cache provider.

By incorporating the features mentioned above, we can achieve the same behaviour as in other auth, filter, and integration commands. This approach would lessen the need to memorize various details for cache functionality, as the same behaviour would be consistent across all commands.

So updating the list command to display both active and unused states, and implementing additional commands like data (or perhaps something else) for return all cached data would be highly beneficial in this situation.

@AlexsJones
Copy link
Member

I believe I understand the enhancement you want to make, I would be supportive of this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend enhancement New feature or request
Projects
Status: Proposed
Development

Successfully merging a pull request may close this issue.

2 participants