Open bengaywins opened 2 years ago
This issue affects me as well. Is anybody aware of any temporary fixes or workarounds? As long as this issue persists, I cannot use a significant number of our Terraform modules.
Hey @gavinbunney this is Alex Bain from Woven Planet. Since they are giving all the new employees M1 Macs, we need to update to Terraform 1.0.2+ (since these versions include M1-compatible release binaries).
In TF 1.0.x, the template_file
construct has been replaced with templatefile
. Is there an easy change that we can make to https://github.com/gavinbunney/terraform-provider-kubectl/blob/master/kubernetes/data_source_kubectl_path_documents.go#L136 that will support TF 1.0.x+ (also without breaking older users of the provider)?
UPDATE: I may have spoken too soon. My teammate shared their stack trace and the provider is actually dying in a SIGSEV trying to access tmpfile.Name()
at https://github.com/gavinbunney/terraform-provider-kubectl/blob/master/kubernetes/resource_kubectl_manifest.go#L477. I'll keep debugging to try to find the root cause.
UPDATE 2: the code gets tmpfile.Name()
after Close()
has already been called on the file. I suspect that on M1 Macs the File
interface implementation deletes the underlying OS file pointer immediately upon Close()
and that is the result of the SIGSEV. I think we just need to get the file name before it is closed; working with my teammate to confirm (they have an M1 Mac and I do not).
@convexquad There is a workaround. You can use the kubernetes
provider and just use the kubernetes_manifest
resource. The advantage here is you aren't taking arbitrary manifests and applying them. You are building the manifest using Terraform. To quickly migrate to using them, you can use a tool called tfk8s that will convert the yaml manifests to the kubernetes_manifest
resource.
@convexquad What did your research turn up? This provider increasingly results in signal: killed
for me when dealing with many or large YAML files.
Because this provider requires the
hashicorp/template
provider, which has been deprecated since 2020, I am unfortunately not able to use it. And this breaks things. The replacement is thetemplatefile
function built into Terraform core with Terraform 0.12.