actually works in test now

This commit is contained in:
tahahawa
2025-06-25 16:33:43 -04:00
parent 5c22fc8823
commit ca4e4d871a
4 changed files with 25 additions and 3 deletions

View File

@@ -9,5 +9,6 @@ license.workspace = true
harmony = { version = "0.1.0", path = "../../harmony" }
harmony_cli = { version = "0.1.0", path = "../../harmony_cli" }
harmony_macros = { version = "0.1.0", path = "../../harmony_macros" }
serde_yaml.workspace = true
tokio.workspace = true
url.workspace = true

View File

@@ -19,6 +19,7 @@ use harmony::{
};
use harmony_macros::http_scheme;
use serde_yaml::{Mapping, Value};
#[tokio::main]
async fn main() {
@@ -55,13 +56,24 @@ async fn main() {
relabelings: vec![],
};
let mut selector = Mapping::new();
selector.insert(
Value::from("matchExpressions"),
serde_yaml::to_value(vec![Selector {
key: "monitored".to_string(),
operator: "In".to_string(),
values: vec!["test-service-1".to_string()],
}])
.expect("couldn't create mapping value"),
);
let service_monitor = ServiceMonitor {
name: "test service monitor".to_string(),
name: "test-service-monitor".to_string(),
additional_labels: None,
job_label: None,
target_labels: vec![],
pod_target_labels: vec![],
selector: None,
selector: selector,
match_labels: None,
namespace_selector: None,
endpoints: vec![service_monitor_endpoint],