From a421fd4834c5fcf006dff79023ad913f22ff4d55 Mon Sep 17 00:00:00 2001 From: Cici Huang Date: Mon, 11 Jul 2022 17:05:02 +0000 Subject: [PATCH] Bump cel-go to v0.12.1 --- go.mod | 4 ++-- go.sum | 4 ++-- staging/src/k8s.io/apiextensions-apiserver/go.mod | 2 +- staging/src/k8s.io/apiextensions-apiserver/go.sum | 4 ++-- vendor/github.com/google/cel-go/cel/decls.go | 8 ++++---- vendor/github.com/google/cel-go/cel/env.go | 4 ++++ vendor/github.com/google/cel-go/cel/macro.go | 6 +++++- vendor/github.com/google/cel-go/parser/macro.go | 2 +- vendor/modules.txt | 4 ++-- 9 files changed, 23 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 14ba52e2413..a672d079d09 100644 --- a/go.mod +++ b/go.mod @@ -176,7 +176,7 @@ require ( github.com/gofrs/uuid v4.0.0+incompatible // indirect github.com/golang-jwt/jwt/v4 v4.2.0 // indirect github.com/google/btree v1.0.1 // indirect - github.com/google/cel-go v0.12.0 // indirect + github.com/google/cel-go v0.12.1 // indirect github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/googleapis/gax-go/v2 v2.1.1 // indirect @@ -390,7 +390,7 @@ replace ( github.com/golangplus/testing => github.com/golangplus/testing v1.0.0 github.com/google/btree => github.com/google/btree v1.0.1 github.com/google/cadvisor => github.com/google/cadvisor v0.44.1 - github.com/google/cel-go => github.com/google/cel-go v0.12.0 + github.com/google/cel-go => github.com/google/cel-go v0.12.1 github.com/google/gnostic => github.com/google/gnostic v0.5.7-v3refs github.com/google/go-cmp => github.com/google/go-cmp v0.5.6 github.com/google/gofuzz => github.com/google/gofuzz v1.1.0 diff --git a/go.sum b/go.sum index 3d2ed7dcd98..f5a252bac2d 100644 --- a/go.sum +++ b/go.sum @@ -218,8 +218,8 @@ github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/cadvisor v0.44.1 h1:hsAxDZOY+5xSCXH12d/G9cxYTfP+32cMT3J7aatrgDY= github.com/google/cadvisor v0.44.1/go.mod h1:GQ9KQfz0iNHQk3D6ftzJWK4TXabfIgM10Oy3FkR+Gzg= -github.com/google/cel-go v0.12.0 h1:XCkZC//dlejP4ZRfncdFhdUIJOmI/ELasvdcTHkE3Vc= -github.com/google/cel-go v0.12.0/go.mod h1:Av7CU6r6X3YmcHR9GXqVDaEJYfEtSxl6wvIjUQTriCw= +github.com/google/cel-go v0.12.1 h1:wbz0PE4f9ouKwoQdE7Q1xfGMu9gXKECRZFa72kl8sQw= +github.com/google/cel-go v0.12.1/go.mod h1:Av7CU6r6X3YmcHR9GXqVDaEJYfEtSxl6wvIjUQTriCw= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= diff --git a/staging/src/k8s.io/apiextensions-apiserver/go.mod b/staging/src/k8s.io/apiextensions-apiserver/go.mod index 0ccb1ffaf03..4e6adf3a162 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/go.mod +++ b/staging/src/k8s.io/apiextensions-apiserver/go.mod @@ -7,7 +7,7 @@ go 1.18 require ( github.com/emicklei/go-restful/v3 v3.8.0 github.com/gogo/protobuf v1.3.2 - github.com/google/cel-go v0.12.0 + github.com/google/cel-go v0.12.1 github.com/google/gnostic v0.5.7-v3refs github.com/google/go-cmp v0.5.6 github.com/google/gofuzz v1.1.0 diff --git a/staging/src/k8s.io/apiextensions-apiserver/go.sum b/staging/src/k8s.io/apiextensions-apiserver/go.sum index 878a1deb4eb..89c8c4528c0 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/go.sum +++ b/staging/src/k8s.io/apiextensions-apiserver/go.sum @@ -198,8 +198,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/cel-go v0.12.0 h1:XCkZC//dlejP4ZRfncdFhdUIJOmI/ELasvdcTHkE3Vc= -github.com/google/cel-go v0.12.0/go.mod h1:Av7CU6r6X3YmcHR9GXqVDaEJYfEtSxl6wvIjUQTriCw= +github.com/google/cel-go v0.12.1 h1:wbz0PE4f9ouKwoQdE7Q1xfGMu9gXKECRZFa72kl8sQw= +github.com/google/cel-go v0.12.1/go.mod h1:Av7CU6r6X3YmcHR9GXqVDaEJYfEtSxl6wvIjUQTriCw= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= diff --git a/vendor/github.com/google/cel-go/cel/decls.go b/vendor/github.com/google/cel-go/cel/decls.go index 4349d7ec6a9..12c8f256b22 100644 --- a/vendor/github.com/google/cel-go/cel/decls.go +++ b/vendor/github.com/google/cel-go/cel/decls.go @@ -165,7 +165,7 @@ type Type struct { isAssignableRuntimeType func(other ref.Type) bool } -// IsAssignableFrom determines whether the current type is type-check assignable from the input fromType. +// IsAssignableType determines whether the current type is type-check assignable from the input fromType. func (t *Type) IsAssignableType(fromType *Type) bool { if t.isAssignableType != nil { return t.isAssignableType(fromType) @@ -650,7 +650,7 @@ func (f *functionDecl) merge(other *functionDecl) (*functionDecl, error) { for _, o := range other.overloads { err := merged.addOverload(o) if err != nil { - return nil, fmt.Errorf("function declration merge failed: %v", err) + return nil, fmt.Errorf("function declaration merge failed: %v", err) } } if other.singleton != nil { @@ -821,8 +821,8 @@ func (o *overloadDecl) signatureOverlaps(other *overloadDecl) bool { for i, argType := range o.argTypes { otherArgType := other.argTypes[i] argsOverlap = argsOverlap && - (argType.IsAssignableRuntimeType(otherArgType.runtimeType) || - otherArgType.IsAssignableRuntimeType(argType.runtimeType)) + (argType.IsAssignableType(otherArgType) || + otherArgType.IsAssignableType(argType)) } return argsOverlap } diff --git a/vendor/github.com/google/cel-go/cel/env.go b/vendor/github.com/google/cel-go/cel/env.go index f037405ab39..f2c40c0e75b 100644 --- a/vendor/github.com/google/cel-go/cel/env.go +++ b/vendor/github.com/google/cel-go/cel/env.go @@ -61,6 +61,8 @@ func (ast *Ast) SourceInfo() *exprpb.SourceInfo { // ResultType returns the output type of the expression if the Ast has been type-checked, else // returns decls.Dyn as the parse step cannot infer the type. +// +// Deprecated: use OutputType func (ast *Ast) ResultType() *exprpb.Type { if !ast.IsChecked() { return decls.Dyn @@ -68,6 +70,8 @@ func (ast *Ast) ResultType() *exprpb.Type { return ast.typeMap[ast.expr.GetId()] } +// OutputType returns the output type of the expression if the Ast has been type-checked, else +// returns cel.DynType as the parse step cannot infer types. func (ast *Ast) OutputType() *Type { t, err := ExprTypeToType(ast.ResultType()) if err != nil { diff --git a/vendor/github.com/google/cel-go/cel/macro.go b/vendor/github.com/google/cel-go/cel/macro.go index d0bfa489d9c..e43cb4eeea1 100644 --- a/vendor/github.com/google/cel-go/cel/macro.go +++ b/vendor/github.com/google/cel-go/cel/macro.go @@ -20,6 +20,10 @@ import ( exprpb "google.golang.org/genproto/googleapis/api/expr/v1alpha1" ) +// Macro describes a function signature to match and the MacroExpander to apply. +// +// Note: when a Macro should apply to multiple overloads (based on arg count) of a given function, +// a Macro should be created per arg-count or as a var arg macro. type Macro = parser.Macro // MacroExpander converts a call and its associated arguments into a new CEL abstract syntax tree, or an error @@ -85,7 +89,7 @@ func MapMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.E return parser.MakeMap(meh, target, args) } -// MakeFilter expands the input call arguments into a comprehension which produces a list which contains +// FilterMacroExpander expands the input call arguments into a comprehension which produces a list which contains // only elements which match the provided predicate expression: // .filter(, ) func FilterMacroExpander(meh MacroExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) { diff --git a/vendor/github.com/google/cel-go/parser/macro.go b/vendor/github.com/google/cel-go/parser/macro.go index 7d0222185a7..9150b064e5f 100644 --- a/vendor/github.com/google/cel-go/parser/macro.go +++ b/vendor/github.com/google/cel-go/parser/macro.go @@ -284,7 +284,7 @@ const ( quantifierExistsOne ) -// MakeExists expands the input call arguments into a comprehension that returns true if all of the +// MakeAll expands the input call arguments into a comprehension that returns true if all of the // elements in the range match the predicate expressions: // .all(, ) func MakeAll(eh ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) { diff --git a/vendor/modules.txt b/vendor/modules.txt index b444b082c87..438eaee3a1c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -416,7 +416,7 @@ github.com/google/cadvisor/utils/sysfs github.com/google/cadvisor/utils/sysinfo github.com/google/cadvisor/version github.com/google/cadvisor/watcher -# github.com/google/cel-go v0.12.0 => github.com/google/cel-go v0.12.0 +# github.com/google/cel-go v0.12.1 => github.com/google/cel-go v0.12.1 ## explicit; go 1.17 github.com/google/cel-go/cel github.com/google/cel-go/checker @@ -2676,7 +2676,7 @@ sigs.k8s.io/yaml # github.com/golangplus/testing => github.com/golangplus/testing v1.0.0 # github.com/google/btree => github.com/google/btree v1.0.1 # github.com/google/cadvisor => github.com/google/cadvisor v0.44.1 -# github.com/google/cel-go => github.com/google/cel-go v0.12.0 +# github.com/google/cel-go => github.com/google/cel-go v0.12.1 # github.com/google/gnostic => github.com/google/gnostic v0.5.7-v3refs # github.com/google/go-cmp => github.com/google/go-cmp v0.5.6 # github.com/google/gofuzz => github.com/google/gofuzz v1.1.0