kudobuilder / kudo

Kubernetes Universal Declarative Operator (KUDO)
https://kudo.dev
Apache License 2.0
1.18k stars 103 forks source link

Refactoring: Extract cert-manager detection and tinyCA from webhook #1669

Open ANeumann82 opened 4 years ago

ANeumann82 commented 4 years ago

What would you like to be added: Extract the cert-manager detection and the tinyCA code from the kudoinit/prereq/webhook.go into it's own initializers and allow the data from those two parts to be used in different areas from the init process.

Why is this needed: The conversion webhook for CRDs will need the same data as the admission webhook. But the CRDs are initialized before the webhook at the moment.

It makes sense to extract the functionality to configure a ClientConfig for either cert-manager or tinyCA and use it for both admission webhook and CRD conversion webhook. This refactoring should be done before implementing the conversion webhook to keep the PRs smaller and easier to review.