iterative / terraform-provider-iterative

☁️ Terraform plugin for machine learning workloads: spot instance recovery & auto-termination | AWS, GCP, Azure, Kubernetes
https://registry.terraform.io/providers/iterative/iterative/latest/docs
Apache License 2.0
289 stars 27 forks source link

`task` Chosen design is enforced to repeat same code for every vendor #356

Open DavidGOrtega opened 2 years ago

DavidGOrtega commented 2 years ago

Current design is not very DRY. Actually the vendors are exactly repeating the same code for many functions. This is undesired since is creating more source code to review and we are duplicating business logic instead of sharing the business logic implementing just the specific adapters.

0x2b3bfa0 commented 2 years ago

Not every vendor can share the same code: k8s is substantially different, and it may also be the case for other vendors in the future.

As you requested during the review of #237, all the other vendors already share as much code as they can through the common machine module.

What else would you suggest to improve the project structure?

DavidGOrtega commented 2 years ago

We should have a generic task and override generic methods depending on every vendor.