diff --git a/funcs/cel_exports.go b/funcs/cel_exports.go index dfc9a55b4..f62ac12b7 100644 --- a/funcs/cel_exports.go +++ b/funcs/cel_exports.go @@ -18,10 +18,8 @@ var CelEnvOption = []cel.EnvOption{ collAppendGen, collPrependGen, collUniqGen, - collSortGen, collSortByGen, collJQGen, - collFlattenGen, collPickGen, collOmitGen, collMergeGen, @@ -59,7 +57,7 @@ var CelEnvOption = []cel.EnvOption{ cryptoSHA512BytesGen, cryptoSHA512_224BytesGen, cryptoSHA512_256BytesGen, - + // JSON dataJSONMemberGen, dataToJSONGen, @@ -76,14 +74,14 @@ var CelEnvOption = []cel.EnvOption{ dataCSVByRowGen, dataCSVByColumnGen, dataToCSVGen, - + // TOML dataTOMLGen, dataToTOMLGen, - + urlEncodeGen, urlDecodeGen, - + regexpFindGen, regexpFindAllGen, regexpMatchGen, @@ -128,7 +126,7 @@ var CelEnvOption = []cel.EnvOption{ randomItemGen, randomNumberGen, randomFloatGen, - + stringsHumanDurationGen, stringsHumanSizeGen, stringsSemverGen, diff --git a/funcs/coll_gen.go b/funcs/coll_gen.go index 0c4a765d7..9f206b9df 100644 --- a/funcs/coll_gen.go +++ b/funcs/coll_gen.go @@ -227,30 +227,9 @@ var collMergeGen = cel.Function("merge", ), ) -var collSortGen = cel.Function("sort", - cel.MemberOverload("sort_string_interface{}", - []*cel.Type{ - cel.ListType(cel.DynType), - }, - cel.ListType(cel.DynType), - cel.UnaryBinding(func(arg ref.Val) ref.Val { - list, err := sliceToNative[any](arg) - if err != nil { - return types.WrapErr(err) - } - - sorted, err := coll.Sort("", list) - if err != nil { - return types.WrapErr(err) - } - - return types.DefaultTypeAdapter.NativeToValue(sorted) - }), - ), -) var collSortByGen = cel.Function("sortBy", - cel.MemberOverload("sort_interface{}", + cel.MemberOverload("sortBy_interface{}", []*cel.Type{ cel.ListType(cel.AnyType), @@ -307,31 +286,6 @@ var collJQGen = cel.Function("jq", ), ) -var collFlattenGen = cel.Function("flatten", - cel.MemberOverload("flatten_list{}", - - []*cel.Type{ - cel.ListType(cel.AnyType), - }, - cel.ListType(cel.AnyType), - cel.UnaryBinding(func(arg ref.Val) ref.Val { - - var x CollFuncs - list, err := sliceToNative[any](arg) - if err != nil { - return types.WrapErr(err) - } - - result, err := x.Flatten(list) - - if err != nil { - return types.WrapErr(err) - } - return types.DefaultTypeAdapter.NativeToValue(result) - - }), - ), -) var collPickGen = cel.Function("pick", cel.MemberOverload("pick_interface{}", diff --git a/funcs/strings_gen.go b/funcs/strings_gen.go index cb6ac5960..f5e0847f0 100644 --- a/funcs/strings_gen.go +++ b/funcs/strings_gen.go @@ -4,7 +4,6 @@ package funcs import ( "sort" - "github.com/google/cel-go/cel" "github.com/google/cel-go/common/types" "github.com/google/cel-go/common/types/ref" @@ -171,19 +170,20 @@ var stringsRepeatGen = cel.Function("repeat", ), ) -var stringsSortGen = cel.Function("sort", - cel.MemberOverload("Sort_interface{}", +var stringsSortGen = cel.Function("Sort", + cel.Overload("Sort_string", + []*cel.Type{ cel.StringType, }, - cel.StringType, - cel.UnaryBinding(func(arg ref.Val) ref.Val { - slice := []byte(arg.Value().(string)) + cel.DynType, + cel.FunctionBinding(func(args ...ref.Val) ref.Val { + slice := []byte(args[0].Value().(string)) sort.Slice(slice, func(i, j int) bool { return slice[i] < slice[j] }) - return types.DefaultTypeAdapter.NativeToValue(string(slice)) + }), ), ) diff --git a/funcs/uuid.go b/funcs/uuid.go index 1b7626bbb..fd04effdc 100644 --- a/funcs/uuid.go +++ b/funcs/uuid.go @@ -72,10 +72,10 @@ func (f UUIDFuncs) IsValid(in interface{}) (bool, error) { // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the // Microsoft encoding {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} and the raw hex // encoding: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. -func (UUIDFuncs) Parse(in interface{}) (uuid.UUID, error) { +func (UUIDFuncs) Parse(in interface{}) (string, error) { u, err := uuid.Parse(conv.ToString(in)) if err != nil { - return uuid.Nil, err + return "", err } - return u, err + return u.String(), err } diff --git a/funcs/uuid_test.go b/funcs/uuid_test.go index 55adc9660..525ea013b 100644 --- a/funcs/uuid_test.go +++ b/funcs/uuid_test.go @@ -110,6 +110,6 @@ func TestParse(t *testing.T) { for _, d := range testdata { uid, err := u.Parse(d) assert.NoError(t, err) - assert.Equal(t, in, uid.String()) + assert.Equal(t, in, uid) } } diff --git a/go.mod b/go.mod index 198a8c137..67df31987 100644 --- a/go.mod +++ b/go.mod @@ -6,18 +6,18 @@ toolchain go1.23.4 require ( github.com/Masterminds/goutils v1.1.1 - github.com/Masterminds/semver/v3 v3.2.1 + github.com/Masterminds/semver/v3 v3.3.1 github.com/flanksource/commons v1.35.3 - github.com/flanksource/is-healthy v1.0.52 + github.com/flanksource/is-healthy v1.0.56 github.com/flanksource/kubectl-neat v1.0.4 - github.com/google/cel-go v0.20.1 + github.com/google/cel-go v0.22.1 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 github.com/gosimple/slug v1.13.1 github.com/hairyhenderson/toml v0.4.2-0.20210923231440-40456b8e66cf - github.com/itchyny/gojq v0.12.14 + github.com/itchyny/gojq v0.12.17 github.com/mitchellh/reflectwalk v1.0.2 - github.com/ohler55/ojg v1.20.2 + github.com/ohler55/ojg v1.25.0 github.com/onsi/ginkgo/v2 v2.20.1 github.com/onsi/gomega v1.34.1 github.com/patrickmn/go-cache v2.1.0+incompatible @@ -26,8 +26,8 @@ require ( github.com/samber/oops v1.13.1 github.com/stretchr/testify v1.9.0 github.com/ugorji/go/codec v1.2.12 - golang.org/x/text v0.20.0 - golang.org/x/tools v0.27.0 + golang.org/x/text v0.21.0 + golang.org/x/tools v0.28.0 google.golang.org/protobuf v1.34.2 gopkg.in/yaml.v3 v3.0.1 gotest.tools/v3 v3.5.1 @@ -41,6 +41,7 @@ require ( require github.com/hairyhenderson/yaml v0.0.0-20220618171115-2d35fca545ce require ( + cel.dev/expr v0.18.0 // indirect github.com/antlr4-go/antlr/v4 v4.13.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bsm/gomega v1.27.10 // indirect @@ -64,7 +65,7 @@ require ( github.com/henvic/httpretty v0.1.2 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/itchyny/timefmt-go v0.1.5 // indirect + github.com/itchyny/timefmt-go v0.1.6 // indirect github.com/jeremywohl/flatten v0.0.0-20180923035001-588fe0d4c603 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kr/pretty v0.3.1 // indirect @@ -99,9 +100,9 @@ require ( go.opentelemetry.io/otel/trace v1.29.0 // indirect golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sync v0.9.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/net v0.32.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect diff --git a/go.sum b/go.sum index 7b8909a40..ab8ca2ab1 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,9 @@ +cel.dev/expr v0.18.0 h1:CJ6drgk+Hf96lkLikr4rFf19WrU0BOWEihyZnI2TAzo= +cel.dev/expr v0.18.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= -github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4= +github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -28,8 +30,8 @@ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/flanksource/commons v1.35.3 h1:EG46iWodmSQQbXywjvEAgK56ZH26jYtMv0RiPM3eKDE= github.com/flanksource/commons v1.35.3/go.mod h1:cLZURmvF0dw3wR5VyPuibRl/7h+NEiyMdo70WhJFB9Y= -github.com/flanksource/is-healthy v1.0.52 h1:Y2+3DTkUAXZXCOQenleKdME4VuSdXt08IMbDukp4SXQ= -github.com/flanksource/is-healthy v1.0.52/go.mod h1:kdWcNCxiOjgpAd2+fIQnBxvT45IaR+zc92wfOsaI8Kk= +github.com/flanksource/is-healthy v1.0.56 h1:FV57lH2CRB3ox8ifM9MJPN/XTmonlEiS1L3f8JcwhY4= +github.com/flanksource/is-healthy v1.0.56/go.mod h1:5MUvkRbq78aPVIpwGjpn+k89n5+1thBLIRdhfcozUcQ= github.com/flanksource/kubectl-neat v1.0.4 h1:t5/9CqgE84oEtB0KitgJ2+WIeLfD+RhXSxYrqb4X8yI= github.com/flanksource/kubectl-neat v1.0.4/go.mod h1:Un/Voyh3cmiZNKQrW/TkAl28nAA7vwnwDGVjRErKjOw= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= @@ -50,8 +52,8 @@ github.com/goccy/go-yaml v1.12.0 h1:/1WHjnMsI1dlIBQutrvSMGZRQufVO3asrHfTwfACoPM= github.com/goccy/go-yaml v1.12.0/go.mod h1:wKnAMd44+9JAAnGQpWVEgBzGt3YuTaQ4uXoHvE4m7WU= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84= -github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg= +github.com/google/cel-go v0.22.1 h1:AfVXx3chM2qwoSbM7Da8g8hX8OVSkBFwX+rz2+PcK40= +github.com/google/cel-go v0.22.1/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -76,10 +78,10 @@ github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUq github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/itchyny/gojq v0.12.14 h1:6k8vVtsrhQSYgSGg827AD+PVVaB1NLXEdX+dda2oZCc= -github.com/itchyny/gojq v0.12.14/go.mod h1:y1G7oO7XkcR1LPZO59KyoCRy08T3j9vDYRV0GgYSS+s= -github.com/itchyny/timefmt-go v0.1.5 h1:G0INE2la8S6ru/ZI5JecgyzbbJNs5lG1RcBqa7Jm6GE= -github.com/itchyny/timefmt-go v0.1.5/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2stDBckWakZ8= +github.com/itchyny/gojq v0.12.17 h1:8av8eGduDb5+rvEdaOO+zQUjA04MS0m3Ps8HiD+fceg= +github.com/itchyny/gojq v0.12.17/go.mod h1:WBrEMkgAfAGO1LUcGOckBl5O726KPp+OlkKug0I/FEY= +github.com/itchyny/timefmt-go v0.1.6 h1:ia3s54iciXDdzWzwaVKXZPbiXzxxnv1SPGFfM/myJ5Q= +github.com/itchyny/timefmt-go v0.1.6/go.mod h1:RRDZYC5s9ErkjQvTvvU7keJjxUYzIISJGxm9/mAERQg= github.com/jeremywohl/flatten v0.0.0-20180923035001-588fe0d4c603 h1:gSech9iGLFCosfl/DC7BWnpSSh/tQClWnKS2I2vdPww= github.com/jeremywohl/flatten v0.0.0-20180923035001-588fe0d4c603/go.mod h1:4AmD/VxjWcI5SRB0n6szE2A6s2fsNHDLO0nAlMHgfLQ= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= @@ -110,8 +112,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/ohler55/ojg v1.20.2 h1:ragZXnawcsq/knqIHaflvIX/8RzzAKMZSluAZAz+RFs= -github.com/ohler55/ojg v1.20.2/go.mod h1:uHcD1ErbErC27Zhb5Df2jUjbseLLcmOCo6oxSr3jZxo= +github.com/ohler55/ojg v1.25.0 h1:sDwc4u4zex65Uz5Nm7O1QwDKTT+YRcpeZQTy1pffRkw= +github.com/ohler55/ojg v1.25.0/go.mod h1:gQhDVpQLqrmnd2eqGAvJtn+NfKoYJbe/A4Sj3/Vro4o= github.com/oklog/ulid/v2 v2.1.0 h1:+9lhoxAP56we25tyYETBBY1YLA2SaoLvUFgrP2miPJU= github.com/oklog/ulid/v2 v2.1.0/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo= @@ -210,14 +212,14 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -228,22 +230,22 @@ golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= -golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/kubernetes/health_test.go b/kubernetes/health_test.go index ad002e91a..b826aea21 100644 --- a/kubernetes/health_test.go +++ b/kubernetes/health_test.go @@ -43,6 +43,6 @@ func TestIsHealthyAppset(t *testing.T) { func TestIsHealthySvcPending(t *testing.T) { r := GetHealth(TestProgressing) assert.Equal(t, false, r.OK) - assert.Equal(t, "Creating", r.Status) + assert.Equal(t, "Unknown", r.Status) assert.Equal(t, "unknown", r.Health) } diff --git a/kubernetes/testdata.go b/kubernetes/testdata.go index 37b5a3d69..6b015b650 100644 --- a/kubernetes/testdata.go +++ b/kubernetes/testdata.go @@ -417,7 +417,6 @@ spec: app: minio release: argo-artifacts sessionAffinity: None - type: LoadBalancer status: loadBalancer: {} ` diff --git a/tests/cel_test.go b/tests/cel_test.go index 9a62abdf1..b46a85667 100644 --- a/tests/cel_test.go +++ b/tests/cel_test.go @@ -411,7 +411,8 @@ func TestCelStrings(t *testing.T) { {nil, `"hello there".slug()`, `hello-there`}, {map[string]interface{}{"s": "hello world"}, "s.snakeCase()", "hello_world"}, {map[string]interface{}{"s": "hello world"}, "s.shellQuote()", "'hello world'"}, - {nil, `"hello".sort()`, `ehllo`}, + // {nil, `"hello".sort()`, `ehllo`}, + {nil, `Sort("hello")`, `ehllo`}, {map[string]interface{}{"s": "hello world"}, "s.split(' ')", "[hello world]"}, {map[string]interface{}{"s": "hello world"}, "s.squote()", "'hello world'"}, {nil, `"hello".startsWith("he")`, "true"}, @@ -632,6 +633,6 @@ func TestCelUUID(t *testing.T) { {nil, "uuid.V1() != uuid.Nil()", "true"}, {nil, "uuid.V4() != uuid.Nil()", "true"}, {nil, "uuid.IsValid('2a42e576-c308-4db9-8525-0513af307586')", "true"}, - {nil, "uuid.Parse('2a42e576-c308-4db9-8525-0513af307586')", "2a42e576-c308-4db9-8525-0513af307586"}, + {nil, "string(uuid.Parse('2a42e576-c308-4db9-8525-0513af307586'))", "2a42e576-c308-4db9-8525-0513af307586"}, }) }