DataWorkz-NL / KubeETL

ETL controller for Kubernetes
Apache License 2.0
4 stars 0 forks source link

Feat/validating webhook connections #6

Closed Blokje5 closed 3 years ago

Blokje5 commented 3 years ago

This PR adds a validating webhook for dynamically validating Connections on correctness. In the webhook the following is executed:

There is sadly a limitation to the validation: ValueFrom references (e.g. ConfigMaps, Secrets) can't be validated against the rules. However we can still validate whether the Connection does not contain any invalid fields.

Testing took some effort for the webhook, as at a first glance it was quite hard to set up locally (you can see some of my earlier attempts in the commits still, inspired by this blog). However, it turned out that the latest version of controller-runtime has support for Webhook tests, which was perfect!

There where some other bug fixes I needed to do to get it all working: