From bbbaee847891baee40330880cc31d9c3bc390952 Mon Sep 17 00:00:00 2001 From: Juan Manuel Leflet Estrada Date: Fri, 15 Nov 2024 16:18:52 +0100 Subject: [PATCH] Revert "Do not export ChainTemplate members" This reverts commit cc856166a53c180c109630592cffcfd92c823066. --- engine/conditions.go | 12 ++++++------ rule-example.yaml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/engine/conditions.go b/engine/conditions.go index 5112fb63..59936c8c 100644 --- a/engine/conditions.go +++ b/engine/conditions.go @@ -165,8 +165,8 @@ func (a AndCondition) Evaluate(ctx context.Context, log logr.Logger, condCtx Con } if c.As != "" { condCtx.Template[c.As] = ChainTemplate{ - filepaths: incidentsToFilepaths(response.Incidents), - extras: response.TemplateContext, + Filepaths: incidentsToFilepaths(response.Incidents), + Extras: response.TemplateContext, } } @@ -223,8 +223,8 @@ func (o OrCondition) Evaluate(ctx context.Context, log logr.Logger, condCtx Cond if c.As != "" { condCtx.Template[c.As] = ChainTemplate{ - filepaths: incidentsToFilepaths(response.Incidents), - extras: response.TemplateContext, + Filepaths: incidentsToFilepaths(response.Incidents), + Extras: response.TemplateContext, } } @@ -299,6 +299,6 @@ func gatherChain(start ConditionEntry, entries []ConditionEntry) []ConditionEntr // Chain Templates are used by rules and providers to pass context around during rule execution. type ChainTemplate struct { - filepaths []string `yaml:"filepaths"` - extras map[string]interface{} `yaml:"extras"` + Filepaths []string `yaml:"filepaths"` + Extras map[string]interface{} `yaml:"extras"` } diff --git a/rule-example.yaml b/rule-example.yaml index c504d1b9..40743bfe 100644 --- a/rule-example.yaml +++ b/rule-example.yaml @@ -417,5 +417,5 @@ - java.referenced: pattern: org.springframework.web.WebApplicationInitializer location: IMPLEMENTS_TYPE - filepaths: "{{class.filepaths}}" + filepaths: "{{class.Filepaths}}" from: class