Skip to content

Validation for Custom Resource contents #38117

@fabxc

Description

@fabxc

Feature Request

When adding objects for a TPR type, create and update operations succeed as long as the contents are valid JSON. The closest thing to user feedback controllers of those TPRs can provide is emitting of an event, which is asynchronous. In practice, we want to prevent invalid objects to be stored from the server side in the first place and also give them useful feedback on what is wrong with it.

Currently, in many cases only consistent operation to perform if a previously valid resource was modified into an invalid state is to tear everything associated with the resource down or halt everything for the user to resolve.

@davidopp mentioned this before in #22768 (comment). It was concluded custom tools shipped with custom controllers can handle this on the client side.
However, one of the great things about TPRs is the seamless and native experience. That seems to include no need for a new client tool for anyone who wants to use a custom controller/TPR.

Solutions that came up so far were providing JSON schema specifications with each TPR or arbitrary validation handled by the controller handling a TPR.
The latter seems to be a more powerful and thinner technique. It could be implemented by having the API server to a validation round trip through a specified HTTP endpoint using a standardized protocol.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions