AzBuilder / terrakube

Open source IaC Automation and Collaboration Software.
https://docs.terrakube.io
Apache License 2.0
496 stars 38 forks source link

Wrong terraformWorkingDir when user not type path with leading "/" in workspace configuration #1268

Closed jiin995 closed 3 weeks ago

jiin995 commented 3 weeks ago

Bug description 🐞

If user does not write the path with the initial "/" the executor working directory path is wrong and can be not exist.

For example if you set Terraform Working Directory as environment/test, the executor run Terraform or OpenTofu in directory: /home/cnb/.terraform-spring-boot/executor/816a1372-1c53-42b8-a0bd-a1fbd8a191dc/94408cba-17df-4381-a604-b019563bf34aenvironment/test

Steps to reproduce

  1. Create new workspace
  2. Set working directory without initial "/"
  3. Run plan
  4. Wait plan without changes because working directory it's wrong and check executor log for find bad path.

Expected behavior

Path correct even if the initial "/" is missing

Example repository

No response

Anything else?

No response

jiin995 commented 3 weeks ago

I create pull request for fix this bug https://github.com/AzBuilder/terrakube/pull/1269