Component
infrahubctl
Infrahub SDK version
1.22.2
Current Behavior
When you are using infrahubctl and specifically point to a configuration toml file environment variables can override the settings from the tomlfile.
Example:
infrahubctl transform --config-file=infrahub_prod.toml device_config_transform device=router1 --branch=main
Contents of infrahub_prod.toml
server_address = "https://infrahub.example.com/"
api_token = "xyz"
You also have a local environment variable where INFRAHUB_ADDRESS=http://localhost:8000.
In this case infrahubctl will try to connect to the localhost.
Expected Behavior
Since the user specifically used the --config-file option that setting should win.
Steps to Reproduce
Check the current behaviour section
Additional Information
A consideration here though is that the default argument for --config-file is "infrahub.toml", and there's a scenario where the file is just silently found. It's not clear which setting should win in that case the config file or the environment variable.
Component
infrahubctl
Infrahub SDK version
1.22.2
Current Behavior
When you are using infrahubctl and specifically point to a configuration toml file environment variables can override the settings from the tomlfile.
Example:
Contents of infrahub_prod.toml
You also have a local environment variable where
INFRAHUB_ADDRESS=http://localhost:8000.In this case infrahubctl will try to connect to the localhost.
Expected Behavior
Since the user specifically used the
--config-fileoption that setting should win.Steps to Reproduce
Check the current behaviour section
Additional Information
A consideration here though is that the default argument for
--config-fileis "infrahub.toml", and there's a scenario where the file is just silently found. It's not clear which setting should win in that case the config file or the environment variable.