From f5d49727633c20ae8434f671a0284189e4e7862c Mon Sep 17 00:00:00 2001 From: Chandan-DK Date: Fri, 13 Sep 2024 18:57:51 +0000 Subject: [PATCH] fix: capture the returned environment from Extend() in env variable Signed-off-by: Chandan-DK --- pkg/utils/cel/cel.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/utils/cel/cel.go b/pkg/utils/cel/cel.go index 9efd0e901b1b..d0f21f251fd2 100644 --- a/pkg/utils/cel/cel.go +++ b/pkg/utils/cel/cel.go @@ -27,8 +27,7 @@ func NewCompiler( matchConditions []admissionregistrationv1.MatchCondition, variables []admissionregistrationv1beta1.Variable, ) (*Compiler, error) { - env := environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), false) - env.Extend(environment.VersionedOptions{ + env, err := environment.MustBaseEnvSet(environment.DefaultCompatibilityVersion(), false).Extend(environment.VersionedOptions{ IntroducedVersion: version.MajorMinor(1, 0), EnvOptions: []celgo.EnvOption{ library.JsonParseLib(),