From e6d9fe5ad91c04d956bda8cec79e2360b1ec1632 Mon Sep 17 00:00:00 2001 From: Yusuke Kato Date: Mon, 23 May 2022 17:16:44 +0900 Subject: [PATCH 1/3] add invalid id argument handling (#1667) * add invalid id argument handling Merge branch 'master' into bugfix/gateway/handler-invalid-argument Signed-off-by: kpango * update deps Signed-off-by: kpango --- Makefile | 10 +- Makefile.d/functions.mk | 4 - Makefile.d/proto.mk | 4 - example/client/go.mod | 10 +- example/client/go.sum | 16 +-- go.mod | 76 +++++------ go.sum | 141 ++++++++++----------- hack/go.mod.default | 7 +- pkg/agent/core/ngt/handler/grpc/handler.go | 16 +++ pkg/gateway/lb/handler/grpc/handler.go | 122 ++++++++++++++++-- versions/NGT_VERSION | 2 +- 11 files changed, 257 insertions(+), 151 deletions(-) diff --git a/Makefile b/Makefile index 209a32109b..3c31196aaf 100644 --- a/Makefile +++ b/Makefile @@ -54,14 +54,14 @@ TENSORFLOW_C_VERSION := $(eval TENSORFLOW_C_VERSION := $(shell cat versions/TENS OPERATOR_SDK_VERSION := $(eval OPERATOR_SDK_VERSION := $(shell cat versions/OPERATOR_SDK_VERSION))$(OPERATOR_SDK_VERSION) -KIND_VERSION ?= v0.13.0 -HELM_VERSION ?= v3.8.2 +KIND_VERSION ?= v0.14.0 +HELM_VERSION ?= v3.9.0 HELM_DOCS_VERSION ?= 1.10.0 YQ_VERSION ?= v4.25.1 VALDCLI_VERSION ?= v1.5.2 -TELEPRESENCE_VERSION ?= 2.5.8 -KUBELINTER_VERSION ?= 0.2.6 -GOLANGCILINT_VERSION ?= v1.46.0 +TELEPRESENCE_VERSION ?= 2.6.3 +KUBELINTER_VERSION ?= 0.3.0 +GOLANGCILINT_VERSION ?= v1.46.2 REVIEWDOG_VERSION ?= v0.14.1 PROTOBUF_VERSION ?= 3.20.1 diff --git a/Makefile.d/functions.mk b/Makefile.d/functions.mk index 3fe661f83e..4d4acab880 100644 --- a/Makefile.d/functions.mk +++ b/Makefile.d/functions.mk @@ -24,10 +24,6 @@ define go-install GO111MODULE=on go install $1@latest endef -define go-get-no-mod - GO111MODULE=off go get -u $1 -endef - define mkdir mkdir -p $1 endef diff --git a/Makefile.d/proto.mk b/Makefile.d/proto.mk index 4ac48c2ed3..097d1842b0 100644 --- a/Makefile.d/proto.mk +++ b/Makefile.d/proto.mk @@ -43,7 +43,6 @@ proto/paths/print: .PHONY: proto/deps ## install protobuf dependencies proto/deps: \ - $(GOPATH)/bin/google.golang.org/genproto \ $(GOPATH)/bin/protoc-gen-doc \ $(GOPATH)/bin/protoc-gen-go \ $(GOPATH)/bin/protoc-gen-go-grpc \ @@ -104,9 +103,6 @@ $(GOPATH)/src/google.golang.org/genproto: https://github.com/googleapis/go-genproto \ $(GOPATH)/src/google.golang.org/genproto -$(GOPATH)/bin/google.golang.org/genproto: - $(call go-get-no-mod, google.golang.org/genproto/...) - $(GOPATH)/bin/protoc-gen-go: $(call go-install, google.golang.org/protobuf/cmd/protoc-gen-go) diff --git a/example/client/go.mod b/example/client/go.mod index d7be93079e..8c4320826d 100644 --- a/example/client/go.mod +++ b/example/client/go.mod @@ -8,14 +8,14 @@ replace ( github.com/golang/protobuf => github.com/golang/protobuf v1.5.2 github.com/kpango/glg => github.com/kpango/glg v1.6.10 github.com/pkg/sftp => github.com/pkg/sftp v1.13.4 - golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 - golang.org/x/net => golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 + golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 + golang.org/x/net => golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 golang.org/x/text => golang.org/x/text v0.3.7 - google.golang.org/genproto => google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 - google.golang.org/grpc => google.golang.org/grpc v1.46.0 + google.golang.org/genproto => google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd + google.golang.org/grpc => google.golang.org/grpc v1.46.2 google.golang.org/protobuf => google.golang.org/protobuf v1.28.0 gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.4.0 - gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99 + gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.0 ) require ( diff --git a/example/client/go.sum b/example/client/go.sum index 8dfc78eaf4..1e75b3ea9f 100644 --- a/example/client/go.sum +++ b/example/client/go.sum @@ -50,13 +50,13 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= +golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -86,12 +86,12 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 h1:vJpL69PeUullhJyKtTjHjENEmZU3BkO4e+fod7nKzgM= gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946/go.mod h1:BQUWDHIAygjdt1HnUPQ0eWqLN2n5FwJycrpYUVUOx2I= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 h1:q1kiSVscqoDeqTF27eQ2NnLLDmqF0I373qQNXYMy0fo= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/grpc v1.46.0 h1:oCjezcn6g6A75TGoKYBPgKmVBLexhYLM6MebdrPApP8= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/go.mod b/go.mod index 16f3421365..778f8dadbe 100755 --- a/go.mod +++ b/go.mod @@ -4,15 +4,16 @@ go 1.18 replace ( cloud.google.com/go => cloud.google.com/go v0.101.1 + cloud.google.com/go/compute => cloud.google.com/go/compute v1.6.1 cloud.google.com/go/iam => cloud.google.com/go/iam v0.3.0 cloud.google.com/go/monitoring => cloud.google.com/go/monitoring v1.5.0 - cloud.google.com/go/profiler => cloud.google.com/go/profiler v0.2.0 - cloud.google.com/go/storage => cloud.google.com/go/storage v1.22.0 + cloud.google.com/go/profiler => cloud.google.com/go/profiler v0.3.0 + cloud.google.com/go/storage => cloud.google.com/go/storage v1.22.1 cloud.google.com/go/trace => cloud.google.com/go/trace v1.2.0 - github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.2.1-0.20220504154517-49906996bd99+incompatible - github.com/Azure/go-autorest/autorest => github.com/Azure/go-autorest/autorest v0.11.28-0.20220504154517-49906996bd99 - github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.9.19 - github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.44.13 + github.com/Azure/go-autorest => github.com/Azure/go-autorest v14.2.1-0.20220519225546-7dd32b67be4e+incompatible + github.com/Azure/go-autorest/autorest => github.com/Azure/go-autorest/autorest v0.11.28-0.20220519225546-7dd32b67be4e + github.com/Azure/go-autorest/autorest/adal => github.com/Azure/go-autorest/autorest/adal v0.9.20 + github.com/aws/aws-sdk-go => github.com/aws/aws-sdk-go v1.44.19 github.com/chzyer/logex => github.com/chzyer/logex v1.2.1 github.com/coreos/etcd => go.etcd.io/etcd v3.3.27+incompatible github.com/docker/docker => github.com/moby/moby v20.10.16+incompatible @@ -20,6 +21,7 @@ replace ( github.com/envoyproxy/protoc-gen-validate => github.com/envoyproxy/protoc-gen-validate v0.6.7 github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify v1.5.4 github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.7 + github.com/go-logfmt/logfmt => github.com/go-logfmt/logfmt v0.5.1 github.com/go-logr/logr => github.com/go-logr/logr v1.2.3 github.com/go-sql-driver/mysql => github.com/go-sql-driver/mysql v1.6.0 github.com/goccy/go-json => github.com/goccy/go-json v0.9.7 @@ -30,12 +32,13 @@ replace ( github.com/golang/snappy => github.com/golang/snappy v0.0.4 github.com/google/btree => github.com/google/btree v1.0.1 github.com/google/go-cmp => github.com/google/go-cmp v0.5.8 - github.com/google/pprof => github.com/google/pprof v0.0.0-20220509035851-59ca7ad80af3 + github.com/google/pprof => github.com/google/pprof v0.0.0-20220520215854-d04f2422c8a1 github.com/google/uuid => github.com/google/uuid v1.3.0 + github.com/googleapis/gax-go/v2 => github.com/googleapis/gax-go/v2 v2.4.0 github.com/gorilla/mux => github.com/gorilla/mux v1.8.0 github.com/gorilla/websocket => github.com/gorilla/websocket v1.5.0 github.com/hailocab/go-hostpool => github.com/kpango/go-hostpool v0.0.0-20210303030322-aab80263dcd0 - github.com/hashicorp/go-version => github.com/hashicorp/go-version v1.4.0 + github.com/hashicorp/go-version => github.com/hashicorp/go-version v1.5.0 github.com/jackc/chunkreader => github.com/jackc/chunkreader v1.0.0 github.com/jackc/pgconn => github.com/jackc/pgconn v1.12.1 github.com/jackc/pgmock => github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65 @@ -46,17 +49,19 @@ replace ( github.com/json-iterator/go => github.com/json-iterator/go v1.1.12 github.com/klauspost/compress => github.com/klauspost/compress v1.15.5-0.20220512161851-3909335c441d github.com/kpango/glg => github.com/kpango/glg v1.6.10 + github.com/mailru/easyjson => github.com/mailru/easyjson v0.7.7 github.com/onsi/ginkgo => github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega => github.com/onsi/gomega v1.19.0 github.com/opentracing/opentracing-go => github.com/opentracing/opentracing-go v1.2.0 github.com/pkg/sftp => github.com/pkg/sftp v1.13.4 - github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.12.1 + github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.12.2 github.com/prometheus/client_model => github.com/prometheus/client_model v0.2.0 github.com/prometheus/common => github.com/prometheus/common v0.34.0 github.com/prometheus/procfs => github.com/prometheus/procfs v0.7.3 github.com/prometheus/prometheus/v2 => github.com/prometheus/prometheus/v2 v2.35.0-retract github.com/rs/xid => github.com/rs/xid v1.4.0 github.com/sirupsen/logrus => github.com/sirupsen/logrus v1.8.1 + github.com/spf13/afero => github.com/spf13/afero v1.8.2 github.com/spf13/cobra => github.com/spf13/cobra v1.4.0 github.com/spf13/pflag => github.com/spf13/pflag v1.0.5 github.com/stretchr/testify => github.com/stretchr/testify v1.7.1 @@ -74,31 +79,31 @@ replace ( go.uber.org/goleak => go.uber.org/goleak v1.1.12 go.uber.org/multierr => go.uber.org/multierr v1.8.0 go.uber.org/zap => go.uber.org/zap v1.21.0 - golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 - golang.org/x/exp => golang.org/x/exp v0.0.0-20220428152302-39d4317da171 + golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 + golang.org/x/exp => golang.org/x/exp v0.0.0-20220518171630-0b5c67f07fdf golang.org/x/image => golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 golang.org/x/lint => golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 golang.org/x/mod => golang.org/x/mod v0.5.1 - golang.org/x/net => golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 + golang.org/x/net => golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 golang.org/x/oauth2 => golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 - golang.org/x/sync => golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys => golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 + golang.org/x/sync => golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 + golang.org/x/sys => golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a golang.org/x/term => golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 golang.org/x/text => golang.org/x/text v0.3.7 golang.org/x/time => golang.org/x/time v0.0.0-20220411224347-583f2d630306 golang.org/x/tools => golang.org/x/tools v0.1.10 - golang.org/x/xerrors => golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f + golang.org/x/xerrors => golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df gonum.org/v1/gonum => gonum.org/v1/gonum v0.11.0 gonum.org/v1/plot => gonum.org/v1/plot v0.11.0 - google.golang.org/api => google.golang.org/api v0.79.0 + google.golang.org/api => google.golang.org/api v0.80.0 google.golang.org/appengine => google.golang.org/appengine v1.6.7 - google.golang.org/genproto => google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 - google.golang.org/grpc => google.golang.org/grpc v1.46.0 + google.golang.org/genproto => google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd + google.golang.org/grpc => google.golang.org/grpc v1.46.2 google.golang.org/grpc/cmd/protoc-gen-go-grpc => google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0 google.golang.org/protobuf => google.golang.org/protobuf v1.28.0 gopkg.in/check.v1 => gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c gopkg.in/yaml.v2 => gopkg.in/yaml.v2 v2.4.0 - gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99 + gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.0 k8s.io/api => k8s.io/api v0.24.0 k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.24.0 k8s.io/apimachinery => k8s.io/apimachinery v0.24.0 @@ -112,16 +117,16 @@ replace ( k8s.io/metrics => k8s.io/metrics v0.24.0 k8s.io/utils => k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 sigs.k8s.io/apiserver-network-proxy/konnectivity-client => sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.31 - sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.12.0 - sigs.k8s.io/kustomize/api => sigs.k8s.io/kustomize/api v0.11.4 - sigs.k8s.io/kustomize/kyaml => sigs.k8s.io/kustomize/kyaml v0.13.6 + sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.12.1 + sigs.k8s.io/kustomize/api => sigs.k8s.io/kustomize/api v0.11.5 + sigs.k8s.io/kustomize/kyaml => sigs.k8s.io/kustomize/kyaml v0.13.7 sigs.k8s.io/structured-merge-diff/v4 => sigs.k8s.io/structured-merge-diff/v4 v4.2.1 sigs.k8s.io/yaml => sigs.k8s.io/yaml v1.3.0 ) require ( cloud.google.com/go/profiler v0.0.0-00010101000000-000000000000 - cloud.google.com/go/storage v1.22.0 + cloud.google.com/go/storage v1.22.1 code.cloudfoundry.org/bytefmt v0.0.0-20211005130812-5bb3c17173e5 contrib.go.opencensus.io/exporter/jaeger v0.2.1 contrib.go.opencensus.io/exporter/prometheus v0.4.1 @@ -144,9 +149,9 @@ require ( github.com/kpango/glg v1.6.10 github.com/leanovate/gopter v0.2.9 github.com/lucasb-eyer/go-colorful v1.2.0 - github.com/pierrec/lz4/v3 v3.3.4 - github.com/quasilyte/go-ruleguard v0.3.15 - github.com/quasilyte/go-ruleguard/dsl v0.3.19 + github.com/pierrec/lz4/v3 v3.3.5 + github.com/quasilyte/go-ruleguard v0.3.16 + github.com/quasilyte/go-ruleguard/dsl v0.3.21 github.com/scylladb/gocqlx v1.5.0 github.com/tensorflow/tensorflow v0.0.0-00010101000000-000000000000 github.com/zeebo/xxh3 v1.0.1 @@ -160,11 +165,11 @@ require ( golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 golang.org/x/text v0.3.7 - golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717 + golang.org/x/tools v0.1.10 gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 gonum.org/v1/plot v0.0.0-00010101000000-000000000000 - google.golang.org/api v0.77.0 - google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 + google.golang.org/api v0.78.0 + google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335 google.golang.org/grpc v1.46.0 google.golang.org/protobuf v1.28.0 gopkg.in/yaml.v2 v2.4.0 @@ -214,11 +219,11 @@ require ( github.com/google/btree v1.0.1 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/gofuzz v1.1.0 // indirect - github.com/google/pprof v0.0.0-20220113144219-d25a53d42d00 // indirect + github.com/google/pprof v0.0.0-20220412212628-83db2b799d1f // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.3.0 // indirect github.com/google/wire v0.5.0 // indirect - github.com/googleapis/gax-go/v2 v2.3.0 // indirect + github.com/googleapis/gax-go/v2 v2.4.0 // indirect github.com/googleapis/go-type-adapters v1.0.0 // indirect github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed // indirect @@ -238,18 +243,17 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_golang v1.12.1 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/prometheus/prometheus v2.5.0+incompatible // indirect github.com/prometheus/statsd_exporter v0.21.0 // indirect - github.com/quasilyte/gogrep v0.0.0-20220103110004-ffaa07af02e3 // indirect + github.com/quasilyte/gogrep v0.0.0-20220120141003-628d8b3623b5 // indirect + github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect github.com/scylladb/go-reflectx v1.0.1 // indirect github.com/spf13/cobra v1.4.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.7.1 // indirect github.com/uber/jaeger-client-go v2.25.0+incompatible // indirect github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca // indirect go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect @@ -269,11 +273,11 @@ require ( k8s.io/apiextensions-apiserver v0.24.0 // indirect k8s.io/component-base v0.24.0 // indirect k8s.io/klog/v2 v2.60.1 // indirect - k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect + k8s.io/kube-openapi v0.0.0-20220401212409-b28bf2818661 // indirect k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect sigs.k8s.io/kustomize/api v0.11.4 // indirect - sigs.k8s.io/kustomize/kyaml v0.13.6 // indirect + sigs.k8s.io/kustomize/kyaml v0.13.7 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index 3f38bd9d0a..d11d4e089e 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,9 @@ cloud.google.com/go v0.101.1 h1:3+/0TAm9JD/PyhkrDWQWi2L197h3euCsM+H+J4iYTR8= cloud.google.com/go v0.101.1/go.mod h1:55HwjsGW4CHD3JrNuMdZtSDsgTs0CuCB/bBTugD+7AA= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/compute v1.6.1 h1:2sMmt8prCn7DPaG4Pmh0N3Inmc8cT8ae5k1M6VJ9Wqc= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= cloud.google.com/go/iam v0.3.0 h1:exkAomrVUuzx9kWFI1wm3KI0uoDeUFPB4kKGzx6x+Gc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= @@ -13,12 +11,12 @@ cloud.google.com/go/kms v1.1.0/go.mod h1:WdbppnCDMDpOvoYBMn1+gNmOeEoZYqAv+HeuKAR cloud.google.com/go/kms v1.4.0/go.mod h1:fajBHndQ+6ubNw6Ss2sSd+SWvjL26RNo/dr7uxsnnOA= cloud.google.com/go/monitoring v1.5.0 h1:ZltYv8e69fJVga7RTthUBGdx4+Pwz6GRF1V3zylERl4= cloud.google.com/go/monitoring v1.5.0/go.mod h1:/o9y8NYX5j91JjD/JvGLYbi86kL11OjyJXq2XziLJu4= -cloud.google.com/go/profiler v0.2.0 h1:TZEKR39niWTuvpak6VNg+D8J5qTzJnyaD1Yl4BOU+d8= -cloud.google.com/go/profiler v0.2.0/go.mod h1:Rn0g4ZAbYR1sLVP7GAmCZxid4dmtD/nURxcaxf6pngI= +cloud.google.com/go/profiler v0.3.0 h1:R6y/xAeifaUXxd2x6w+jIwKxoKl8Cv5HJvcvASTPWJo= +cloud.google.com/go/profiler v0.3.0/go.mod h1:9wYk9eY4iZHsev8TQb61kh3wiOiSyz/xOYixWPzweCU= cloud.google.com/go/pubsub v1.19.0/go.mod h1:/O9kmSe9bb9KRnIAWkzmqhPjHo6LtzGOBYd/kr06XSs= cloud.google.com/go/secretmanager v1.3.0/go.mod h1:+oLTkouyiYiabAQNugCeTS3PAArGiMJuBqvJnJsyH+U= -cloud.google.com/go/storage v1.22.0 h1:NUV0NNp9nkBuW66BFRLuMgldN60C57ET3dhbwLIYio8= -cloud.google.com/go/storage v1.22.0/go.mod h1:GbaLEoMqbVm6sx3Z0R++gSiBlgMv6yUi2q1DeGFKQgE= +cloud.google.com/go/storage v1.22.1 h1:F6IlQJZrZM++apn9V5/VfS3gbTUYg98PS3EMQAzqtfg= +cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/trace v1.2.0 h1:oIaB4KahkIUOpLSAAjEJ8y2desbjY/x/RfP4O3KAtTI= cloud.google.com/go/trace v1.2.0/go.mod h1:Wc8y/uYyOhPy12KEnXG9XGrvfMz5F5SrYecQlbW1rwM= code.cloudfoundry.org/bytefmt v0.0.0-20190710193110-1eb035ffe2b6/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc= @@ -50,9 +48,9 @@ github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEew github.com/Azure/go-amqp v0.16.0/go.mod h1:9YJ3RhxRT1gquYnzpZO1vcYMMpAdJT+QEg6fwmw9Zlg= github.com/Azure/go-amqp v0.16.4/go.mod h1:9YJ3RhxRT1gquYnzpZO1vcYMMpAdJT+QEg6fwmw9Zlg= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v14.2.1-0.20220504154517-49906996bd99+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.28-0.20220504154517-49906996bd99/go.mod h1:7l8ybrIdUmGqZMTD0sRtAr8NvbHjfofbf8RSP2q7w7U= -github.com/Azure/go-autorest/autorest/adal v0.9.19/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= +github.com/Azure/go-autorest v14.2.1-0.20220519225546-7dd32b67be4e+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest/autorest v0.11.28-0.20220519225546-7dd32b67be4e/go.mod h1:7l8ybrIdUmGqZMTD0sRtAr8NvbHjfofbf8RSP2q7w7U= +github.com/Azure/go-autorest/autorest/adal v0.9.20/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= github.com/Azure/go-autorest/autorest/azure/auth v0.5.9/go.mod h1:hg3/1yw0Bq87O3KvvnJoAh34/0zbP7SFizX/qN5JvjU= github.com/Azure/go-autorest/autorest/azure/cli v0.4.2/go.mod h1:7qkJkT+j6b+hIpzMOwPChJhTqS8VbsqqgULzMNRugoM= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= @@ -81,8 +79,8 @@ github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.m github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.44.13 h1:7mRsYayiEQSladCR2ASLsNz3f3XIdfOdXd+od3uOLP4= -github.com/aws/aws-sdk-go v1.44.13/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.19 h1:dhI6p4l6kisnA7gBAM8sP5YIk0bZ9HNAj7yrK7kcfdU= +github.com/aws/aws-sdk-go v1.44.19/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/aws/aws-sdk-go-v2 v1.16.2 h1:fqlCk6Iy3bnCumtrLz9r3mJ/2gUT0pJ0wLFVIdWh+JA= github.com/aws/aws-sdk-go-v2 v1.16.2/go.mod h1:ytwTPBG6fXTZLxxeeCCWj2/EMYp/xDUgX+OET6TLNNU= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.1 h1:SdK4Ppk5IzLs64ZMvr6MrSficMtjY2oS0WOORXTlxwU= @@ -142,7 +140,9 @@ github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cb github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -211,8 +211,6 @@ github.com/go-kit/log v0.2.0 h1:7i2K3eKTos3Vc0enKCfnVcgHh2olr/MyfboYq7cAcFw= github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81 h1:6zl3BbBhdnMkpSj2YY30qV3gDcVBGtFgVsV3+/i+mKQ= github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpxhq9o2S/CELCSUxEWWAuoCUcVCQWv7G2OCk= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= @@ -300,8 +298,8 @@ github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible h1:x github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/pprof v0.0.0-20220509035851-59ca7ad80af3 h1:vFrXU7L2gqtlP/ZGijSpaDIc16ZQrZI4FAuYtpQTyQc= -github.com/google/pprof v0.0.0-20220509035851-59ca7ad80af3/go.mod h1:Pt31oes+eGImORns3McJn8zHefuQl2rG8l6xQjGYB4U= +github.com/google/pprof v0.0.0-20220520215854-d04f2422c8a1 h1:K4bn56FHdjFCfjSo3wWaD6rJL8r9yvmmncJNMhdkKrw= +github.com/google/pprof v0.0.0-20220520215854-d04f2422c8a1/go.mod h1:gSuNB+gJaOiQKLEZ+q+PK9Mq3SOzhRcw2GsGS/FhYDk= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= @@ -310,14 +308,11 @@ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0 h1:nRJtk3y8Fm770D42QV6T90ZnvFZyk7agSo3Q+Z9p3WI= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= +github.com/googleapis/gax-go/v2 v2.4.0 h1:dS9eYAjhrE2RjmzYw2XAPvcXfmcQLtFEQWn0CR82awk= +github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/go-type-adapters v1.0.0 h1:9XdMn+d/G57qq1s8dNc5IesGCXHf6V2HZ2JwRxfA2tA= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -328,10 +323,10 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hanwen/go-fuse v1.0.0/go.mod h1:unqXarDXqzAk0rt98O2tVndEPIpUgLD9+rwFisZH3Ok= github.com/hanwen/go-fuse/v2 v2.1.0/go.mod h1:oRyA5eK+pvJyv5otpO/DgccS8y/RvYMaO00GgRLGryc= -github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4= -github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.5.0 h1:O293SZ2Eg+AAYijkVK3jR786Am1bhDEh2GHT0tIVE5E= +github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= +github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -381,7 +376,6 @@ github.com/kpango/glg v1.6.10/go.mod h1:Er7L/mFi0MY+Nse2a85sc3kU80cR3Vi3iBKax56r github.com/kpango/go-hostpool v0.0.0-20210303030322-aab80263dcd0 h1:orIEVdc68woWO1ZyYWEVOl5Kl33eDjP+kbxgbdpMwi4= github.com/kpango/go-hostpool v0.0.0-20210303030322-aab80263dcd0/go.mod h1:CJt2OTBmIWH7X/gYDy8fg67d26E/a8MpbGvgrKWZQxQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= @@ -402,11 +396,8 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9 github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-ieproxy v0.0.1/go.mod h1:pYabZ6IHcRpFh7vIaLfK7rdcWgFEb3SFJ6/gNWuh88E= github.com/mattn/go-ieproxy v0.0.3 h1:YkaHmK1CzE5C4O7A3hv3TCbfNDPSCf0RKZFX+VhBeYk= @@ -454,8 +445,8 @@ github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2 github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/pierrec/cmdflag v0.0.2/go.mod h1:a3zKGZ3cdQUfxjd0RGMLZr8xI3nvpJOB+m6o/1X5BmU= -github.com/pierrec/lz4/v3 v3.3.4 h1:fqXL+KOc232xP6JgmKMp22fd+gn8/RFZjTreqbbqExc= -github.com/pierrec/lz4/v3 v3.3.4/go.mod h1:280XNCGS8jAcG++AHdd6SeWnzyJ1w9oow2vbORyey8Q= +github.com/pierrec/lz4/v3 v3.3.5 h1:JzKda6jLXZpQK5/ulrEfT1I66tsKiGlw6sjKssFpwt8= +github.com/pierrec/lz4/v3 v3.3.5/go.mod h1:280XNCGS8jAcG++AHdd6SeWnzyJ1w9oow2vbORyey8Q= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -465,8 +456,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= -github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= +github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.34.0 h1:RBmGO9d/FVjqHT0yUGQwBJhkwKV+wPCn7KGpvfab0uE= @@ -477,17 +468,14 @@ github.com/prometheus/prometheus v2.5.0+incompatible h1:7QPitgO2kOFG8ecuRn9O/4L9 github.com/prometheus/prometheus v2.5.0+incompatible/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s= github.com/prometheus/statsd_exporter v0.21.0 h1:hA05Q5RFeIjgwKIYEdFd59xu5Wwaznf33yKI+pyX6T8= github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= -github.com/quasilyte/go-ruleguard v0.3.1-0.20210203134552-1b5a410e1cc8/go.mod h1:KsAh3x0e7Fkpgs+Q9pNLS5XpFSvYCEVl5gP9Pp1xp30= -github.com/quasilyte/go-ruleguard v0.3.15 h1:iWYzp1z72IlXTioET0+XI6SjQdPfMGfuAiZiKznOt7g= -github.com/quasilyte/go-ruleguard v0.3.15/go.mod h1:NhuWhnlVEM1gT1A4VJHYfy9MuYSxxwHgxWoPsn9llB4= -github.com/quasilyte/go-ruleguard/dsl v0.3.0/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.12-0.20220101150716-969a394a9451/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.19 h1:5+KTKb2YREUYiqZFEIuifFyBxlcCUPWgNZkWy71XS0Q= -github.com/quasilyte/go-ruleguard/dsl v0.3.19/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mod h1:7JTjp89EGyU1d6XfBiXihJNG37wB2VRkd125Q1u7Plc= -github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= -github.com/quasilyte/gogrep v0.0.0-20220103110004-ffaa07af02e3 h1:P4QPNn+TK49zJjXKERt/vyPbv/mCHB/zQ4flDYOMN+M= -github.com/quasilyte/gogrep v0.0.0-20220103110004-ffaa07af02e3/go.mod h1:wSEyW6O61xRV6zb6My3HxrQ5/8ke7NE2OayqCHa3xRM= +github.com/quasilyte/go-ruleguard v0.3.16 h1:jvwWgz0rsVy91m8gy2vLFPMU0K63utoLYBVYDkOLATU= +github.com/quasilyte/go-ruleguard v0.3.16/go.mod h1:aykhjU4hUplU3VXDm9EBcovBvlEwolXMEYcmTgq3eG4= +github.com/quasilyte/go-ruleguard/dsl v0.3.21 h1:vNkC6fC6qMLzCOGbnIHOd5ixUGgTbp3Z4fGnUgULlDA= +github.com/quasilyte/go-ruleguard/dsl v0.3.21/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/quasilyte/gogrep v0.0.0-20220120141003-628d8b3623b5 h1:PDWGei+Rf2bBiuZIbZmM20J2ftEy9IeUCHA8HbQqed8= +github.com/quasilyte/gogrep v0.0.0-20220120141003-628d8b3623b5/go.mod h1:wSEyW6O61xRV6zb6My3HxrQ5/8ke7NE2OayqCHa3xRM= +github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= +github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY= @@ -508,9 +496,7 @@ github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -579,23 +565,23 @@ go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37 h1:Tx9kY6y go4.org/unsafe/assume-no-moving-gc v0.0.0-20211027215541-db492cf91b37/go.mod h1:FftLjUGFEDu5k8lt0ddY+HcrH/qU/0qk+H8j9/nTl3E= gocloud.dev v0.25.0 h1:Y7vDq8xj7SyM848KXf32Krda2e6jQ4CLh/mTeCSqXtk= gocloud.dev v0.25.0/go.mod h1:7HegHVCYZrMiU3IE1qtnzf/vRrDwLYnRNR3EhWX8x9Y= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/exp v0.0.0-20220428152302-39d4317da171 h1:TfdoLivD44QwvssI9Sv1xwa5DcL5XQr4au4sZ2F2NV4= +golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898 h1:SLP7Q4Di66FONjDJbCYrCRrh97focO6sLogHO7/g8F0= +golang.org/x/crypto v0.0.0-20220518034528-6f7dac969898/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/exp v0.0.0-20220518171630-0b5c67f07fdf h1:oXVg4h2qJDd9htKxb5SCpFBHLipW6hXmL3qpUixS2jw= golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 h1:LRtI4W37N+KFebI/qV0OFiLUv4GLOWeEW5hn/KEJvxE= golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 h1:NWy5+hlRbC7HK+PmcXVUmW1IMyFce7to56IUvhUFm7Y= +golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 h1:OSnWWcOd/CtWQC2cYSBgbTSJv3ciqd8r54ySIW2y3RE= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6 h1:nonptSpoQ4vQjyraW20DXPAglgQfVnM9ZC6MmNLMR60= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 h1:w8s32wxx3sY+OjLlv9qltkLU5yvJzxjjgiHWLjdIcw4= +golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 h1:EH1Deb8WZJ0xc0WK//leUHXcX9aLE5SymusoTmMZye8= golang.org/x/term v0.0.0-20220411215600-e5f449aeb171/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= @@ -604,8 +590,8 @@ golang.org/x/time v0.0.0-20220411224347-583f2d630306 h1:+gHMid33q6pen7kv9xvT+JRi golang.org/x/time v0.0.0-20220411224347-583f2d630306/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f h1:GGU+dLjvlC3qDwqYgL6UgRmHXhOOgns0bZu2Ty5mm6U= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= gonum.org/v1/gonum v0.11.0 h1:f1IJhK4Km5tBJmaiJXtk/PkL4cdVX6J+tGiM187uT5E= @@ -613,14 +599,14 @@ gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 h1:vJpL69PeUullhJyKtTjHjENE gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946/go.mod h1:BQUWDHIAygjdt1HnUPQ0eWqLN2n5FwJycrpYUVUOx2I= gonum.org/v1/plot v0.11.0 h1:z2ZkgNqW34d0oYUzd80RRlc0L9kWtenqK4kflZG1lGc= gonum.org/v1/plot v0.11.0/go.mod h1:fH9YnKnDKax0u5EzHVXvhN5HJwtMFWIOLNuhgUahbCQ= -google.golang.org/api v0.79.0 h1:vaOcm0WdXvhGkci9a0+CcQVZqSRjN8ksSBlWv99f8Pg= -google.golang.org/api v0.79.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= +google.golang.org/api v0.80.0 h1:IQWaGVCYnsm4MO3hh+WtSXMzMzuyFx/fuR8qkN3A0Qo= +google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 h1:q1kiSVscqoDeqTF27eQ2NnLLDmqF0I373qQNXYMy0fo= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/grpc v1.46.0 h1:oCjezcn6g6A75TGoKYBPgKmVBLexhYLM6MebdrPApP8= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I= +google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= +google.golang.org/grpc v1.46.2 h1:u+MLGgVf7vRdjEYZ8wDFhAVNmhkbJ5hmrA1LMWK1CAQ= +google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= @@ -637,10 +623,11 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99 h1:dbuHpmKjkDzSOMKAWl10QNlgaZUd3V1q99xc81tt2Kc= -gopkg.in/yaml.v3 v3.0.0-20220512140231-539c8e751b99/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= inet.af/netaddr v0.0.0-20211027220019-c74959edd3b6 h1:acCzuUSQ79tGsM/O50VRFySfMm19IoMKL+sZztZkCxw= @@ -662,9 +649,9 @@ k8s.io/component-base v0.24.0/go.mod h1:Dgazgon0i7KYUsS8krG8muGiMVtUZxG037l1MKyX k8s.io/gengo v0.0.0-20220307231824-4627b89bbf1b/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.60.1 h1:VW25q3bZx9uE3vvdL6M8ezOX79vA2Aq1nEWLqNQclHc= k8s.io/klog/v2 v2.60.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 h1:Gii5eqf+GmIEwGNKQYQClCayuJCe2/4fZUvF7VG99sU= k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= +k8s.io/kube-openapi v0.0.0-20220401212409-b28bf2818661 h1:nqYOUleKLC/0P1zbU29F5q6aoezM6MOAVz+iyfQbZ5M= +k8s.io/kube-openapi v0.0.0-20220401212409-b28bf2818661/go.mod h1:daOouuuwd9JXpv1L7Y34iV3yf6nxzipkKMWWlqlvK9M= k8s.io/metrics v0.24.0 h1:nsFLJBDgj+B8mXvVBWFxTZBRRDJ8uTdf4C/Gedjy9BA= k8s.io/metrics v0.24.0/go.mod h1:jrLlFGdKl3X+szubOXPG0Lf2aVxuV3QJcbsgVRAM6fI= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= @@ -672,14 +659,14 @@ k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= rsc.io/pdf v0.1.1 h1:k1MczvYDUvJBe93bYd7wrZLLUEcLZAuF824/I4e5Xr4= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.31/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= -sigs.k8s.io/controller-runtime v0.12.0 h1:gA4zphrmHFc7ihmY/+GyyE0BxKD+OYdb5+DjD2azFAQ= -sigs.k8s.io/controller-runtime v0.12.0/go.mod h1:BKhxlA4l7FPK4AQcsuL4X6vZeWnKDXez/vp1Y8dxTU0= +sigs.k8s.io/controller-runtime v0.12.1 h1:4BJY01xe9zKQti8oRjj/NeHKRXthf1YkYJAgLONFFoI= +sigs.k8s.io/controller-runtime v0.12.1/go.mod h1:BKhxlA4l7FPK4AQcsuL4X6vZeWnKDXez/vp1Y8dxTU0= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= -sigs.k8s.io/kustomize/api v0.11.4 h1:/0Mr3kfBBNcNPOW5Qwk/3eb8zkswCwnqQxxKtmrTkRo= -sigs.k8s.io/kustomize/api v0.11.4/go.mod h1:k+8RsqYbgpkIrJ4p9jcdPqe8DprLxFUUO0yNOq8C+xI= -sigs.k8s.io/kustomize/kyaml v0.13.6 h1:eF+wsn4J7GOAXlvajv6OknSunxpcOBQQqsnPxObtkGs= -sigs.k8s.io/kustomize/kyaml v0.13.6/go.mod h1:yHP031rn1QX1lr/Xd934Ri/xdVNG8BE2ECa78Ht/kEg= +sigs.k8s.io/kustomize/api v0.11.5 h1:vLDp++YAX7iy2y2CVPJNy9pk9CY8XaUKgHkjbVtnWag= +sigs.k8s.io/kustomize/api v0.11.5/go.mod h1:2UDpxS6AonWXow2ZbySd4AjUxmdXLeTlvGBC46uSiq8= +sigs.k8s.io/kustomize/kyaml v0.13.7 h1:/EZ/nPaLUzeJKF/BuJ4QCuMVJWiEVoI8iftOHY3g3tk= +sigs.k8s.io/kustomize/kyaml v0.13.7/go.mod h1:6K+IUOuir3Y7nucPRAjw9yth04KSWBnP5pqUTGwj/qU= sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= diff --git a/hack/go.mod.default b/hack/go.mod.default index b36902f359..71a687d69a 100755 --- a/hack/go.mod.default +++ b/hack/go.mod.default @@ -4,6 +4,7 @@ go 1.18 replace ( cloud.google.com/go => cloud.google.com/go latest + cloud.google.com/go/compute => cloud.google.com/go/compute latest cloud.google.com/go/iam => cloud.google.com/go/iam latest cloud.google.com/go/monitoring => cloud.google.com/go/monitoring latest cloud.google.com/go/profiler => cloud.google.com/go/profiler latest @@ -20,6 +21,7 @@ replace ( github.com/envoyproxy/protoc-gen-validate => github.com/envoyproxy/protoc-gen-validate latest github.com/fsnotify/fsnotify => github.com/fsnotify/fsnotify latest github.com/gin-gonic/gin => github.com/gin-gonic/gin latest + github.com/go-logfmt/logfmt => github.com/go-logfmt/logfmt latest github.com/go-logr/logr => github.com/go-logr/logr latest github.com/go-sql-driver/mysql => github.com/go-sql-driver/mysql latest github.com/goccy/go-json => github.com/goccy/go-json latest @@ -32,6 +34,7 @@ replace ( github.com/google/go-cmp => github.com/google/go-cmp latest github.com/google/pprof => github.com/google/pprof master github.com/google/uuid => github.com/google/uuid latest + github.com/googleapis/gax-go/v2 => github.com/googleapis/gax-go/v2 latest github.com/gorilla/mux => github.com/gorilla/mux latest github.com/gorilla/websocket => github.com/gorilla/websocket latest github.com/hailocab/go-hostpool => github.com/kpango/go-hostpool master @@ -46,6 +49,7 @@ replace ( github.com/json-iterator/go => github.com/json-iterator/go latest github.com/klauspost/compress => github.com/klauspost/compress master github.com/kpango/glg => github.com/kpango/glg latest + github.com/mailru/easyjson => github.com/mailru/easyjson latest github.com/onsi/ginkgo => github.com/onsi/ginkgo latest github.com/onsi/gomega => github.com/onsi/gomega latest github.com/opentracing/opentracing-go => github.com/opentracing/opentracing-go latest @@ -57,6 +61,7 @@ replace ( github.com/prometheus/prometheus/v2 => github.com/prometheus/prometheus/v2 latest github.com/rs/xid => github.com/rs/xid latest github.com/sirupsen/logrus => github.com/sirupsen/logrus latest + github.com/spf13/afero => github.com/spf13/afero latest github.com/spf13/cobra => github.com/spf13/cobra latest github.com/spf13/pflag => github.com/spf13/pflag latest github.com/stretchr/testify => github.com/stretchr/testify latest @@ -112,7 +117,7 @@ replace ( k8s.io/metrics => k8s.io/metrics v0.24.0 k8s.io/utils => k8s.io/utils latest sigs.k8s.io/apiserver-network-proxy/konnectivity-client => sigs.k8s.io/apiserver-network-proxy/konnectivity-client latest - sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.12.0 + sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.12.1 sigs.k8s.io/kustomize/api => sigs.k8s.io/kustomize/api latest sigs.k8s.io/kustomize/kyaml => sigs.k8s.io/kustomize/kyaml latest sigs.k8s.io/structured-merge-diff/v4 => sigs.k8s.io/structured-merge-diff/v4 latest diff --git a/pkg/agent/core/ngt/handler/grpc/handler.go b/pkg/agent/core/ngt/handler/grpc/handler.go index 5e9e0f4024..dae0593029 100644 --- a/pkg/agent/core/ngt/handler/grpc/handler.go +++ b/pkg/agent/core/ngt/handler/grpc/handler.go @@ -134,6 +134,10 @@ func (s *server) Exists(ctx context.Context, uid *payload.Object_ID) (res *paylo ResourceType: ngtResourceType + "/ngt.Exists", ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), }) + + if span != nil { + span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) + } log.Warn(err) return nil, err } @@ -310,6 +314,9 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), }) log.Warn(err) + if span != nil { + span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) + } return nil, err } vec, dst, err := s.ngt.SearchByID( @@ -813,6 +820,9 @@ func (s *server) LinearSearchByID(ctx context.Context, req *payload.Search_IDReq ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), }) log.Warn(err) + if span != nil { + span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) + } return nil, err } vec, dst, err := s.ngt.LinearSearchByID( @@ -2021,6 +2031,9 @@ func (s *server) Remove(ctx context.Context, req *payload.Remove_Request) (res * ResourceType: ngtResourceType + "/ngt.Remove", ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), }) + if span != nil { + span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) + } log.Warn(err) return nil, err } @@ -2229,6 +2242,9 @@ func (s *server) GetObject(ctx context.Context, id *payload.Object_VectorRequest ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), }) log.Warn(err) + if span != nil { + span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) + } return nil, err } vec, err := s.ngt.GetObject(uuid) diff --git a/pkg/gateway/lb/handler/grpc/handler.go b/pkg/gateway/lb/handler/grpc/handler.go index 0949f7d06b..298f8bb67a 100644 --- a/pkg/gateway/lb/handler/grpc/handler.go +++ b/pkg/gateway/lb/handler/grpc/handler.go @@ -74,6 +74,33 @@ func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *paylo span.End() } }() + + uuid := meta.GetId() + if len(uuid) == 0 { + err = errors.ErrInvalidUUID(uuid) + err = status.WrapWithInvalidArgument(fmt.Sprintf("Exists API invalid argument for uuid \"%s\" detected", uuid), err, + &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(meta), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1.Exists", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }) + log.Warn(err) + if span != nil { + span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) + } + return nil, err + } ich := make(chan *payload.Object_ID, 1) ech := make(chan error, 1) s.eg.Go(func() error { @@ -90,7 +117,7 @@ func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *paylo } }() oid, err := vc.Exists(sctx, &payload.Object_ID{ - Id: meta.GetId(), + Id: uuid, }, copts...) if err != nil { switch { @@ -117,9 +144,9 @@ func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *paylo st *status.Status msg string ) - st, msg, err = status.ParseError(err, codes.NotFound, fmt.Sprintf("error Exists API meta %s's uuid not found", meta.GetId()), + st, msg, err = status.ParseError(err, codes.NotFound, fmt.Sprintf("error Exists API meta %s's uuid not found", uuid), &errdetails.RequestInfo{ - RequestId: meta.GetId(), + RequestId: uuid, ServingData: errdetails.Serialize(meta), }, &errdetails.ResourceInfo{ @@ -152,11 +179,11 @@ func (s *server) Exists(ctx context.Context, meta *payload.Object_ID) (id *paylo } if err != nil || id == nil || id.GetId() == "" { if err == nil { - err = errors.ErrObjectIDNotFound(meta.GetId()) + err = errors.ErrObjectIDNotFound(uuid) } - st, msg, err := status.ParseError(err, codes.NotFound, fmt.Sprintf("error Exists API meta %s's uuid not found", meta.GetId()), + st, msg, err := status.ParseError(err, codes.NotFound, fmt.Sprintf("error Exists API meta %s's uuid not found", uuid), &errdetails.RequestInfo{ - RequestId: meta.GetId(), + RequestId: uuid, ServingData: errdetails.Serialize(meta), }, &errdetails.ResourceInfo{ @@ -244,7 +271,8 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) span.End() } }() - if len(req.GetId()) == 0 { + uuid := req.GetId() + if len(uuid) == 0 { err = errors.ErrInvalidMetaDataConfig err = status.WrapWithInvalidArgument("SearchByID API invalid uuid", err, &errdetails.RequestInfo{ @@ -258,6 +286,10 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) Description: err.Error(), }, }, + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1.SearchByID", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), }) if span != nil { span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) @@ -266,7 +298,7 @@ func (s *server) SearchByID(ctx context.Context, req *payload.Search_IDRequest) } oreq := &payload.Object_VectorRequest{ Id: &payload.Object_ID{ - Id: req.GetId(), + Id: uuid, }, Filters: req.GetConfig().GetEgressFilters(), } @@ -1321,8 +1353,31 @@ func (s *server) Insert(ctx context.Context, req *payload.Insert_Request) (ce *p span.End() } }() - vec := req.GetVector().GetVector() uuid := req.GetVector().GetId() + if len(uuid) == 0 { + err = errors.ErrInvalidMetaDataConfig + err = status.WrapWithInvalidArgument("Insert API invalid uuid", err, + &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "invalid id", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1.Insert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }) + if span != nil { + span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) + } + return nil, err + } + vec := req.GetVector().GetVector() vl := len(vec) if vl < algorithm.MinimumVectorDimensionSize { err = errors.ErrInvalidDimensionSize(vl, 0) @@ -1699,8 +1754,31 @@ func (s *server) Update(ctx context.Context, req *payload.Update_Request) (res * span.End() } }() - vec := req.GetVector().GetVector() uuid := req.GetVector().GetId() + if len(uuid) == 0 { + err = errors.ErrInvalidMetaDataConfig + err = status.WrapWithInvalidArgument("Update API invalid uuid", err, + &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "invalid id", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1.Update", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }) + if span != nil { + span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) + } + return nil, err + } + vec := req.GetVector().GetVector() vl := len(vec) if vl < algorithm.MinimumVectorDimensionSize { err = errors.ErrInvalidDimensionSize(vl, 0) @@ -2030,6 +2108,30 @@ func (s *server) Upsert(ctx context.Context, req *payload.Upsert_Request) (loc * vec := req.GetVector() uuid := vec.GetId() + if len(uuid) == 0 { + err = errors.ErrInvalidMetaDataConfig + err = status.WrapWithInvalidArgument("Upsert API invalid uuid", err, + &errdetails.RequestInfo{ + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "invalid id", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: errdetails.ValdGRPCResourceTypePrefix + "/vald.v1.Upsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, s.name, s.ip), + }) + if span != nil { + span.SetStatus(trace.StatusCodeInvalidArgument(err.Error())) + } + return nil, err + } + vl := len(vec.GetVector()) if vl < algorithm.MinimumVectorDimensionSize { err = errors.ErrInvalidDimensionSize(vl, 0) diff --git a/versions/NGT_VERSION b/versions/NGT_VERSION index 4ea8ad87e6..24a57f28a4 100644 --- a/versions/NGT_VERSION +++ b/versions/NGT_VERSION @@ -1 +1 @@ -1.14.3 +1.14.5 From 25d453f3cee06eeec8b845435305437ae2e1fa0d Mon Sep 17 00:00:00 2001 From: Kevin Diu Date: Tue, 24 May 2022 13:40:48 +0900 Subject: [PATCH 2/3] Implement multi insert test case for pkg agent handler (#1612) * draft part of test case for multi insert Signed-off-by: kevindiu * fix comments and add decision table test cases Signed-off-by: kevindiu * fix decision table test case name Signed-off-by: kevindiu * update test case name Signed-off-by: kevindiu * Update pkg/agent/core/ngt/handler/grpc/handler_test.go Co-authored-by: Kosuke Morimoto * Implement multi insert test case for pkg agent handler - part 1 (#1630) * impl multiinsert Equivalence Class Testing Signed-off-by: kevindiu * Implement multi insert test case for pkg agent handler - part 2 (#1645) * impl multiinsert boundary value test (part1) Signed-off-by: kevindiu * impl remaining tests Signed-off-by: kevindiu * change max dim Signed-off-by: kevindiu * change max dim to reference value Signed-off-by: kevindiu * change max dim to reference value Signed-off-by: kevindiu * fix comments Signed-off-by: kevindiu * rename help function name Signed-off-by: kevindiu * combine genXXXInsertReq function Signed-off-by: kevindiu * rename helper function name Signed-off-by: kevindiu * Implement multi insert test case for pkg agent handler - part 3 (#1646) * impl multiinsert test part 3 Signed-off-by: kevindiu * fix comment Signed-off-by: kevindiu * fix comment Signed-off-by: kevindiu * Implement multi insert test case for pkg agent handler - part 4 (#1651) * implement tests Signed-off-by: kevindiu * implement remaining tests Signed-off-by: kevindiu * Update pkg/agent/core/ngt/handler/grpc/handler_test.go Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix comment Signed-off-by: kevindiu * Update pkg/agent/core/ngt/handler/grpc/handler_test.go Co-authored-by: Kiichiro YUKAWA Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Kiichiro YUKAWA * Apply suggestions from code review Co-authored-by: Kiichiro YUKAWA * fix comment Signed-off-by: kevindiu * fix comment Signed-off-by: kevindiu * fix comment Signed-off-by: kevindiu * fix comment Signed-off-by: kevindiu * fix comment Signed-off-by: kevindiu * fix comment Signed-off-by: kevindiu Co-authored-by: Kosuke Morimoto Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Kiichiro YUKAWA --- .../core/ngt/handler/grpc/handler_test.go | 2875 ++++++++++++++++- 1 file changed, 2801 insertions(+), 74 deletions(-) diff --git a/pkg/agent/core/ngt/handler/grpc/handler_test.go b/pkg/agent/core/ngt/handler/grpc/handler_test.go index 9b6862a096..224bb85dfb 100644 --- a/pkg/agent/core/ngt/handler/grpc/handler_test.go +++ b/pkg/agent/core/ngt/handler/grpc/handler_test.go @@ -2863,7 +2863,7 @@ func Test_server_Insert(t *testing.T) { req := &payload.Insert_Request{ Vector: &payload.Object_Vector{ Id: id, - Vector: []float32{0, 0, 0}, + Vector: genSameValueVec(intVecDim, 0), }, } @@ -2900,7 +2900,7 @@ func Test_server_Insert(t *testing.T) { req := &payload.Insert_Request{ Vector: &payload.Object_Vector{ Id: id, - Vector: []float32{0, 0, 0}, + Vector: genSameValueVec(f32VecDim, 0), }, } @@ -2937,7 +2937,7 @@ func Test_server_Insert(t *testing.T) { req := &payload.Insert_Request{ Vector: &payload.Object_Vector{ Id: id, - Vector: []float32{math.MinInt, math.MinInt, math.MinInt}, + Vector: genSameValueVec(intVecDim, math.MinInt), }, } @@ -2974,7 +2974,7 @@ func Test_server_Insert(t *testing.T) { req := &payload.Insert_Request{ Vector: &payload.Object_Vector{ Id: id, - Vector: []float32{math.SmallestNonzeroFloat32, math.SmallestNonzeroFloat32, math.SmallestNonzeroFloat32}, + Vector: genSameValueVec(f32VecDim, -math.MaxFloat32), }, } @@ -3011,7 +3011,7 @@ func Test_server_Insert(t *testing.T) { req := &payload.Insert_Request{ Vector: &payload.Object_Vector{ Id: id, - Vector: []float32{math.MaxInt, math.MaxInt, math.MaxInt}, + Vector: genSameValueVec(intVecDim, math.MaxInt), }, } @@ -3048,7 +3048,7 @@ func Test_server_Insert(t *testing.T) { req := &payload.Insert_Request{ Vector: &payload.Object_Vector{ Id: id, - Vector: []float32{math.MaxFloat32, math.MaxFloat32, math.MaxFloat32}, + Vector: genSameValueVec(f32VecDim, math.MaxFloat32), }, } @@ -3245,7 +3245,7 @@ func Test_server_Insert(t *testing.T) { req := &payload.Insert_Request{ Vector: &payload.Object_Vector{ Id: id, - Vector: []float32{nan, nan, nan}, + Vector: genSameValueVec(f32VecDim, nan), }, } @@ -3860,8 +3860,69 @@ func Test_server_StreamInsert(t *testing.T) { } } +func genF32Vec(dist vector.Distribution, num int, dim int) [][]float32 { + generator, _ := vector.Float32VectorGenerator(dist) + return generator(num, dim) +} + +func genIntVec(dist vector.Distribution, num int, dim int) [][]float32 { + generator, _ := vector.Uint8VectorGenerator(dist) + ivecs := generator(num, dim) + result := make([][]float32, num) + + for j, ivec := range ivecs { + vec := make([]float32, dim) + for i := 0; i < dim; i++ { + vec[i] = float32(ivec[i]) + } + result[j] = vec + } + return result +} + +func genSameValueVec(size int, val float32) []float32 { + v := make([]float32, size) + for i := 0; i < size; i++ { + v[i] = val + } + return v +} + +type objectType int + +const ( + Uint8 objectType = iota + Float +) + +func genMultiInsertReq(t objectType, dist vector.Distribution, num int, dim int, cfg *payload.Insert_Config) *payload.Insert_MultiRequest { + var vecs [][]float32 + switch t { + case Float: + vecs = genF32Vec(dist, num, dim) + case Uint8: + vecs = genIntVec(dist, num, dim) + } + + req := &payload.Insert_MultiRequest{ + Requests: make([]*payload.Insert_Request, num), + } + for i, vec := range vecs { + req.Requests[i] = &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: "uuid-" + strconv.Itoa(i+1), + Vector: vec, + }, + Config: cfg, + } + } + + return req +} + func Test_server_MultiInsert(t *testing.T) { t.Parallel() + type args struct { ctx context.Context reqs *payload.Insert_MultiRequest @@ -3869,13 +3930,14 @@ func Test_server_MultiInsert(t *testing.T) { type fields struct { name string ip string - ngt service.NGT - eg errgroup.Group streamConcurrency int + svcCfg *config.NGT + svcOpts []service.Option } type want struct { - wantRes *payload.Object_Locations - err error + wantRes *payload.Object_Locations + err error + containErr []error // check the function output error contain one of the error or not } type test struct { name string @@ -3883,83 +3945,2748 @@ func Test_server_MultiInsert(t *testing.T) { fields fields want want checkFunc func(want, *payload.Object_Locations, error) error - beforeFunc func(args) + beforeFunc func(*testing.T, *server) afterFunc func(args) } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + // common variables for test + const ( + name = "vald-agent-ngt-1" // agent name + id = "uuid-1" // insert request id + intVecDim = 3 // int vector dimension + f32VecDim = 3 // float32 vector dimension + maxVecDim = 1 << 18 // reference value for testing, this value is temporary + ) + var ( + ip = net.LoadLocalIP() // agent ip address + + // default NGT configuration for test + defaultIntSvcCfg = &config.NGT{ + Dimension: intVecDim, + DistanceType: ngt.Angle.String(), + ObjectType: ngt.Uint8.String(), + KVSDB: &config.KVSDB{}, + VQueue: &config.VQueue{}, + } + defaultF32SvcCfg = &config.NGT{ + Dimension: f32VecDim, + DistanceType: ngt.Angle.String(), + ObjectType: ngt.Float.String(), + KVSDB: &config.KVSDB{}, + VQueue: &config.VQueue{}, + } + defaultSvcOpts = []service.Option{ + service.WithEnableInMemoryMode(true), + } + ) + + // generate MultiInsert request with the same vector + genSameVecMultiInsertReq := func(num int, vec []float32, cfg *payload.Insert_Config) *payload.Insert_MultiRequest { + req := &payload.Insert_MultiRequest{ + Requests: make([]*payload.Insert_Request, num), + } + for i := 0; i < num; i++ { + req.Requests[i] = &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: "uuid-" + strconv.Itoa(i+1), + Vector: vec, + }, + Config: cfg, + } + } + + return req + } + + genAlreadyExistsErr := func(uuid string, req *payload.Insert_MultiRequest, name, ip string) error { + return status.WrapWithAlreadyExists(fmt.Sprintf("MultiInsert API uuids [%v] already exists", uuid), + errors.ErrUUIDAlreadyExists(uuid), + &errdetails.RequestInfo{ + RequestId: uuid, + ServingData: errdetails.Serialize(req), + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + } + + genObjectLocations := func(num int, name string, ip string) *payload.Object_Locations { + result := &payload.Object_Locations{ + Locations: make([]*payload.Object_Location, num), + } + + for i := 0; i < num; i++ { + result.Locations[i] = &payload.Object_Location{ + Name: name, + Uuid: "uuid-" + strconv.Itoa(i+1), + Ips: []string{ip}, + } + } + return result + } defaultCheckFunc := func(w want, gotRes *payload.Object_Locations, err error) error { - if !errors.Is(err, w.err) { - return errors.Errorf("got_error: \"%#v\",\n\t\t\t\twant: \"%#v\"", err, w.err) + if w.containErr == nil { + if !errors.Is(err, w.err) { + return errors.Errorf("got_error: \"%v\",\n\t\t\t\twant: \"%v\"", err, w.err) + } + } else { + exist := false + for _, e := range w.containErr { + if errors.Is(err, e) { + exist = true + break + } + } + if !exist { + return errors.Errorf("got_error: \"%v\",\n\t\t\t\tshould contain one of the error: \"%v\"", err, w.containErr) + } } if !reflect.DeepEqual(gotRes, w.wantRes) { return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", gotRes, w.wantRes) } return nil } - tests := []test{ - // TODO test cases - /* - { - name: "test_case_1", - args: args { - ctx: nil, - reqs: nil, - }, - fields: fields { - name: "", - ip: "", - ngt: nil, - eg: nil, - streamConcurrency: 0, - }, - want: want{}, - checkFunc: defaultCheckFunc, - }, - */ - // TODO test cases - /* - func() test { - return test { - name: "test_case_2", - args: args { - ctx: nil, - reqs: nil, - }, - fields: fields { - name: "", - ip: "", - ngt: nil, - eg: nil, - streamConcurrency: 0, - }, - want: want{}, - checkFunc: defaultCheckFunc, - } - }(), - */ - } + /* + - Equivalence Class Testing + - uint8, float32 + - case 1.1: Success to MultiInsert 1 vector (vector type is uint8) + - case 1.2: Success to MultiInsert 1 vector (vector type is float32) + - case 1.3: Success to MultiInsert 100 vector (vector type is uint8) + - case 1.4: Success to MultiInsert 100 vector (vector type is float32) + - case 1.5: Success to MultiInsert 0 vector (vector type is uint8) + - case 1.6: Success to MultiInsert 0 vector (vector type is float32) + - case 2.1: Fail to MultiInsert 1 vector with different dimension (vector type is uint8) + - case 2.2: Fail to MultiInsert 1 vector with different dimension (vector type is float32) + - case 3.1: Fail to MultiInsert 100 vector with 1 vector with different dimension (vector type is uint8) + - case 3.2: Fail to MultiInsert 100 vector with 1 vector with different dimension (vector type is float32) + - case 3.3: Fail to MultiInsert 100 vector with 50 vector with different dimension (vector type is uint8) + - case 3.4: Fail to MultiInsert 100 vector with 50 vector with different dimension (vector type is float32) + - case 3.5: Fail to MultiInsert 100 vector with all vector with different dimension (vector type is uint8) + - case 3.6: Fail to MultiInsert 100 vector with all vector with different dimension (vector type is float32) - for _, tc := range tests { - test := tc - t.Run(test.name, func(tt *testing.T) { - tt.Parallel() - defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) - if test.beforeFunc != nil { - test.beforeFunc(test.args) + - Boundary Value Testing + - uint8, float32 (with 100 insert request in a single MultiInsert request) + - case 1.1: Success to MultiInsert with 0 value vector (vector type is uint8) + - case 1.2: Success to MultiInsert with 0 value vector (vector type is float32) + - case 2.1: Success to MultiInsert with min value vector (vector type is uint8) + - case 2.2: Success to MultiInsert with min value vector (vector type is float32) + - case 3.1: Success to MultiInsert with max value vector (vector type is uint8) + - case 3.2: Success to MultiInsert with max value vector (vector type is float32) + - case 4.1: Fail to MultiInsert with 1 request with empty UUID (vector type is uint8) + - case 4.2: Fail to MultiInsert with 1 request with empty UUID (vector type is float32) + - case 4.3: Fail to MultiInsert with 50 request with empty UUID (vector type is uint8) + - case 4.4: Fail to MultiInsert with 50 request with empty UUID (vector type is float32) + - case 4.5: Fail to MultiInsert with all request with empty UUID (vector type is uint8) + - case 4.6: Fail to MultiInsert with all request with empty UUID (vector type is float32) + - case 5.1: Fail to MultiInsert with 1 vector with maximum dimension (vector type is uint8) + - case 5.2: Fail to MultiInsert with 1 vector with maximum dimension (vector type is float32) + - case 5.3: Fail to MultiInsert with 50 vector with maximum dimension (vector type is uint8) + - case 5.4: Fail to MultiInsert with 50 vector with maximum dimension (vector type is float32) + - case 5.5: Fail to MultiInsert with all vector with maximum dimension (vector type is uint8) + - case 5.6: Fail to MultiInsert with all vector with maximum dimension (vector type is float32) + + - float32 (with 100 insert request in a single MultiInsert request) + - case 6.1: Success to MultiInsert with NaN value (vector type is float32) + - case 6.2: Success to MultiInsert with +Inf value (vector type is float32) + - case 6.3: Success to MultiInsert with -Inf value (vector type is float32) + - case 6.4: Success to MultiInsert with -0 value (vector type is float32) + + - others (with 100 insert request in a single MultiInsert request) + - case 7.1: Fail to MultiInsert with 1 vector with nil insert request + - case 7.2: Fail to MultiInsert with 50 vector with nil insert request + - case 7.3: Fail to MultiInsert with all vector with nil insert request + - case 8.1: Fail to MultiInsert with 1 vector with nil vector + - case 8.2: Fail to MultiInsert with 50 vector with nil vector + - case 8.3: Fail to MultiInsert with all vector with nil vector + - case 9.1: Fail to MultiInsert with 1 vector with empty insert vector + - case 9.2: Fail to MultiInsert with 50 vector with empty insert vector + - case 9.3: Fail to MultiInsert with all vector with empty insert vector + + - Decision Table Testing + - duplicated ID (with 100 insert request in a single MultiInsert request) + - case 1.1: Success to MultiInsert with 2 duplicated ID when SkipStrictExistCheck is false + - case 1.2: Success to MultiInsert with all duplicated ID when SkipStrictExistCheck is false + - case 1.3: Success to MultiInsert with 2 duplicated ID when SkipStrictExistCheck is true + - case 1.4: Success to MultiInsert with all duplicated ID when SkipStrictExistCheck is true + - duplicated vector (with 100 insert request in a single MultiInsert request) + - case 2.1: Success to MultiInsert with 2 duplicated vector when SkipStrictExistCheck is false + - case 2.2: Success to MultiInsert with all duplicated vector when SkipStrictExistCheck is false + - case 2.3: Success to MultiInsert with 2 duplicated vector when SkipStrictExistCheck is true + - case 2.4: Success to MultiInsert with all duplicated vector when SkipStrictExistCheck is true + - duplicated ID & duplicated vector (with 100 insert request in a single MultiInsert request) + - case 3.1: Success to MultiInsert with 2 duplicated ID & vector when SkipStrictExistCheck is false + - case 3.2: Success to MultiInsert with all duplicated ID & vector when SkipStrictExistCheck is false + - case 3.3: Success to MultiInsert with 2 duplicated ID & vector when SkipStrictExistCheck is true + - case 3.4: Success to MultiInsert with all duplicated ID & vector when SkipStrictExistCheck is true + + // existed in NGT test cases + - existed ID (with 100 insert request in a single MultiInsert request) + - case 4.1: Fail to MultiInsert with 2 existed ID when SkipStrictExistCheck is false + - case 4.2: Fail to MultiInsert with all existed ID when SkipStrictExistCheck is false + - case 4.3: Fail to MultiInsert with 2 existed ID when SkipStrictExistCheck is true + - case 4.4: Fail to MultiInsert with all existed ID when SkipStrictExistCheck is true + - existed vector (with 100 insert request in a single MultiInsert request) + - case 5.1: Success to MultiInsert with 2 existed vector when SkipStrictExistCheck is false + - case 5.2: Success to MultiInsert with all existed vector when SkipStrictExistCheck is false + - case 5.3: Success to MultiInsert with 2 existed vector when SkipStrictExistCheck is true + - case 5.4: Success to MultiInsert with all existed vector when SkipStrictExistCheck is true + - existed ID & existed vector (with 100 insert request in a single MultiInsert request) + - case 6.1: Fail to MultiInsert with 2 existed ID & vector when SkipStrictExistCheck is false + - case 6.2: Fail to MultiInsert with all existed ID & vector when SkipStrictExistCheck is false + - case 6.3: Fail to MultiInsert with 2 existed ID & vector when SkipStrictExistCheck is true + - case 6.4: Fail to MultiInsert with all existed ID & vector when SkipStrictExistCheck is true + + */ + tests := []test{ + func() test { + insertNum := 1 + return test{ + name: "Equivalence Class Testing case 1.1: Success to MultiInsert 1 vector (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: genMultiInsertReq(Uint8, vector.Gaussian, insertNum, intVecDim, nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, } - if test.afterFunc != nil { - defer test.afterFunc(test.args) + }(), + func() test { + insertNum := 1 + return test{ + name: "Equivalence Class Testing case 1.2: Success to MultiInsert 1 vector (vector type is float32)", + args: args{ + ctx: ctx, + reqs: genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, } - checkFunc := test.checkFunc - if test.checkFunc == nil { - checkFunc = defaultCheckFunc + }(), + func() test { + insertNum := 100 + return test{ + name: "Equivalence Class Testing case 1.3: Success to MultiInsert 100 vector (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: genMultiInsertReq(Uint8, vector.Gaussian, insertNum, intVecDim, nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, } - s := &server{ - name: test.fields.name, - ip: test.fields.ip, - ngt: test.fields.ngt, - eg: test.fields.eg, - streamConcurrency: test.fields.streamConcurrency, + }(), + func() test { + insertNum := 100 + return test{ + name: "Equivalence Class Testing case 1.4: Success to MultiInsert 100 vector (vector type is float32)", + args: args{ + ctx: ctx, + reqs: genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + { + name: "Equivalence Class Testing case 1.5: Success to MultiInsert 0 vector (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: &payload.Insert_MultiRequest{ + Requests: []*payload.Insert_Request{}, + }, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: nil, + }, + }, + { + name: "Equivalence Class Testing case 1.6: Success to MultiInsert 0 vector (vector type is float32)", + args: args{ + ctx: ctx, + reqs: &payload.Insert_MultiRequest{ + Requests: []*payload.Insert_Request{}, + }, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: nil, + }, + }, + func() test { + insertNum := 1 + req := genMultiInsertReq(Uint8, vector.Gaussian, insertNum, intVecDim+1, nil) + + return test{ + name: "Equivalence Class Testing case 2.1: Fail to MultiInsert 1 vector with different dimension (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 1 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim+1, nil) + + return test{ + name: "Equivalence Class Testing case 2.2: Fail to MultiInsert 1 vector with different dimension (vector type is float32)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Uint8, vector.Gaussian, insertNum, intVecDim, nil) + req.Requests[0].Vector.Vector = genIntVec(vector.Gaussian, 1, intVecDim+1)[0] + + return test{ + name: "Equivalence Class Testing case 3.1: Fail to MultiInsert 100 vector with 1 vector with different dimension (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + req.Requests[0].Vector.Vector = genF32Vec(vector.Gaussian, 1, f32VecDim+1)[0] + + return test{ + name: "Equivalence Class Testing case 3.2: Fail to MultiInsert 100 vector with 1 vector with different dimension (vector type is float32)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + + func() test { + insertNum := 100 + req := genMultiInsertReq(Uint8, vector.Gaussian, insertNum, intVecDim, nil) + for i := 0; i < len(req.Requests)/2; i++ { + req.Requests[i].Vector.Vector = genIntVec(vector.Gaussian, 1, intVecDim+1)[0] + } + + return test{ + name: "Equivalence Class Testing case 3.3: Fail to MultiInsert 100 vector with 50 vector with different dimension (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + for i := 0; i < len(req.Requests)/2; i++ { + req.Requests[i].Vector.Vector = genF32Vec(vector.Gaussian, 1, f32VecDim+1)[0] + } + + return test{ + name: "Equivalence Class Testing case 3.4: Fail to MultiInsert 100 vector with 50 vector with different dimension (vector type is float32)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim+1, nil) + + return test{ + name: "Equivalence Class Testing case 3.5: Fail to MultiInsert 100 vector with all vector with different dimension (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim+1, nil) + + return test{ + name: "Equivalence Class Testing case 3.6: Fail to MultiInsert 100 vector with all vector with different dimension (vector type is float32)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + return test{ + name: "Boundary Value Testing case 1.1: Success to MultiInsert with 0 value vector (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: genSameVecMultiInsertReq(insertNum, genSameValueVec(intVecDim, 0), nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + return test{ + name: "Boundary Value Testing case 1.2: Success to MultiInsert with 0 value vector (vector type is float32)", + args: args{ + ctx: ctx, + reqs: genSameVecMultiInsertReq(insertNum, genSameValueVec(f32VecDim, 0), nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + return test{ + name: "Boundary Value Testing case 2.1: Success to MultiInsert with min value vector (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: genSameVecMultiInsertReq(insertNum, genSameValueVec(intVecDim, math.MinInt), nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + return test{ + name: "Boundary Value Testing case 2.2: Success to MultiInsert with min value vector (vector type is float32)", + args: args{ + ctx: ctx, + reqs: genSameVecMultiInsertReq(insertNum, genSameValueVec(f32VecDim, -math.MaxFloat32), nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + return test{ + name: "Boundary Value Testing case 3.1: Success to MultiInsert with max value vector (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: genSameVecMultiInsertReq(insertNum, genSameValueVec(intVecDim, math.MaxUint8), nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + return test{ + name: "Boundary Value Testing case 3.2: Success to MultiInsert with max value vector (vector type is float32)", + args: args{ + ctx: ctx, + reqs: genSameVecMultiInsertReq(insertNum, genSameValueVec(f32VecDim, math.MaxFloat32), nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Uint8, vector.Gaussian, insertNum, intVecDim, nil) + req.Requests[0].Vector.Id = "" + + uuids := make([]string, 0, len(req.Requests)) + for _, r := range req.Requests { + uuids = append(uuids, r.Vector.Id) + } + + return test{ + name: "Boundary Value Testing case 4.1: Fail to MultiInsert with 1 request with empty UUID (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + err: status.WrapWithInvalidArgument(fmt.Sprintf("MultiInsert API invalid uuids \"%v\" detected", uuids), errors.ErrUUIDNotFound(0), + &errdetails.RequestInfo{ + RequestId: strings.Join(uuids, ", "), + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: errors.ErrUUIDNotFound(0).Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + req.Requests[0].Vector.Id = "" + + uuids := make([]string, 0, len(req.Requests)) + for _, r := range req.Requests { + uuids = append(uuids, r.Vector.Id) + } + + return test{ + name: "Boundary Value Testing case 4.2: Fail to MultiInsert with 1 request with empty UUID (vector type is float32)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + err: status.WrapWithInvalidArgument(fmt.Sprintf("MultiInsert API invalid uuids \"%v\" detected", uuids), errors.ErrUUIDNotFound(0), + &errdetails.RequestInfo{ + RequestId: strings.Join(uuids, ", "), + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: errors.ErrUUIDNotFound(0).Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Uint8, vector.Gaussian, insertNum, intVecDim, nil) + for i := 0; i < len(req.Requests)/2; i++ { + req.Requests[i].Vector.Id = "" + } + + uuids := make([]string, 0, len(req.Requests)) + for _, r := range req.Requests { + uuids = append(uuids, r.Vector.Id) + } + + return test{ + name: "Boundary Value Testing case 4.3: Fail to MultiInsert with 50 request with empty UUID (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + err: status.WrapWithInvalidArgument(fmt.Sprintf("MultiInsert API invalid uuids \"%v\" detected", uuids), errors.ErrUUIDNotFound(0), + &errdetails.RequestInfo{ + RequestId: strings.Join(uuids, ", "), + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: errors.ErrUUIDNotFound(0).Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Uint8, vector.Gaussian, insertNum, f32VecDim, nil) + for i := 0; i < len(req.Requests)/2; i++ { + req.Requests[i].Vector.Id = "" + } + + uuids := make([]string, 0, len(req.Requests)) + for _, r := range req.Requests { + uuids = append(uuids, r.Vector.Id) + } + + return test{ + name: "Boundary Value Testing case 4.4: Fail to MultiInsert with 50 request with empty UUID (vector type is float32)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + err: status.WrapWithInvalidArgument(fmt.Sprintf("MultiInsert API invalid uuids \"%v\" detected", uuids), errors.ErrUUIDNotFound(0), + &errdetails.RequestInfo{ + RequestId: strings.Join(uuids, ", "), + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: errors.ErrUUIDNotFound(0).Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Uint8, vector.Gaussian, insertNum, intVecDim, nil) + for i := 0; i < len(req.Requests); i++ { + req.Requests[i].Vector.Id = "" + } + + uuids := make([]string, 0, len(req.Requests)) + for _, r := range req.Requests { + uuids = append(uuids, r.Vector.Id) + } + + return test{ + name: "Boundary Value Testing case 4.5: Fail to MultiInsert with all request with empty UUID (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + err: status.WrapWithInvalidArgument(fmt.Sprintf("MultiInsert API invalid uuids \"%v\" detected", uuids), errors.ErrUUIDNotFound(0), + &errdetails.RequestInfo{ + RequestId: strings.Join(uuids, ", "), + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: errors.ErrUUIDNotFound(0).Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Uint8, vector.Gaussian, insertNum, f32VecDim, nil) + for i := 0; i < len(req.Requests); i++ { + req.Requests[i].Vector.Id = "" + } + + uuids := make([]string, 0, len(req.Requests)) + for _, r := range req.Requests { + uuids = append(uuids, r.Vector.Id) + } + + return test{ + name: "Boundary Value Testing case 4.6: Fail to MultiInsert with all request with empty UUID (vector type is float32)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + err: status.WrapWithInvalidArgument(fmt.Sprintf("MultiInsert API invalid uuids \"%v\" detected", uuids), errors.ErrUUIDNotFound(0), + &errdetails.RequestInfo{ + RequestId: strings.Join(uuids, ", "), + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "uuid", + Description: errors.ErrUUIDNotFound(0).Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Uint8, vector.Gaussian, insertNum, intVecDim, nil) + req.Requests[0].Vector.Vector = make([]float32, maxVecDim) + + return test{ + name: "Boundary Value Testing case 5.1: Fail to MultiInsert with 1 vector with maximum dimension (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Uint8, vector.Gaussian, insertNum, f32VecDim, nil) + req.Requests[0].Vector.Vector = make([]float32, maxVecDim) + + return test{ + name: "Boundary Value Testing case 5.1: Fail to MultiInsert with 1 vector with maximum dimension (vector type is float32)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Uint8, vector.Gaussian, insertNum, intVecDim, nil) + for i := 0; i < len(req.Requests)/2; i++ { + req.Requests[i].Vector.Vector = make([]float32, maxVecDim) + } + + return test{ + name: "Boundary Value Testing case 5.3: Fail to MultiInsert with 50 vector with maximum dimension (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Uint8, vector.Gaussian, insertNum, f32VecDim, nil) + for i := 0; i < len(req.Requests)/2; i++ { + req.Requests[i].Vector.Vector = make([]float32, maxVecDim) + } + + return test{ + name: "Boundary Value Testing case 5.4: Fail to MultiInsert with 50 vector with maximum dimension (vector type is float32)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genSameVecMultiInsertReq(insertNum, make([]float32, maxVecDim), nil) + + return test{ + name: "Boundary Value Testing case 5.5: Fail to MultiInsert with all vector with maximum dimension (vector type is uint8)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultIntSvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genSameVecMultiInsertReq(insertNum, make([]float32, maxVecDim), nil) + + return test{ + name: "Boundary Value Testing case 5.6: Fail to MultiInsert with all vector with maximum dimension (vector type is float32)", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(len(req.Requests[0].Vector.Vector), intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: req.Requests[0].Vector.Id, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + return test{ + name: "Boundary Value Testing case 6.1: Success to MultiInsert with NaN value (vector type is float32)", + args: args{ + ctx: ctx, + reqs: genSameVecMultiInsertReq(insertNum, genSameValueVec(f32VecDim, float32(math.NaN())), nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + return test{ + name: "Boundary Value Testing case 6.2: Success to MultiInsert with +Inf value (vector type is float32)", + args: args{ + ctx: ctx, + reqs: genSameVecMultiInsertReq(insertNum, genSameValueVec(f32VecDim, float32(math.Inf(+1.0))), nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + return test{ + name: "Boundary Value Testing case 6.3: Success to MultiInsert with -Inf value (vector type is float32)", + args: args{ + ctx: ctx, + reqs: genSameVecMultiInsertReq(insertNum, genSameValueVec(f32VecDim, float32(math.Inf(-1.0))), nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + return test{ + name: "Boundary Value Testing case 6.4: Success to MultiInsert with -0 value (vector type is float32)", + args: args{ + ctx: ctx, + reqs: genSameVecMultiInsertReq(insertNum, genSameValueVec(f32VecDim, float32(math.Copysign(0, -1.0))), nil), + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + streamConcurrency: 0, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + vid := req.Requests[0].Vector.Id + req.Requests[0] = nil + + return test{ + name: "Boundary Value Testing case 7.1: Fail to MultiInsert with 1 vector with nil insert request", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(0, intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: vid, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + vid := req.Requests[0].Vector.Id + for i := 0; i < len(req.Requests)/2; i++ { + req.Requests[i] = nil + } + + return test{ + name: "Boundary Value Testing case 7.2: Fail to MultiInsert with 50 vector with nil insert request", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(0, intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: vid, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + vid := req.Requests[0].Vector.Id + for i := 0; i < len(req.Requests); i++ { + req.Requests[i] = nil + } + + return test{ + name: "Boundary Value Testing case 7.3: Fail to MultiInsert with all vector with nil insert request", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(0, intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: vid, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + vid := req.Requests[0].Vector.Id + req.Requests[0].Vector.Vector = nil + + return test{ + name: "Boundary Value Testing case 8.1: Fail to MultiInsert with 1 vector with nil vector", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(0, intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: vid, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + vid := req.Requests[0].Vector.Id + for i := 0; i < len(req.Requests)/2; i++ { + req.Requests[i].Vector.Vector = nil + } + + return test{ + name: "Boundary Value Testing case 8.2: Fail to MultiInsert with 50 vector with nil vector", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(0, intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: vid, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + vid := req.Requests[0].Vector.Id + for i := 0; i < len(req.Requests); i++ { + req.Requests[i].Vector.Vector = nil + } + + return test{ + name: "Boundary Value Testing case 8.3: Fail to MultiInsert with all vector with nil vector", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(0, intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: vid, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + vid := req.Requests[0].Vector.Id + req.Requests[0].Vector.Vector = []float32{} + + return test{ + name: "Boundary Value Testing case 9.1: Fail to MultiInsert with 1 vector with empty insert vector", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(0, intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: vid, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + vid := req.Requests[0].Vector.Id + for i := 0; i < len(req.Requests)/2; i++ { + req.Requests[i].Vector.Vector = []float32{} + } + + return test{ + name: "Boundary Value Testing case 9.2: Fail to MultiInsert with 50 vector with empty insert vector", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(0, intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: vid, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + vid := req.Requests[0].Vector.Id + for i := 0; i < len(req.Requests); i++ { + req.Requests[i].Vector.Vector = []float32{} + } + + return test{ + name: "Boundary Value Testing case 9.3: Fail to MultiInsert with all vector with empty insert vector", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + err: func() error { + err := errors.ErrIncompatibleDimensionSize(0, intVecDim) + err = status.WrapWithInvalidArgument("MultiInsert API Incompatible Dimension Size detected", + err, + &errdetails.RequestInfo{ + RequestId: vid, + ServingData: errdetails.Serialize(req), + }, + &errdetails.BadRequest{ + FieldViolations: []*errdetails.BadRequestFieldViolation{ + { + Field: "vector dimension size", + Description: err.Error(), + }, + }, + }, + &errdetails.ResourceInfo{ + ResourceType: ngtResourceType + "/ngt.MultiInsert", + ResourceName: fmt.Sprintf("%s: %s(%s)", apiName, name, ip), + }) + return err + }(), + }, + } + }(), + func() test { + insertNum := 100 + cfg := &payload.Insert_Config{ + SkipStrictExistCheck: false, + } + + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, cfg) + req.Requests[0].Vector.Id = req.Requests[1].Vector.Id + + // set want + w := genObjectLocations(insertNum, name, ip) + w.Locations[0].Uuid = req.Requests[0].Vector.Id + + return test{ + name: "Decision Table Testing case 1.1: Success to MultiInsert with 2 duplicated ID when SkipStrictExistCheck is false", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + wantRes: w, + }, + } + }(), + func() test { + insertNum := 100 + cfg := &payload.Insert_Config{ + SkipStrictExistCheck: false, + } + + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, cfg) + for i := 1; i < len(req.Requests); i++ { + req.Requests[i].Vector.Id = req.Requests[0].Vector.Id + } + + // set want + w := genObjectLocations(insertNum, name, ip) + for _, l := range w.Locations { + l.Uuid = req.Requests[0].Vector.Id + } + + return test{ + name: "Decision Table Testing case 1.2: Success to MultiInsert with all duplicated ID when SkipStrictExistCheck is false", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + wantRes: w, + }, + } + }(), + func() test { + insertNum := 100 + cfg := &payload.Insert_Config{ + SkipStrictExistCheck: true, + } + + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, cfg) + req.Requests[0].Vector.Id = req.Requests[1].Vector.Id + + // set want + w := genObjectLocations(insertNum, name, ip) + w.Locations[0].Uuid = req.Requests[0].Vector.Id + // w.Locations[1].Uuid = dupID + + return test{ + name: "Decision Table Testing case 1.3: Success to MultiInsert with 2 duplicated ID when SkipStrictExistCheck is true", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + wantRes: w, + }, + } + }(), + func() test { + insertNum := 100 + cfg := &payload.Insert_Config{ + SkipStrictExistCheck: true, + } + + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, cfg) + for i := 1; i < len(req.Requests); i++ { + req.Requests[i].Vector.Id = req.Requests[0].Vector.Id + } + + // set want + w := genObjectLocations(insertNum, name, ip) + for _, l := range w.Locations { + l.Uuid = req.Requests[0].Vector.Id + } + + return test{ + name: "Decision Table Testing case 1.4: Success to MultiInsert with all duplicated ID when SkipStrictExistCheck is true", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + wantRes: w, + }, + } + }(), + func() test { + insertNum := 100 + cfg := &payload.Insert_Config{ + SkipStrictExistCheck: false, + } + + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, cfg) + req.Requests[0].Vector.Vector = req.Requests[1].Vector.Vector + + return test{ + name: "Decision Table Testing case 2.1: Success to MultiInsert with 2 duplicated vector when SkipStrictExistCheck is false", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + cfg := &payload.Insert_Config{ + SkipStrictExistCheck: false, + } + + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, cfg) + for i := 1; i < len(req.Requests); i++ { + req.Requests[i].Vector.Vector = req.Requests[0].Vector.Vector + } + + return test{ + name: "Decision Table Testing case 2.2: Success to MultiInsert with all duplicated vector when SkipStrictExistCheck is false", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + cfg := &payload.Insert_Config{ + SkipStrictExistCheck: true, + } + + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, cfg) + req.Requests[0].Vector.Vector = req.Requests[1].Vector.Vector + + return test{ + name: "Decision Table Testing case 2.3: Success to MultiInsert with 2 duplicated vector when SkipStrictExistCheck is true", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + cfg := &payload.Insert_Config{ + SkipStrictExistCheck: true, + } + + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, cfg) + for i := 1; i < len(req.Requests); i++ { + req.Requests[i].Vector.Vector = req.Requests[0].Vector.Vector + } + + return test{ + name: "Decision Table Testing case 2.4: Success to MultiInsert with all duplicated vector when SkipStrictExistCheck is true", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + cfg := &payload.Insert_Config{ + SkipStrictExistCheck: false, + } + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, cfg) + req.Requests[0].Vector.Vector = req.Requests[1].Vector.Vector + req.Requests[0].Vector.Id = req.Requests[1].Vector.Id + + // set want + w := genObjectLocations(insertNum, name, ip) + w.Locations[0].Uuid = req.Requests[0].Vector.Id + + return test{ + name: "Decision Table Testing case 3.1: Success to MultiInsert with 2 duplicated ID & vector when SkipStrictExistCheck is false", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + wantRes: w, + }, + } + }(), + func() test { + insertNum := 100 + cfg := &payload.Insert_Config{ + SkipStrictExistCheck: false, + } + + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, cfg) + for i := 1; i < len(req.Requests); i++ { + req.Requests[i].Vector.Id = req.Requests[0].Vector.Id + req.Requests[i].Vector.Vector = req.Requests[0].Vector.Vector + } + + // set want + w := genObjectLocations(insertNum, name, ip) + for _, l := range w.Locations { + l.Uuid = req.Requests[0].Vector.Id + } + + return test{ + name: "Decision Table Testing case 3.2: Success to MultiInsert with all duplicated ID & vector when SkipStrictExistCheck is false", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + wantRes: w, + }, + } + }(), + func() test { + insertNum := 100 + cfg := &payload.Insert_Config{ + SkipStrictExistCheck: true, + } + + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, cfg) + req.Requests[0].Vector.Vector = req.Requests[1].Vector.Vector + req.Requests[0].Vector.Id = req.Requests[1].Vector.Id + + // set want + w := genObjectLocations(insertNum, name, ip) + w.Locations[0].Uuid = req.Requests[0].Vector.Id + + return test{ + name: "Decision Table Testing case 3.3: Success to MultiInsert with 2 duplicated ID & vector when SkipStrictExistCheck is true", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + wantRes: w, + }, + } + }(), + func() test { + insertNum := 100 + cfg := &payload.Insert_Config{ + SkipStrictExistCheck: true, + } + + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, cfg) + for i := 1; i < len(req.Requests); i++ { + req.Requests[i].Vector.Id = req.Requests[0].Vector.Id + req.Requests[i].Vector.Vector = req.Requests[0].Vector.Vector + } + + // set want + w := genObjectLocations(insertNum, name, ip) + for _, l := range w.Locations { + l.Uuid = req.Requests[0].Vector.Id + } + + return test{ + name: "Decision Table Testing case 3.4: Success to MultiInsert with all duplicated ID & vector when SkipStrictExistCheck is true", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + want: want{ + wantRes: w, + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + + return test{ + name: "Decision Table Testing case 4.1: Fail to MultiInsert with 2 existed ID when SkipStrictExistCheck is false", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + beforeFunc: func(t *testing.T, s *server) { + vecs := genF32Vec(vector.Gaussian, 2, f32VecDim) + for i := 0; i < 2; i++ { + ir := &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: req.Requests[i].Vector.Id, + Vector: vecs[i], + }, + Config: &payload.Insert_Config{ + SkipStrictExistCheck: false, + }, + } + if _, err := s.Insert(ctx, ir); err != nil { + t.Fatal(err) + } + } + + if _, err := s.CreateIndex(ctx, &payload.Control_CreateIndexRequest{ + PoolSize: 2, + }); err != nil { + t.Fatal(err) + } + }, + want: want{ + containErr: []error{ + genAlreadyExistsErr(req.Requests[0].Vector.Id, req, name, ip), + genAlreadyExistsErr(req.Requests[1].Vector.Id, req, name, ip), + }, + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + + wantErrs := make([]error, 100) + for i := 0; i < len(req.Requests); i++ { + wantErrs[i] = genAlreadyExistsErr(req.Requests[i].Vector.Id, req, name, ip) + } + + return test{ + name: "Decision Table Testing case 4.2: Fail to MultiInsert with all existed ID when SkipStrictExistCheck is false", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + beforeFunc: func(t *testing.T, s *server) { + vecs := genF32Vec(vector.Gaussian, insertNum, f32VecDim) + for i, r := range req.Requests { + ir := &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: r.Vector.Id, + Vector: vecs[i], + }, + Config: &payload.Insert_Config{ + SkipStrictExistCheck: false, + }, + } + if _, err := s.Insert(ctx, ir); err != nil { + t.Fatal(err) + } + } + if _, err := s.CreateIndex(ctx, &payload.Control_CreateIndexRequest{ + PoolSize: uint32(len(req.Requests)), + }); err != nil { + t.Fatal(err) + } + }, + want: want{ + containErr: wantErrs, + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + + return test{ + name: "Decision Table Testing case 4.3: Fail to MultiInsert with 2 existed ID when SkipStrictExistCheck is true", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + beforeFunc: func(t *testing.T, s *server) { + vecs := genF32Vec(vector.Gaussian, 2, f32VecDim) + for i := 0; i < 2; i++ { + ir := &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: req.Requests[i].Vector.Id, + Vector: vecs[i], + }, + Config: &payload.Insert_Config{ + SkipStrictExistCheck: true, + }, + } + if _, err := s.Insert(ctx, ir); err != nil { + t.Fatal(err) + } + } + + if _, err := s.CreateIndex(ctx, &payload.Control_CreateIndexRequest{ + PoolSize: 2, + }); err != nil { + t.Fatal(err) + } + }, + want: want{ + containErr: []error{ + genAlreadyExistsErr(req.Requests[0].Vector.Id, req, name, ip), + genAlreadyExistsErr(req.Requests[1].Vector.Id, req, name, ip), + }, + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + + wantErrs := make([]error, 100) + for i := 0; i < len(req.Requests); i++ { + wantErrs[i] = genAlreadyExistsErr(req.Requests[i].Vector.Id, req, name, ip) + } + + return test{ + name: "Decision Table Testing case 4.4: Fail to MultiInsert with all existed ID when SkipStrictExistCheck is true", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + beforeFunc: func(t *testing.T, s *server) { + vecs := genF32Vec(vector.Gaussian, insertNum, f32VecDim) + for i, r := range req.Requests { + ir := &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: r.Vector.Id, + Vector: vecs[i], + }, + Config: &payload.Insert_Config{ + SkipStrictExistCheck: true, + }, + } + if _, err := s.Insert(ctx, ir); err != nil { + t.Fatal(err) + } + } + if _, err := s.CreateIndex(ctx, &payload.Control_CreateIndexRequest{ + PoolSize: uint32(len(req.Requests)), + }); err != nil { + t.Fatal(err) + } + }, + want: want{ + containErr: wantErrs, + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + + return test{ + name: "Decision Table Testing case 5.1: Success to MultiInsert with 2 existed vector when SkipStrictExistCheck is false", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + beforeFunc: func(t *testing.T, s *server) { + // insert same request with different ID + for i := 0; i < 2; i++ { + ir := &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: fmt.Sprintf("nonexistid%d", i), + Vector: req.Requests[i].Vector.Vector, + }, + Config: &payload.Insert_Config{ + SkipStrictExistCheck: false, + }, + } + if _, err := s.Insert(ctx, ir); err != nil { + t.Fatal(err) + } + } + if _, err := s.CreateIndex(ctx, &payload.Control_CreateIndexRequest{ + PoolSize: uint32(len(req.Requests)), + }); err != nil { + t.Fatal(err) + } + }, + want: want{ + wantRes: genObjectLocations(100, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + + return test{ + name: "Decision Table Testing case 5.2: Success to MultiInsert with all existed vector when SkipStrictExistCheck is false", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + beforeFunc: func(t *testing.T, s *server) { + // insert same request with different ID + for i := range req.Requests { + ir := &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: fmt.Sprintf("nonexistid%d", i), + Vector: req.Requests[i].Vector.Vector, + }, + Config: &payload.Insert_Config{ + SkipStrictExistCheck: false, + }, + } + if _, err := s.Insert(ctx, ir); err != nil { + t.Fatal(err) + } + } + if _, err := s.CreateIndex(ctx, &payload.Control_CreateIndexRequest{ + PoolSize: uint32(len(req.Requests)), + }); err != nil { + t.Fatal(err) + } + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + + return test{ + name: "Decision Table Testing case 5.3: Success to MultiInsert with 2 existed vector when SkipStrictExistCheck is true", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + beforeFunc: func(t *testing.T, s *server) { + // insert same request with different ID + for i := 0; i < 2; i++ { + ir := &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: fmt.Sprintf("nonexistid%d", i), + Vector: req.Requests[i].Vector.Vector, + }, + Config: &payload.Insert_Config{ + SkipStrictExistCheck: true, + }, + } + if _, err := s.Insert(ctx, ir); err != nil { + t.Fatal(err) + } + } + if _, err := s.CreateIndex(ctx, &payload.Control_CreateIndexRequest{ + PoolSize: uint32(len(req.Requests)), + }); err != nil { + t.Fatal(err) + } + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + + return test{ + name: "Decision Table Testing case 5.4: Success to MultiInsert with all existed vector when SkipStrictExistCheck is true", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + beforeFunc: func(t *testing.T, s *server) { + // insert same request with different ID + for i := range req.Requests { + ir := &payload.Insert_Request{ + Vector: &payload.Object_Vector{ + Id: fmt.Sprintf("nonexistid%d", i), + Vector: req.Requests[i].Vector.Vector, + }, + Config: &payload.Insert_Config{ + SkipStrictExistCheck: true, + }, + } + if _, err := s.Insert(ctx, ir); err != nil { + t.Fatal(err) + } + } + if _, err := s.CreateIndex(ctx, &payload.Control_CreateIndexRequest{ + PoolSize: uint32(len(req.Requests)), + }); err != nil { + t.Fatal(err) + } + }, + want: want{ + wantRes: genObjectLocations(insertNum, name, ip), + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + + return test{ + name: "Decision Table Testing case 6.1: Fail to MultiInsert with 2 existed ID & vector when SkipStrictExistCheck is false", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + beforeFunc: func(t *testing.T, s *server) { + for i := 0; i < 2; i++ { + ir := &payload.Insert_Request{ + Vector: req.Requests[i].Vector, + Config: &payload.Insert_Config{ + SkipStrictExistCheck: false, + }, + } + if _, err := s.Insert(ctx, ir); err != nil { + t.Fatal(err) + } + } + + if _, err := s.CreateIndex(ctx, &payload.Control_CreateIndexRequest{ + PoolSize: 2, + }); err != nil { + t.Fatal(err) + } + }, + want: want{ + containErr: []error{ + genAlreadyExistsErr(req.Requests[0].Vector.Id, req, name, ip), + genAlreadyExistsErr(req.Requests[1].Vector.Id, req, name, ip), + }, + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + + wantErrs := make([]error, 100) + for i := 0; i < len(req.Requests); i++ { + wantErrs[i] = genAlreadyExistsErr(req.Requests[i].Vector.Id, req, name, ip) + } + + return test{ + name: "Decision Table Testingcase 6.2: Fail to MultiInsert with all existed ID & vector when SkipStrictExistCheck is false", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + beforeFunc: func(t *testing.T, s *server) { + for _, r := range req.Requests { + ir := &payload.Insert_Request{ + Vector: r.Vector, + Config: &payload.Insert_Config{ + SkipStrictExistCheck: false, + }, + } + if _, err := s.Insert(ctx, ir); err != nil { + t.Fatal(err) + } + } + if _, err := s.CreateIndex(ctx, &payload.Control_CreateIndexRequest{ + PoolSize: uint32(len(req.Requests)), + }); err != nil { + t.Fatal(err) + } + }, + want: want{ + containErr: wantErrs, + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + + return test{ + name: "Decision Table Testing case 6.3: Fail to MultiInsert with 2 existed ID & vector when SkipStrictExistCheck is true", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + beforeFunc: func(t *testing.T, s *server) { + for i := 0; i < 2; i++ { + ir := &payload.Insert_Request{ + Vector: req.Requests[i].Vector, + Config: &payload.Insert_Config{ + SkipStrictExistCheck: true, + }, + } + if _, err := s.Insert(ctx, ir); err != nil { + t.Fatal(err) + } + } + + if _, err := s.CreateIndex(ctx, &payload.Control_CreateIndexRequest{ + PoolSize: 2, + }); err != nil { + t.Fatal(err) + } + }, + want: want{ + containErr: []error{ + genAlreadyExistsErr(req.Requests[0].Vector.Id, req, name, ip), + genAlreadyExistsErr(req.Requests[1].Vector.Id, req, name, ip), + }, + }, + } + }(), + func() test { + insertNum := 100 + req := genMultiInsertReq(Float, vector.Gaussian, insertNum, f32VecDim, nil) + + wantErrs := make([]error, 100) + for i := 0; i < len(req.Requests); i++ { + wantErrs[i] = genAlreadyExistsErr(req.Requests[i].Vector.Id, req, name, ip) + } + + return test{ + name: "Decision Table Testing case 6.4: Fail to MultiInsert with all existed ID & vector when SkipStrictExistCheck is true", + args: args{ + ctx: ctx, + reqs: req, + }, + fields: fields{ + name: name, + ip: ip, + svcCfg: defaultF32SvcCfg, + svcOpts: defaultSvcOpts, + }, + beforeFunc: func(t *testing.T, s *server) { + for _, r := range req.Requests { + ir := &payload.Insert_Request{ + Vector: r.Vector, + Config: &payload.Insert_Config{ + SkipStrictExistCheck: true, + }, + } + if _, err := s.Insert(ctx, ir); err != nil { + t.Fatal(err) + } + } + if _, err := s.CreateIndex(ctx, &payload.Control_CreateIndexRequest{ + PoolSize: uint32(len(req.Requests)), + }); err != nil { + t.Fatal(err) + } + }, + want: want{ + containErr: wantErrs, + }, + } + }(), + } + + for _, tc := range tests { + test := tc + t.Run(test.name, func(tt *testing.T) { + tt.Parallel() + defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) + if test.afterFunc != nil { + defer test.afterFunc(test.args) + } + checkFunc := test.checkFunc + if test.checkFunc == nil { + checkFunc = defaultCheckFunc + } + + eg, _ := errgroup.New(ctx) + ngt, err := service.New(test.fields.svcCfg, append(test.fields.svcOpts, service.WithErrGroup(eg))...) + if err != nil { + tt.Errorf("failed to init ngt service, error = %v", err) + } + + s := &server{ + name: test.fields.name, + ip: test.fields.ip, + ngt: ngt, + eg: eg, + streamConcurrency: test.fields.streamConcurrency, + } + + if test.beforeFunc != nil { + test.beforeFunc(tt, s) } gotRes, err := s.MultiInsert(test.args.ctx, test.args.reqs) From e9fdd5229f4b9636aad89c8e51deec3b43d16bea Mon Sep 17 00:00:00 2001 From: vdaas-ci <57942646+vdaas-ci@users.noreply.github.com> Date: Tue, 24 May 2022 13:58:26 +0900 Subject: [PATCH 3/3] :robot: Automatically update PULL_REQUEST_TEMPLATE and ISSUE_TEMPLATE (#1669) Signed-off-by: Vdaas CI Co-authored-by: Yusuke Kato --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- .github/ISSUE_TEMPLATE/security_issue_report.md | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 94931957f8..4aa100d3b0 100755 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,4 +26,4 @@ assignees: "" - Go Version: 1.18.2 - Docker Version: 20.10.8 - Kubernetes Version: 1.22.0 -- NGT Version: 1.14.3 +- NGT Version: 1.14.5 diff --git a/.github/ISSUE_TEMPLATE/security_issue_report.md b/.github/ISSUE_TEMPLATE/security_issue_report.md index e1cf539af8..43e200c7dd 100644 --- a/.github/ISSUE_TEMPLATE/security_issue_report.md +++ b/.github/ISSUE_TEMPLATE/security_issue_report.md @@ -20,4 +20,4 @@ assignees: "" - Go Version: 1.18.2 - Docker Version: 20.10.8 - Kubernetes Version: 1.22.0 -- NGT Version: 1.14.3 +- NGT Version: 1.14.5 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 19de712e5f..4f968e7bff 100755 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -24,7 +24,7 @@ - Go Version: 1.18.2 - Docker Version: 20.10.8 - Kubernetes Version: 1.22.0 -- NGT Version: 1.14.3 +- NGT Version: 1.14.5 ### Types of changes: