Skip to content

Commit d37f059

Browse files
authored
Fix targetless check in layer (metalbear-co#2445)
* Targetless check fixed * Changelog entry
1 parent 4ec58fb commit d37f059

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

changelog.d/2444.fixed.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed agent crashing when mirrord target is explicitly set to `targetless`.

mirrord/layer/src/setup.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use mirrord_config::{
77
fs::FsConfig,
88
network::{incoming::IncomingConfig, outgoing::OutgoingConfig},
99
},
10+
target::Target,
1011
util::VecOrSingle,
1112
LayerConfig,
1213
};
@@ -103,7 +104,12 @@ impl LayerSetup {
103104
}
104105

105106
pub fn targetless(&self) -> bool {
106-
self.config.target.path.is_none()
107+
self.config
108+
.target
109+
.path
110+
.as_ref()
111+
.map(|path| matches!(path, Target::Targetless))
112+
.unwrap_or(true)
107113
}
108114

109115
pub fn sip_binaries(&self) -> Vec<String> {

0 commit comments

Comments
 (0)