-
Notifications
You must be signed in to change notification settings - Fork 593
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
admin
: add key
param to get_cluster_config
endpoint
#22674
admin
: add key
param to get_cluster_config
endpoint
#22674
Conversation
`rpk cluster config get` makes a request for a single property from the cluster. Previously, this would return the entire `configuration` json to `rpk`, which would pick the key out for the sole property it wanted. Add `key` as an optional query parameter to the `get_cluster_config` HTTP route, in order to support returning just a single property from a cluster config request. This will also support using property aliases with `rpk cluster config get` in the future.
rpk
: add single_property
param to get_cluster_config
endpointrpk
: add key
param to get_cluster_config
endpoint
rpk
: add key
param to get_cluster_config
endpointadmin
: add key
param to get_cluster_config
endpoint
8392ed1
to
fa9bc0e
Compare
This is super slick as a way of solving the issue! How does it work with back-compat? I.e. if I use an |
@JFlath Great catch, in my mind I was thinking of backporting to try and avoid this issue, but the sanity check could also be used. It might not be a great user experience to die on a simple |
fa9bc0e
to
c634581
Compare
|
new failures in https://buildkite.com/redpanda/redpanda/builds/52336#01910b54-c6b9-41a0-83d1-e1989562ab72:
new failures in https://buildkite.com/redpanda/redpanda/builds/52336#01910b6a-97e7-4755-b484-615f2d9e70ee:
new failures in https://buildkite.com/redpanda/redpanda/builds/52336#01910b54-c6bd-4c79-bb3f-5851cc50f076:
new failures in https://buildkite.com/redpanda/redpanda/builds/52336#01910b6a-97ea-4f04-8bd3-99109fb3076d:
|
ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/52336#01910b54-c6b7-49ff-8dcd-d842a9c6e7f9 ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/52336#01910b6a-97ea-4f04-8bd3-99109fb3076d ducktape was retried in https://buildkite.com/redpanda/redpanda/builds/52342#01910c68-52be-41a2-a942-4105b5656879 |
For writing a single key value property pair to json.
In order to use the query parameter `key` in the admin server, it is parsed out into a `filter` object in the request route. This also allows us to handle the possibility for aliased property requests with `rpk cluster config get`.
`newGetCommand` will issue a request for a single property from the `client` (to be changed in `common-go/rpadmin`). This allows for `rpk cluster config get` to work with property's aliased names, i.e `rpk cluster config get wasm_per_core_memory_reservation`, `rpk cluster config get data_transforms_per_core_memory_reservation` should both return the same value.
In order to allow for requests to be made by specifying a single key to the admin endpoint. Also adds some test coverage for use of aliased properties with `get` and `set` functionality with the admin endpoint and the new improvements.
c634581
to
8f3c771
Compare
Force push to update behaviour of If key If property bar is queried, then the JSON is In the case of an older version of |
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.
rpk changes LGTM, thanks!
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.
LGTM!
github.com/redpanda-data/common-go/rpadmin v0.1.3 h1:JRdr4rHcdr+A0hHr+viJYnPm+dP01bsgVUoQLM7Kz44= | ||
github.com/redpanda-data/common-go/rpadmin v0.1.3/go.mod h1:I7umqhnMhIOSEnIA3fvLtdQU7QO/SbWGCwFfFDs3De4= |
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.
nit: would be useful as a reviewer / git historian to see the commit you are intending to pull in with this bump mentioned in the commit message
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.
Noted, thanks
Fixes #22666, depends on redpanda-data/common-go#11
rpk cluster config get
makes a request for a single property from the cluster. However,redpanda
currently returns the clusterconfiguration
in whole, and allowsrpk
to index the desired property.This makes dealing with aliased property names tricky, as the
configuration
json contains only key-value information.Since
rpk cluster config get
is only concerned with one parameter, we add the optionalkey
query parameter, which will be used to handle the possibility of an aliased property name internally byredpanda
and return only one key-value pair in the regular json object.The returned JSON will reference the alias's name, i.e a
GET
request to/v1/cluster_config?key=data_transforms_per_core_memory_reservation
will returnand a request to
/v1/cluster_config?key=wasm_per_core_memory_reservation
will returnBackports Required
Release Notes
Improvements
rpk cluster config get
using either the original property name, or any of its aliases. Whereas before,rpk cluster config get
using a property's aliased name would return aProperty {} not found
result.Before Example:
After Example: