Skip to content

Commit

Permalink
chore(bors): merge pull request openebs#708
Browse files Browse the repository at this point in the history
708: feat(eventing): add node name to nvme path events r=tiagolobocastro a=datacore-vvarakantham

Adding node name in the NvmePathFail and NvmePathSuspect events.

Co-authored-by: Vandana Varakantham <[email protected]>
  • Loading branch information
mayastor-bors and datacore-vvarakantham committed Jan 8, 2024
2 parents 9d3c484 + aa48fec commit 1aec7c0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions control-plane/agents/src/bin/ha/node/detector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ impl NvmePathCache {

impl Event for PathRecord {
fn event(&self, action: EventAction) -> EventMessage {
let event_source =
EventSource::new("".to_string()).with_nvme_path_data(&self.nqn, &self.path);
let event_source = EventSource::new(self.reporter.node_name().to_string())
.with_nvme_path_data(&self.nqn, &self.path);
EventMessage {
category: EventCategory::NvmePath as i32,
action: action as i32,
Expand Down
5 changes: 5 additions & 0 deletions control-plane/agents/src/bin/ha/node/reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ impl PathReporter {
self.channel.send(nqn).ok();
}
}

/// Get node name.
pub fn node_name(&self) -> &str {
&self.node_name
}
}

#[derive(Debug)]
Expand Down
4 changes: 4 additions & 0 deletions deployer/src/infra/agents/ha/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ impl ComponentAction for HaNodeAgent {
let jaeger_config = format!("jaeger.{}:6831", cfg.get_name());
spec = spec.with_args(vec!["--jaeger", &jaeger_config])
};
if options.eventing {
let nats_server_url = "nats://nats:4222";
spec = spec.with_args(vec!["--events-url", nats_server_url]);
};

Ok(cfg.add_container_spec(spec))
}
Expand Down

0 comments on commit 1aec7c0

Please sign in to comment.