-
Notifications
You must be signed in to change notification settings - Fork 61
Add dumb watch mechanism for Vai #107
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
base: main
Are you sure you want to change the base?
Conversation
|
JFYI I took the liberty to rebase, fix conflicts and force push. I hope this helps |
| Watch(ctx context.Context, listener Listener) int | ||
| } | ||
|
|
||
| // this is set to a var so that it can be overriden by test code for mocking purposes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: "overridden"
| @@ -1,5 +1,5 @@ | |||
| /* | |||
| Package factory provides a cache factory for the sql-based cache. | |||
| Package factory provides an cache factory for the sql-based cache. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: "a cache" is correct
| indexedFields: indexedFields, | ||
| resourceVersionCache: newResourceVersionCache(1000), | ||
| } | ||
| fmt.Println("HITHERE creating list option indexer") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
draft mode :)
| // - an error instead of all of the above if anything went wrong | ||
| func (l *ListOptionIndexer) ListByOptions(ctx context.Context, lo ListOptions, partitions []partition.Partition, namespace string) (*unstructured.UnstructuredList, int, string, error) { | ||
| isMaybeStale := lo.Revision != "" && !l.resourceVersionCache.contains(lo.Revision) | ||
| if isMaybeStale { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get how we can "maybe" return an error message, but can live with this for now.
|
Just to be clear this isn't ready for review I'm still very much in development. The current state has both the first attempt at solving this and another attempt. Appreciate the reviews anyway though. |
Issue rancher/rancher#40773
Might want to add a workqueue in there or anything really to avoid blocking the reflector.