Skip to content

Commit

Permalink
Do not export ChainTemplate members
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Manuel Leflet Estrada <[email protected]>
  • Loading branch information
jmle committed Nov 15, 2024
1 parent 1aecd4f commit cc85616
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions engine/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down Expand Up @@ -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,
}
}

Expand Down Expand Up @@ -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"`
}
2 changes: 1 addition & 1 deletion rule-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -417,5 +417,5 @@
- java.referenced:
pattern: org.springframework.web.WebApplicationInitializer
location: IMPLEMENTS_TYPE
filepaths: "{{class.Filepaths}}"
filepaths: "{{class.filepaths}}"
from: class

0 comments on commit cc85616

Please sign in to comment.