kestra-io / terraform-provider-kestra

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

Docker line added when creating a flow through Terraform #118

Closed PilarIH closed 2 days ago

PilarIH commented 4 months ago

Expected Behavior

When the flow is created through the UI, you can build it only with these parameters:

id: get_connections
namespace: prod
tasks:
- id: hello
  type: io.kestra.plugin.scripts.python.Script
  script: | <here comes the python code>

Actual Behaviour

When you create the flow from Terraform, the UI shows this code:

id: get_connections
namespace: prod
tasks:
- id: hello
  type: io.kestra.plugin.scripts.python.Script
  docker:
    pullPolicy: ALWAYS
  script: |

The docker and pullPolicy are added by default and since there's no image specified, it raises an error when checking the flow in the UI. The docs say nothing about docker being a required parameter and it definitely works without it.

Steps To Reproduce

Create a Kestra Flow resource through Terraform with a Python script task, apply Terraform and check the UI to see the result.

Environment Information

Example flow

No response

loicmathieu commented 2 months ago

@PilarIH can you give us the Terraform resource you are using to create the flow?

smunteankestra commented 2 days ago

Not reproducing, sent this message via Terrafrom, @PilarIH if you can reproduce on a newer version - please reopen the bug

this is what was created :

image

`provider "null" {

The null provider is used to trigger local-exec provisioner.

}

resource "null_resource" "create_kestra_flow" {

This forces Terraform to recreate the resource every time you run apply

triggers = { always_run = "${timestamp()}" }

provisioner "local-exec" { command = <<EOT echo "Sending request to Kestra..." response=$(curl -X POST http://localhost:8080/api/v1/flows \ -H "Content-Type: application/x-yaml" \ -H "Authorization: Bearer eyJhbGciOiJub25lIn0.eyJzdWIiOiJhZG1pbiIsIm5iZiI6MTcyMzgwMTY3MCwicm9sZXMiOltdLCJpc3MiOiJrZXN0cmEtZWUiLCJleHAiOjE3MjM4MDUyNzAsImlhdCI6MTcyMzgwMTY3MCwidXNlciI6IjF2b1Q5R1RZVjQ0dzBBSWVKNGJKdWQifQ." \ -d ' id: testingissue118 namespace: tutorial description: "Hello World" inputs: