diff --git a/config/config.go b/config/config.go index 937726b7..860ac734 100644 --- a/config/config.go +++ b/config/config.go @@ -150,14 +150,14 @@ func (sc *SafeConfig) ReloadConfig(confFile string, logger log.Logger) (err erro // CelProgram encapsulates a cel.Program and makes it YAML marshalable. type CelProgram struct { cel.Program - expression string + Expression string } // NewCelProgram creates a new CEL Program and returns an error if the // passed-in CEL expression does not compile. func NewCelProgram(s string) (CelProgram, error) { program := CelProgram{ - expression: s, + Expression: s, } env, err := cel.NewEnv( @@ -200,8 +200,8 @@ func (c *CelProgram) UnmarshalYAML(unmarshal func(interface{}) error) error { // MarshalYAML implements the yaml.Marshaler interface. func (c CelProgram) MarshalYAML() (interface{}, error) { - if c.expression != "" { - return c.expression, nil + if c.Expression != "" { + return c.Expression, nil } return nil, nil } diff --git a/prober/http.go b/prober/http.go index 0cc83e93..cd09af94 100644 --- a/prober/http.go +++ b/prober/http.go @@ -95,7 +95,7 @@ func matchCelExpressions(ctx context.Context, reader io.Reader, httpConfig confi return false } if result.Type() == cel.BoolType && result.Value().(bool) { - level.Error(logger).Log("msg", "Body matched CEL expression", "expression", httpConfig.FailIfBodyJSONMatchesCel) + level.Error(logger).Log("msg", "Body matched CEL expression", "expression", httpConfig.FailIfBodyJSONMatchesCel.Expression) return false } } @@ -111,7 +111,7 @@ func matchCelExpressions(ctx context.Context, reader io.Reader, httpConfig confi return false } if result.Type() == cel.BoolType && !result.Value().(bool) { - level.Error(logger).Log("msg", "Body did not match CEL expression", "expression", httpConfig.FailIfBodyJSONNotMatchesCel) + level.Error(logger).Log("msg", "Body did not match CEL expression", "expression", httpConfig.FailIfBodyJSONNotMatchesCel.Expression) return false } }