kestra-io / plugin-kubernetes

https://kestra.io/plugins/plugin-kubernetes/
Apache License 2.0
6 stars 7 forks source link

Cannot retrieve an output file #77

Closed loicmathieu closed 8 months ago

loicmathieu commented 11 months ago

Expected Behavior

We should be able to create a file in a container referenced inside outputFiles and retrieve it as output.

Actual Behaviour

When a file is created inside a container, it cannot be retrieved as output. If we generate a file via for ex echo "I am working fine!" > output.txt this file is in the root directory which is not the downloaded repository. If we generate a file via for ex echo "I am working fine!" > {{workingDir}}/output.txt which should point to the correct directory the pod ends in error.

Steps To Reproduce

No response

Environment Information

Example flow

id: sample-k8s namespace: company.ls.sample.k8s tasks:

krishan-la commented 11 months ago

This is the sample flow which i am using

id: sample-k8s
namespace: company.ls.sample.k8s
tasks:
  - id: "pod_create"
    type: "io.kestra.plugin.kubernetes.PodCreate"
    namespace: kestra
    metadata:
      labels:
        my-label: my-value
    delete: true
    waitRunning: ""
    spec:
      containers:
      - name: unittest
        image: debian:stable-slim
        command: 
          - 'bash' 
          - '-c'
          - 'echo "I am working fine!" > output.txt'
      restartPolicy: Never
    outputFiles:
      - output.txt

  - id: logging
    type: io.kestra.core.tasks.log.Log
    message:
      - "Output is {{ outputs['pod_create']}}"

And it is going in infinite state and later getting terminated after default 60000 Duration.

logs from the container

waiting to be ended!