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

Provide a 'LastRefresh' field for OCI discoveries #138

Closed

Conversation

marckhouzam
Copy link
Contributor

What this PR does / why we need it

This is meant to be used by the CLI to only refresh the plugin inventory DB at a certain interval, to make the plugin-lifecycle commands more responsive.

I included this field in an OCI discovery so that when we support more than once discovery, we are prepared.

Which issue(s) this PR fixes

Fixes # N/A

Describe testing done for PR

Let CI run.
The rest of the testing is done through the tanzu-cli PR that will use this new field.
I will update this PR with the other PR once it is opened.

Release note

Add `LastRefresh` to an OCI discovery source. 

Additional information

Special notes for your reviewer

This is used by the CLI to only refresh the plugin inventory DB at a
certain interval, to make the plugin-lifecycle commands more responsive.

Signed-off-by: Marc Khouzam <[email protected]>
@@ -234,6 +234,8 @@ type OCIDiscovery struct {
// Contains a directory containing YAML files, each of which contains single
// CLIPlugin API resource.
Image string `json:"image,omitempty" yaml:"image,omitempty"`
// LastRefresh allows to store the last time the OCI image was refreshed by the CLI
LastRefresh string `json:"lastrefresh,omitempty" yaml:"lastrefresh,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if this information

  1. needs to be part of the OCI configuration in the config file.
  2. we need a timestamp per OCI discovery source

It feels like something that only the core CLI need to track during it use and the information can be stored somewhere else.

(Setting aside vmware-tanzu/tanzu-cli#605 (comment) for the moment)
Could storing even a single timestamp in ~/.cache/tanzu/plugin_inventory have done the job as well?

@marckhouzam
Copy link
Contributor Author

After discussing this comment with @vuil, this PR will most probably not needed.

I will mark it as draft until I have updated vmware-tanzu/tanzu-cli#605 and confirmed this can be closed.

@marckhouzam marckhouzam marked this pull request as draft December 11, 2023 17:39
@marckhouzam
Copy link
Contributor Author

The PR that originally needed this change was reworked and simplified.
This PR is no longer needed.
Thanks for your good suggestions @vuil

@marckhouzam marckhouzam deleted the feat/betterCaching branch December 15, 2023 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants