kestra-io / terraform-provider-kestra

https://kestra.io/docs/terraform/
Apache License 2.0
11 stars 10 forks source link

Add initial `/` to all namespace files if they don't start with / #99

Closed anna-geller closed 3 months ago

anna-geller commented 9 months ago

Feature description

Using this configuration should work:

resource "kestra_namespace_file" "prod_scripts" {
  for_each  = fileset(path.module, "scripts/**")
  namespace = "prod"
  filename = each.value
  content   = file(each.value)
}

For now, deploying the above will result in those files being added as e.g. scripts/hello.py but in order to appear in the editor, they need to be formatted as /scripts/hello.py.

Replacing the above code with this and reapplying confirm this:

resource "kestra_namespace_file" "prod_scripts" {
  for_each  = fileset(path.module, "scripts/**")
  namespace = "prod"
  filename = "/${each.value}"
  content   = file(each.value)
}

image

TODO: add / to all files

We should avoid that the user needs to think about adding / to all files, we should add that automatically so that the first configuration with just filename = each.valueworks.