A worker's environment (environment variables and command-line arguments) can only be set once when the worker is created. This is intentional as modifying them can lead to divergence as the worker's code can depend on them.
However, as we support updating workers, it is possible that an update introduces the need for a new environment variable and it is not possible to add it currently.
The following proposal would solve this:
Add optional parameters to the worker update command (on all layers) to accept an updated list of environment variables / args.
This should be made convenient on the user interface level, for example being able to list "additional env vars" without touching the existing ones, etc.
The worker update command must allow updating to the same version if the user only wants to update the configuration
Even if the version does not change but the environment does, worker executor must go through the usual process of attempting an update with the updated environment, which potentially can lead to divergence and fail.
A worker's environment (environment variables and command-line arguments) can only be set once when the worker is created. This is intentional as modifying them can lead to divergence as the worker's code can depend on them.
However, as we support updating workers, it is possible that an update introduces the need for a new environment variable and it is not possible to add it currently.
The following proposal would solve this: