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
290 stars 27 forks source link

Slight refactoring of machine script generation #642

Closed tasdomas closed 2 years ago

tasdomas commented 2 years ago

Use embedded template instead of format string. Add test. Remove use of map pointer - golang maps are already pointers to a maps structure and can be nil.

0x2b3bfa0 commented 2 years ago

Have you considered using github.com/sebdah/goldie for template tests, like in other places of this project? E.g.

https://github.com/iterative/terraform-provider-iterative/blob/142cd5b8b1aba9b0deb746b9fc5cfe3b6fecdd39/iterative/testdata/script_template_cloud_aws.golden#L1

0x2b3bfa0 commented 2 years ago

Merging with AWS red because of capacity issues; works as expected.