From 0bec42d005a9695d45238edb6143966ccc92aded Mon Sep 17 00:00:00 2001 From: Jesse Szwedko Date: Mon, 11 Mar 2024 15:30:43 -0700 Subject: [PATCH] chore(cli)!: Update default for --strict-env-vars to true (#20062) This deprecates this option. Signed-off-by: Jesse Szwedko --- changelog.d/deprecate_strict_env_vars.breaking.md | 4 ++++ docs/DEPRECATIONS.md | 6 +++--- src/cli.rs | 11 ++++++----- website/cue/reference/cli.cue | 8 ++++++-- 4 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 changelog.d/deprecate_strict_env_vars.breaking.md diff --git a/changelog.d/deprecate_strict_env_vars.breaking.md b/changelog.d/deprecate_strict_env_vars.breaking.md new file mode 100644 index 00000000000000..2fd268c132a9b5 --- /dev/null +++ b/changelog.d/deprecate_strict_env_vars.breaking.md @@ -0,0 +1,4 @@ +The default of `--strict-env-vars` has been changed to `true`. This option has been deprecated. In +a future version it will be removed and Vector will have the behavior it currently has when set +to `true` which is that missing environment variables will cause Vector to fail to start up with an +error instead of a warning. diff --git a/docs/DEPRECATIONS.md b/docs/DEPRECATIONS.md index 019a262d706bd0..a18ed62e132a8a 100644 --- a/docs/DEPRECATIONS.md +++ b/docs/DEPRECATIONS.md @@ -16,7 +16,7 @@ For example: ## To be migrated -- v0.37.0 strict_env_vars Change the default for missing environment variable interpolation from - warning to erroring. - ## To be removed + +- v0.38.0 strict_env_vars Remove option for configuring missing environment variable interpolation + to be a warning rather than an error diff --git a/src/cli.rs b/src/cli.rs index 441cce9f720df0..297dff89a86104 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -213,11 +213,12 @@ pub struct RootOpts { #[arg(long, env = "VECTOR_ALLOW_EMPTY_CONFIG", default_value = "false")] pub allow_empty_config: bool, - /// Turn on strict mode for environment variable interpolation. When set, interpolation of a - /// missing environment variable in configuration files will cause an error instead of a - /// warning, which will result in a failure to load any such configuration file. This defaults - /// to false, but that default is deprecated and will be changed to strict in future versions. - #[arg(long, env = "VECTOR_STRICT_ENV_VARS", default_value = "false")] + /// Turn on strict mode for environment variable interpolation. When set, interpolation of + /// a missing environment variable in configuration files will cause an error instead of + /// a warning, which will result in a failure to load any such configuration file. This option + /// is deprecated and will be removed in a future version to remove the ability to downgrade + /// missing environment variables to warnings. + #[arg(long, env = "VECTOR_STRICT_ENV_VARS", default_value = "true")] pub strict_env_vars: bool, } diff --git a/website/cue/reference/cli.cue b/website/cue/reference/cli.cue index 33b5ef448e062b..8e839a32ec40dd 100644 --- a/website/cue/reference/cli.cue +++ b/website/cue/reference/cli.cue @@ -658,9 +658,13 @@ cli: { } VECTOR_STRICT_ENV_VARS: { description: """ - Turn on strict mode for environment variable interpolation. When set, interpolation of a missing environment variable in configuration files will cause an error instead of a warning, which will result in a failure to load any such configuration file. This defaults to false, but that default is deprecated and will be changed to strict in future versions. + Turn on strict mode for environment variable interpolation. When set, interpolation of a missing + environment variable in configuration files will cause an error instead of a warning, which will + result in a failure to load any such configuration file. This option is deprecated and will be + removed in a future version to remove the ability to downgrade missing environment variables to + warnings. """ - type: bool: default: false + type: bool: default: true } }