Skip to content

Commit 1908acf

Browse files
committed
Expose target container targetting
When I implemented this in #906 I was working in a stack and completely lost track of exposing this new work in the CLI: there was no way to flip this feature on. Fixed in this PR. Signed-off-by: Brian L. Troutwine <[email protected]>
1 parent eca9cdd commit 1908acf

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9+
## [0.22.0-rc1]
10+
### Fixed
11+
- Target observer was not exposed through CLI.
12+
913
## [0.22.0-rc0]
1014
### Added
1115
- Target observer now allows a docker target, identified by name.

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lading/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lading"
3-
version = "0.22.0-rc0"
3+
version = "0.22.0-rc1"
44
authors = [
55
"Brian L. Troutwine <[email protected]>",
66
"George Hahn <[email protected]>",

lading/src/bin/lading.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl FromStr for CliKeyValues {
131131
#[clap(group(
132132
ArgGroup::new("target")
133133
.required(true)
134-
.args(&["target-path", "target-pid", "no-target"]),
134+
.args(&["target-path", "target-pid", "target-container", "no-target"]),
135135
))]
136136
#[clap(group(
137137
ArgGroup::new("telemetry")
@@ -153,6 +153,9 @@ struct Opts {
153153
/// measure an externally-launched process by PID
154154
#[clap(long)]
155155
target_pid: Option<NonZeroU32>,
156+
/// measure an externally-launched container by name
157+
#[clap(long)]
158+
target_container: Option<String>,
156159
/// disable target measurement
157160
#[clap(long)]
158161
no_target: bool,
@@ -264,6 +267,10 @@ fn get_config(ops: &Opts, config: Option<String>) -> Result<Config, Error> {
264267
None
265268
} else if let Some(pid) = ops.target_pid {
266269
Some(target::Config::Pid(target::PidConfig { pid }))
270+
} else if let Some(name) = &ops.target_container {
271+
Some(target::Config::Docker(target::DockerConfig {
272+
name: name.clone(),
273+
}))
267274
} else if let Some(path) = &ops.target_path {
268275
Some(target::Config::Binary(target::BinaryConfig {
269276
command: path.clone(),

0 commit comments

Comments
 (0)