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

feat: rework cache package - add gcs cache - add cache purge command #750

Merged
merged 13 commits into from
Nov 18, 2023

Conversation

matthisholleville
Copy link
Contributor

@matthisholleville matthisholleville commented Nov 13, 2023

πŸ“‘ Description

  • Cache package rework
  • Added GCS as a cache provider
  • Added the cache object purge command
  • Improved the output of the k8sgpt cache list command

βœ… Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

β„Ή Additional Information

The cache package rework enables the integration of other providers without conflicts in option naming. For example, the integration of GCS and S3 uses the same options (bucketName & Region), which made GCS integration impossible before the rework.

The server mode has been tested with the k8sgpt-ai/schemas#19 branch available on buf.build.

The k8sgpt cache list command now returns a table, which makes it easier for users to read.

(matthisholleville) ➜  k8sgpt git:(feat/rework-cache) βœ— ./bin/k8sgpt cache list                                                                  
+------------------------------------------------------------------+-------------------------------+
|                               NAME                               |           UPDATEDAT           |
+------------------------------------------------------------------+-------------------------------+
| 02111dd651b326313a1d79097ae213d71287beed3a8217f0026e0efab7363d7d | 2023-11-13 12:56:50 +0000 UTC |
+------------------------------------------------------------------+-------------------------------+

The k8sgpt cache purge command allows you to delete an object from the cache (local or remote). A future improvement could allow for the deletion of multiple or all cache objects.

Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
@matthisholleville matthisholleville changed the title !feat: rework cache package - add gcs cache - add cache purge command feat: rework cache package - add gcs cache - add cache purge command Nov 13, 2023
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
… to addOrUpdate

Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
README.md Outdated Show resolved Hide resolved
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Copy link
Member

@arbreezy arbreezy left a comment

Choose a reason for hiding this comment

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

Awesome work

pkg/cache/gcs_based.go Show resolved Hide resolved
pkg/cache/gcs_based.go Show resolved Hide resolved
pkg/cache/gcs_based.go Show resolved Hide resolved
pkg/cache/gcs_based.go Show resolved Hide resolved
pkg/cache/s3_based.go Show resolved Hide resolved
pkg/cache/s3_based.go Show resolved Hide resolved
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Signed-off-by: Matthis <matthish29@gmail.com>
@matthisholleville matthisholleville merged commit 12146bf into k8sgpt-ai:main Nov 18, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants