Skip to content

Commit 453c564

Browse files
committed
test: enable on-host attributes integration tests
1 parent d950729 commit 453c564

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

agent-control/tests/k8s/scenarios/attributes.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![cfg(target_family = "unix")]
21
use crate::common::attributes::{
32
check_latest_identifying_attributes_match_expected,
43
check_latest_non_identifying_attributes_match_expected, convert_to_vec_key_value,
@@ -16,9 +15,9 @@ use newrelic_agent_control::agent_control::defaults::{
1615
OPAMP_SERVICE_NAMESPACE, OPAMP_SERVICE_VERSION, OPAMP_SUBAGENT_CHART_VERSION_ATTRIBUTE_KEY,
1716
PARENT_AGENT_ID_ATTRIBUTE_KEY,
1817
};
19-
use nix::unistd::gethostname;
2018
use opamp_client::opamp::proto::any_value::Value;
2119
use opamp_client::opamp::proto::any_value::Value::BytesValue;
20+
use resource_detection::system::hostname::get_hostname;
2221
use std::time::Duration;
2322
use tempfile::tempdir;
2423

@@ -82,7 +81,7 @@ agents:
8281
let ac_expected_non_identifying_attributes = convert_to_vec_key_value(Vec::from([
8382
(
8483
HOST_NAME_ATTRIBUTE_KEY,
85-
Value::StringValue(gethostname().unwrap_or_default().into_string().unwrap()),
84+
Value::StringValue(get_hostname().unwrap_or_default()),
8685
),
8786
(
8887
FLEET_ID_ATTRIBUTE_KEY,

0 commit comments

Comments
 (0)