Skip to content

Commit

Permalink
chore(cli)!: Update default for --strict-env-vars to true (#20062)
Browse files Browse the repository at this point in the history
This deprecates this option.

Signed-off-by: Jesse Szwedko <[email protected]>
  • Loading branch information
jszwedko committed Mar 11, 2024
1 parent 4804e17 commit 0bec42d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
4 changes: 4 additions & 0 deletions changelog.d/deprecate_strict_env_vars.breaking.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 3 additions & 3 deletions docs/DEPRECATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 6 additions & 5 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
8 changes: 6 additions & 2 deletions website/cue/reference/cli.cue
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down

0 comments on commit 0bec42d

Please sign in to comment.