Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform stuck in running state when using dependencyRef variable on non existing key #32

Open
IbraheemAlSaady opened this issue Jul 22, 2022 · 0 comments
Labels

Comments

@IbraheemAlSaady
Copy link
Contributor

If the pod fails to mount the secret based on a variable that have dependencyRef on a key that does not exist, it will cause the pod to be in CreateContainerConfigError state with error couldn't find key number in Secret ....

To Reproduce
The following will produce the issue

apiVersion: run.terraform-operator.io/v1alpha1
kind: Terraform
metadata:
  name: terraform-run1
spec:
  terraformVersion: 1.1.7

  module:
    source: IbraheemAlSaady/test/module
    version: 0.0.3

  variables:
    - key: length
      value: "4"

  outputs:
    - key: result
      moduleOutputName: result
---
apiVersion: run.terraform-operator.io/v1alpha1
kind: Terraform
metadata:
  name: terraform-run2
spec:
  terraformVersion: 1.1.7

  module:
    source: IbraheemAlSaady/test/module
    version: 0.0.3

  dependsOn:
    - name: terraform-run1

  variables:
    - key: length
      dependencyRef:
        name: terraform-run1
        key: invalid-key

Expected behavior
If the pod hit an error, we need to update the Terraform status to Failed

Current evaluations are only happening on the job, the job is not aware that pod is in that state. We probably need to validate the pod status as well

Possibly we need to do the pod evaluation when the job is in a running state

Versions

  • Operator: 0.1.1
  • Runner: 0.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant