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

Add defaulting and validating webhooks for amalthea sessions #749

Open
olevski opened this issue Oct 21, 2024 · 1 comment
Open

Add defaulting and validating webhooks for amalthea sessions #749

olevski opened this issue Oct 21, 2024 · 1 comment

Comments

@olevski
Copy link
Member

olevski commented Oct 21, 2024

These would be useful in a few cases:

  1. 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.
  2. 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.

There are or will be more use cases for this.

@olevski
Copy link
Member Author

olevski commented Oct 21, 2024

See #748

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

No branches or pull requests

1 participant