Skip to content

Commit a0f7f60

Browse files
committed
Fix
1 parent 47f8297 commit a0f7f60

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/router/src/pipeline/progressive_override.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl StableOverrideContext {
119119
/// It's intended to be used as a shared state in the router.
120120
pub struct OverrideLabelsEvaluator {
121121
static_enabled_labels: HashSet<String>,
122-
expressions: HashMap<String, VrlProgram>,
122+
expressions: HashMap<String, Expression>,
123123
}
124124

125125
impl OverrideLabelsEvaluator {
@@ -174,7 +174,7 @@ impl OverrideLabelsEvaluator {
174174
let mut ctx = VrlContext::new(&mut target, &mut state, &timezone);
175175

176176
for (label, expression) in &self.expressions {
177-
match expression.resolve(&mut ctx) {
177+
match expression.execute_with_context(&mut ctx) {
178178
Ok(evaluated_value) => match evaluated_value {
179179
VrlValue::Boolean(true) => {
180180
active_flags.insert(label.clone());

lib/router-config/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jsonwebtoken = { workspace = true }
2424
retry-policies = { workspace = true}
2525
tracing = { workspace = true }
2626

27+
once_cell = "1.21.3"
2728
schemars = "1.0.4"
2829
humantime-serde = "1.1.1"
2930
config = { version = "0.15.14", features = ["yaml", "json", "json5"] }

lib/router-config/src/override_labels.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use schemars::JsonSchema;
22
use serde::{Deserialize, Serialize};
33
use std::collections::HashMap;
44

5+
use crate::primitives::expression::Expression;
6+
57
/// A map of label names to their override configuration.
68
pub type OverrideLabelsConfig = HashMap<String, LabelOverrideValue>;
79

@@ -15,10 +17,7 @@ pub enum LabelOverrideValue {
1517
/// A static boolean value to enable or disable the label.
1618
Boolean(bool),
1719
/// A dynamic value computed by an expression.
18-
Expression {
19-
/// An expression that must evaluate to a boolean. If true, the label will be applied.
20-
expression: String,
21-
},
20+
Expression(Expression),
2221
}
2322

2423
impl LabelOverrideValue {

0 commit comments

Comments
 (0)