From c80b254553d78c6fc52342d69fc04e70159a1969 Mon Sep 17 00:00:00 2001 From: Razz4780 Date: Tue, 5 Dec 2023 16:46:16 +0100 Subject: [PATCH] Fixed config verification in IDEs with 'copy_target' feature --- changelog.d/+fix-verification.fixed.md | 1 + mirrord/config/src/config.rs | 2 +- mirrord/config/src/lib.rs | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelog.d/+fix-verification.fixed.md diff --git a/changelog.d/+fix-verification.fixed.md b/changelog.d/+fix-verification.fixed.md new file mode 100644 index 00000000000..e588fd9fdc1 --- /dev/null +++ b/changelog.d/+fix-verification.fixed.md @@ -0,0 +1 @@ +Fixed config verification in IDE context when `copy_target` feature is used. \ No newline at end of file diff --git a/mirrord/config/src/config.rs b/mirrord/config/src/config.rs index 8079bb795d6..d842a89d200 100644 --- a/mirrord/config/src/config.rs +++ b/mirrord/config/src/config.rs @@ -58,7 +58,7 @@ pub type Result = std::result::Result; /// Struct used for storing context during building of configuration. #[derive(Default)] pub struct ConfigContext { - /// Are we in a IDE context? + /// Are we in an IDE context? /// /// Used by `Config::verify` to change some errors into warnings. pub ide: bool, diff --git a/mirrord/config/src/lib.rs b/mirrord/config/src/lib.rs index 4cacab9a95b..98cb0c5e4aa 100644 --- a/mirrord/config/src/lib.rs +++ b/mirrord/config/src/lib.rs @@ -442,7 +442,8 @@ impl LayerConfig { )); } - if self.target.path.is_none() { + // Target may also be set later in the UI. + if self.target.path.is_none() && !context.ide { return Err(ConfigError::Conflict( "The copy target feature is not compatible with a targetless agent, \ please either disable this option or specify a target."