Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions src/alerts/alert_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,6 @@ use serde_json::Value;
use tokio::sync::{RwLock, mpsc};
use ulid::Ulid;

const RESERVED_FIELDS: &[&str] = &[
"id",
"version",
"severity",
"title",
"query",
"datasets",
"alertType",
"anomalyConfig",
"forecastConfig",
"thresholdConfig",
"notificationConfig",
"evalConfig",
"targets",
"tags",
"state",
"notificationState",
"created",
"lastTriggeredAt",
];

use crate::{
alerts::{
AlertError, CURRENT_ALERTS_VERSION,
Expand Down Expand Up @@ -336,15 +315,6 @@ impl AlertRequest {
other_fields.len()
)));
}

for key in other_fields.keys() {
if RESERVED_FIELDS.contains(&key.as_str()) {
return Err(AlertError::ValidationFailure(format!(
"Field '{}' cannot be in other_fields as it's a reserved field name",
key
)));
}
}
}

// Validate that all target IDs exist
Expand Down
Loading