mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
rebase: bump the k8s-dependencies group in /e2e with 3 updates
Bumps the k8s-dependencies group in /e2e with 3 updates: [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery), [k8s.io/cloud-provider](https://github.com/kubernetes/cloud-provider) and [k8s.io/pod-security-admission](https://github.com/kubernetes/pod-security-admission). Updates `k8s.io/apimachinery` from 0.32.3 to 0.33.0 - [Commits](https://github.com/kubernetes/apimachinery/compare/v0.32.3...v0.33.0) Updates `k8s.io/cloud-provider` from 0.32.3 to 0.33.0 - [Commits](https://github.com/kubernetes/cloud-provider/compare/v0.32.3...v0.33.0) Updates `k8s.io/pod-security-admission` from 0.32.3 to 0.33.0 - [Commits](https://github.com/kubernetes/pod-security-admission/compare/v0.32.3...v0.33.0) --- updated-dependencies: - dependency-name: k8s.io/apimachinery dependency-version: 0.33.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: k8s-dependencies - dependency-name: k8s.io/cloud-provider dependency-version: 0.33.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: k8s-dependencies - dependency-name: k8s.io/pod-security-admission dependency-version: 0.33.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: k8s-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
committed by
mergify[bot]
parent
d52dc2c4ba
commit
dd77e72800
112
e2e/vendor/github.com/google/cel-go/cel/library.go
generated
vendored
112
e2e/vendor/github.com/google/cel-go/cel/library.go
generated
vendored
@ -15,6 +15,7 @@
|
||||
package cel
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -35,9 +36,11 @@ const (
|
||||
optMapMacro = "optMap"
|
||||
optFlatMapMacro = "optFlatMap"
|
||||
hasValueFunc = "hasValue"
|
||||
unwrapOptFunc = "unwrapOpt"
|
||||
optionalNoneFunc = "optional.none"
|
||||
optionalOfFunc = "optional.of"
|
||||
optionalOfNonZeroValueFunc = "optional.ofNonZeroValue"
|
||||
optionalUnwrapFunc = "optional.unwrap"
|
||||
valueFunc = "value"
|
||||
unusedIterVar = "#unused"
|
||||
)
|
||||
@ -260,6 +263,37 @@ func (stdLibrary) ProgramOptions() []ProgramOption {
|
||||
// be expressed with `optMap`.
|
||||
//
|
||||
// msg.?elements.optFlatMap(e, e[?0]) // return the first element if present.
|
||||
|
||||
// # First
|
||||
//
|
||||
// Introduced in version: 2
|
||||
//
|
||||
// Returns an optional with the first value from the right hand list, or
|
||||
// optional.None.
|
||||
//
|
||||
// [1, 2, 3].first().value() == 1
|
||||
|
||||
// # Last
|
||||
//
|
||||
// Introduced in version: 2
|
||||
//
|
||||
// Returns an optional with the last value from the right hand list, or
|
||||
// optional.None.
|
||||
//
|
||||
// [1, 2, 3].last().value() == 3
|
||||
//
|
||||
// This is syntactic sugar for msg.elements[msg.elements.size()-1].
|
||||
|
||||
// # Unwrap / UnwrapOpt
|
||||
//
|
||||
// Introduced in version: 2
|
||||
//
|
||||
// Returns a list of all the values that are not none in the input list of optional values.
|
||||
// Can be used as optional.unwrap(List[T]) or with postfix notation: List[T].unwrapOpt()
|
||||
//
|
||||
// optional.unwrap([optional.of(42), optional.none()]) == [42]
|
||||
// [optional.of(42), optional.none()].unwrapOpt() == [42]
|
||||
|
||||
func OptionalTypes(opts ...OptionalTypesOption) EnvOption {
|
||||
lib := &optionalLib{version: math.MaxUint32}
|
||||
for _, opt := range opts {
|
||||
@ -303,6 +337,7 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
|
||||
optionalTypeV := OptionalType(paramTypeV)
|
||||
listTypeV := ListType(paramTypeV)
|
||||
mapTypeKV := MapType(paramTypeK, paramTypeV)
|
||||
listOptionalTypeV := ListType(optionalTypeV)
|
||||
|
||||
opts := []EnvOption{
|
||||
// Enable the optional syntax in the parser.
|
||||
@ -375,6 +410,46 @@ func (lib *optionalLib) CompileOptions() []EnvOption {
|
||||
if lib.version >= 1 {
|
||||
opts = append(opts, Macros(ReceiverMacro(optFlatMapMacro, 2, optFlatMap)))
|
||||
}
|
||||
|
||||
if lib.version >= 2 {
|
||||
opts = append(opts, Function("last",
|
||||
MemberOverload("list_last", []*Type{listTypeV}, optionalTypeV,
|
||||
UnaryBinding(func(v ref.Val) ref.Val {
|
||||
list := v.(traits.Lister)
|
||||
sz := list.Size().Value().(int64)
|
||||
|
||||
if sz == 0 {
|
||||
return types.OptionalNone
|
||||
}
|
||||
|
||||
return types.OptionalOf(list.Get(types.Int(sz - 1)))
|
||||
}),
|
||||
),
|
||||
))
|
||||
|
||||
opts = append(opts, Function("first",
|
||||
MemberOverload("list_first", []*Type{listTypeV}, optionalTypeV,
|
||||
UnaryBinding(func(v ref.Val) ref.Val {
|
||||
list := v.(traits.Lister)
|
||||
sz := list.Size().Value().(int64)
|
||||
|
||||
if sz == 0 {
|
||||
return types.OptionalNone
|
||||
}
|
||||
|
||||
return types.OptionalOf(list.Get(types.Int(0)))
|
||||
}),
|
||||
),
|
||||
))
|
||||
|
||||
opts = append(opts, Function(optionalUnwrapFunc,
|
||||
Overload("optional_unwrap", []*Type{listOptionalTypeV}, listTypeV,
|
||||
UnaryBinding(optUnwrap))))
|
||||
opts = append(opts, Function(unwrapOptFunc,
|
||||
MemberOverload("optional_unwrapOpt", []*Type{listOptionalTypeV}, listTypeV,
|
||||
UnaryBinding(optUnwrap))))
|
||||
}
|
||||
|
||||
return opts
|
||||
}
|
||||
|
||||
@ -439,6 +514,23 @@ func optFlatMap(meh MacroExprFactory, target ast.Expr, args []ast.Expr) (ast.Exp
|
||||
), nil
|
||||
}
|
||||
|
||||
func optUnwrap(value ref.Val) ref.Val {
|
||||
list := value.(traits.Lister)
|
||||
var unwrappedList []ref.Val
|
||||
iter := list.Iterator()
|
||||
for iter.HasNext() == types.True {
|
||||
val := iter.Next()
|
||||
opt, isOpt := val.(*types.Optional)
|
||||
if !isOpt {
|
||||
return types.WrapErr(fmt.Errorf("value %v is not optional", val))
|
||||
}
|
||||
if opt.HasValue() {
|
||||
unwrappedList = append(unwrappedList, opt.GetValue())
|
||||
}
|
||||
}
|
||||
return types.DefaultTypeAdapter.NativeToValue(unwrappedList)
|
||||
}
|
||||
|
||||
func enableOptionalSyntax() EnvOption {
|
||||
return func(e *Env) (*Env, error) {
|
||||
e.prsrOpts = append(e.prsrOpts, parser.EnableOptionalSyntax(true))
|
||||
@ -677,7 +769,7 @@ var (
|
||||
func timestampGetFullYear(ts, tz ref.Val) ref.Val {
|
||||
t, err := inTimeZone(ts, tz)
|
||||
if err != nil {
|
||||
return types.NewErr(err.Error())
|
||||
return types.NewErrFromString(err.Error())
|
||||
}
|
||||
return types.Int(t.Year())
|
||||
}
|
||||
@ -685,7 +777,7 @@ func timestampGetFullYear(ts, tz ref.Val) ref.Val {
|
||||
func timestampGetMonth(ts, tz ref.Val) ref.Val {
|
||||
t, err := inTimeZone(ts, tz)
|
||||
if err != nil {
|
||||
return types.NewErr(err.Error())
|
||||
return types.NewErrFromString(err.Error())
|
||||
}
|
||||
// CEL spec indicates that the month should be 0-based, but the Time value
|
||||
// for Month() is 1-based.
|
||||
@ -695,7 +787,7 @@ func timestampGetMonth(ts, tz ref.Val) ref.Val {
|
||||
func timestampGetDayOfYear(ts, tz ref.Val) ref.Val {
|
||||
t, err := inTimeZone(ts, tz)
|
||||
if err != nil {
|
||||
return types.NewErr(err.Error())
|
||||
return types.NewErrFromString(err.Error())
|
||||
}
|
||||
return types.Int(t.YearDay() - 1)
|
||||
}
|
||||
@ -703,7 +795,7 @@ func timestampGetDayOfYear(ts, tz ref.Val) ref.Val {
|
||||
func timestampGetDayOfMonthZeroBased(ts, tz ref.Val) ref.Val {
|
||||
t, err := inTimeZone(ts, tz)
|
||||
if err != nil {
|
||||
return types.NewErr(err.Error())
|
||||
return types.NewErrFromString(err.Error())
|
||||
}
|
||||
return types.Int(t.Day() - 1)
|
||||
}
|
||||
@ -711,7 +803,7 @@ func timestampGetDayOfMonthZeroBased(ts, tz ref.Val) ref.Val {
|
||||
func timestampGetDayOfMonthOneBased(ts, tz ref.Val) ref.Val {
|
||||
t, err := inTimeZone(ts, tz)
|
||||
if err != nil {
|
||||
return types.NewErr(err.Error())
|
||||
return types.NewErrFromString(err.Error())
|
||||
}
|
||||
return types.Int(t.Day())
|
||||
}
|
||||
@ -719,7 +811,7 @@ func timestampGetDayOfMonthOneBased(ts, tz ref.Val) ref.Val {
|
||||
func timestampGetDayOfWeek(ts, tz ref.Val) ref.Val {
|
||||
t, err := inTimeZone(ts, tz)
|
||||
if err != nil {
|
||||
return types.NewErr(err.Error())
|
||||
return types.NewErrFromString(err.Error())
|
||||
}
|
||||
return types.Int(t.Weekday())
|
||||
}
|
||||
@ -727,7 +819,7 @@ func timestampGetDayOfWeek(ts, tz ref.Val) ref.Val {
|
||||
func timestampGetHours(ts, tz ref.Val) ref.Val {
|
||||
t, err := inTimeZone(ts, tz)
|
||||
if err != nil {
|
||||
return types.NewErr(err.Error())
|
||||
return types.NewErrFromString(err.Error())
|
||||
}
|
||||
return types.Int(t.Hour())
|
||||
}
|
||||
@ -735,7 +827,7 @@ func timestampGetHours(ts, tz ref.Val) ref.Val {
|
||||
func timestampGetMinutes(ts, tz ref.Val) ref.Val {
|
||||
t, err := inTimeZone(ts, tz)
|
||||
if err != nil {
|
||||
return types.NewErr(err.Error())
|
||||
return types.NewErrFromString(err.Error())
|
||||
}
|
||||
return types.Int(t.Minute())
|
||||
}
|
||||
@ -743,7 +835,7 @@ func timestampGetMinutes(ts, tz ref.Val) ref.Val {
|
||||
func timestampGetSeconds(ts, tz ref.Val) ref.Val {
|
||||
t, err := inTimeZone(ts, tz)
|
||||
if err != nil {
|
||||
return types.NewErr(err.Error())
|
||||
return types.NewErrFromString(err.Error())
|
||||
}
|
||||
return types.Int(t.Second())
|
||||
}
|
||||
@ -751,7 +843,7 @@ func timestampGetSeconds(ts, tz ref.Val) ref.Val {
|
||||
func timestampGetMilliseconds(ts, tz ref.Val) ref.Val {
|
||||
t, err := inTimeZone(ts, tz)
|
||||
if err != nil {
|
||||
return types.NewErr(err.Error())
|
||||
return types.NewErrFromString(err.Error())
|
||||
}
|
||||
return types.Int(t.Nanosecond() / 1000000)
|
||||
}
|
||||
|
Reference in New Issue
Block a user