1
0
mirror of https://github.com/rancher/steve.git synced 2025-05-10 17:04:54 +00:00
Commit Graph

21 Commits

Author SHA1 Message Date
Eric Promislow
2711fd1f46
Added more fields - part 6. ()
* 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.
2025-03-04 09:31:21 -08:00
Richard Cox
eab91bb3d3
Fix code blocks in README ()
- an errant set of backticks broke quotes below
2025-02-12 09:26:25 -08:00
Silvio Moioli
6a46a1e091
sql: encrypt Tokens by default ()
Co-authored-by: Eric Promislow <epromislow@suse.com>
2025-02-03 09:12:02 +01:00
Eric Promislow
d794bfe4e8
Index arbitrary labels ()
* Add more fields to index when sql-caching is on.

* Restore the gvkKey helper, add event fields.

The UI team wasn't sure whether the event fields should go in the empty-string group or in 'events.k8s.io',
so let's go with both until/unless specified otherwise.

* More fixes to the fields to index:

- Remove the erroneously added management.cattle.io.nodes fields
- Use the builtin Event class, not events.k8s.io (by looking at the dashboard client code)

* Start on the virtual-field work.

* Map `Event.type` to `Event._type` for indexing.

* Add a unit test for field replacement for Event.type

* Add label processing.

* Don't test for transformation of event objects in the common module.

* Parse metadata.label queries differently.

* Improve a variable name that turned out to not be temporary.

* No need to specifically cache certain labels, as all are now cached.

* Add a test to verify simple label (m.labels.foo=blah) queries work.

* 'addLabelFields' never returns an error.

* Delete superseded function.

* Was calling 'addLabelFields' one time too many.

* Start using k8s ParseToRequirements

* Pull in the k8s parser.

* Successfully test for quotation marks.

* Add quoted strings to the lexer.

* Move to a forked k8s label lexer to include non-label tests.

* Improve and test the way quoted strings in the query are detected.

* Reinstate the original Apache license in the derived code.

Following clause 4.3 of the Apache license:
"You must cause any modified files to carry prominent notices stating that You changed the files..."

* Ignore case for operators.

* Test IN multiple-target-values

* Test the not-in operator.

* Ignore case for operators.

SQL is case-insensitive on field names and values, so this just adds consistency.

* Added tests for parsing EXISTS and NOT-EXISTS queries.

* Parse less-than and greater-than ops

* Lasso's `CacheFor` now takes a `watchable` argument.

* Support 'gt' and 'lt' as synonyms for '<' and '>'.

I see both types of operators being bandied about -- it's easy to support the aliases.

* typo fix

* Have the filter parser allow exist tests only on labels.

Also reduce the case where there's no namespace function.

* Specify hard-wired fields to index alphabetically.

* Remove unused variable.

* Parser: 'metadata.labels[FIELD]' is valid

* Pull in new gvk fields from main (and keep in alpha order).

* Fixed a couple of drops done during the last rebase.

* Add a reminder to keep the entries in alpha order.

* Test TransformLabels

* Remove TransformLabels

* Remove unused/unneeded code.

* Describe diffs between our label-selector parser and upstream's.

* Use the merged lasso 46333 work.

* Drop unused field.

* Tighten up the code.

* Specify which commit the label selector parser is based on.

* Allow both single-quoted and double-quoted value matching, doc difference.

* More review-driven changes:

- Stricter processing of m.l.name keys:
  Require ending close-bracket for a start-bracket

- Comment fix

- Moving sql processing from lasso to steve: some changes missed in rebase

* Drop support for double-quotes for string values.

For now on only single-quotes (or none where possible) are allowed.

* Renaming and dropping an init block.

* Quoted strings are dropped from the filter queries

In particular, label values have a specific syntax: they must
start and end with a letter, and their innards may contain
only alnums '.', '-' and '_'.  So there's no need for quoting.

And that means now that `=` and `==` do exact matches,
and the `~` operator does a partial match.

`!=` and `!~` negate -- note that `!~` is a stricter operation than `!=`,
in that given a set of possible string values, `!=` will accept more
of them than `!~`. Maybe I shouldn't have gone here, but these operators
reminded me of learning about `nicht durfen` and `nicht sollen` in German,
or something like that.

* Move a constant definition to the module level.

* Remove commented-out code.

* Remove unused func and adjacent redundant comment.
2025-01-30 11:57:23 -08:00
Eric Promislow
c1805696ce
SQLite backed cache: Support sorting mgmt clusters on value in a specific condition ()
* Replace primary/secondary sort fields with an array of sort directives.

* Allow more than 2 sort-params in a search query.

* Add a virtual 'status.ready' field to clusters.

* Rename status.ready -> status.connected

* Set virtual field 'spec.internal' <- spec.displayName == 'local'

* Need to declare all virtual fields to index.

* Ready clusters have condition[type==Ready && status=True]

* Update the README to reflect generalized sorting.

* Bump lasso to get revised sort directives.

* Review-driven changes, mostly comments and drop unneeded code.

* Add unit tests to verify sort-order stringification.

* Ignore empty-string sort components.

* Fix a rebase mishap.

* Drop unneeded commented-out code.

* Clusters have a 'spec.internal' field, no need to synthesize one.

* Added a note on square-brackets for label references.

This should be added to the README for filter queries in the PR for 46333.

* Bump to latest sqlcache-free lasso
2025-01-27 11:55:09 -08:00
Josh Meranda
61e80cffc8
Implement versioning ADR ()
* update renovate

* add release workflow

* document versioning

---------

Co-authored-by: joshmeranda <joshua.meranda@gmail.com>
2024-11-15 10:29:32 -05:00
Tom Lebreux
1f21e5e515
Implement /ext in Steve for Imperative API ()
This implements the Imperative API that is served at /ext with Steve. The imperative API is compatible with Kubernetes' API server and will be used as an extension API server.
2024-10-11 15:19:27 -04:00
Silvio Moioli
f02f3f9411
README: SQLite specify encryption limitations ()
Co-authored-by: Paulo Gomes <paulo.gomes@suse.com>
2024-09-10 09:38:42 +02:00
Michael Bolot
1149920168 Adding virtual fields
Adds logic which adds virtual fields resources. This allows these fields
to be sorted/filtered on when the SQL cache is enabled. Id and
metadata.state.name were added as the first two fields.
2024-08-28 12:17:53 -05:00
Silvio Moioli
5ec7c773df
README: document API differences when SQLite caching is enabled ()
* README: make common header for list parameters
* README: document differences when SQLite caching is enabled
* README: clarify support of sorting with the SQL cache
* README: mention additional printer columns

Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-08-20 13:28:40 +02:00
vardhaman22
dae842ea98 updated wrangler from v2 to v3
also updated k8s dependencies to v0.30.1
2024-06-05 22:53:08 +05:30
Eric Promislow
18ff2ebb7a Fix the sample formatter code. 2024-04-22 10:26:00 -07:00
Kevin Joiner
e35a044d5a Bumps rancher/wrangler to it's tagged v2 version.
The previous wrangler commit included all of the v2 changes.
Except for the import paths changes.
2024-01-24 10:24:01 -05:00
Colleen Murphy
7ecbec31bd Add information about API parameters to README 2023-09-27 11:06:56 -07:00
Colleen Murphy
1826066646 Fix typo in README 2023-09-27 11:03:29 -07:00
Colleen Murphy
feab37c476 Add section on pagination design to README
Add a section describing the design of pagination-related query
parameters (filter, sort, page, etc) to the README, including how
testing is implemented.
2023-09-20 14:00:34 -07:00
Colleen Murphy
6b8eceb3e4 Add developer docs to README 2023-09-14 11:32:45 -07:00
Colleen Murphy
84dedac146 Add projectsornamespaces query parameter
Add a new query parameter to filter resources by their namespace or
their namespace's project. This parameter is separate from the existing
`filter` parameter.

Filter by a comma-separated list of projects and/or namespaces with:

?projectsornamespaces=p1,n1,n2

The result can be negated with the ! operator:

?projectsornamespaces!=p1,n1,n2
2023-05-11 14:17:39 -07:00
Colleen Murphy
2e4ee872d9 Add support for OR filters
Currently, multiple filters can be appended on the query string, and
each subsequent filter is ANDed with the set. Items that pass through
the filter set must match every filter in the set.

This change adds support for OR filters. A single filter key can specify
multiple filters, separated by ','. An item that passes this filter can
match any filter in the set.

For example, this filter matches items that have either "name" or
"namespace" that match "example":

?filter=metadata.name=example,metadata.namespace=example

This filter matches items that have "name" that matches either "foo" or
"bar":

?filter=metadata.name=foo,metadata.name=bar

Specifying more than one filter key in the query still ANDs each inner
filter set together. This set of filters can match either a name of
"foo" or "bar", but must in all cases match namespace "abc":

?filter=metadata.name=foo,metadata.name=bar&filter=metadata.namespace=abc
2023-03-23 14:12:13 -07:00
Colleen Murphy
7c0228e575 Use limit=-1 to disable default list limit
The default chunk size in the partition was set to 100000. It could be
overridden as a larger or smaller number, but not disabled altogether.
This change adds the ability for users to explicitly opt out of the
limit by specifying a negative number or zero. The default behavior is
the same.
2022-12-20 15:01:20 -08:00
Colleen Murphy
1a360d705a Add README
Add an initial README to explain the basics of the API and the new
parameters.
2022-12-20 15:01:20 -08:00