ensemble icon indicating copy to clipboard operation
ensemble copied to clipboard

Webhook validation for arbitrary params

Open ferranbt opened this issue 5 years ago • 0 comments

The Resource CRD type uses an arbitrary field name 'param' to describe the dynamic config which is different for each Resource. Thus, the kubectl apply command will return true even if that field does not match the expected input, giving a bad UX.

We have to enable webhook validation so that K8s will check with the operator if the schema is correct before applying it.

Note that this also applies to other situations: check if the backend name is correct, check if the resource name exists in the backend... We will leave this for separated PRs.

Though this pattern is useful for dynamic validations, we should encourage as much as possible the OpenAPI validation of the input.

ferranbt avatar Dec 10 '20 00:12 ferranbt