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

Introduce a validating webhook for validation of extension resources #4293

Closed
stoyanr opened this issue Jul 1, 2021 · 3 comments · Fixed by #4499
Closed

Introduce a validating webhook for validation of extension resources #4293

stoyanr opened this issue Jul 1, 2021 · 3 comments · Fixed by #4499
Assignees
Labels
area/control-plane Control plane related area/ops-productivity Operator productivity related (how to improve operations) area/usability Usability related kind/enhancement Enhancement, improvement, extension priority/3 Priority (lower number equals higher priority)

Comments

@stoyanr
Copy link
Contributor

stoyanr commented Jul 1, 2021

How to categorize this issue?

/area control-plane
/area usability
/area ops-productivity
/kind enhancement
/priority 3

What would you like to be added:
Introduce a validating webhook to execute the existing validation of extension resources in https://github.com/gardener/gardener/tree/master/pkg/apis/extensions/validation. The natural place to host it would be the seed-admission-controller.

Why is this needed:
Currently, the validation of extension resources in https://github.com/gardener/gardener/tree/master/pkg/apis/extensions/validation is not executed, so this validation is essentially dead code. It was not seen as high priority so far since the contract is internal to Gardener - extension resources are only created and updated by gardenlet and we could assume this is done correctly.

However, there are edge cases in which gardenlet could create an invalid resource or e.g. attempt to update an immutable field, and without actually validating this could have some negative consequences, see for example this discussion: gardener/gardener-extension-provider-aws#362 (comment).

/cc @timebertt @kris94

@stoyanr stoyanr added the kind/enhancement Enhancement, improvement, extension label Jul 1, 2021
@gardener-robot gardener-robot added area/control-plane Control plane related area/ops-productivity Operator productivity related (how to improve operations) area/usability Usability related priority/3 Priority (lower number equals higher priority) labels Jul 1, 2021
@vanjiii
Copy link
Contributor

vanjiii commented Jul 27, 2021

/assign

@stoyanr
Copy link
Contributor Author

stoyanr commented Aug 5, 2021

/cc @plkokanov

@stoyanr
Copy link
Contributor Author

stoyanr commented Aug 5, 2021

In addition to the extension resources mentioned above, the validating webhook should also take care to validate etcd resources. We had a recent case where if we had such a validation in place, we could have prevented a rather severe issue from happening.
Note that validation of etcd resources is currently missing in the etcd-druid repo, so the webhook would currently have nothing to call. I will open an issue in that repo to request that such validation is introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/control-plane Control plane related area/ops-productivity Operator productivity related (how to improve operations) area/usability Usability related kind/enhancement Enhancement, improvement, extension priority/3 Priority (lower number equals higher priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants