bug: WHITELIST_ENVS for workers set non-existing variables to empty

Open
#3,958 0 comments 0 reactions 1 assignee View on GitHub

@rubenfiszel is already working on this.

Since Jun 24, 2024.

Assessment

This issue has not been assessed yet.

Description

bug
Describe the bug

Any variable that is specified with WHITELIST_ENVS seems to get set, no matter if the worker container actually has the environment variable defined or not.

To reproduce
  1. set WHITELIST_ENVS=MY_VAR
  2. do NOT define MY_VAR for the worker
  3. create shell script:
    env | grep -F 'MY_VAR='
    
  4. execute script
  5. note the unexpected output:
    --- BASH CODE EXECUTION ---
    
    MY_VAR=
    
Expected behavior

If the variable is not set by any means for the worker, the variable should not be defined for script execution.

As a result, the output of env | grep -F 'MY_VAR=' should be empty.

Screenshots

No response

Browser information

No response

Application version

CE v1.349.1-2-g37c88272f

Additional Context

This caught my attention while working with the AWS CLI and profiles. As soon as AWS_PROFILE is available, the AWS CLI tries to find a profile with that name. It does not safe-guard for empty strings and instead throws an error with:

The config profile () could not be found
Dominant language
Rust
Stars
18k
Forks
1.1k
Avg merge
1d 1h
Merged PRs (30d)
328

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from windmill-labs/windmill

All issues in windmill-labs/windmill

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.