diff --git a/Cargo.lock b/Cargo.lock index 9336521d..c349c11f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -410,7 +410,7 @@ dependencies = [ [[package]] name = "defguard_version" version = "0.0.0" -source = "git+https://github.com/DefGuard/defguard.git?rev=a5709e7117103458ad8417d4437a8a369ca5bbce#a5709e7117103458ad8417d4437a8a369ca5bbce" +source = "git+https://github.com/DefGuard/defguard.git?rev=db678a95398e38b72bbb4ecef36a27caa427e48c#db678a95398e38b72bbb4ecef36a27caa427e48c" dependencies = [ "http", "os_info", diff --git a/Cargo.toml b/Cargo.toml index b7d63934..fd41f589 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "1.5.0" edition = "2021" [dependencies] -defguard_version = { git = "https://github.com/DefGuard/defguard.git", rev = "a5709e7117103458ad8417d4437a8a369ca5bbce" } +defguard_version = { git = "https://github.com/DefGuard/defguard.git", rev = "db678a95398e38b72bbb4ecef36a27caa427e48c" } axum = { version = "0.8", features = ["macros"] } base64 = "0.22" clap = { version = "4.5", features = ["derive", "env"] } diff --git a/src/version.rs b/src/version.rs index dcd9e985..754bc7f4 100644 --- a/src/version.rs +++ b/src/version.rs @@ -1,4 +1,4 @@ -use defguard_version::Version; +use defguard_version::{is_version_lower, Version}; const MIN_CORE_VERSION: Version = Version::new(1, 5, 0); @@ -6,10 +6,11 @@ const MIN_CORE_VERSION: Version = Version::new(1, 5, 0); /// Terminates the process if it doesn't. pub(crate) fn ensure_core_version_supported(core_version: Option<&Version>) { let Some(core_version) = core_version else { - error!("Missing core component version information. This most likely means that core component uses unsupported version. Exiting."); + error!("Missing core component version information. This most likely means that core component uses outdated version. Exiting."); std::process::exit(1); }; - if core_version < &MIN_CORE_VERSION { + + if is_version_lower(core_version, &MIN_CORE_VERSION) { error!("Core version {core_version} is not supported. Minimal supported core version is {MIN_CORE_VERSION}. Exiting."); std::process::exit(1); }