- Bump wrangler to get fix for 'GetValueFromAny'.
This adds string arrays to the types it supports.
- Use a newer go library sort function to maintain a stable sort
- Use the map-sort-map pattern to avoid repeatedly calculating the
same underlying value for `object[arg1][arg2][...]`
* block UI until we receive requests from kube-apiserver
* satisfy CI
* undo test code
---------
Co-authored-by: joshmeranda <joshua.meranda@gmail.com>
* Return watch error instead of logging it
The UI needs to know about watch error like `resourceversion too old` so
we need to return it.
* Sort by resourceVersion as number
The UI makes some assumption on resourceVersion. It assumes they are a
number and they are ordered by the number value. We'll want to fix this
at some point most likely but for now let's give something in a way that
UI wants.
* Remove -d suffix
After much testing, a delete of an object seems to have its own
resourceVersion so we don't need the -d suffix, we can simply use the
new resourceVersion.
* Add vai access-control for tokens.
* Check for both Token and Kubeconfig resources
* Add a unit test for verifying the generated filters for restricted resources.
* Remove a TODO comment as Tom points out we no longer need it.
* Return error if we can't get userinfo from apiOp.Request.Context
* Stop using camelCase for the user ID label.
* Add a test for the admin user.
* And fold the two user-access tests into a single parameterized test.
* Address reviewer comments.
* post-rebase merge fixes
* WIP - add a comment about determining admin users.
---------
Co-authored-by: Peter Matseykanets <peter.matseykanets@suse.com>
* Add ListOptionIndexerOptions to create ListOptionIndexer
* Remove unused function
* Implement configurable garbage collection on ListOptionIndexer
* Propagate Steve options from Server
* Re-order SQL event hooks so events are last
* Add QueryRowContext for single line queries
* Add test case for unknown resource version
* Properly check rows and close it
* More accurate error message when context.Context is canceled
* Re-order test check
* Split RegisterAfterUpsert into two
We're going to need to be able to differentiate between Add and Update
for storing events in the _events table.
* Update mocks
Add support for modifying the created Factory clients
This adds a new functional-opt based mechanism for configuring the factory clients, and provides a new function for allowing consumers to provide the QPS and Burst values for configuring clients.
* Small refactor in tests
* Small refactor around decoding
* Refactor decodeHelm3 so we can drop the helm dependency
* Vendor helmv2 protobuf types so we can drop the helmv2 old dependency
* go mod tidy
* Add test with sample HelmV2 data
* Update formatter signature to use the interface to facilitate using a fake for testing
* Add a few unit tests
* Avoid adding empty perms to permissions map
* Add context to the remotedialer ping logger - steve side.
* Use a custom type as a context key instead of a basic string
* Bump remotedialer so it can use the configured context.
* Move types related to list options and sql queries into their own package.
The problem having these in the informer package is that eventually code
in other packages will need to import `informer` only for constants or types,
but some members of the informer package may already depend on those. Best to
move type definitions into their own simpler package.
* Fix the ListOptions sort field.
Instead of making it a single array-ish field, convert it into a
true array of Sort Directives. Easier to read, less bending backwards.
* Pass the listOptions struct by reference to avoid copying.
We never update the ListOptions struct once it's created so there's
no need to pass it by value.
This might be a near-useless optimization...
* Move types related to list options and sql queries into their own package.
The problem having these in the informer package is that eventually code
in other packages will need to import `informer` only for constants or types,
but some members of the informer package may already depend on those. Best to
move type definitions into their own simpler package.
* Fix the ListOptions sort field.
Instead of making it a single array-ish field, convert it into a
true array of Sort Directives. Easier to read, less bending backwards.
* Rebasing (or human error) duplicated 'NewSortList'.
The problem having these in the informer package is that eventually code
in other packages will need to import `informer` only for constants or types,
but some members of the informer package may already depend on those. Best to
move type definitions into their own simpler package.
provisioning.cattle.io.clusters\
metadata.annotations[provisioning.cattle.io/management-cluster-display-name]
Needed to add another character to the subfieldRegex in
listoption_indexer to allow hyphens in annotation field names.
* Added more fields - part 6.
* Tweaks needed to get 'batch.cronjobs' working
* Add a clarifying comment on pulling values out of an array.
* Use the correct capitalization for the etcd-snapshot kind.
* Support sorting on metadata.labels.NAME
The key to doing this is if we want to sort on, say, `metadata.labels.foo`, we need to
search for all rows with a label of the name `foo` in all the various
join tables we create for each label the query references.
We ignore nulls by giving them lowest priority using "NULLS LAST"
("NULLS FIRST" if sorting in descending order).
* Ensure labels that are mentioned only in sort params are still selected.
If we don't do this -- say we sort on metadata.labels.foo but never
make a test on it, the sort resuilts are ignored.
* Remove extraneous debugger statements.
* Generate field names with brackets when needed.
* Stop hard-wiring complex selectors as `["field1", "field2[sub-field3]"]`
and instead represent them as a more consistent `["field1", "field2", "sub-field3"]`
* Convert all filter strings ending with square brackets to an array.
Stop special-casing 'metadata.labels[X]' and handle any query string that ends with '[...]'.
* Stop checking for pre-bracketed terms in constant field-accessor arrays.
In this commit we stop converting string arrays like
`["metadata", "labels[k8s.io/deepcode]"]` into the database field
`"metadata.labels[k8s.io/deepcode]"` and instead will do a
naive `join` to give `metadata[labels[k8s.io/deepcode]]`. The solution
is to never express the above terms in separate fields, like
`["metadata", "labels", "k8s.io/deepcode"]`. This also better reflects
the stucture of the referenced object.
* gofmt changes
* Simplify comment about 'smartJoin'.
* Create and use a synthetic watcher for non-watchable resources.
* Write unit tests for the synthetic watcher.
* Make the refresh interval for synthetic watchers configurable.
The default is to call `client.List(...)` every 5 seconds for each unwatchable GVK.
There are currently only 3 such GVKs right now so this will be informative
enough but not really noticeable.
* Pass the context into the synthetic watch func.
* Restore changes lost in rebasing.
---------
Co-authored-by: Tom Lebreux <tom.lebreux@suse.com>