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

Typed parameter support #988

Closed
mpereira opened this issue Oct 22, 2019 · 5 comments
Closed

Typed parameter support #988

mpereira opened this issue Oct 22, 2019 · 5 comments

Comments

@mpereira
Copy link
Member

What would you like to be added:

Support for boolean, array, integer, float params.yaml parameters.
Bonus points for object type support.

Why is this needed:

Configuration files for KUDO operators (potentially YAML templates) usually
require array or object settings. Being able to more easily template in arrays
and objects, and to use booleans directly as template predicates instead of
using text equality to "true" or "false" strings would be nice.

Adding typed setting support also sets the stage for parameter validation. For
example, integer values might validate bounds checking in the form of
mininum and maximum fields.

NODE_COUNT:
  description: "Number of Cassandra nodes."
  type: "integer"
  default: 3
  minimum: 1

Or enum validation for optional string types:

DISK_OPTIMIZATION_STRATEGY:
  description: "The strategy for optimizing disk reads"
  type: "string"
  default: ""
  required: false
  enum:
    - "ssd"
    - "spinning"
@gerred
Copy link
Member

gerred commented Oct 22, 2019

👍 to this. It's potentially a pretty big story. Not sure if we'll need to use reflect here.

I'm tempted to wait on this until we can make typed CRDs for each operator, because then we can generate and take advantage of CRD OpenAPIv3 specs.

@mpereira
Copy link
Member Author

Should we work on a KEP for this?

@mpereira
Copy link
Member Author

I just noticed that there's a "needs KEP" label... 🙂

@kensipe
Copy link
Member

kensipe commented Dec 30, 2019

There is a need for KEP... and perhaps we should look at params / values as a whole (in that KEP).

@porridge
Copy link
Member

Support for boolean, array, integer, float params.yaml parameters.

Support for array of anything might be much more involved than, say, support for arrays of strings only. What use cases did you have in mind @mpereira ?

Bonus points for object type support.

What about maps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants