EDITD / kubetools

:nut_and_bolt: Kubetools is a tool and processes for developing and deploying microservices to Kubernetes.
MIT License
13 stars 2 forks source link

Fix cronjobs and api versions #150

Closed gchazot closed 1 year ago

gchazot commented 1 year ago

This is extracted and fixed/improved from #147 . It's eventually a massive re-write of the logic to determine which API Version to use for CronJobs:

Eventually, we should drop support specifically for this case in kubetools, but this demonstrates how we could do it for any of the other k8s APIs in order to support multiple versions. It also helps understand the gaps in the code architecture that need to be filled in order to support this for other Resource kinds.

I've also fixed an important bug along the way: We shouldn't wait for cronjobs to finish executing on deploy; the next schedule might be a year from now. So we only need to wait for the CronJob resource to be created/updated

Sorry I don't find an easy way to clean-up the commit history better, so it still shows the numerous refactoring steps that were needed to clarify/simplify the code, and attempts that didn't work, until the solution became possible.

gchazot commented 1 year ago

Thanks for the review @tmwoodruff