From e68e859796f632995737825d9a2665a2d6c535f5 Mon Sep 17 00:00:00 2001 From: Pavlos Rontidis Date: Fri, 6 Oct 2023 13:31:26 -0400 Subject: [PATCH 1/8] chore(config, docs): delete deprecated vector.toml code --- src/cli.rs | 5 ++--- src/config/cmd.rs | 4 +--- src/config/loading/mod.rs | 22 +++------------------- src/tap/cmd.rs | 2 +- src/top/cmd.rs | 2 +- src/validate.rs | 6 +++--- website/cue/reference/configuration.cue | 3 +-- 7 files changed, 12 insertions(+), 32 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index ff7f35a3116c7..4531ff740397f 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,4 +1,5 @@ #![allow(missing_docs)] + use std::{num::NonZeroU64, path::PathBuf}; use clap::{ArgAction, CommandFactory, FromArgMatches, Parser}; @@ -64,9 +65,7 @@ pub struct RootOpts { /// Read configuration from one or more files. Wildcard paths are supported. /// File format is detected from the file name. /// If zero files are specified the deprecated default config path - /// `/etc/vector/vector.toml` will be targeted. - /// And if the aforementioned file does not exist, - /// then `/etc/vector/vector.yaml` will be used. + /// `/etc/vector/vector.yaml` will be targeted. #[arg( id = "config", short, diff --git a/src/config/cmd.rs b/src/config/cmd.rs index f3c3104cfe5e8..ddd7b91edb932 100644 --- a/src/config/cmd.rs +++ b/src/config/cmd.rs @@ -21,9 +21,7 @@ pub struct Opts { /// Read configuration from one or more files. Wildcard paths are supported. /// File format is detected from the file name. /// If zero files are specified the deprecated default config path - /// `/etc/vector/vector.toml` will be targeted. - /// And if the aforementioned file does not exist, - /// then `/etc/vector/vector.yaml` will be used. + /// `/etc/vector/vector.yaml` will be targeted. #[arg( id = "config", short, diff --git a/src/config/loading/mod.rs b/src/config/loading/mod.rs index f7ac2d4c648bc..092fc826dac6e 100644 --- a/src/config/loading/mod.rs +++ b/src/config/loading/mod.rs @@ -304,39 +304,23 @@ where #[cfg(not(windows))] fn default_path() -> PathBuf { - "/etc/vector/vector.toml".into() + "/etc/vector/vector.yaml".into() } #[cfg(windows)] fn default_path() -> PathBuf { let program_files = std::env::var("ProgramFiles").expect("%ProgramFiles% environment variable must be defined"); - format!("{}\\Vector\\config\\vector.toml", program_files).into() + format!("{}\\Vector\\config\\vector.yaml", program_files).into() } fn default_config_paths() -> Vec { #[cfg(not(windows))] let default_path = default_path(); - #[cfg(windows)] let default_path = default_path(); - let yaml_path = default_path.with_extension("yaml"); - if default_path.exists() { - warn!("DEPRECATED Using the deprecated {:?} config path as the default config location. Vector is migrating \ - to YAML as the default config format. Future Vector versions will use {:?} as the default config location.", - default_path, - yaml_path); - - vec![ConfigPath::File(default_path, Some(Format::Toml))] - } else { - warn!( - "The {:?} config path does not exist. Vector will attempt to use new default {:?} instead.", - default_path, yaml_path - ); - - vec![ConfigPath::File(yaml_path, Some(Format::Yaml))] - } + vec![ConfigPath::File(default_path, Some(Format::Yaml))] } #[cfg(all( diff --git a/src/tap/cmd.rs b/src/tap/cmd.rs index f06529ed77b4b..a5c4f20eede12 100644 --- a/src/tap/cmd.rs +++ b/src/tap/cmd.rs @@ -32,7 +32,7 @@ pub(crate) async fn cmd(opts: &super::Opts, signal_rx: SignalRx) -> exitcode::Ex Have you enabled the API? - To enable the API, add the following to your `vector.toml` config file: + To enable the API, add the following to your Vector config file: [api] enabled = true"}, diff --git a/src/top/cmd.rs b/src/top/cmd.rs index a774ca7bcc448..2617ed0721259 100644 --- a/src/top/cmd.rs +++ b/src/top/cmd.rs @@ -37,7 +37,7 @@ pub async fn cmd(opts: &super::Opts) -> exitcode::ExitCode { Have you enabled the API? - To enable the API, add the following to your `vector.toml` config file: + To enable the API, add the following to your Vector config file: [api] enabled = true"}, diff --git a/src/validate.rs b/src/validate.rs index 121b8a161a813..318ff7347ef93 100644 --- a/src/validate.rs +++ b/src/validate.rs @@ -1,4 +1,5 @@ #![allow(missing_docs)] + use std::{collections::HashMap, fmt, fs::remove_dir_all, path::PathBuf}; use clap::Parser; @@ -53,9 +54,8 @@ pub struct Opts { /// Any number of Vector config files to validate. /// Format is detected from the file name. - /// If none are specified the default config path `/etc/vector/vector.toml` - /// will be targeted. And if the aforementioned file does not exist, - // then `/etc/vector/vector.yaml` will be used. + /// If none are specified the default config path `/etc/vector/vector.yaml` + /// will be targeted. #[arg(env = "VECTOR_CONFIG", value_delimiter(','))] pub paths: Vec, diff --git a/website/cue/reference/configuration.cue b/website/cue/reference/configuration.cue index c93b155256803..83a64684bbb96 100644 --- a/website/cue/reference/configuration.cue +++ b/website/cue/reference/configuration.cue @@ -711,8 +711,7 @@ configuration: { title: "Location" body: """ The location of your Vector configuration file depends on your installation method. For most Linux - based systems, the file can be found at `/etc/vector/vector.toml`. And if the aforementioned file does - not exist, then `/etc/vector/vector.yaml` will be used. + based systems, the file can be found at `/etc/vector/vector.yaml`. All files in `/etc/vector` are user configuration files and can be safely overridden to craft your desired Vector configuration. From 57534017e22b34d04ab6f473a2eef206773469c2 Mon Sep 17 00:00:00 2001 From: Pavlos Rontidis Date: Fri, 6 Oct 2023 14:12:47 -0400 Subject: [PATCH 2/8] Update src/validate.rs Co-authored-by: Heston Hoffman --- src/validate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/validate.rs b/src/validate.rs index 318ff7347ef93..ea3097f154756 100644 --- a/src/validate.rs +++ b/src/validate.rs @@ -54,7 +54,7 @@ pub struct Opts { /// Any number of Vector config files to validate. /// Format is detected from the file name. - /// If none are specified the default config path `/etc/vector/vector.yaml` + /// If none are specified, the default config path `/etc/vector/vector.yaml` /// will be targeted. #[arg(env = "VECTOR_CONFIG", value_delimiter(','))] pub paths: Vec, From b1bb7a78a6ddd46129789072e7e86865a3f1654f Mon Sep 17 00:00:00 2001 From: Pavlos Rontidis Date: Fri, 6 Oct 2023 14:12:53 -0400 Subject: [PATCH 3/8] Update src/cli.rs Co-authored-by: Heston Hoffman --- src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.rs b/src/cli.rs index 4531ff740397f..0642684439ba2 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -64,7 +64,7 @@ impl Opts { pub struct RootOpts { /// Read configuration from one or more files. Wildcard paths are supported. /// File format is detected from the file name. - /// If zero files are specified the deprecated default config path + /// If zero files are specified, the deprecated default config path /// `/etc/vector/vector.yaml` will be targeted. #[arg( id = "config", From ccf653810cd9ba4d1676a15660321e9c9633eea9 Mon Sep 17 00:00:00 2001 From: Pavlos Rontidis Date: Fri, 6 Oct 2023 14:12:59 -0400 Subject: [PATCH 4/8] Update src/validate.rs Co-authored-by: Heston Hoffman --- src/validate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/validate.rs b/src/validate.rs index ea3097f154756..bd35909e47822 100644 --- a/src/validate.rs +++ b/src/validate.rs @@ -55,7 +55,7 @@ pub struct Opts { /// Any number of Vector config files to validate. /// Format is detected from the file name. /// If none are specified, the default config path `/etc/vector/vector.yaml` - /// will be targeted. + /// is targeted. #[arg(env = "VECTOR_CONFIG", value_delimiter(','))] pub paths: Vec, From 8fa817c84c9bd07b29158d6f3d6c7d6e70fab9c6 Mon Sep 17 00:00:00 2001 From: Pavlos Rontidis Date: Fri, 6 Oct 2023 14:13:06 -0400 Subject: [PATCH 5/8] Update src/cli.rs Co-authored-by: Heston Hoffman --- src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.rs b/src/cli.rs index 0642684439ba2..794ca3ade12e0 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -65,7 +65,7 @@ pub struct RootOpts { /// Read configuration from one or more files. Wildcard paths are supported. /// File format is detected from the file name. /// If zero files are specified, the deprecated default config path - /// `/etc/vector/vector.yaml` will be targeted. + /// `/etc/vector/vector.yaml` is targeted. #[arg( id = "config", short, From d3f68c6cdcaf5c5f25f475750e4b360ad5d5e392 Mon Sep 17 00:00:00 2001 From: Pavlos Rontidis Date: Fri, 6 Oct 2023 14:13:12 -0400 Subject: [PATCH 6/8] Update src/config/cmd.rs Co-authored-by: Heston Hoffman --- src/config/cmd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/cmd.rs b/src/config/cmd.rs index ddd7b91edb932..db200d353bf1f 100644 --- a/src/config/cmd.rs +++ b/src/config/cmd.rs @@ -20,7 +20,7 @@ pub struct Opts { /// Read configuration from one or more files. Wildcard paths are supported. /// File format is detected from the file name. - /// If zero files are specified the deprecated default config path + /// If zero files are specified, the deprecated default config path /// `/etc/vector/vector.yaml` will be targeted. #[arg( id = "config", From 0710a0f5c54150153d7ffc6a082aad28b6dd66e5 Mon Sep 17 00:00:00 2001 From: Pavlos Rontidis Date: Fri, 6 Oct 2023 14:13:19 -0400 Subject: [PATCH 7/8] Update src/config/cmd.rs Co-authored-by: Heston Hoffman --- src/config/cmd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/cmd.rs b/src/config/cmd.rs index db200d353bf1f..64b04aeafb546 100644 --- a/src/config/cmd.rs +++ b/src/config/cmd.rs @@ -21,7 +21,7 @@ pub struct Opts { /// Read configuration from one or more files. Wildcard paths are supported. /// File format is detected from the file name. /// If zero files are specified, the deprecated default config path - /// `/etc/vector/vector.yaml` will be targeted. + /// `/etc/vector/vector.yaml` is targeted. #[arg( id = "config", short, From 9500d72c88cd915b04b9caf6daa148b414b4d03b Mon Sep 17 00:00:00 2001 From: Pavlos Rontidis Date: Fri, 6 Oct 2023 14:22:52 -0400 Subject: [PATCH 8/8] remove 'to be removed' entry --- docs/DEPRECATIONS.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/DEPRECATIONS.md b/docs/DEPRECATIONS.md index 061e19f36e9ed..6d1586930bd12 100644 --- a/docs/DEPRECATIONS.md +++ b/docs/DEPRECATIONS.md @@ -8,4 +8,3 @@ See [DEPRECATION.md](docs/DEPRECATION.md#process) for the process for updating t * legacy_openssl_provider v0.34.0 OpenSSL legacy provider flag should be removed * armv7_rpm v0.34.0 The armv7 RPM packages should be removed (replaced by armv7hl) -* yaml_migration v0.34.0 Prefer loading `/etc/vector/vector.yaml` first