diff --git a/Release.toml b/Release.toml index 9cfa1e04aa0..94dfdb489b2 100644 --- a/Release.toml +++ b/Release.toml @@ -297,4 +297,6 @@ version = "1.20.0" "migrate_v1.20.0_update-ecs-config-path.lz4", "migrate_v1.20.0_update-ecs-config-template-path.lz4", "migrate_v1.20.0_add-ntp-default-options-v0-1-0.lz4", + "migrate_v1.20.0_static-pods-add-prefix-v0-1-0.lz4", + "migrate_v1.20.0_static-pods-services-cfg-v0-1-0.lz4", ] diff --git a/packages/static-pods/Cargo.toml b/packages/static-pods/Cargo.toml index 85fd40b767a..69290ff19af 100644 --- a/packages/static-pods/Cargo.toml +++ b/packages/static-pods/Cargo.toml @@ -5,6 +5,11 @@ edition = "2021" publish = false build = "../build.rs" +[package.metadata.build-package] +source-groups = [ + "api/static-pods" +] + [lib] path = "../packages.rs" diff --git a/packages/static-pods/static-pods.spec b/packages/static-pods/static-pods.spec index 13c6d026807..363723148b8 100644 --- a/packages/static-pods/static-pods.spec +++ b/packages/static-pods/static-pods.spec @@ -35,4 +35,4 @@ install -p -m 0644 %{S:0} %{buildroot}%{_cross_templatedir} %files %{_cross_bindir}/static-pods -%{_cross_templatedir}/static-pods-toml \ No newline at end of file +%{_cross_templatedir}/static-pods-toml diff --git a/sources/Cargo.lock b/sources/Cargo.lock index 55815ea9f23..8a372f9e505 100644 --- a/sources/Cargo.lock +++ b/sources/Cargo.lock @@ -4105,6 +4105,20 @@ dependencies = [ "toml", ] +[[package]] +name = "static-pods-add-prefix-v0-1-0" +version = "0.1.0" +dependencies = [ + "migration-helpers", +] + +[[package]] +name = "static-pods-services-cfg-v0-1-0" +version = "0.1.0" +dependencies = [ + "migration-helpers", +] + [[package]] name = "storewolf" version = "0.1.0" diff --git a/sources/Cargo.toml b/sources/Cargo.toml index c0a8e8f95e2..f6b69248da2 100644 --- a/sources/Cargo.toml +++ b/sources/Cargo.toml @@ -80,6 +80,8 @@ members = [ "api/migration/migrations/v1.20.0/update-ecs-config-path", "api/migration/migrations/v1.20.0/update-ecs-config-template-path", "api/migration/migrations/v1.20.0/add-ntp-default-options-v0-1-0", + "api/migration/migrations/v1.20.0/static-pods-add-prefix-v0-1-0", + "api/migration/migrations/v1.20.0/static-pods-services-cfg-v0-1-0", "bloodhound", diff --git a/sources/api/migration/migrations/v1.20.0/static-pods-add-prefix-v0-1-0/Cargo.toml b/sources/api/migration/migrations/v1.20.0/static-pods-add-prefix-v0-1-0/Cargo.toml new file mode 100644 index 00000000000..08354cf089c --- /dev/null +++ b/sources/api/migration/migrations/v1.20.0/static-pods-add-prefix-v0-1-0/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "static-pods-add-prefix-v0-1-0" +version = "0.1.0" +authors = ["Jarrett Tierney "] +license = "Apache-2.0 OR MIT" +edition = "2021" +publish = false +exclude = ["README.md"] + +[dependencies] +migration-helpers = { path = "../../../migration-helpers", version = "0.1.0" } diff --git a/sources/api/migration/migrations/v1.20.0/static-pods-add-prefix-v0-1-0/src/main.rs b/sources/api/migration/migrations/v1.20.0/static-pods-add-prefix-v0-1-0/src/main.rs new file mode 100644 index 00000000000..c0a95ae7118 --- /dev/null +++ b/sources/api/migration/migrations/v1.20.0/static-pods-add-prefix-v0-1-0/src/main.rs @@ -0,0 +1,16 @@ +use migration_helpers::common_migrations::AddPrefixesMigration; +use migration_helpers::{migrate, Result}; +use std::process; + +fn run() -> Result<()> { + migrate(AddPrefixesMigration(vec![ + "configuration-files.static-pods-toml", + ])) +} + +fn main() { + if let Err(e) = run() { + eprintln!("{}", e); + process::exit(1); + } +} diff --git a/sources/api/migration/migrations/v1.20.0/static-pods-services-cfg-v0-1-0/Cargo.toml b/sources/api/migration/migrations/v1.20.0/static-pods-services-cfg-v0-1-0/Cargo.toml new file mode 100644 index 00000000000..f1e72224cb1 --- /dev/null +++ b/sources/api/migration/migrations/v1.20.0/static-pods-services-cfg-v0-1-0/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "static-pods-services-cfg-v0-1-0" +version = "0.1.0" +authors = ["Jarrett Tierney "] +license = "Apache-2.0 OR MIT" +edition = "2021" +publish = false +exclude = ["README.md"] + +[dependencies] +migration-helpers = { path = "../../../migration-helpers", version = "0.1.0" } diff --git a/sources/api/migration/migrations/v1.20.0/static-pods-services-cfg-v0-1-0/src/main.rs b/sources/api/migration/migrations/v1.20.0/static-pods-services-cfg-v0-1-0/src/main.rs new file mode 100644 index 00000000000..6c170aa6fa7 --- /dev/null +++ b/sources/api/migration/migrations/v1.20.0/static-pods-services-cfg-v0-1-0/src/main.rs @@ -0,0 +1,18 @@ +use migration_helpers::common_migrations::{ListReplacement, ReplaceListsMigration}; +use migration_helpers::{migrate, Result}; +use std::process; + +fn run() -> Result<()> { + migrate(ReplaceListsMigration(vec![ListReplacement { + setting: "services.static-pods.configuration-files", + old_vals: &[], + new_vals: &["static-pods-toml"], + }])) +} + +fn main() { + if let Err(e) = run() { + eprintln!("{}", e); + process::exit(1); + } +} diff --git a/sources/api/static-pods/Cargo.toml b/sources/api/static-pods/Cargo.toml index 1b360c02393..6354c7f9f59 100644 --- a/sources/api/static-pods/Cargo.toml +++ b/sources/api/static-pods/Cargo.toml @@ -13,7 +13,7 @@ exclude = ["README.md"] base64 = "0.21" log = "0.4" modeled-types = { path = "../../models/modeled-types", version = "0.1" } -serde = { version = "1.0", features = ["default"]} +serde = { version = "1", features = ["default"]} simplelog = "0.12" snafu = "0.8" toml = "0.8"