diff --git a/go.mod b/go.mod index 63b730a9fc8..6abb298c73b 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/bombsimon/logrusr/v4 v4.0.0 github.com/cilium/cilium v1.15.0-pre.1 github.com/cilium/ebpf v0.11.0 - github.com/cilium/little-vm-helper v0.0.13-0.20230822094713-37431633085a + github.com/cilium/little-vm-helper v0.0.13-0.20230929123958-5fec6024949c github.com/cilium/lumberjack/v2 v2.3.0 github.com/cilium/tetragon/api v0.0.0-00010101000000-000000000000 github.com/cilium/tetragon/pkg/k8s v0.0.0-00010101000000-000000000000 @@ -33,7 +33,7 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 github.com/spf13/viper v1.16.0 - github.com/sryoya/protorand v0.0.0-20230527172419-e5ae2594eadc + github.com/sryoya/protorand v0.0.0-20230821135621-5e0808bbd3d8 github.com/stretchr/testify v1.8.4 github.com/vishvananda/netlink v1.2.1-beta.2.0.20230807190133-6afddb37c1f0 go.uber.org/atomic v1.11.0 diff --git a/go.sum b/go.sum index 0848754f9d5..713de5897ce 100644 --- a/go.sum +++ b/go.sum @@ -465,8 +465,8 @@ github.com/cilium/dns v1.1.51-0.20230303133941-d3bcb3008ed2 h1:aUhT8ib6cKposeTys github.com/cilium/dns v1.1.51-0.20230303133941-d3bcb3008ed2/go.mod h1:AyKxZ17L5Q7fk2doxT3yjMYGlrJdq5/jvR2xN5KMbxA= github.com/cilium/ebpf v0.11.0 h1:V8gS/bTCCjX9uUnkUFUpPsksM8n1lXBAvHcpiFk1X2Y= github.com/cilium/ebpf v0.11.0/go.mod h1:WE7CZAnqOL2RouJ4f1uyNhqr2P4CCvXFIqdRDUgWsVs= -github.com/cilium/little-vm-helper v0.0.13-0.20230822094713-37431633085a h1:A507gvPbURMidkslEIOENfyLiqr5vSxsiPoD/V4GXrg= -github.com/cilium/little-vm-helper v0.0.13-0.20230822094713-37431633085a/go.mod h1:wErT4smPfNaVj2s9iaTKzP/Q8hN/5o5SH5GAp2OPeRA= +github.com/cilium/little-vm-helper v0.0.13-0.20230929123958-5fec6024949c h1:OwlalGy+EdB8pabLfa+ArdFZ5YQInXHEfjwQQuXzSQs= +github.com/cilium/little-vm-helper v0.0.13-0.20230929123958-5fec6024949c/go.mod h1:XccVlR2A+X5lEwDwvLSeV7rbEuxvvGsMMI9Dj2FkhxA= github.com/cilium/lumberjack/v2 v2.3.0 h1:IhVJMvPpqDYmQzC0KDhAoy7KlaRsyOsZnT97Nsa3u0o= github.com/cilium/lumberjack/v2 v2.3.0/go.mod h1:yfbtPGmg4i//5oEqzaMxDqSWqgfZFmMoV70Mc2k6v0A= github.com/cilium/proxy v0.0.0-20230914115435-e8543968fd3d h1:JtLpAxG5Sf8mi9hC8i7pyCZP4AVk9M6QS8HU+IXtD7o= @@ -1136,8 +1136,8 @@ github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5q github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= -github.com/sryoya/protorand v0.0.0-20230527172419-e5ae2594eadc h1:ZPybelHpsefohBfSL6u3i+qNcf7b0UTHvY8hIlAxYNU= -github.com/sryoya/protorand v0.0.0-20230527172419-e5ae2594eadc/go.mod h1:9a23nlv6vzBeVlQq6JQCjljZ6sfzsB6aha1m5Ly1W2Y= +github.com/sryoya/protorand v0.0.0-20230821135621-5e0808bbd3d8 h1:ycURGtB/l/SlFdlMCQCJbTdln5PgNn+wxba82/8N0pU= +github.com/sryoya/protorand v0.0.0-20230821135621-5e0808bbd3d8/go.mod h1:9a23nlv6vzBeVlQq6JQCjljZ6sfzsB6aha1m5Ly1W2Y= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/vendor/github.com/sryoya/protorand/rand.go b/vendor/github.com/sryoya/protorand/rand.go index a721b65ab01..d97587fa62f 100644 --- a/vendor/github.com/sryoya/protorand/rand.go +++ b/vendor/github.com/sryoya/protorand/rand.go @@ -272,6 +272,10 @@ func (p *ProtoRand) chooseEnumValueRandomly(values protoreflect.EnumValueDescrip } func (p *ProtoRand) chooseOneOfFieldRandomly(oneOf protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { - index := p.rand.Intn(oneOf.Fields().Len() - 1) + ln := oneOf.Fields().Len() + if ln == 1 { + return oneOf.Fields().Get(0) + } + index := p.rand.Intn(ln - 1) return oneOf.Fields().Get(index) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 73689b4b50d..53b3979f7c0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -202,7 +202,7 @@ github.com/cilium/ebpf/internal/unix github.com/cilium/ebpf/link github.com/cilium/ebpf/perf github.com/cilium/ebpf/rlimit -# github.com/cilium/little-vm-helper v0.0.13-0.20230822094713-37431633085a +# github.com/cilium/little-vm-helper v0.0.13-0.20230929123958-5fec6024949c ## explicit; go 1.18 github.com/cilium/little-vm-helper/pkg/images github.com/cilium/little-vm-helper/pkg/kernels @@ -678,7 +678,7 @@ github.com/spf13/viper/internal/encoding/javaproperties github.com/spf13/viper/internal/encoding/json github.com/spf13/viper/internal/encoding/toml github.com/spf13/viper/internal/encoding/yaml -# github.com/sryoya/protorand v0.0.0-20230527172419-e5ae2594eadc +# github.com/sryoya/protorand v0.0.0-20230821135621-5e0808bbd3d8 ## explicit; go 1.17 github.com/sryoya/protorand # github.com/stoewer/go-strcase v1.3.0