To get a non-null status for status fields that depend on fields that the creator of a session can change (directly or indirectly). I.e. as soon as you create a session the status field in the CR has 0 for the number of both ready and non-ready containers. Then in the next request / reconcile cycle the value will be set properly. But the response from a POST will always be weird. A defaulting webhook would fix this.
To validate and fail when certain thing are not well defined. Some things we cannot encode in the json schema in the CRD. For example the extraVolumes field has to unique names for each volume. And we should not even accept a POST request to create a session that has duplicates for volume names. The way to reject such a request - i.e. to send 422 or 400 on the post request to create a session is to use a validating webhook.
These would be useful in a few cases:
extraVolumes
field has to unique names for each volume. And we should not even accept a POST request to create a session that has duplicates for volume names. The way to reject such a request - i.e. to send 422 or 400 on the post request to create a session is to use a validating webhook.There are or will be more use cases for this.