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

Enable providing list and dict variables in env variables config #29

Merged
merged 8 commits into from
Sep 17, 2024

Conversation

onurmus
Copy link
Contributor

@onurmus onurmus commented Sep 16, 2024

Use Case

In the current implementation, we can just provide environment variables which are text, numeric, or boolean values. However, I need to provide a transformation config which is a nested configuration. In this case, the charm tries to provide a JSON object as an environment variable.

env:
  - name: TWC_HOST
    value: 192.168.67.5:7233
  - name: TWC_QUEUE
    value: test
  - name: TWC_NAMESPACE
    value: default
  - name: WF_TRANSFORMATION
    value:
      - connection_id: my_connection_id
        unnesting:
          tables:
            issues: ["test1", "test2"]
            users: [test3]
        redaction:

Solution

Use json.dumps() to convert dict or list to string.

@onurmus onurmus self-assigned this Sep 16, 2024
Copy link

@gtato gtato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg

Copy link
Collaborator

@kelkawi-a kelkawi-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for working on this!

@onurmus onurmus merged commit 62cf497 into main Sep 17, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants