Skip to content

Increased debug-ability #58

@RickardCardell

Description

@RickardCardell

What problem are you facing?

In some cases the apply fails with a 400 error and fails. But the output is quite sparse.
E.g in Azure when there's already an existing role-assignment:
Error: unexpected status 409 (409 Conflict) with error: RoleAssignmentExists: The role assignment already exists.
However, no sign of which role etc it was which makes it rather hard to debug.

When running TF locally one would set export TF_LOG=DEBUG and it will output a lot of useful information.
However, adding an env-var TF_LOG=DEBUG to the workspace doesn't seem to increase the logging in the TF-output on the opentofu provider-pod:

- apiVersion: opentofu.upbound.io/v1beta1
  kind: Workspace
  metadata:
    name: tofu-debug
  spec:
    deletionPolicy: Delete
    forProvider:
      enableTofuCLILogging: true
      entrypoint: ''
      env:
      - name: TF_LOG
        value: DEBUG
...

Neither setting it on the DeploymentRuntimeConfig seems to have any effect:

apiVersion: pkg.crossplane.io/v1beta1
kind: DeploymentRuntimeConfig
metadata:
  name: debug-config
spec:
  deploymentTemplate:
    spec:
      selector: {}
      template:
        spec:
          containers:
          - name: package-runtime
            args:
            - --debug
            env:
              - name: TF_LOG
                value: DEBUG
---
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
  name: provider-opentofu
spec:
  package: xpkg.upbound.io/upbound/provider-opentofu:v0.2.2
  runtimeConfigRef:
    apiVersion: pkg.crossplane.io/v1beta1
    kind: DeploymentRuntimeConfig
    name: debug-config

How could Upbound help solve your problem?

Add support for a debug-flag or enable setting TF_LOG env variable.
Please correct me if I'm doing something wrong when setting the flag or if there's already support for debugging the TF-run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions