rancher / terraform-controller

Use K8s to Run Terraform
Apache License 2.0
292 stars 46 forks source link

is it possible to use a module from a sub-directory in my git repo? #61

Open docteurklein opened 4 years ago

docteurklein commented 4 years ago

I'd like to provide a sub-directory in the git url of my module CRD, like https://www.terraform.io/docs/modules/sources.html#modules-in-package-sub-directories

Since it's terraform-controller doing the checkout, I guess it doesn't support the same syntax than terraform?

Wouldn't it be possible to let terraform do the work using its source feature?

k0da commented 3 years ago

@docteurklein we had the same usecase. I've implemented this in https://github.com/AbsaOSS/terraform-controller/commit/94fd278c505d75c98421b68327407e2e9e22cd71 but there is a drawback. there is no way git commit relates to particular module in a subdir, hence module will get an update whether or not subdir got changes.

k0da commented 3 years ago

I plan to open a PR for this.

k0da commented 3 years ago

With tf 0.14 being avaiable, there is a new flag -chdir, I'll investigate it.