Skip to content

Commit

Permalink
chore: add component self reference in HealthExpr evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra authored and moshloop committed Sep 19, 2024
1 parent dc34332 commit 121917f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions models/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ func (c Component) GetHealth() (Health, error) {
if c.HealthExpr != "" {
env := map[string]any{
"summary": c.Summary.AsEnv(),
"self": c.AsMap(),
}
out, err := gomplate.RunTemplate(env, gomplate.Template{Expression: c.HealthExpr})
if err != nil {
Expand Down

0 comments on commit 121917f

Please sign in to comment.