From 59473e8349a21603f51d61396b1f75625731a690 Mon Sep 17 00:00:00 2001 From: Sayan Hazra Date: Mon, 21 Sep 2020 09:41:09 +0200 Subject: [PATCH 001/194] Rename component to event publisher proxy (#9475) --- Dockerfile | 17 ++ Makefile | 37 +++ OWNERS | 0 README.md | 43 ++++ cmd/event-publisher-proxy/main.go | 42 ++++ config/100-secret.yaml | 11 + config/200-service.yaml | 12 + config/300-deployment.yaml | 63 +++++ go.mod | 12 + go.sum | 126 ++++++++++ pkg/cloudevents/utils.go | 27 +++ pkg/cloudevents/utils_test.go | 56 +++++ pkg/ems/types.go | 8 + pkg/env/config.go | 24 ++ pkg/env/config_test.go | 26 ++ pkg/handler/handler.go | 166 +++++++++++++ pkg/handler/handler_test.go | 227 ++++++++++++++++++ pkg/health/probes.go | 26 ++ pkg/health/probes_test.go | 49 ++++ pkg/oauth/client.go | 32 +++ pkg/oauth/client_test.go | 116 +++++++++ pkg/oauth/config.go | 16 ++ pkg/oauth/config_test.go | 24 ++ pkg/receiver/receiver.go | 66 +++++ pkg/receiver/receiver_test.go | 73 ++++++ pkg/sender/sender.go | 27 +++ pkg/sender/sender_test.go | 106 ++++++++ pkg/signals/signals.go | 75 ++++++ .../propagation/http_format_sequence.go | 37 +++ .../propagation/tracecontextb3/http_format.go | 21 ++ testing/env_config.go | 41 ++++ testing/fixtures.go | 46 ++++ testing/mock_server.go | 75 ++++++ testing/utils.go | 51 ++++ 34 files changed, 1778 insertions(+) create mode 100644 Dockerfile create mode 100644 Makefile create mode 100644 OWNERS create mode 100644 README.md create mode 100644 cmd/event-publisher-proxy/main.go create mode 100644 config/100-secret.yaml create mode 100644 config/200-service.yaml create mode 100644 config/300-deployment.yaml create mode 100644 go.mod create mode 100644 go.sum create mode 100644 pkg/cloudevents/utils.go create mode 100644 pkg/cloudevents/utils_test.go create mode 100644 pkg/ems/types.go create mode 100644 pkg/env/config.go create mode 100644 pkg/env/config_test.go create mode 100644 pkg/handler/handler.go create mode 100644 pkg/handler/handler_test.go create mode 100644 pkg/health/probes.go create mode 100644 pkg/health/probes_test.go create mode 100644 pkg/oauth/client.go create mode 100644 pkg/oauth/client_test.go create mode 100644 pkg/oauth/config.go create mode 100644 pkg/oauth/config_test.go create mode 100644 pkg/receiver/receiver.go create mode 100644 pkg/receiver/receiver_test.go create mode 100644 pkg/sender/sender.go create mode 100644 pkg/sender/sender_test.go create mode 100644 pkg/signals/signals.go create mode 100644 pkg/tracing/propagation/http_format_sequence.go create mode 100644 pkg/tracing/propagation/tracecontextb3/http_format.go create mode 100644 testing/env_config.go create mode 100644 testing/fixtures.go create mode 100644 testing/mock_server.go create mode 100644 testing/utils.go diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..643c24b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM golang:1.15-alpine as builder + +ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy + +WORKDIR $DOCK_PKG_DIR +COPY . $DOCK_PKG_DIR + +RUN GOOS=linux GO111MODULE=on go mod vendor &&\ + go build -o event-publisher-proxy ./cmd/event-publisher-proxy + +FROM scratch +LABEL source = git@github.com:kyma-project/kyma.git + +COPY --from=builder /go/src/github.com/kyma-project/kyma/components/event-publisher-proxy/event-publisher-proxy . +COPY licenses/ /licenses/ + +ENTRYPOINT ["/event-publisher-proxy"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..90b89fb --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +APP_NAME = event-publisher-proxy +APP_PATH = components/$(APP_NAME) +BUILDPACK = eu.gcr.io/kyma-project/test-infra/buildpack-golang-toolbox:v20200117-d3885041 +SCRIPTS_DIR = $(realpath $(shell pwd)/../..)/common/makefiles + +override ENTRYPOINT = cmd/main.go + +include $(SCRIPTS_DIR)/generic-make-go.mk + +VERIFY_IGNORE := /vendor\|/mocks + +verify:: mod-verify + +resolve-local: + GO111MODULE=on go mod vendor -v + +ensure-local: + @echo "Go modules present in component - omitting." + +dep-status: + @echo "Go modules present in component - omitting." + +dep-status-local: + @echo "Go modules present in component - omitting." + +mod-verify-local: + GO111MODULE=on go mod verify + +test-local: + GO111MODULE=on go test ./... + +$(eval $(call buildpack-cp-ro,resolve)) +$(eval $(call buildpack-mount,mod-verify)) +$(eval $(call buildpack-mount,test)) + +path-to-referenced-charts: + @echo "resources/event-publisher-proxy" diff --git a/OWNERS b/OWNERS new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..7a89485 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# Event Publisher Proxy + +## Overview + +The Event Publisher Proxy receives Cloud Event publishing requests from the cluster workloads (microservice or Serverless functions) and redirects them to the Enterprise Messaging Service Cloud Event Gateway. + +## Prerequisites + +- Go modules +- [ko](https://github.com/google/ko) + +## Development + +### Build + +```bash +$ go mod vendor +``` + +### Test + +```bash +$ make test-local +``` + +### Deploy inside a cluster + +```bash +$ ko apply -f config/ +``` + +## Environment Variables + +| Environment Variable | Default Value | Description | +| ----------------------- | ------------- |---------------------------------------------------------------------------------------------- | +| INGRESS_PORT | 8080 | The ingress port for the CloudEvents Gateway Proxy. | +| MAX_IDLE_CONNS | 100 | The maximum number of idle (keep-alive) connections across all hosts. Zero means no limit. | +| MAX_IDLE_CONNS_PER_HOST | 2 | The maximum idle (keep-alive) connections to keep per-host. Zero means the default value. | +| REQUEST_TIMEOUT | 5s | The timeout for the outgoing requests to the Messaging server. | +| CLIENT_ID | | The Client ID used to acquire Access Tokens from the Authentication server. | +| CLIENT_SECRET | | The Client Secret used to acquire Access Tokens from the Authentication server. | +| TOKEN_ENDPOINT | | The Authentication Server Endpoint to provide Access Tokens. | +| EMS_PUBLISH_URL | | The Messaging Server Endpoint that accepts publishing CloudEvents to it. | diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go new file mode 100644 index 0000000..b09523f --- /dev/null +++ b/cmd/event-publisher-proxy/main.go @@ -0,0 +1,42 @@ +package main + +import ( + "github.com/kelseyhightower/envconfig" + "github.com/sirupsen/logrus" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" +) + +func main() { + logger := logrus.New() + + cfg := new(env.Config) + if err := envconfig.Process("", cfg); err != nil { + logger.Fatalf("Start handler failed with error: %s", err) + } + + logger.Info("Start the Event Publisher Proxy") + + // configure message receiver + messageReceiver := receiver.NewHttpMessageReceiver(cfg.Port) + + // configure auth client + ctx := signals.NewContext() + client := oauth.NewClient(ctx, cfg) + defer client.CloseIdleConnections() + + // configure message sender + messageSender := sender.NewHttpMessageSender(cfg.EmsPublishURL, client) + + // start handler which blocks until it receives a shutdown signal + if err := handler.NewHandler(messageReceiver, messageSender, cfg.RequestTimeout, logger).Start(ctx); err != nil { + logger.Fatalf("Start handler failed with error: %s", err) + } + + logger.Info("Shutdown the Event Publisher Proxy") +} diff --git a/config/100-secret.yaml b/config/100-secret.yaml new file mode 100644 index 0000000..31b016f --- /dev/null +++ b/config/100-secret.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +data: + client-id: fake-id + client-secret: fake-secret + token-endpoint: fake-token-ep + ems-publish-url: fake-ems-publish-url +kind: Secret +metadata: + labels: + app: event-publisher-proxy + name: event-publisher-proxy diff --git a/config/200-service.yaml b/config/200-service.yaml new file mode 100644 index 0000000..3b4b0e7 --- /dev/null +++ b/config/200-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: event-publisher-proxy +spec: + type: ClusterIP + selector: + app: event-publisher-proxy + ports: + - protocol: TCP + port: 80 + targetPort: 8080 diff --git a/config/300-deployment.yaml b/config/300-deployment.yaml new file mode 100644 index 0000000..45ac20e --- /dev/null +++ b/config/300-deployment.yaml @@ -0,0 +1,63 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: event-publisher-proxy + name: event-publisher-proxy +spec: + replicas: 1 + selector: + matchLabels: + app: event-publisher-proxy + strategy: + type: RollingUpdate + template: + metadata: + labels: + app: event-publisher-proxy + spec: + containers: + - env: + - name: CLIENT_ID + valueFrom: + secretKeyRef: + name: event-publisher-proxy + key: client-id + - name: CLIENT_SECRET + valueFrom: + secretKeyRef: + name: event-publisher-proxy + key: client-secret + - name: TOKEN_ENDPOINT + valueFrom: + secretKeyRef: + name: event-publisher-proxy + key: token-endpoint + - name: EMS_PUBLISH_URL + valueFrom: + secretKeyRef: + name: event-publisher-proxy + key: ems-publish-url + image: github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy + imagePullPolicy: IfNotPresent + name: event-publisher-proxy + ports: + - containerPort: 8080 + name: http + protocol: TCP + livenessProbe: + failureThreshold: 3 + httpGet: + path: /healthz + port: 8080 + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 1 + readinessProbe: + failureThreshold: 3 + httpGet: + path: /readyz + port: 8080 + scheme: HTTP diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..61ce984 --- /dev/null +++ b/go.mod @@ -0,0 +1,12 @@ +module github.com/kyma-project/kyma/components/event-publisher-proxy + +go 1.15 + +require ( + github.com/cloudevents/sdk-go/v2 v2.2.0 + github.com/kelseyhightower/envconfig v1.4.0 + github.com/pkg/errors v0.9.1 + github.com/sirupsen/logrus v1.6.0 + go.opencensus.io v0.22.4 + golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..a04bab7 --- /dev/null +++ b/go.sum @@ -0,0 +1,126 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudevents/sdk-go/v2 v2.2.0 h1:FlBJg7W0QywbOjuZGmRXUyFk8qkCHx2euETp+tuopSU= +github.com/cloudevents/sdk-go/v2 v2.2.0/go.mod h1:3CTrpB4+u7Iaj6fd7E2Xvm5IxMdRoaAhqaRVnOr2rCU= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= +github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac h1:+2b6iGRJe3hvV/yVXrd41yVEjxuFHxasJqDhkIjS4gk= +github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac/go.mod h1:Frd2bnT3w5FB5q49ENTfVlztJES+1k/7lyWX2+9gq/M= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.2 h1:uqH7bpe+ERSiDa34FDOF7RikN6RzXgduUF8yarlZp94= +github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +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= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/pkg/cloudevents/utils.go b/pkg/cloudevents/utils.go new file mode 100644 index 0000000..809051e --- /dev/null +++ b/pkg/cloudevents/utils.go @@ -0,0 +1,27 @@ +package events + +import ( + "context" + "net/http" + + "github.com/pkg/errors" + + "github.com/cloudevents/sdk-go/v2/binding" + cehttp "github.com/cloudevents/sdk-go/v2/protocol/http" +) + +// WriteRequestWithHeaders writes a CloudEvent HTTP request with the given message and adds the given headers to it. +func WriteRequestWithHeaders(ctx context.Context, message binding.Message, req *http.Request, headers http.Header, transformers ...binding.Transformer) error { + err := cehttp.WriteRequest(ctx, message, req, transformers...) + if err != nil { + return errors.Wrap(err, "failed to write Request") + } + + for k, v := range headers { + for _, vv := range v { + req.Header.Add(k, vv) + } + } + + return nil +} diff --git a/pkg/cloudevents/utils_test.go b/pkg/cloudevents/utils_test.go new file mode 100644 index 0000000..cfac9bd --- /dev/null +++ b/pkg/cloudevents/utils_test.go @@ -0,0 +1,56 @@ +package events + +import ( + "context" + "net/http" + "net/http/httptest" + "net/textproto" + "reflect" + "testing" + + cehttp "github.com/cloudevents/sdk-go/v2/protocol/http" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/ems" +) + +func TestWriteRequestWithHeaders(t *testing.T) { + t.Parallel() + + req := httptest.NewRequest(http.MethodPost, "/", nil) + req.Header.Add("Content-Type", "application/cloudevents+json") + + message := cehttp.NewMessageFromHttpRequest(req) + defer func() { _ = message.Finish(nil) }() + + additionalHeaders := http.Header{ + "qos": []string{string(ems.QosAtLeastOnce)}, + "accept": []string{"application/json"}, + "key1": []string{"value1", "value2"}, + "key2": []string{"value3"}, + } + additionalHeadersCopy := copyHeaders(additionalHeaders) + + ctx := context.Background() + err := WriteRequestWithHeaders(ctx, message, req, additionalHeaders) + if err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(additionalHeaders, additionalHeadersCopy) { + t.Fatal("Write request with headers should not change the input HTTP headers") + } + + for k, v := range additionalHeaders { + vv, ok := req.Header[textproto.CanonicalMIMEHeaderKey(k)] + if !ok || !reflect.DeepEqual(v, vv) { + t.Fatal("The HTTP request should contain the given HTTP headers") + } + } +} + +func copyHeaders(headers http.Header) http.Header { + headersCopy := make(http.Header) + for k, v := range headers { + headersCopy[k] = v + } + return headersCopy +} diff --git a/pkg/ems/types.go b/pkg/ems/types.go new file mode 100644 index 0000000..73c535d --- /dev/null +++ b/pkg/ems/types.go @@ -0,0 +1,8 @@ +package ems + +type Qos string + +const ( + // QosAtLeastOnce the quality of service supported by EMS to send Events with at least once guarantee. + QosAtLeastOnce Qos = "AT_LEAST_ONCE" +) diff --git a/pkg/env/config.go b/pkg/env/config.go new file mode 100644 index 0000000..8127792 --- /dev/null +++ b/pkg/env/config.go @@ -0,0 +1,24 @@ +package env + +import ( + "net/http" + "time" +) + +// Config represents the environment config for the Event Publisher Proxy. +type Config struct { + Port int `envconfig:"INGRESS_PORT" default:"8080"` + ClientID string `envconfig:"CLIENT_ID" required:"true"` + ClientSecret string `envconfig:"CLIENT_SECRET" required:"true"` + TokenEndpoint string `envconfig:"TOKEN_ENDPOINT" required:"true"` + EmsPublishURL string `envconfig:"EMS_PUBLISH_URL" required:"true"` + MaxIdleConns int `envconfig:"MAX_IDLE_CONNS" default:"100"` + MaxIdleConnsPerHost int `envconfig:"MAX_IDLE_CONNS_PER_HOST" default:"2"` + RequestTimeout time.Duration `envconfig:"REQUEST_TIMEOUT" default:"5s"` +} + +// ConfigureTransport receives an HTTP transport and configure its max idle connection properties. +func (c *Config) ConfigureTransport(transport *http.Transport) { + transport.MaxIdleConns = c.MaxIdleConns + transport.MaxIdleConnsPerHost = c.MaxIdleConnsPerHost +} diff --git a/pkg/env/config_test.go b/pkg/env/config_test.go new file mode 100644 index 0000000..97cdb67 --- /dev/null +++ b/pkg/env/config_test.go @@ -0,0 +1,26 @@ +package env + +import ( + "net/http" + "testing" +) + +func TestConfigureTransport(t *testing.T) { + t.Parallel() + + const ( + maxIdleConns = 100 + maxIdleConnsPerHost = 200 + ) + + transport := &http.Transport{} + cfg := Config{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost} + cfg.ConfigureTransport(transport) + + if transport.MaxIdleConns != maxIdleConns { + t.Errorf("HTTP Transport MaxIdleConns is misconfigured want: %d but got: %d", maxIdleConns, transport.MaxIdleConns) + } + if transport.MaxIdleConnsPerHost != maxIdleConnsPerHost { + t.Errorf("HTTP Transport MaxIdleConnsPerHost is misconfigured want: %d but got: %d", maxIdleConnsPerHost, transport.MaxIdleConnsPerHost) + } +} diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go new file mode 100644 index 0000000..908cb68 --- /dev/null +++ b/pkg/handler/handler.go @@ -0,0 +1,166 @@ +package handler + +import ( + "context" + "io/ioutil" + "net/http" + "time" + + "github.com/sirupsen/logrus" + + "github.com/cloudevents/sdk-go/v2/binding" + cev2client "github.com/cloudevents/sdk-go/v2/client" + cev2event "github.com/cloudevents/sdk-go/v2/event" + cehttp "github.com/cloudevents/sdk-go/v2/protocol/http" + + cloudevents "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/ems" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/health" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" +) + +const ( + // noDuration signals that the dispatch step has not started yet. + noDuration = -1 +) + +var ( + // additionalHeaders are the required headers by EMS for publish requests. + // Any alteration or removal of those headers might cause publish requests to fail. + additionalHeaders = http.Header{ + "qos": []string{string(ems.QosAtLeastOnce)}, + "Accept": []string{"application/json"}, + } +) + +// Handler is responsible for receiving HTTP requests and dispatching them to the EMS gateway. +// It also assures that the messages received are compliant with the Cloud Events spec. +type Handler struct { + // Receiver receives incoming HTTP requests + Receiver *receiver.HttpMessageReceiver + // Sender sends requests to the broker + Sender *sender.HttpMessageSender + // Defaulter sets default values to incoming events + Defaulter cev2client.EventDefaulter + // RequestTimeout timeout for outgoing requests + RequestTimeout time.Duration + // Logger default logger + Logger *logrus.Logger +} + +// NewHandler returns a new Handler instance for the Event Publisher Proxy. +func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.HttpMessageSender, requestTimeout time.Duration, logger *logrus.Logger) *Handler { + return &Handler{Receiver: receiver, Sender: sender, RequestTimeout: requestTimeout, Logger: logger} +} + +// Start starts the Handler with the given context. +func (h *Handler) Start(ctx context.Context) error { + return h.Receiver.StartListen(ctx, health.CheckHealth(h)) +} + +// ServeHTTP serves an HTTP request and returns back an HTTP response. +// It ensures that the incoming request is a valid Cloud Event, then dispatches it +// to the EMS gateway and writes back the HTTP response. +func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { + // validate request method + if request.Method != http.MethodPost { + h.Logger.Warnf("Unexpected request method: %s", request.Method) + h.writeResponse(writer, http.StatusMethodNotAllowed, nil) + return + } + + // validate request URI + if request.RequestURI != "/publish" { + h.writeResponse(writer, http.StatusNotFound, nil) + return + } + + ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) + defer cancel() + + message := cehttp.NewMessageFromHttpRequest(request) + defer func() { _ = message.Finish(nil) }() + + event, err := binding.ToEvent(ctx, message) + if err != nil { + h.Logger.Warnf("Failed to extract event from request with error: %s", err) + h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) + return + } + + if err := event.Validate(); err != nil { + h.Logger.Warnf("Request is invalid as per CE spec with error: %s", err) + h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) + return + } + + h.receive(ctx, event) + statusCode, dispatchTime, respBody := h.send(ctx, event) + h.writeResponse(writer, statusCode, respBody) + + h.Logger.Infof("Event dispatched id:[%s] statusCode:[%d] duration:[%s] responseBody:[%s]", event.ID(), statusCode, dispatchTime, respBody) +} + +// writeResponse writes the HTTP response given the status code and response body. +func (h *Handler) writeResponse(writer http.ResponseWriter, statusCode int, respBody []byte) { + writer.WriteHeader(statusCode) + + if respBody == nil { + return + } + if _, err := writer.Write(respBody); err != nil { + h.Logger.Errorf("Failed to write response body with error: %s", err) + } +} + +// receive applies the default values (if any) to the given Cloud Event. +func (h *Handler) receive(ctx context.Context, event *cev2event.Event) { + if h.Defaulter != nil { + newEvent := h.Defaulter(ctx, *event) + event = &newEvent + } + + h.Logger.Infof("Event received id:[%s]", event.ID()) +} + +// send dispatches the given Cloud Event to the EMS gateway and returns the response details and dispatch time. +func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.Duration, []byte) { + request, err := h.Sender.NewRequestWithTarget(ctx, h.Sender.Target) + if err != nil { + h.Logger.Errorf("Failed to prepare a cloudevent request with error: %s", err) + return http.StatusInternalServerError, noDuration, []byte{} + } + + message := binding.ToMessage(event) + defer func() { _ = message.Finish(nil) }() + + err = cloudevents.WriteRequestWithHeaders(ctx, message, request, additionalHeaders) + if err != nil { + h.Logger.Errorf("Failed to add additional headers to the request with error: %s", err) + return http.StatusInternalServerError, noDuration, []byte{} + } + + resp, dispatchTime, err := h.sendAndRecordDispatchTime(request) + if err != nil { + h.Logger.Errorf("Failed to send event and record dispatch time with error: %s", err) + return http.StatusInternalServerError, dispatchTime, []byte{} + } + defer func() { _ = resp.Body.Close() }() + + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + h.Logger.Errorf("Failed to read response body with error: %s", err) + return http.StatusInternalServerError, dispatchTime, []byte{} + } + + return resp.StatusCode, dispatchTime, body +} + +// sendAndRecordDispatchTime sends a CloudEvent and records the time taken while sending. +func (h *Handler) sendAndRecordDispatchTime(request *http.Request) (*http.Response, time.Duration, error) { + start := time.Now() + resp, err := h.Sender.Send(request) + dispatchTime := time.Since(start) + return resp, dispatchTime, err +} diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go new file mode 100644 index 0000000..4651815 --- /dev/null +++ b/pkg/handler/handler_test.go @@ -0,0 +1,227 @@ +package handler + +import ( + "context" + "fmt" + "net/http" + "testing" + "time" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" + "github.com/sirupsen/logrus" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" +) + +const ( + // mock server endpoints + tokenEndpoint = "/token" + eventsEndpoint = "/events" +) + +func TestHandler(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + provideMessage func() (string, http.Header) + wantStatusCode int + }{ + // structured cloudevents + { + name: "Structured CloudEvent without id", + provideMessage: func() (string, http.Header) { + return testingutils.StructuredCloudEventPayloadWithoutID, testingutils.GetStructuredMessageHeaders() + }, + wantStatusCode: http.StatusBadRequest, + }, + { + name: "Structured CloudEvent without type", + provideMessage: func() (string, http.Header) { + return testingutils.StructuredCloudEventPayloadWithoutType, testingutils.GetStructuredMessageHeaders() + }, + wantStatusCode: http.StatusBadRequest, + }, + { + name: "Structured CloudEvent without specversion", + provideMessage: func() (string, http.Header) { + return testingutils.StructuredCloudEventPayloadWithoutSpecVersion, testingutils.GetStructuredMessageHeaders() + }, + wantStatusCode: http.StatusBadRequest, + }, + { + name: "Structured CloudEvent without source", + provideMessage: func() (string, http.Header) { + return testingutils.StructuredCloudEventPayloadWithoutSource, testingutils.GetStructuredMessageHeaders() + }, + wantStatusCode: http.StatusBadRequest, + }, + { + name: "Structured CloudEvent is valid", + provideMessage: func() (string, http.Header) { + return testingutils.StructuredCloudEventPayload, testingutils.GetStructuredMessageHeaders() + }, + wantStatusCode: http.StatusNoContent, + }, + // binary cloudevents + { + name: "Binary CloudEvent without CE-ID header", + provideMessage: func() (string, http.Header) { + headers := testingutils.GetBinaryMessageHeaders() + headers.Del(testingutils.CeIDHeader) + return testingutils.BinaryCloudEventPayload, headers + }, + wantStatusCode: http.StatusBadRequest, + }, + { + name: "Binary CloudEvent without CE-Type header", + provideMessage: func() (string, http.Header) { + headers := testingutils.GetBinaryMessageHeaders() + headers.Del(testingutils.CeTypeHeader) + return testingutils.BinaryCloudEventPayload, headers + }, + wantStatusCode: http.StatusBadRequest, + }, + { + name: "Binary CloudEvent without CE-SpecVersion header", + provideMessage: func() (string, http.Header) { + headers := testingutils.GetBinaryMessageHeaders() + headers.Del(testingutils.CeSpecVersionHeader) + return testingutils.BinaryCloudEventPayload, headers + }, + wantStatusCode: http.StatusBadRequest, + }, + { + name: "Binary CloudEvent without CE-Source header", + provideMessage: func() (string, http.Header) { + headers := testingutils.GetBinaryMessageHeaders() + headers.Del(testingutils.CeSourceHeader) + return testingutils.BinaryCloudEventPayload, headers + }, + wantStatusCode: http.StatusBadRequest, + }, + { + name: "Binary CloudEvent is valid with required headers", + provideMessage: func() (string, http.Header) { + return testingutils.BinaryCloudEventPayload, testingutils.GetBinaryMessageHeaders() + }, + wantStatusCode: http.StatusNoContent, + }, + } + + var ( + port = 8888 + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) + ) + + mockServer := testingutils.NewMockServer() + mockServer.Start(t, tokenEndpoint, eventsEndpoint) + defer mockServer.Close() + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + emsCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) + authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) + cfg := testingutils.NewEnvConfig(emsCEURL, authURL, testingutils.WithPort(port)) + client := oauth.NewClient(ctx, cfg) + defer client.CloseIdleConnections() + + msgSender := sender.NewHttpMessageSender(emsCEURL, client) + + msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) + handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, logrus.New()) + go func() { + if err := handler.Start(ctx); err != nil { + t.Errorf("Failed to start handler with error: %v", err) + } + }() + + waitForHandlerToStart(t, healthEndpoint) + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + body, headers := testCase.provideMessage() + resp, err := testingutils.SendEvent(publishEndpoint, body, headers) + if err != nil { + t.Errorf("Failed to send event with error: %v", err) + } + _ = resp.Body.Close() + if testCase.wantStatusCode != resp.StatusCode { + t.Errorf("Test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) + } + }) + } +} + +func TestHandlerTimeout(t *testing.T) { + t.Parallel() + + var ( + port = 9999 + requestTimeout = time.Nanosecond // short request timeout + serverResponseTime = time.Millisecond // long server response time + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) + ) + + mockServer := testingutils.NewMockServer(testingutils.WithResponseTime(serverResponseTime)) + mockServer.Start(t, tokenEndpoint, eventsEndpoint) + defer mockServer.Close() + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + emsCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) + authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) + cfg := testingutils.NewEnvConfig(emsCEURL, authURL, testingutils.WithPort(port), testingutils.WithRequestTimeout(requestTimeout)) + client := oauth.NewClient(ctx, cfg) + defer client.CloseIdleConnections() + + msgSender := sender.NewHttpMessageSender(emsCEURL, client) + + msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) + handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, logrus.New()) + go func() { + if err := handler.Start(ctx); err != nil { + t.Errorf("Failed to start handler with error: %v", err) + } + }() + + waitForHandlerToStart(t, healthEndpoint) + + body, headers := testingutils.StructuredCloudEventPayload, testingutils.GetStructuredMessageHeaders() + resp, err := testingutils.SendEvent(publishEndpoint, body, headers) + if err != nil { + t.Errorf("Failed to send event with error: %v", err) + } + _ = resp.Body.Close() + if http.StatusInternalServerError != resp.StatusCode { + t.Errorf("Test failed, want status code:%d but got:%d", http.StatusInternalServerError, resp.StatusCode) + } +} + +func waitForHandlerToStart(t *testing.T, healthEndpoint string) { + timeout := time.After(time.Second * 30) + tick := time.Tick(time.Second * 1) + + for { + select { + case <-timeout: + { + t.Fatal("Failed to start handler") + } + case <-tick: + { + if resp, err := http.Get(healthEndpoint); err != nil { + continue + } else if resp.StatusCode == http.StatusOK { + return + } + } + } + } +} diff --git a/pkg/health/probes.go b/pkg/health/probes.go new file mode 100644 index 0000000..83b3db9 --- /dev/null +++ b/pkg/health/probes.go @@ -0,0 +1,26 @@ +package health + +import ( + "net/http" +) + +const ( + livenessURI = "/healthz" + readinessURI = "/readyz" +) + +// CheckHealth does the health checks for the readiness and liveness probes, otherwise it will let the next +// handler take care of the incoming HTTP requests. +func CheckHealth(next http.Handler) http.Handler { + return http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + if request.RequestURI == livenessURI { + writer.WriteHeader(http.StatusOK) + return + } + if request.RequestURI == readinessURI { + writer.WriteHeader(http.StatusOK) + return + } + next.ServeHTTP(writer, request) + }) +} diff --git a/pkg/health/probes_test.go b/pkg/health/probes_test.go new file mode 100644 index 0000000..d148c17 --- /dev/null +++ b/pkg/health/probes_test.go @@ -0,0 +1,49 @@ +package health + +import ( + "net/http" + "net/http/httptest" + "testing" +) + +func TestCheckHealthSuccess(t *testing.T) { + writer := httptest.NewRecorder() + checkHealthHandler := CheckHealth(failHandler(http.StatusInternalServerError)) + + requestLiveness := httptest.NewRequest(http.MethodGet, livenessURI, nil) + checkHealthHandler.ServeHTTP(writer, requestLiveness) + if got := writer.Result().StatusCode; got != http.StatusOK { + t.Errorf("Handler must respond with status code %d to %s requests to path: '%s' but got code %d", + http.StatusOK, http.MethodGet, livenessURI, got) + } + + requestReadiness := httptest.NewRequest(http.MethodGet, readinessURI, nil) + checkHealthHandler.ServeHTTP(writer, requestReadiness) + if got := writer.Result().StatusCode; got != http.StatusOK { + t.Errorf("Handler must respond with status code %d to %s requests to path: '%s' but got code %d", + http.StatusOK, http.MethodGet, readinessURI, got) + } +} + +func TestCheckHealthFail(t *testing.T) { + const ( + endpoint = "/someEndpoint" + statusCode = http.StatusInternalServerError + ) + + writer := httptest.NewRecorder() + checkHealthHandler := CheckHealth(failHandler(statusCode)) + + requestLiveness := httptest.NewRequest(http.MethodGet, endpoint, nil) + checkHealthHandler.ServeHTTP(writer, requestLiveness) + if got := writer.Result().StatusCode; got != statusCode { + t.Errorf("Handler must respond with status code %d to %s requests to path: '%s' but got code %d", + statusCode, http.MethodGet, endpoint, got) + } +} + +func failHandler(statusCode int) http.Handler { + return http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { + writer.WriteHeader(statusCode) + }) +} diff --git a/pkg/oauth/client.go b/pkg/oauth/client.go new file mode 100644 index 0000000..ceba289 --- /dev/null +++ b/pkg/oauth/client.go @@ -0,0 +1,32 @@ +package oauth + +import ( + "context" + "net/http" + + "go.opencensus.io/plugin/ochttp" + "golang.org/x/oauth2" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing/propagation/tracecontextb3" +) + +// NewClient returns a new HTTP client which have nested transports for handling oauth2 security, HTTP connection pooling, and tracing. +func NewClient(ctx context.Context, cfg *env.Config) *http.Client { + // configure auth client + config := Config(cfg) + client := config.Client(ctx) + + // configure connection transport + var base = http.DefaultTransport.(*http.Transport).Clone() + cfg.ConfigureTransport(base) + client.Transport.(*oauth2.Transport).Base = base + + // configure tracing transport + client.Transport = &ochttp.Transport{ + Base: client.Transport, + Propagation: tracecontextb3.TraceContextEgress, + } + + return client +} diff --git a/pkg/oauth/client_test.go b/pkg/oauth/client_test.go new file mode 100644 index 0000000..b22c921 --- /dev/null +++ b/pkg/oauth/client_test.go @@ -0,0 +1,116 @@ +package oauth + +import ( + "context" + "fmt" + "net/http" + "testing" + "time" + + "go.opencensus.io/plugin/ochttp" + "golang.org/x/oauth2" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" +) + +func TestNewClient(t *testing.T) { + t.Parallel() + + const ( + maxIdleConns = 100 + maxIdleConnsPerHost = 200 + ) + + client := NewClient(context.Background(), &env.Config{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) + defer client.CloseIdleConnections() + + ocTransport, ok := client.Transport.(*ochttp.Transport) + if !ok { + t.Errorf("Failed to convert to OpenCensus transport") + } + + secTransport, ok := ocTransport.Base.(*oauth2.Transport) + if !ok { + t.Errorf("Failed to convert to oauth2 transport") + } + + httpTransport, ok := secTransport.Base.(*http.Transport) + if !ok { + t.Errorf("Failed to convert to HTTP transport") + } + + if httpTransport.MaxIdleConns != maxIdleConns { + t.Errorf("HTTP Client Transport MaxIdleConns is misconfigured want: %d but got: %d", maxIdleConns, httpTransport.MaxIdleConns) + } + if httpTransport.MaxIdleConnsPerHost != maxIdleConnsPerHost { + t.Errorf("HTTP Client Transport MaxIdleConnsPerHost is misconfigured want: %d but got: %d", maxIdleConnsPerHost, httpTransport.MaxIdleConnsPerHost) + } +} + +func TestGetToken(t *testing.T) { + t.Parallel() + + const ( + tokenEndpoint = "/token" + eventsEndpoint = "/events" + ) + + testCases := []struct { + name string + delay time.Duration + requestsCount int + givenExpiresInSec int + wantGeneratedTokensCount int + }{ + { + name: "Token expires every 60 seconds", + delay: time.Millisecond, + requestsCount: 50, + givenExpiresInSec: 60, + wantGeneratedTokensCount: 1, + }, + { + name: "Token expires every second", + delay: time.Second + time.Millisecond, + requestsCount: 5, + givenExpiresInSec: 1, + wantGeneratedTokensCount: 5, + }, + } + + for _, test := range testCases { + t.Run(test.name, func(t *testing.T) { + t.Parallel() + + mockServer := testingutils.NewMockServer(testingutils.WithExpiresIn(test.givenExpiresInSec)) + mockServer.Start(t, tokenEndpoint, eventsEndpoint) + defer mockServer.Close() + + emsCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) + authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) + cfg := testingutils.NewEnvConfig(emsCEURL, authURL) + client := NewClient(context.Background(), cfg) + defer client.CloseIdleConnections() + + for i := 0; i < test.requestsCount; i++ { + req, err := http.NewRequest(http.MethodPost, emsCEURL, nil) + if err != nil { + t.Errorf("Failed to create HTTP request with error: %v", err) + } + + resp, err := client.Do(req) + if err != nil { + t.Errorf("Failed to post HTTP request with error: %v", err) + } + _ = resp.Body.Close() + + time.Sleep(test.delay) + } + + if got := mockServer.GeneratedTokensCount(); got != test.wantGeneratedTokensCount { + t.Fatalf("Tokens count does not match, want: %d but got: %d", test.wantGeneratedTokensCount, got) + } + }) + } +} diff --git a/pkg/oauth/config.go b/pkg/oauth/config.go new file mode 100644 index 0000000..4d2b1bc --- /dev/null +++ b/pkg/oauth/config.go @@ -0,0 +1,16 @@ +package oauth + +import ( + "golang.org/x/oauth2/clientcredentials" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" +) + +// Config returns a new oauth2 client credentials config instance. +func Config(cfg *env.Config) clientcredentials.Config { + return clientcredentials.Config{ + ClientID: cfg.ClientID, + ClientSecret: cfg.ClientSecret, + TokenURL: cfg.TokenEndpoint, + } +} diff --git a/pkg/oauth/config_test.go b/pkg/oauth/config_test.go new file mode 100644 index 0000000..f0eef2d --- /dev/null +++ b/pkg/oauth/config_test.go @@ -0,0 +1,24 @@ +package oauth + +import ( + "testing" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" +) + +func TestConfig(t *testing.T) { + t.Parallel() + + cfg := &env.Config{ClientID: "someID", ClientSecret: "someSecret", TokenEndpoint: "someEndpoint"} + conf := Config(cfg) + + if cfg.ClientID != conf.ClientID { + t.Errorf("Client IDs do not match want:%s but got:%s", cfg.ClientID, conf.ClientID) + } + if cfg.ClientSecret != conf.ClientSecret { + t.Errorf("Client secrets do not match want:%s but got:%s", cfg.ClientSecret, conf.ClientSecret) + } + if cfg.TokenEndpoint != conf.TokenURL { + t.Errorf("Token URLs do not match want:%s but got:%s", cfg.TokenEndpoint, conf.TokenURL) + } +} diff --git a/pkg/receiver/receiver.go b/pkg/receiver/receiver.go new file mode 100644 index 0000000..4472510 --- /dev/null +++ b/pkg/receiver/receiver.go @@ -0,0 +1,66 @@ +package receiver + +import ( + "context" + "fmt" + "net" + "net/http" + "time" + + "go.opencensus.io/plugin/ochttp" +) + +const ( + // defaultShutdownTimeout is the default timeout for the receiver to shutdown. + defaultShutdownTimeout = time.Minute * 1 +) + +// HttpMessageReceiver is responsible for receiving messages over HTTP. +type HttpMessageReceiver struct { + port int + handler http.Handler + server *http.Server + listener net.Listener +} + +// NewHttpMessageReceiver returns a new NewHttpMessageReceiver instance with the given port. +func NewHttpMessageReceiver(port int) *HttpMessageReceiver { + return &HttpMessageReceiver{port: port} +} + +// StartListen starts the HTTP message receiver and blocks until it receives a shutdown signal. +func (recv *HttpMessageReceiver) StartListen(ctx context.Context, handler http.Handler) error { + var err error + if recv.listener, err = net.Listen("tcp", fmt.Sprintf(":%d", recv.port)); err != nil { + return err + } + + recv.handler = createHandler(handler) + + recv.server = &http.Server{ + Addr: recv.listener.Addr().String(), + Handler: recv.handler, + } + + errChan := make(chan error, 1) + go func() { + errChan <- recv.server.Serve(recv.listener) + }() + + // wait for the server to return or ctx.Done(). + select { + case <-ctx.Done(): + ctx, cancel := context.WithTimeout(context.Background(), defaultShutdownTimeout) + defer cancel() + err := recv.server.Shutdown(ctx) + <-errChan // Wait for server goroutine to exit + return err + case err := <-errChan: + return err + } +} + +// createHandler returns a new opentracing HTTP handler wrapper for the given HTTP handler. +func createHandler(handler http.Handler) http.Handler { + return &ochttp.Handler{Handler: handler} +} diff --git a/pkg/receiver/receiver_test.go b/pkg/receiver/receiver_test.go new file mode 100644 index 0000000..22c2b6f --- /dev/null +++ b/pkg/receiver/receiver_test.go @@ -0,0 +1,73 @@ +package receiver + +import ( + "context" + "net/http" + "sync" + "testing" + "time" +) + +// a mocked http.Handler +type testHandler struct{} + +func (h *testHandler) ServeHTTP(http.ResponseWriter, *http.Request) {} + +var _ http.Handler = (*testHandler)(nil) + +func TestNewHttpMessageReceiver(t *testing.T) { + port := 9091 + r := NewHttpMessageReceiver(port) + if r == nil { + t.Fatalf("Could not create HttpMessageReceiver") + } + if r.port != port { + t.Errorf("Port should be: %d is: %d", port, r.port) + } +} + +// Test that tht receiver shuts down properly then receiving stop signal +func TestStartListener(t *testing.T) { + timeout := time.Second * 10 + r := fixtureReceiver() + + ctx := context.Background() + // used to simulate sending a stop signal + ctx, cancelFunc := context.WithCancel(ctx) + + // start receiver + wg := sync.WaitGroup{} + go func() { + wg.Add(1) + t.Log("starting receiver in goroutine") + if err := r.StartListen(ctx, &testHandler{}); err != nil { + t.Fatalf("error while starting HTTPMessageReceiver: %v", err) + } + t.Log("receiver goroutine ends here") + wg.Done() + }() + + // stop it + cancelFunc() + c := make(chan struct{}) + go func() { + defer close(c) + wg.Wait() + }() + + // wait for it + t.Log("Waiting for receiver to stop") + select { + // receiver dit shut down properly + case <-c: + t.Log("Waiting for receiver to stop [done]") + break + // receiver dit shut down in time + case <-time.Tick(timeout): + t.Fatalf("Expected receiver to shutdown after timeout: %v\n", timeout) + } +} + +func fixtureReceiver() *HttpMessageReceiver { + return NewHttpMessageReceiver(9091) +} diff --git a/pkg/sender/sender.go b/pkg/sender/sender.go new file mode 100644 index 0000000..3dd9e45 --- /dev/null +++ b/pkg/sender/sender.go @@ -0,0 +1,27 @@ +package sender + +import ( + "context" + "net/http" +) + +// HttpMessageSender is responsible for sending messages over HTTP. +type HttpMessageSender struct { + Client *http.Client + Target string +} + +// NewHttpMessageSender returns a new HttpMessageSender instance with the given target and client. +func NewHttpMessageSender(target string, client *http.Client) *HttpMessageSender { + return &HttpMessageSender{Client: client, Target: target} +} + +// NewRequestWithTarget returns a new HTTP POST request with the given context and target. +func (s *HttpMessageSender) NewRequestWithTarget(ctx context.Context, target string) (*http.Request, error) { + return http.NewRequestWithContext(ctx, http.MethodPost, target, nil) +} + +// Send sends the given HTTP request and returns the HTTP response back. +func (s *HttpMessageSender) Send(req *http.Request) (*http.Response, error) { + return s.Client.Do(req) +} diff --git a/pkg/sender/sender_test.go b/pkg/sender/sender_test.go new file mode 100644 index 0000000..3c41bb8 --- /dev/null +++ b/pkg/sender/sender_test.go @@ -0,0 +1,106 @@ +package sender + +import ( + "context" + "fmt" + "net/http" + "testing" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" +) + +const ( + // mock server endpoints + tokenEndpoint = "/token" + eventsEndpoint = "/events" + + // connection settings + maxIdleConns = 100 + maxIdleConnsPerHost = 200 +) + +func TestNewHttpMessageSender(t *testing.T) { + t.Parallel() + + client := oauth.NewClient(context.Background(), &env.Config{}) + defer client.CloseIdleConnections() + + msgSender := NewHttpMessageSender(eventsEndpoint, client) + if msgSender.Target != eventsEndpoint { + t.Errorf("Message sender target is misconfigured want: %s but got: %s", eventsEndpoint, msgSender.Target) + } + if msgSender.Client != client { + t.Errorf("Message sender client is misconfigured want: %#v but got: %#v", client, msgSender.Client) + } +} + +func TestNewRequestWithTarget(t *testing.T) { + t.Parallel() + + client := oauth.NewClient(context.Background(), &env.Config{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) + defer client.CloseIdleConnections() + + msgSender := NewHttpMessageSender(eventsEndpoint, client) + + const ctxKey, ctxValue = "testKey", "testValue" + ctx := context.WithValue(context.Background(), ctxKey, ctxValue) + req, err := msgSender.NewRequestWithTarget(ctx, eventsEndpoint) + if err != nil { + t.Errorf("Failed to create a CloudEvent HTTP request with error: %v", err) + } + if req == nil { + t.Error("Failed to create a CloudEvent HTTP request want new request but got nil") + } + if req.Method != http.MethodPost { + t.Errorf("HTTP request has invalid method want: %s but got: %s", http.MethodPost, req.Method) + } + if req.URL.Path != eventsEndpoint { + t.Errorf("HTTP request has invalid target want: %s but got: %s", eventsEndpoint, req.URL.Path) + } + if len(req.Header) > 0 { + t.Error("HTTP request should be created with empty headers") + } + if req.Close != false { + t.Errorf("HTTP request close is invalid want: %v but got: %v", false, req.Close) + } + if req.Body != nil { + t.Error("HTTP request should be created with empty body") + } + if req.Context() != ctx { + t.Errorf("HTTP request context does not match original context want: %#v, but got %#v", ctx, req.Context()) + } + if got := req.Context().Value(ctxKey); got != ctxValue { + t.Errorf("HTTP request context key:value do not match mant: %v:%v but got %v:%v", ctxKey, ctxValue, ctxKey, got) + } +} + +func TestSend(t *testing.T) { + mockServer := testingutils.NewMockServer() + mockServer.Start(t, tokenEndpoint, eventsEndpoint) + defer mockServer.Close() + + ctx := context.Background() + emsCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) + authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) + cfg := testingutils.NewEnvConfig(emsCEURL, authURL, testingutils.WithMaxIdleConns(maxIdleConns), testingutils.WithMaxIdleConnsPerHost(maxIdleConnsPerHost)) + client := oauth.NewClient(ctx, cfg) + defer client.CloseIdleConnections() + + msgSender := NewHttpMessageSender(emsCEURL, client) + + request, err := msgSender.NewRequestWithTarget(ctx, msgSender.Target) + if err != nil { + t.Errorf("Failed to create a CloudEvent HTTP request with error: %v", err) + } + + resp, err := msgSender.Send(request) + defer func() { _ = resp.Body.Close() }() + if err != nil { + t.Errorf("Failed to send request with error: %v", err) + } + if resp.StatusCode > http.StatusNoContent { + t.Errorf("HTTP response has invalid HTTP status code want: %d but got: %d", http.StatusNoContent, resp.StatusCode) + } +} diff --git a/pkg/signals/signals.go b/pkg/signals/signals.go new file mode 100644 index 0000000..4adccc1 --- /dev/null +++ b/pkg/signals/signals.go @@ -0,0 +1,75 @@ +package signals + +import ( + "context" + "errors" + "os" + "os/signal" + "syscall" + "time" +) + +var ( + // onlyOneSignalHandler to make sure that only one signal handler is registered. + onlyOneSignalHandler = make(chan struct{}) + + // shutdownSignals array of system signals to cause shutdown. + shutdownSignals = []os.Signal{os.Interrupt, syscall.SIGTERM} +) + +// SetupSignalHandler registered for SIGTERM and SIGINT. A stop channel is returned +// which is closed on one of these signals. If a second signal is caught, the program +// is terminated with exit code 1. +func SetupSignalHandler() (stopCh <-chan struct{}) { + close(onlyOneSignalHandler) // panics when called twice + + stop := make(chan struct{}) + osSignal := make(chan os.Signal, 2) + signal.Notify(osSignal, shutdownSignals...) + go func() { + <-osSignal + close(stop) + <-osSignal + os.Exit(1) // second signal. Exit directly. + }() + + return stop +} + +// signalContext represents a signal context. +type signalContext struct { + stopCh <-chan struct{} +} + +// NewContext creates a new context with SetupSignalHandler() +// as our Done() channel. +func NewContext() context.Context { + return &signalContext{stopCh: SetupSignalHandler()} +} + +// Deadline implements context.Context. +func (scc *signalContext) Deadline() (deadline time.Time, ok bool) { + return +} + +// Done implements context.Context. +func (scc *signalContext) Done() <-chan struct{} { + return scc.stopCh +} + +// Err implements context.Context. +func (scc *signalContext) Err() error { + select { + case _, ok := <-scc.Done(): + if !ok { + return errors.New("received a termination signal") + } + default: + } + return nil +} + +// Value implements context.Context. +func (scc *signalContext) Value(interface{}) interface{} { + return nil +} diff --git a/pkg/tracing/propagation/http_format_sequence.go b/pkg/tracing/propagation/http_format_sequence.go new file mode 100644 index 0000000..579bb5d --- /dev/null +++ b/pkg/tracing/propagation/http_format_sequence.go @@ -0,0 +1,37 @@ +package propagation + +import ( + "net/http" + + "go.opencensus.io/trace" + "go.opencensus.io/trace/propagation" +) + +// HTTPFormatSequence is a propagation.HTTPFormat that applies multiple other propagation formats. +// For incoming requests, it will use the first SpanContext it can find, checked in the order of +// HTTPFormatSequence.Ingress. +// For outgoing requests, it will apply all the formats to the outgoing request, in the order of +// HTTPFormatSequence.Egress. +type HTTPFormatSequence struct { + Ingress []propagation.HTTPFormat + Egress []propagation.HTTPFormat +} + +var _ propagation.HTTPFormat = (*HTTPFormatSequence)(nil) + +// SpanContextFromRequest satisfies the propagation.HTTPFormat interface. +func (h *HTTPFormatSequence) SpanContextFromRequest(req *http.Request) (trace.SpanContext, bool) { + for _, format := range h.Ingress { + if sc, ok := format.SpanContextFromRequest(req); ok { + return sc, true + } + } + return trace.SpanContext{}, false +} + +// SpanContextToRequest satisfies the propagation.HTTPFormat interface. +func (h *HTTPFormatSequence) SpanContextToRequest(sc trace.SpanContext, req *http.Request) { + for _, format := range h.Egress { + format.SpanContextToRequest(sc, req) + } +} diff --git a/pkg/tracing/propagation/tracecontextb3/http_format.go b/pkg/tracing/propagation/tracecontextb3/http_format.go new file mode 100644 index 0000000..bffcdab --- /dev/null +++ b/pkg/tracing/propagation/tracecontextb3/http_format.go @@ -0,0 +1,21 @@ +package tracecontextb3 + +import ( + "go.opencensus.io/plugin/ochttp/propagation/b3" + "go.opencensus.io/plugin/ochttp/propagation/tracecontext" + ocpropagation "go.opencensus.io/trace/propagation" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing/propagation" +) + +// TraceContextEgress is a propagation.HTTPFormat that reads both TraceContext and B3 tracing +// formats, preferring TraceContext. It always writes TraceContext format exclusively. +var TraceContextEgress = &propagation.HTTPFormatSequence{ + Ingress: []ocpropagation.HTTPFormat{ + &tracecontext.HTTPFormat{}, + &b3.HTTPFormat{}, + }, + Egress: []ocpropagation.HTTPFormat{ + &tracecontext.HTTPFormat{}, + }, +} diff --git a/testing/env_config.go b/testing/env_config.go new file mode 100644 index 0000000..0547efa --- /dev/null +++ b/testing/env_config.go @@ -0,0 +1,41 @@ +package testing + +import ( + "time" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" +) + +func NewEnvConfig(emsCEURL, authURL string, opts ...EnvConfigOption) *env.Config { + envConfig := &env.Config{Port: 8080, EmsPublishURL: emsCEURL, TokenEndpoint: authURL, RequestTimeout: time.Minute} + for _, opt := range opts { + opt(envConfig) + } + return envConfig +} + +type EnvConfigOption func(e *env.Config) + +func WithPort(port int) EnvConfigOption { + return func(e *env.Config) { + e.Port = port + } +} + +func WithMaxIdleConns(maxIdleConns int) EnvConfigOption { + return func(e *env.Config) { + e.MaxIdleConns = maxIdleConns + } +} + +func WithMaxIdleConnsPerHost(maxIdleConnsPerHost int) EnvConfigOption { + return func(e *env.Config) { + e.MaxIdleConnsPerHost = maxIdleConnsPerHost + } +} + +func WithRequestTimeout(requestTimeout time.Duration) EnvConfigOption { + return func(e *env.Config) { + e.RequestTimeout = requestTimeout + } +} diff --git a/testing/fixtures.go b/testing/fixtures.go new file mode 100644 index 0000000..66611e0 --- /dev/null +++ b/testing/fixtures.go @@ -0,0 +1,46 @@ +package testing + +const ( + StructuredCloudEventPayloadWithoutID = `{ + "type":"someType", + "specversion":"1.0", + "source":"someSource", + "data":"{\"foo\":\"bar\"}", + "datacontenttype":"application/json" + }` + + StructuredCloudEventPayloadWithoutType = `{ + "id":"00000", + "specversion":"1.0", + "source":"someSource", + "data":"{\"foo\":\"bar\"}", + "datacontenttype":"application/json" + }` + + StructuredCloudEventPayloadWithoutSpecVersion = `{ + "id":"00000", + "type":"someType", + "source":"someSource", + "data":"{\"foo\":\"bar\"}", + "datacontenttype":"application/json" + }` + + StructuredCloudEventPayloadWithoutSource = `{ + "id":"00000", + "type":"someType", + "specversion":"1.0", + "data":"{\"foo\":\"bar\"}", + "datacontenttype":"application/json" + }` + + StructuredCloudEventPayload = `{ + "id":"00000", + "type":"someType", + "specversion":"1.0", + "source":"someSource", + "data":"{\"foo\":\"bar\"}", + "datacontenttype":"application/json" + }` + + BinaryCloudEventPayload = `"{\"foo\":\"bar\"}"` +) diff --git a/testing/mock_server.go b/testing/mock_server.go new file mode 100644 index 0000000..169e104 --- /dev/null +++ b/testing/mock_server.go @@ -0,0 +1,75 @@ +package testing + +import ( + "fmt" + "net/http" + "net/http/httptest" + "testing" + "time" +) + +type MockServer struct { + server *httptest.Server + responseTime time.Duration // server response time + expiresInSec int // token expiry in seconds + generatedTokensCount int // generated tokens count +} + +func NewMockServer(opts ...MockServerOption) *MockServer { + mockServer := &MockServer{expiresInSec: 0, generatedTokensCount: 0, responseTime: 0} + for _, opt := range opts { + opt(mockServer) + } + return mockServer +} + +type MockServerOption func(m *MockServer) + +func WithExpiresIn(expiresIn int) MockServerOption { + return func(m *MockServer) { + m.expiresInSec = expiresIn + } +} + +func WithResponseTime(responseTime time.Duration) MockServerOption { + return func(m *MockServer) { + m.responseTime = responseTime + } +} + +func (m *MockServer) Start(t *testing.T, tokenEndpoint, eventsEndpoint string) { + m.server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + time.Sleep(m.responseTime) + + switch r.URL.String() { + case tokenEndpoint: + { + m.generatedTokensCount++ + token := fmt.Sprintf("access_token=token-%d&token_type=bearer&expires_in=%d", time.Now().UnixNano(), m.expiresInSec) + if _, err := w.Write([]byte(token)); err != nil { + t.Errorf("Failed to write HTTP response") + } + } + case eventsEndpoint: + { + w.WriteHeader(http.StatusNoContent) + } + default: + { + t.Errorf("Mock server supports the following endpoints only: [%s]", tokenEndpoint) + } + } + })) +} + +func (m *MockServer) URL() string { + return m.server.URL +} + +func (m *MockServer) GeneratedTokensCount() int { + return m.generatedTokensCount +} + +func (m *MockServer) Close() { + m.server.Close() +} diff --git a/testing/utils.go b/testing/utils.go new file mode 100644 index 0000000..6158c94 --- /dev/null +++ b/testing/utils.go @@ -0,0 +1,51 @@ +package testing + +import ( + "bytes" + "net/http" +) + +const ( + // binary cloudevent headers + CeIDHeader = "CE-ID" + CeTypeHeader = "CE-Type" + CeSourceHeader = "CE-Source" + CeSpecVersionHeader = "CE-SpecVersion" + + // cloudevent attributes + CeID = "00000" + CeType = "someType" + CeSource = "someSource" + CeSpecVersion = "1.0" +) + +func SendEvent(endpoint, body string, headers http.Header) (*http.Response, error) { + req, err := http.NewRequest(http.MethodPost, endpoint, bytes.NewBuffer([]byte(body))) + if err != nil { + return nil, err + } + + if headers != nil { + for k, v := range headers { + req.Header[k] = v + } + } + + client := http.Client{} + defer client.CloseIdleConnections() + + return client.Do(req) +} + +func GetStructuredMessageHeaders() http.Header { + return http.Header{"Content-Type": []string{"application/cloudevents+json"}} +} + +func GetBinaryMessageHeaders() http.Header { + headers := make(http.Header) + headers.Add(CeIDHeader, CeID) + headers.Add(CeTypeHeader, CeType) + headers.Add(CeSourceHeader, CeSource) + headers.Add(CeSpecVersionHeader, CeSpecVersion) + return headers +} From 8373ee972f6f988685456eb89e897646046464f4 Mon Sep 17 00:00:00 2001 From: Sayan Hazra Date: Tue, 22 Sep 2020 10:37:53 +0200 Subject: [PATCH 002/194] Fix Dockerfile (#9499) --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 643c24b..be25ac2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,8 @@ ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher WORKDIR $DOCK_PKG_DIR COPY . $DOCK_PKG_DIR -RUN GOOS=linux GO111MODULE=on go mod vendor &&\ - go build -o event-publisher-proxy ./cmd/event-publisher-proxy +RUN GOOS=linux GO111MODULE=on go mod vendor && \ + CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -o event-publisher-proxy ./cmd/event-publisher-proxy FROM scratch LABEL source = git@github.com:kyma-project/kyma.git From b4585d774241b2c2a002f97cdf8e808ee643b48c Mon Sep 17 00:00:00 2001 From: Sayan Hazra Date: Tue, 22 Sep 2020 13:52:46 +0200 Subject: [PATCH 003/194] Copy certs from builder (#9504) --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index be25ac2..51fb3c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,8 @@ FROM scratch LABEL source = git@github.com:kyma-project/kyma.git COPY --from=builder /go/src/github.com/kyma-project/kyma/components/event-publisher-proxy/event-publisher-proxy . +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ + COPY licenses/ /licenses/ ENTRYPOINT ["/event-publisher-proxy"] From 162a74d85a7a37fb96e49b601f21b42a28a27a7b Mon Sep 17 00:00:00 2001 From: Nils Seip Date: Thu, 24 Sep 2020 16:33:02 +0200 Subject: [PATCH 004/194] Helm Chart for event-publisher-proxy (#9505) --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 7a89485..7c3c3bf 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,26 @@ $ make test-local $ ko apply -f config/ ``` +### Send Events + +```bash +curl -v -X POST \ + -H "Content-Type: application/cloudevents+json" \ + --data @<(</publish +``` + ## Environment Variables | Environment Variable | Default Value | Description | From 0321f28eb4565b7078e8aff810fe13363b96bfb3 Mon Sep 17 00:00:00 2001 From: Sayan Hazra Date: Wed, 11 Nov 2020 19:54:07 +0100 Subject: [PATCH 005/194] Use non root in Dockerfile (#9905) * Use non root in Dockerfile * Fix workdir * Removing user as it is non-root already --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 51fb3c5..3a230aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,11 +8,11 @@ COPY . $DOCK_PKG_DIR RUN GOOS=linux GO111MODULE=on go mod vendor && \ CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -o event-publisher-proxy ./cmd/event-publisher-proxy -FROM scratch +FROM gcr.io/distroless/static:nonroot LABEL source = git@github.com:kyma-project/kyma.git +WORKDIR / COPY --from=builder /go/src/github.com/kyma-project/kyma/components/event-publisher-proxy/event-publisher-proxy . -COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY licenses/ /licenses/ From e58a6ae8cec5e5ebcb10260a93418e14c23e0ed1 Mon Sep 17 00:00:00 2001 From: Sayan Hazra Date: Mon, 23 Nov 2020 10:42:32 +0100 Subject: [PATCH 006/194] =?UTF-8?q?Migrate=20/:app/v1/events=20endpoint?= =?UTF-8?q?=C2=A0from=20event-service=20(#9958)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 27 +- cmd/event-publisher-proxy/main.go | 11 +- go.mod | 1 + pkg/env/config.go | 5 + pkg/handler/handler.go | 88 ++++- pkg/handler/handler_test.go | 555 +++++++++++++++++++++++++++++- pkg/legacy-events/api/types.go | 49 +++ pkg/legacy-events/constants.go | 39 +++ pkg/legacy-events/helpers.go | 72 ++++ pkg/legacy-events/legacy.go | 212 ++++++++++++ pkg/legacy-events/legacy_test.go | 123 +++++++ pkg/oauth/client_test.go | 7 +- pkg/options/options.go | 16 + pkg/receiver/receiver.go | 1 - pkg/sender/sender_test.go | 7 +- testing/env_config.go | 12 + testing/fixtures.go | 72 ++++ testing/mock_server.go | 14 +- testing/utils.go | 8 + 19 files changed, 1283 insertions(+), 36 deletions(-) create mode 100644 pkg/legacy-events/api/types.go create mode 100644 pkg/legacy-events/constants.go create mode 100644 pkg/legacy-events/helpers.go create mode 100644 pkg/legacy-events/legacy.go create mode 100644 pkg/legacy-events/legacy_test.go create mode 100644 pkg/options/options.go diff --git a/README.md b/README.md index 7c3c3bf..3c48009 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Overview -The Event Publisher Proxy receives Cloud Event publishing requests from the cluster workloads (microservice or Serverless functions) and redirects them to the Enterprise Messaging Service Cloud Event Gateway. +The Event Publisher Proxy receives legacy and Cloud Event publishing requests from the cluster workloads (microservice or Serverless functions) and redirects them to the Enterprise Messaging Service Cloud Event Gateway. ## Prerequisites @@ -31,6 +31,7 @@ $ ko apply -f config/ ### Send Events +This command supports **cloud events**: ```bash curl -v -X POST \ -H "Content-Type: application/cloudevents+json" \ @@ -49,6 +50,22 @@ EOF http:///publish ``` +This command supports **legacy events**: +```bash +curl -v -X POST \ + -H "Content-Type: application/json" \ + --data @<(</application-name/v1/events +``` + ## Environment Variables | Environment Variable | Default Value | Description | @@ -61,3 +78,11 @@ EOF | CLIENT_SECRET | | The Client Secret used to acquire Access Tokens from the Authentication server. | | TOKEN_ENDPOINT | | The Authentication Server Endpoint to provide Access Tokens. | | EMS_PUBLISH_URL | | The Messaging Server Endpoint that accepts publishing CloudEvents to it. | +| BEB_NAMESPACE | | The name of the namespace in BEB. | +| EVENT_TYPE_PREFIX | | The prefix of the eventType as per the BEB event specification. | + + +## Flags +| Flag | Default Value | Description | +| ----------------------- | ------------- |---------------------------------------------------------------------------------------------- | +| maxRequestSize | 65536 | The maximum size of the request. | diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index b09523f..a280aca 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -2,6 +2,8 @@ package main import ( "github.com/kelseyhightower/envconfig" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/sirupsen/logrus" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" @@ -14,7 +16,7 @@ import ( func main() { logger := logrus.New() - + opts := options.ParseArgs() cfg := new(env.Config) if err := envconfig.Process("", cfg); err != nil { logger.Fatalf("Start handler failed with error: %s", err) @@ -33,8 +35,13 @@ func main() { // configure message sender messageSender := sender.NewHttpMessageSender(cfg.EmsPublishURL, client) + // configure legacyTransformer + legacyTransformer := legacy.NewTransformer( + cfg.BEBNamespace, + cfg.EventTypePrefix, + ) // start handler which blocks until it receives a shutdown signal - if err := handler.NewHandler(messageReceiver, messageSender, cfg.RequestTimeout, logger).Start(ctx); err != nil { + if err := handler.NewHandler(messageReceiver, messageSender, cfg.RequestTimeout, legacyTransformer, opts, logger).Start(ctx); err != nil { logger.Fatalf("Start handler failed with error: %s", err) } diff --git a/go.mod b/go.mod index 61ce984..c509fcb 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.15 require ( github.com/cloudevents/sdk-go/v2 v2.2.0 + github.com/google/uuid v1.1.1 github.com/kelseyhightower/envconfig v1.4.0 github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.6.0 diff --git a/pkg/env/config.go b/pkg/env/config.go index 8127792..494adf5 100644 --- a/pkg/env/config.go +++ b/pkg/env/config.go @@ -15,6 +15,11 @@ type Config struct { MaxIdleConns int `envconfig:"MAX_IDLE_CONNS" default:"100"` MaxIdleConnsPerHost int `envconfig:"MAX_IDLE_CONNS_PER_HOST" default:"2"` RequestTimeout time.Duration `envconfig:"REQUEST_TIMEOUT" default:"5s"` + // BEBNamespace is the name of the namespace in BEB which is used as the event source for legacy events + BEBNamespace string `envconfig:"BEB_NAMESPACE" required:"true"` + // EventTypePrefix is the prefix of each event as per the eventing specification + // It follows the eventType format: ... + EventTypePrefix string `envconfig:"EVENT_TYPE_PREFIX" default:""` } // ConfigureTransport receives an HTTP transport and configure its max idle connection properties. diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 908cb68..6c29e90 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -4,8 +4,12 @@ import ( "context" "io/ioutil" "net/http" + "strings" "time" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/sirupsen/logrus" "github.com/cloudevents/sdk-go/v2/binding" @@ -23,6 +27,9 @@ import ( const ( // noDuration signals that the dispatch step has not started yet. noDuration = -1 + + publishEndpoint = "/publish" + legacyEndpointSuffix = "/v1/events" ) var ( @@ -43,15 +50,26 @@ type Handler struct { Sender *sender.HttpMessageSender // Defaulter sets default values to incoming events Defaulter cev2client.EventDefaulter + // LegacyTransformer handles transformations needed to handle legacy events + LegacyTransformer *legacy.Transformer // RequestTimeout timeout for outgoing requests RequestTimeout time.Duration // Logger default logger Logger *logrus.Logger + // Options configures HTTP server + Options *options.Options } // NewHandler returns a new Handler instance for the Event Publisher Proxy. -func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.HttpMessageSender, requestTimeout time.Duration, logger *logrus.Logger) *Handler { - return &Handler{Receiver: receiver, Sender: sender, RequestTimeout: requestTimeout, Logger: logger} +func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.HttpMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, options *options.Options, logger *logrus.Logger) *Handler { + return &Handler{ + Receiver: receiver, + Sender: sender, + RequestTimeout: requestTimeout, + LegacyTransformer: legacyTransformer, + Logger: logger, + Options: options, + } } // Start starts the Handler with the given context. @@ -69,13 +87,65 @@ func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { h.writeResponse(writer, http.StatusMethodNotAllowed, nil) return } + // Limit server from reading a huge payload + request.Body = http.MaxBytesReader(writer, request.Body, h.Options.MaxRequestSize) + uri := request.RequestURI + + // Process /publish endpoint + // Gets a CE and sends it to BEB + if isARequestWithCE(uri) { + h.publishCloudEvents(writer, request) + return + } + + // Process /:application/v1/events + // Publishes a legacy event as CE v1.0 to BEB + if isARequestWithLegacyEvent(uri) { + h.publishLegacyEventsAsCE(writer, request) + return + } + + h.writeResponse(writer, http.StatusNotFound, nil) + return +} + +func isARequestWithCE(uri string) bool { + return uri == publishEndpoint +} +func isARequestWithLegacyEvent(uri string) bool { + // Assuming the path should be of the form /:application/v1/events + uriPathSegments := make([]string, 0) + + for _, segment := range strings.Split(uri, "/") { + if strings.TrimSpace(segment) != "" { + uriPathSegments = append(uriPathSegments, segment) + } + } + if len(uriPathSegments) != 3 { + return false + } + if !strings.HasSuffix(uri, legacyEndpointSuffix) { + return false + } + return true +} - // validate request URI - if request.RequestURI != "/publish" { - h.writeResponse(writer, http.StatusNotFound, nil) +func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { + event := h.LegacyTransformer.TransformsLegacyRequestsToCE(writer, request) + if event == nil { + h.Logger.Debug("failed to transform legacy event to CE, event is nil") return } + ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) + defer cancel() + h.receive(ctx, event) + statusCode, dispatchTime, respBody := h.send(ctx, event) + // Change response as per old error codes + h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, statusCode, event, string(respBody)) + h.Logger.Infof("Event dispatched id:[%s] statusCode:[%d] duration:[%s] responseBody:[%s]", event.ID(), statusCode, dispatchTime, respBody) +} +func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.Request) { ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) defer cancel() @@ -128,7 +198,7 @@ func (h *Handler) receive(ctx context.Context, event *cev2event.Event) { func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.Duration, []byte) { request, err := h.Sender.NewRequestWithTarget(ctx, h.Sender.Target) if err != nil { - h.Logger.Errorf("Failed to prepare a cloudevent request with error: %s", err) + h.Logger.Errorf("failed to prepare a cloudevent request with error: %s", err) return http.StatusInternalServerError, noDuration, []byte{} } @@ -137,20 +207,20 @@ func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.D err = cloudevents.WriteRequestWithHeaders(ctx, message, request, additionalHeaders) if err != nil { - h.Logger.Errorf("Failed to add additional headers to the request with error: %s", err) + h.Logger.Errorf("failed to add additional headers to the request with error: %s", err) return http.StatusInternalServerError, noDuration, []byte{} } resp, dispatchTime, err := h.sendAndRecordDispatchTime(request) if err != nil { - h.Logger.Errorf("Failed to send event and record dispatch time with error: %s", err) + h.Logger.Errorf("failed to send event and record dispatch time with error: %s", err) return http.StatusInternalServerError, dispatchTime, []byte{} } defer func() { _ = resp.Body.Close() }() body, err := ioutil.ReadAll(resp.Body) if err != nil { - h.Logger.Errorf("Failed to read response body with error: %s", err) + h.Logger.Errorf("failed to read response body with error: %s", err) return http.StatusInternalServerError, dispatchTime, []byte{} } diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index 4651815..13f96c2 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -2,14 +2,25 @@ package handler import ( "context" + "crypto/rand" + "encoding/json" "fmt" + "io" + "io/ioutil" "net/http" + "reflect" + "regexp" + "strconv" "testing" "time" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" "github.com/sirupsen/logrus" + legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" @@ -17,8 +28,9 @@ import ( const ( // mock server endpoints - tokenEndpoint = "/token" - eventsEndpoint = "/events" + tokenEndpoint = "/token" + eventsEndpoint = "/events" + eventsHTTP400Endpoint = "/events400" ) func TestHandler(t *testing.T) { @@ -111,14 +123,18 @@ func TestHandler(t *testing.T) { }, } + port, err := generatePort() + if err != nil { + t.Fatalf("failed to generate port: %v", err) + } + var ( - port = 8888 healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) ) mockServer := testingutils.NewMockServer() - mockServer.Start(t, tokenEndpoint, eventsEndpoint) + mockServer.Start(t, tokenEndpoint, eventsEndpoint, eventsHTTP400Endpoint) defer mockServer.Close() ctx, cancel := context.WithCancel(context.Background()) @@ -126,17 +142,23 @@ func TestHandler(t *testing.T) { emsCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) - cfg := testingutils.NewEnvConfig(emsCEURL, authURL, testingutils.WithPort(port)) + cfg := testingutils.NewEnvConfig( + emsCEURL, + authURL, + testingutils.WithPort(port), + ) client := oauth.NewClient(ctx, cfg) defer client.CloseIdleConnections() msgSender := sender.NewHttpMessageSender(emsCEURL, client) msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) - handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, logrus.New()) + legacyTransformer := legacy.NewTransformer("beb.ns", "event.type.prefix") + opts := &options.Options{MaxRequestSize: 65536} + handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, logrus.New()) go func() { if err := handler.Start(ctx); err != nil { - t.Errorf("Failed to start handler with error: %v", err) + t.Errorf("failed to start handler with error: %v", err) } }() @@ -147,7 +169,7 @@ func TestHandler(t *testing.T) { body, headers := testCase.provideMessage() resp, err := testingutils.SendEvent(publishEndpoint, body, headers) if err != nil { - t.Errorf("Failed to send event with error: %v", err) + t.Errorf("failed to send event with error: %v", err) } _ = resp.Body.Close() if testCase.wantStatusCode != resp.StatusCode { @@ -160,16 +182,18 @@ func TestHandler(t *testing.T) { func TestHandlerTimeout(t *testing.T) { t.Parallel() + port, err := generatePort() + if err != nil { + t.Fatalf("failed to generate port: %v", err) + } var ( - port = 9999 requestTimeout = time.Nanosecond // short request timeout serverResponseTime = time.Millisecond // long server response time healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) ) - mockServer := testingutils.NewMockServer(testingutils.WithResponseTime(serverResponseTime)) - mockServer.Start(t, tokenEndpoint, eventsEndpoint) + mockServer.Start(t, tokenEndpoint, eventsEndpoint, "") defer mockServer.Close() ctx, cancel := context.WithCancel(context.Background()) @@ -177,17 +201,24 @@ func TestHandlerTimeout(t *testing.T) { emsCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) - cfg := testingutils.NewEnvConfig(emsCEURL, authURL, testingutils.WithPort(port), testingutils.WithRequestTimeout(requestTimeout)) + cfg := testingutils.NewEnvConfig(emsCEURL, + authURL, + testingutils.WithPort(port), + testingutils.WithRequestTimeout(requestTimeout), + ) client := oauth.NewClient(ctx, cfg) defer client.CloseIdleConnections() msgSender := sender.NewHttpMessageSender(emsCEURL, client) msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) - handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, logrus.New()) + + legacyTransformer := legacy.NewTransformer("beb.ns", "event.type.prefix") + opts := &options.Options{MaxRequestSize: 65536} + handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, logrus.New()) go func() { if err := handler.Start(ctx); err != nil { - t.Errorf("Failed to start handler with error: %v", err) + t.Errorf("failed to start handler with error: %v", err) } }() @@ -225,3 +256,499 @@ func waitForHandlerToStart(t *testing.T, healthEndpoint string) { } } } + +func TestHandlerForLegacyEvents(t *testing.T) { + t.Parallel() + port, err := generatePort() + if err != nil { + t.Fatalf("failed to generate port: %v", err) + } + var ( + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/app/v1/events", port) + bebNs = "/beb.namespace" + eventTypePrefix = "event.type.prefix" + ) + testCases := []struct { + name string + targetEndpoint string + provideMessage func() (string, http.Header) + wantStatusCode int + wantResponse legacyapi.PublishEventResponses + }{ + { + name: "Send a legacy event successfully with event-id", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusOK, + wantResponse: legacyapi.PublishEventResponses{ + Ok: &legacyapi.PublishResponse{ + EventID: "8945ec08-256b-11eb-9928-acde48001122", + Status: "", + Reason: "", + }, + }, + }, + { + name: "Send a legacy event successfully without event-id", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithoutEventId, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusOK, + wantResponse: legacyapi.PublishEventResponses{ + Ok: &legacyapi.PublishResponse{ + EventID: "", + Status: "", + Reason: "", + }, + }, + }, + { + name: "Send a legacy event with invalid event id", + provideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithInvalidEventId, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: getInvalidValidationErrorFor("event-id"), + }, + }, + { + name: "Send a legacy event without event time", + provideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithoutEventTime, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: getMissingFieldValidationErrorFor("event-time"), + }, + }, + { + name: "Send a legacy event without event type", + provideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithoutEventType, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: getMissingFieldValidationErrorFor("event-type"), + }, + }, + { + name: "Send a legacy event with invalid event time", + provideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithInvalidEventTime, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: getInvalidValidationErrorFor("event-time"), + }, + }, + { + name: "Send a legacy event without event version", + provideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithWithoutEventVersion, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: getMissingFieldValidationErrorFor("event-type-version"), + }, + }, + { + name: "Send a legacy event without data field", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithoutData, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: getMissingFieldValidationErrorFor("data"), + }, + }, + } + + mockServer := testingutils.NewMockServer() + mockServer.Start(t, tokenEndpoint, eventsEndpoint, eventsHTTP400Endpoint) + defer mockServer.Close() + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + bebCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) + authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) + + cfg := testingutils.NewEnvConfig( + bebCEURL, + authURL, + testingutils.WithPort(port), + testingutils.WithBEBNamespace(bebNs), + testingutils.WithEventTypePrefix(eventTypePrefix), + ) + client := oauth.NewClient(ctx, cfg) + defer client.CloseIdleConnections() + + msgSender := sender.NewHttpMessageSender(bebCEURL, client) + msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) + legacyTransformer := legacy.NewTransformer(cfg.BEBNamespace, cfg.EventTypePrefix) + opts := &options.Options{MaxRequestSize: 65536} + handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, logrus.New()) + go func() { + if err := handler.Start(ctx); err != nil { + t.Errorf("failed to start handler with error: %v", err) + } + }() + + waitForHandlerToStart(t, healthEndpoint) + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + body, headers := testCase.provideMessage() + + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + if err != nil { + t.Errorf("Failed to send event with error: %v", err) + } + + if testCase.wantStatusCode != resp.StatusCode { + t.Errorf("Test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) + } + + if testCase.wantStatusCode == http.StatusOK { + validateOkResponse(t, *resp, &testCase.wantResponse) + } else { + validateErrorResponse(t, *resp, &testCase.wantResponse) + } + }) + } +} + +func TestHandlerForBEBFailures(t *testing.T) { + t.Parallel() + port, err := generatePort() + if err != nil { + t.Fatalf("failed to generate port: %v", err) + } + var ( + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/app/v1/events", port) + publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) + bebNs = "/beb.namespace" + eventTypePrefix = "event.type.prefix" + ) + mockServer := testingutils.NewMockServer() + mockServer.Start(t, tokenEndpoint, eventsEndpoint, eventsHTTP400Endpoint) + defer mockServer.Close() + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + beb400CEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsHTTP400Endpoint) + authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) + + cfg := testingutils.NewEnvConfig( + beb400CEURL, + authURL, + testingutils.WithPort(port), + testingutils.WithBEBNamespace(bebNs), + testingutils.WithEventTypePrefix(eventTypePrefix), + ) + client := oauth.NewClient(ctx, cfg) + defer client.CloseIdleConnections() + + msgSender := sender.NewHttpMessageSender(beb400CEURL, client) + msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) + legacyTransformer := legacy.NewTransformer(cfg.BEBNamespace, cfg.EventTypePrefix) + opts := &options.Options{MaxRequestSize: 65536} + handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, logrus.New()) + go func() { + if err := handler.Start(ctx); err != nil { + t.Errorf("failed to start handler with error: %v", err) + } + }() + + waitForHandlerToStart(t, healthEndpoint) + + testCases := []struct { + name string + targetEndpoint string + provideMessage func() (string, http.Header) + endPoint string + wantStatusCode int + wantResponse legacyapi.PublishEventResponses + }{ + { + name: "Send a legacy event with event-id", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() + }, + endPoint: publishLegacyEndpoint, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: &legacyapi.Error{ + Status: 400, + Message: "invalid request"}, + }, + }, + { + name: "Binary CloudEvent is valid with required headers", + provideMessage: func() (string, http.Header) { + return testingutils.BinaryCloudEventPayload, testingutils.GetBinaryMessageHeaders() + }, + endPoint: publishEndpoint, + wantStatusCode: http.StatusBadRequest, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + body, headers := testCase.provideMessage() + _ = legacyapi.PublishEventResponses{} + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + if err != nil { + t.Errorf("failed to send event with error: %v", err) + } + + if testCase.wantStatusCode != resp.StatusCode { + t.Errorf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) + } + + if testCase.endPoint == publishLegacyEndpoint { + validateErrorResponse(t, *resp, &testCase.wantResponse) + } + }) + } +} + +func TestHandlerForHugeRequests(t *testing.T) { + t.Parallel() + port, err := generatePort() + if err != nil { + t.Fatalf("failed to generate port: %v", err) + } + var ( + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/app/v1/events", port) + bebNs = "/beb.namespace" + eventTypePrefix = "event.type.prefix" + ) + mockServer := testingutils.NewMockServer() + mockServer.Start(t, tokenEndpoint, eventsEndpoint, eventsHTTP400Endpoint) + defer mockServer.Close() + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + beb400CEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsHTTP400Endpoint) + authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) + + cfg := testingutils.NewEnvConfig( + beb400CEURL, + authURL, + testingutils.WithPort(port), + testingutils.WithBEBNamespace(bebNs), + testingutils.WithEventTypePrefix(eventTypePrefix), + ) + client := oauth.NewClient(ctx, cfg) + defer client.CloseIdleConnections() + + msgSender := sender.NewHttpMessageSender(beb400CEURL, client) + msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) + legacyTransformer := legacy.NewTransformer(cfg.BEBNamespace, cfg.EventTypePrefix) + + // Limiting the accepted size of the request to 2 Bytes + opts := &options.Options{MaxRequestSize: 2} + handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, logrus.New()) + go func() { + if err := handler.Start(ctx); err != nil { + t.Errorf("failed to start handler with error: %v", err) + } + }() + + waitForHandlerToStart(t, healthEndpoint) + + testCases := []struct { + name string + targetEndpoint string + provideMessage func() (string, http.Header) + endPoint string + wantStatusCode int + }{ + { + name: "Should fail with HTTP 413 with a request which is larger than 2 Bytes as the maximum accepted size is 2 Bytes", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() + }, + endPoint: publishLegacyEndpoint, + wantStatusCode: http.StatusRequestEntityTooLarge, + }, + { + name: "Should accept a request which is lesser than 2 Bytes as the maximum accepted size is 2 Bytes", + provideMessage: func() (string, http.Header) { + return "{}", testingutils.GetBinaryMessageHeaders() + }, + endPoint: publishEndpoint, + wantStatusCode: http.StatusBadRequest, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + body, headers := testCase.provideMessage() + _ = legacyapi.PublishEventResponses{} + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + if err != nil { + t.Errorf("failed to send event with error: %v", err) + } + + if testCase.wantStatusCode != resp.StatusCode { + t.Errorf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) + } + }) + } +} + +// getMissingFieldValidationErrorFor generates an Error message for a missing field +func getMissingFieldValidationErrorFor(field string) *legacyapi.Error { + return &legacyapi.Error{ + Status: 400, + Type: "validation_violation", + Message: "Missing field", + Details: []legacyapi.ErrorDetail{ + { + Field: field, + Type: "missing_field", + Message: "Missing field", + MoreInfo: "", + }, + }, + } +} + +// isValidEventID checks whether EventID is valid or not +func isValidEventID(id string) bool { + return regexp.MustCompile(legacy.AllowedEventIDChars).MatchString(id) +} + +// getInvalidValidationErrorFor generates an Error message for an invalid field +func getInvalidValidationErrorFor(field string) *legacyapi.Error { + return &legacyapi.Error{ + Status: 400, + Type: "validation_violation", + Message: "Invalid field", + Details: []legacyapi.ErrorDetail{ + { + Field: field, + Type: "invalid_field", + Message: "Invalid field", + MoreInfo: "", + }, + }, + } +} + +func TestIsARequestWithLegacyEvent(t *testing.T) { + testCases := []struct { + inputURI string + wantedResult bool + }{ + { + inputURI: "/app/v1/events", + wantedResult: true, + }, + { + inputURI: "///app/v1/events", + wantedResult: true, + }, + { + inputURI: "///app/v1//events", + wantedResult: false, + }, + { + inputURI: "///app/v1/foo/events", + wantedResult: false, + }, + } + + for _, tc := range testCases { + got := isARequestWithLegacyEvent(tc.inputURI) + if tc.wantedResult != got { + t.Errorf("incorrect result with inputURI: %s, wanted: %v, got: %v", tc.inputURI, tc.wantedResult, got) + } + } +} + +// validateErrorResponse validates Error Response +func validateErrorResponse(t *testing.T, resp http.Response, tcWantResponse *legacyapi.PublishEventResponses) { + legacyResponse := legacyapi.PublishEventResponses{} + legacyError := legacyapi.Error{} + bodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Fatalf("failed to read response body: %v", err) + } + t.Logf("response body : %s", string(bodyBytes)) + if err = json.Unmarshal(bodyBytes, &legacyError); err != nil { + t.Fatalf("failed to unmarshal response body: %v", err) + } + legacyResponse.Error = &legacyError + if !reflect.DeepEqual(tcWantResponse.Error, legacyResponse.Error) { + t.Fatalf("Invalid error, want: %v, got: %v", tcWantResponse.Error, legacyResponse.Error) + } +} + +// validateOkResponse validates Ok Response +func validateOkResponse(t *testing.T, resp http.Response, tcWantResponse *legacyapi.PublishEventResponses) { + legacyOkResponse := legacyapi.PublishResponse{} + legacyResponse := legacyapi.PublishEventResponses{} + bodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Fatalf("failed to read response body: %v", err) + } + t.Logf("response body : %s", string(bodyBytes)) + if err = json.Unmarshal(bodyBytes, &legacyOkResponse); err != nil { + t.Fatalf("failed to unmarshal response body: %v", err) + } + legacyResponse.Ok = &legacyOkResponse + if err = resp.Body.Close(); err != nil { + t.Fatalf("failed to close body: %v", err) + } + + if tcWantResponse.Ok.EventID != "" && tcWantResponse.Ok.EventID != legacyResponse.Ok.EventID { + t.Errorf("invalid event-id, want: %v, got: %v", tcWantResponse.Ok.EventID, legacyResponse.Ok.EventID) + } + + if tcWantResponse.Ok.EventID == "" && !isValidEventID(legacyResponse.Ok.EventID) { + t.Errorf("should match regex: [%s] Not a valid event-id: %v ", legacy.AllowedEventIDChars, legacyResponse.Ok.EventID) + } + if tcWantResponse.Ok.Reason != legacyResponse.Ok.Reason { + t.Errorf("invalid reason, want: %v, got: %v", tcWantResponse.Ok.Reason, legacyResponse.Ok.Reason) + } + if tcWantResponse.Ok.Status != legacyResponse.Ok.Status { + t.Errorf("invalid status, want: %v, got: %v", tcWantResponse.Ok.Status, legacyResponse.Ok.Status) + } +} + +// generatePort generates a random 5 digit port +func generatePort() (int, error) { + max := 4 + // Add 4 as prefix to make it 5 digits but less than 65535 + add4AsPrefix := "4" + b := make([]byte, max) + n, err := io.ReadAtLeast(rand.Reader, b, max) + if n != max { + return 0, err + } + if err != nil { + return 0, err + } + for i := 0; i < len(b); i++ { + b[i] = table[int(b[i])%len(table)] + } + + num, err := strconv.Atoi(fmt.Sprintf("%s%s", add4AsPrefix, string(b))) + if err != nil { + return 0, err + } + + return num, nil +} + +var table = [...]byte{'1', '2', '3', '4', '5', '6', '7', '8', '9'} diff --git a/pkg/legacy-events/api/types.go b/pkg/legacy-events/api/types.go new file mode 100644 index 0000000..5520f9b --- /dev/null +++ b/pkg/legacy-events/api/types.go @@ -0,0 +1,49 @@ +package api + +// AnyValue implements the service definition of AnyValue +type AnyValue interface { +} + +// PublishRequestV1 implements the service definition of PublishRequestV1 +type PublishRequestV1 struct { + EventType string `json:"event-type,omitempty"` + EventTypeVersion string `json:"event-type-version,omitempty"` + EventID string `json:"event-id,omitempty"` + EventTime string `json:"event-time,omitempty"` + Data AnyValue `json:"data,omitempty"` +} + +// PublishEventParametersV1 holds parameters to PublishEvent +type PublishEventParametersV1 struct { + PublishrequestV1 PublishRequestV1 `json:"publishrequest,omitempty"` +} + +// PublishResponse implements the service definition of PublishResponse +type PublishResponse struct { + EventID string `json:"event-id,omitempty"` + Status string `json:"status"` + Reason string `json:"reason"` +} + +// Error implements the service definition of APIError +type Error struct { + Status int `json:"status,omitempty"` + Type string `json:"type,omitempty"` + Message string `json:"message,omitempty"` + MoreInfo string `json:"moreInfo,omitempty"` + Details []ErrorDetail `json:"details,omitempty"` +} + +// ErrorDetail implements the service definition of APIErrorDetail +type ErrorDetail struct { + Field string `json:"field,omitempty"` + Type string `json:"type,omitempty"` + Message string `json:"message,omitempty"` + MoreInfo string `json:"moreInfo,omitempty"` +} + +// PublishEventResponses holds responses of PublishEvent +type PublishEventResponses struct { + Ok *PublishResponse + Error *Error +} diff --git a/pkg/legacy-events/constants.go b/pkg/legacy-events/constants.go new file mode 100644 index 0000000..5f5891d --- /dev/null +++ b/pkg/legacy-events/constants.go @@ -0,0 +1,39 @@ +package legacy + +// Allowed patterns for the Event components +const ( + AllowedEventTypeVersionChars = `[a-zA-Z0-9]+` + AllowedEventIDChars = `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$` +) + +// Error messages +const ( + ErrorMessageBadPayload = "Bad payload syntax" + ErrorMessageRequestBodyTooLarge = "Request body too large" + ErrorMessageMissingField = "Missing field" + ErrorMessageInvalidField = "Invalid field" +) + +// Error type definition +const ( + ErrorTypeBadPayload = "bad_payload_syntax" + ErrorTypeRequestBodyTooLarge = "request_body_too_large" + ErrorTypeMissingField = "missing_field" + ErrorTypeValidationViolation = "validation_violation" + ErrorTypeInvalidField = "invalid_field" + ErrorTypeInternalServer = "internal_server" +) + +// Field definition +const ( + FieldEventID = "event-id" + FieldEventTime = "event-time" + FieldEventType = "event-type" + FieldEventTypeVersion = "event-type-version" + FieldData = "data" +) + +// HTTP ContentType constants +const ( + ContentTypeApplicationJSON = "application/json" +) diff --git a/pkg/legacy-events/helpers.go b/pkg/legacy-events/helpers.go new file mode 100644 index 0000000..70ea4de --- /dev/null +++ b/pkg/legacy-events/helpers.go @@ -0,0 +1,72 @@ +package legacy + +import ( + "net/http" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" +) + +// ErrorResponseBadRequest returns an error of type PublishEventResponses with BadRequest status code +func ErrorResponseBadRequest(moreInfo string) (response *api.PublishEventResponses) { + var details []api.ErrorDetail + apiError := api.Error{Status: http.StatusBadRequest, Type: ErrorTypeBadPayload, Message: ErrorMessageBadPayload, MoreInfo: moreInfo, Details: details} + return &api.PublishEventResponses{Ok: nil, Error: &apiError} +} + +// ErrorResponseRequestBodyTooLarge returns an error of type PublishEventResponses with BadRequest status code +func ErrorResponseRequestBodyTooLarge(moreInfo string) (response *api.PublishEventResponses) { + var details []api.ErrorDetail + apiError := api.Error{Status: http.StatusRequestEntityTooLarge, Type: ErrorTypeRequestBodyTooLarge, Message: ErrorMessageRequestBodyTooLarge, MoreInfo: moreInfo, Details: details} + return &api.PublishEventResponses{Ok: nil, Error: &apiError} +} + +// ErrorResponseMissingFieldEventType returns an error of type PublishEventResponses for missing EventType field +func ErrorResponseMissingFieldEventType() (response *api.PublishEventResponses) { + return CreateMissingFieldError(FieldEventType) +} + +// ErrorResponseMissingFieldEventTypeVersion returns an error of type PublishEventResponses for missing EventTypeVersion field +func ErrorResponseMissingFieldEventTypeVersion() (response *api.PublishEventResponses) { + return CreateMissingFieldError(FieldEventTypeVersion) +} + +// ErrorResponseWrongEventTypeVersion returns an error of type PublishEventResponses for wrong EventTypeVersion field +func ErrorResponseWrongEventTypeVersion() (response *api.PublishEventResponses) { + return CreateInvalidFieldError(FieldEventTypeVersion) +} + +// ErrorResponseMissingFieldEventTime returns an error of type PublishEventResponses for missing EventTime field +func ErrorResponseMissingFieldEventTime() (response *api.PublishEventResponses) { + return CreateMissingFieldError(FieldEventTime) +} + +// ErrorResponseWrongEventTime returns an error of type PublishEventResponses for wrong EventTime field +func ErrorResponseWrongEventTime() (response *api.PublishEventResponses) { + return CreateInvalidFieldError(FieldEventTime) +} + +// ErrorResponseWrongEventID returns an error of type PublishEventResponses for wrong EventID field +func ErrorResponseWrongEventID() (response *api.PublishEventResponses) { + return CreateInvalidFieldError(FieldEventID) +} + +// ErrorResponseMissingFieldData returns an error of type PublishEventResponses for missing Data field +func ErrorResponseMissingFieldData() (response *api.PublishEventResponses) { + return CreateMissingFieldError(FieldData) +} + +//CreateMissingFieldError create an error for a missing field +func CreateMissingFieldError(field interface{}) (response *api.PublishEventResponses) { + apiErrorDetail := api.ErrorDetail{Field: field.(string), Type: ErrorTypeMissingField, Message: ErrorMessageMissingField, MoreInfo: ""} + details := []api.ErrorDetail{apiErrorDetail} + apiError := api.Error{Status: http.StatusBadRequest, Type: ErrorTypeValidationViolation, Message: ErrorMessageMissingField, MoreInfo: "", Details: details} + return &api.PublishEventResponses{Ok: nil, Error: &apiError} +} + +//CreateInvalidFieldError creates an error for an invalid field +func CreateInvalidFieldError(field interface{}) (response *api.PublishEventResponses) { + apiErrorDetail := api.ErrorDetail{Field: field.(string), Type: ErrorTypeInvalidField, Message: ErrorMessageInvalidField, MoreInfo: ""} + details := []api.ErrorDetail{apiErrorDetail} + apiError := api.Error{Status: http.StatusBadRequest, Type: ErrorTypeValidationViolation, Message: ErrorMessageInvalidField, MoreInfo: "", Details: details} + return &api.PublishEventResponses{Ok: nil, Error: &apiError} +} diff --git a/pkg/legacy-events/legacy.go b/pkg/legacy-events/legacy.go new file mode 100644 index 0000000..0684adc --- /dev/null +++ b/pkg/legacy-events/legacy.go @@ -0,0 +1,212 @@ +package legacy + +import ( + "encoding/json" + "fmt" + "net/http" + "regexp" + "strings" + "time" + + cev2event "github.com/cloudevents/sdk-go/v2/event" + "github.com/google/uuid" + apiv1 "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + "github.com/pkg/errors" + log "github.com/sirupsen/logrus" +) + +var ( + isValidEventTypeVersion = regexp.MustCompile(AllowedEventTypeVersionChars).MatchString + isValidEventID = regexp.MustCompile(AllowedEventIDChars).MatchString + // eventTypePrefixFormat is driven by BEB specification. + // An eventtype must have atleast 4 segments separated by dots in the form of: + // ... + eventTypePrefixFormat = "%s.%s.%s.%s" +) + +type Transformer struct { + bebNamespace string + eventTypePrefix string +} + +func NewTransformer(bebNamespace string, eventTypePrefix string) *Transformer { + return &Transformer{ + bebNamespace: bebNamespace, + eventTypePrefix: eventTypePrefix, + } +} + +const ( + requestBodyTooLargeErrorMessage = "http: request body too large" + eventTypeVersionExtensionKey = "eventtypeversion" +) + +func (t Transformer) TransformsLegacyRequestsToCE(writer http.ResponseWriter, request *http.Request) *cev2event.Event { + + // parse request body to PublishRequestV1 + if request.Body == nil || request.ContentLength == 0 { + resp := ErrorResponseBadRequest(ErrorMessageBadPayload) + writeJSONResponse(writer, resp) + return nil + } + appName := parseApplicationNameFromPath(request.URL.Path) + var err error + parameters := &apiv1.PublishEventParametersV1{} + decoder := json.NewDecoder(request.Body) + err = decoder.Decode(¶meters.PublishrequestV1) + if err != nil { + var resp *apiv1.PublishEventResponses + if err.Error() == requestBodyTooLargeErrorMessage { + resp = ErrorResponseRequestBodyTooLarge(err.Error()) + } else { + resp = ErrorResponseBadRequest(err.Error()) + } + writeJSONResponse(writer, resp) + return nil + } + + // validate the PublishRequestV1 for missing / incoherent values + checkResp := checkParameters(parameters) + if checkResp.Error != nil { + writeJSONResponse(writer, checkResp) + return nil + } + + response := &apiv1.PublishEventResponses{} + + event, err := t.convertPublishRequestToCloudEvent(appName, parameters) + if err != nil { + response.Error = &apiv1.Error{ + Status: http.StatusInternalServerError, + Message: err.Error(), + } + writeJSONResponse(writer, response) + return nil + } + + return event +} + +func parseApplicationNameFromPath(path string) string { + // Assumption: Clients(e.g. ApplicationConnectivity validator which has a flag for + // the path(https://github.com/kyma-project/kyma/blob/master/components/application-connectivity-validator/cmd/applicationconnectivityvalidator/applicationconnectivityvalidator.go#L49) + // using this endpoint must be sending request to path /:application/v1/events + // Hence it should be safe to return 0th index as the application name + pathSegments := make([]string, 0) + for _, segment := range strings.Split(path, "/") { + if strings.TrimSpace(segment) != "" { + pathSegments = append(pathSegments, segment) + } + } + return pathSegments[0] +} + +func checkParameters(parameters *apiv1.PublishEventParametersV1) (response *apiv1.PublishEventResponses) { + if parameters == nil { + return ErrorResponseBadRequest(ErrorMessageBadPayload) + } + if len(parameters.PublishrequestV1.EventType) == 0 { + return ErrorResponseMissingFieldEventType() + } + if len(parameters.PublishrequestV1.EventTypeVersion) == 0 { + return ErrorResponseMissingFieldEventTypeVersion() + } + if !isValidEventTypeVersion(parameters.PublishrequestV1.EventTypeVersion) { + return ErrorResponseWrongEventTypeVersion() + } + if len(parameters.PublishrequestV1.EventTime) == 0 { + + return ErrorResponseMissingFieldEventTime() + } + if _, err := time.Parse(time.RFC3339, parameters.PublishrequestV1.EventTime); err != nil { + return ErrorResponseWrongEventTime() + } + if len(parameters.PublishrequestV1.EventID) > 0 && !isValidEventID(parameters.PublishrequestV1.EventID) { + return ErrorResponseWrongEventID() + } + if parameters.PublishrequestV1.Data == nil { + return ErrorResponseMissingFieldData() + } + if d, ok := (parameters.PublishrequestV1.Data).(string); ok && len(d) == 0 { + return ErrorResponseMissingFieldData() + } + // OK + return &apiv1.PublishEventResponses{} +} + +func (t Transformer) TransformsCEResponseToLegacyResponse(writer http.ResponseWriter, statusCode int, event *cev2event.Event, msg string) { + response := &apiv1.PublishEventResponses{} + // Fail + if !is2XXStatusCode(statusCode) { + response.Error = &apiv1.Error{ + Status: statusCode, + Message: msg, + } + writeJSONResponse(writer, response) + return + } + + // Success + response.Ok = &apiv1.PublishResponse{EventID: event.ID()} + writeJSONResponse(writer, response) + return +} + +// is2XXStatusCode checks whether status code is a 2XX status code +func is2XXStatusCode(statusCode int) bool { + return statusCode >= http.StatusOK && statusCode < http.StatusMultipleChoices +} + +func writeJSONResponse(w http.ResponseWriter, resp *apiv1.PublishEventResponses) { + encoder := json.NewEncoder(w) + w.Header().Set("Content-Type", ContentTypeApplicationJSON) + + if resp.Error != nil { + w.WriteHeader(resp.Error.Status) + _ = encoder.Encode(resp.Error) + return + } + + if resp.Ok != nil { + _ = encoder.Encode(resp.Ok) + return + } + + log.Errorf("received an empty response") +} + +// convertPublishRequestToCloudEvent converts the given publish request to a CloudEvent. +func (t Transformer) convertPublishRequestToCloudEvent(appName string, publishRequest *apiv1.PublishEventParametersV1) (*cev2event.Event, error) { + event := cev2event.New(cev2event.CloudEventsVersionV1) + + evTime, err := time.Parse(time.RFC3339, publishRequest.PublishrequestV1.EventTime) + if err != nil { + return nil, errors.Wrap(err, "failed to parse time from the external publish request") + } + event.SetTime(evTime) + + if err := event.SetData(ContentTypeApplicationJSON, publishRequest.PublishrequestV1.Data); err != nil { + return nil, errors.Wrap(err, "failed to set data to CE data field") + } + + // set the event id from the request if it is available + // otherwise generate a new one + if len(publishRequest.PublishrequestV1.EventID) > 0 { + event.SetID(publishRequest.PublishrequestV1.EventID) + } else { + event.SetID(uuid.New().String()) + } + + eventType := formatEventType4BEB(t.eventTypePrefix, appName, publishRequest.PublishrequestV1.EventType, publishRequest.PublishrequestV1.EventTypeVersion) + event.SetSource(t.bebNamespace) + event.SetType(eventType) + event.SetExtension(eventTypeVersionExtensionKey, publishRequest.PublishrequestV1.EventTypeVersion) + event.SetDataContentType(ContentTypeApplicationJSON) + return &event, nil +} + +// formatEventType4BEB format eventType as per BEB spec +func formatEventType4BEB(eventTypePrefix, app, eventType, version string) string { + eventType4BEB := fmt.Sprintf(eventTypePrefixFormat, eventTypePrefix, app, eventType, version) + return strings.ReplaceAll(eventType4BEB, "-", ".") +} diff --git a/pkg/legacy-events/legacy_test.go b/pkg/legacy-events/legacy_test.go new file mode 100644 index 0000000..9994bb5 --- /dev/null +++ b/pkg/legacy-events/legacy_test.go @@ -0,0 +1,123 @@ +package legacy + +import ( + "testing" + "time" + + legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" +) + +func TestParseApplicationNameFromPath(t *testing.T) { + testCases := []struct { + name string + inputPath string + wantedAppName string + }{ + { + name: "should return application when correct path is used", + inputPath: "/application/v1/events", + wantedAppName: "application", + }, { + name: "should return application when extra slash is in the path", + inputPath: "//application/v1/events", + wantedAppName: "application", + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + gotAppName := parseApplicationNameFromPath(tc.inputPath) + if tc.wantedAppName != gotAppName { + t.Errorf("incorrect parsing, wanted: %s, got: %s", tc.wantedAppName, gotAppName) + } + }) + } +} + +func TestFormatEventType4BEB(t *testing.T) { + testCases := []struct { + eventTypePrefix string + app string + eventType string + version string + wantedEventType string + }{ + { + eventTypePrefix: "prefix", + app: "app", + eventType: "order.foo", + version: "v1", + wantedEventType: "prefix.app.order.foo.v1", + }, + { + eventTypePrefix: "prefix", + app: "app", + eventType: "order-foo", + version: "v1", + wantedEventType: "prefix.app.order.foo.v1", + }, + } + + for _, tc := range testCases { + gotEventType := formatEventType4BEB(tc.eventTypePrefix, tc.app, tc.eventType, tc.version) + if tc.wantedEventType != gotEventType { + t.Errorf("incorrect formatting of eventType: "+ + "%s, wanted: %s got: %s", tc.eventType, tc.wantedEventType, gotEventType) + } + } +} + +func TestConvertPublishRequestToCloudEvent(t *testing.T) { + bebNs := "beb.namespace" + eventTypePrefix := "event.type.prefix" + legacyTransformer := NewTransformer(bebNs, eventTypePrefix) + eventID := "id" + appName := "foo-app" + legacyEventType := "foo.bar" + legacyEventVersion := "v1" + data := "{\"foo\": \"bar\"}" + timeNow := time.Now() + expectedEventType := formatEventType4BEB(eventTypePrefix, appName, legacyEventType, legacyEventVersion) + timeNowStr := timeNow.Format(time.RFC3339) + timeNowFormatted, _ := time.Parse(time.RFC3339, timeNowStr) + publishReqParams := &legacyapi.PublishEventParametersV1{ + PublishrequestV1: legacyapi.PublishRequestV1{ + EventID: eventID, + EventType: legacyEventType, + EventTime: timeNowStr, + EventTypeVersion: legacyEventVersion, + Data: data, + }, + } + + gotEvent, err := legacyTransformer.convertPublishRequestToCloudEvent(appName, publishReqParams) + if err != nil { + t.Fatal("failed to convert publish request to CE", err) + } + if gotEvent.Context.GetID() != eventID { + t.Errorf("incorrect id, want: %s, got: %s", eventID, gotEvent.Context.GetDataContentType()) + } + + if gotEvent.Context.GetType() != expectedEventType { + t.Errorf("incorrect eventType, want: %s, got: %s", expectedEventType, gotEvent.Context.GetType()) + } + + if gotEvent.Context.GetTime() != timeNowFormatted { + t.Errorf("incorrect eventTime, want: %s, got: %s", timeNowFormatted, gotEvent.Context.GetTime()) + } + + if gotEvent.Context.GetSource() != bebNs { + t.Errorf("incorrect source want: %s, got: %s", bebNs, gotEvent.Context.GetDataContentType()) + } + + if gotEvent.Context.GetDataContentType() != ContentTypeApplicationJSON { + t.Errorf("incorrect content-type, want: %s, got: %s", ContentTypeApplicationJSON, gotEvent.Context.GetDataContentType()) + } + + gotExtension, err := gotEvent.Context.GetExtension(eventTypeVersionExtensionKey) + if err != nil { + t.Errorf("eventtype extension is missing: %v", err) + } + if gotExtension != legacyEventVersion { + t.Errorf("incorrect eventtype extension, want: %s, got: %s", legacyEventVersion, gotExtension) + } +} diff --git a/pkg/oauth/client_test.go b/pkg/oauth/client_test.go index b22c921..f174c94 100644 --- a/pkg/oauth/client_test.go +++ b/pkg/oauth/client_test.go @@ -52,8 +52,9 @@ func TestGetToken(t *testing.T) { t.Parallel() const ( - tokenEndpoint = "/token" - eventsEndpoint = "/events" + tokenEndpoint = "/token" + eventsEndpoint = "/events" + eventsHTTP400Endpoint = "/events400" ) testCases := []struct { @@ -84,7 +85,7 @@ func TestGetToken(t *testing.T) { t.Parallel() mockServer := testingutils.NewMockServer(testingutils.WithExpiresIn(test.givenExpiresInSec)) - mockServer.Start(t, tokenEndpoint, eventsEndpoint) + mockServer.Start(t, tokenEndpoint, eventsEndpoint, eventsHTTP400Endpoint) defer mockServer.Close() emsCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) diff --git a/pkg/options/options.go b/pkg/options/options.go new file mode 100644 index 0000000..6d57313 --- /dev/null +++ b/pkg/options/options.go @@ -0,0 +1,16 @@ +package options + +import "flag" + +type Options struct { + MaxRequestSize int64 +} + +func ParseArgs() *Options { + maxRequestSize := flag.Int64("maxRequestSize", 65536, "The maximum request size in bytes") + flag.Parse() + + return &Options{ + MaxRequestSize: *maxRequestSize, + } +} diff --git a/pkg/receiver/receiver.go b/pkg/receiver/receiver.go index 4472510..d3ea9bc 100644 --- a/pkg/receiver/receiver.go +++ b/pkg/receiver/receiver.go @@ -36,7 +36,6 @@ func (recv *HttpMessageReceiver) StartListen(ctx context.Context, handler http.H } recv.handler = createHandler(handler) - recv.server = &http.Server{ Addr: recv.listener.Addr().String(), Handler: recv.handler, diff --git a/pkg/sender/sender_test.go b/pkg/sender/sender_test.go index 3c41bb8..a13c6d0 100644 --- a/pkg/sender/sender_test.go +++ b/pkg/sender/sender_test.go @@ -13,8 +13,9 @@ import ( const ( // mock server endpoints - tokenEndpoint = "/token" - eventsEndpoint = "/events" + tokenEndpoint = "/token" + eventsEndpoint = "/events" + eventsHTTP400Endpoint = "/events400" // connection settings maxIdleConns = 100 @@ -78,7 +79,7 @@ func TestNewRequestWithTarget(t *testing.T) { func TestSend(t *testing.T) { mockServer := testingutils.NewMockServer() - mockServer.Start(t, tokenEndpoint, eventsEndpoint) + mockServer.Start(t, tokenEndpoint, eventsEndpoint, eventsHTTP400Endpoint) defer mockServer.Close() ctx := context.Background() diff --git a/testing/env_config.go b/testing/env_config.go index 0547efa..6e32662 100644 --- a/testing/env_config.go +++ b/testing/env_config.go @@ -39,3 +39,15 @@ func WithRequestTimeout(requestTimeout time.Duration) EnvConfigOption { e.RequestTimeout = requestTimeout } } + +func WithBEBNamespace(bebNs string) EnvConfigOption { + return func(e *env.Config) { + e.BEBNamespace = bebNs + } +} + +func WithEventTypePrefix(eventTypePrefix string) EnvConfigOption { + return func(e *env.Config) { + e.EventTypePrefix = eventTypePrefix + } +} diff --git a/testing/fixtures.go b/testing/fixtures.go index 66611e0..541d235 100644 --- a/testing/fixtures.go +++ b/testing/fixtures.go @@ -43,4 +43,76 @@ const ( }` BinaryCloudEventPayload = `"{\"foo\":\"bar\"}"` + + ValidLegacyEventPayloadWithEventId = `{ + "event-id": "8945ec08-256b-11eb-9928-acde48001122", + "event-type":"someType", + "event-type-version":"v0", + "event-time": "2020-04-02T21:37:00Z", + "data": { + "foo": "bar" + } + }` + + ValidLegacyEventPayloadWithoutEventId = `{ + "event-type":"someType", + "event-type-version":"v0", + "event-time": "2020-04-02T21:37:00Z", + "data": { + "foo": "bar" + } + }` + LegacyEventPayloadWithInvalidEventId = `{ + "event-id":"foo-bar", + "event-type":"someType", + "event-type-version":"v0", + "event-time": "2020-04-02T21:37:00Z", + "data": { + "foo": "bar" + } + }` + + LegacyEventPayloadWithoutEventTime = `{ + "event-id":"8945ec08-256b-11eb-9928-acde48001122", + "event-type":"someType", + "event-type-version":"v0", + "data": { + "foo": "bar" + } + }` + + LegacyEventPayloadWithoutEventType = `{ + "event-id":"8945ec08-256b-11eb-9928-acde48001122", + "event-type-version":"v0", + "event-time": "2020-04-02T21:37:00Z", + "data": { + "foo": "bar" + } + }` + + LegacyEventPayloadWithInvalidEventTime = `{ + "event-id":"8945ec08-256b-11eb-9928-acde48001122", + "event-type":"someType", + "event-type-version":"v0", + "event-time": "some time 10:23", + "data": { + "foo": "bar" + } + }` + + LegacyEventPayloadWithWithoutEventVersion = `{ + "event-id":"8945ec08-256b-11eb-9928-acde48001122", + "event-type":"someType", + "event-time": "2020-04-02T21:37:00Z", + "data": { + "foo": "bar" + } + }` + + ValidLegacyEventPayloadWithoutData = `{ + "event-id": "8945ec08-256b-11eb-9928-acde48001122", + "event-type":"someType", + "event-type-version":"v0", + "event-time": "2020-04-02T21:37:00Z" + }` ) diff --git a/testing/mock_server.go b/testing/mock_server.go index 169e104..9ad4241 100644 --- a/testing/mock_server.go +++ b/testing/mock_server.go @@ -37,7 +37,7 @@ func WithResponseTime(responseTime time.Duration) MockServerOption { } } -func (m *MockServer) Start(t *testing.T, tokenEndpoint, eventsEndpoint string) { +func (m *MockServer) Start(t *testing.T, tokenEndpoint, eventsEndpoint, eventsWithHTTP400 string) { m.server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { time.Sleep(m.responseTime) @@ -47,16 +47,24 @@ func (m *MockServer) Start(t *testing.T, tokenEndpoint, eventsEndpoint string) { m.generatedTokensCount++ token := fmt.Sprintf("access_token=token-%d&token_type=bearer&expires_in=%d", time.Now().UnixNano(), m.expiresInSec) if _, err := w.Write([]byte(token)); err != nil { - t.Errorf("Failed to write HTTP response") + t.Errorf("failed to write HTTP response") } } case eventsEndpoint: { w.WriteHeader(http.StatusNoContent) } + case eventsWithHTTP400: + { + w.WriteHeader(http.StatusBadRequest) + _, err := w.Write([]byte("invalid request")) + if err != nil { + t.Errorf("failed to write message: %v", err) + } + } default: { - t.Errorf("Mock server supports the following endpoints only: [%s]", tokenEndpoint) + t.Errorf("mock server supports the following endpoints only: [%s]", tokenEndpoint) } } })) diff --git a/testing/utils.go b/testing/utils.go index 6158c94..4cf9be6 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -3,6 +3,8 @@ package testing import ( "bytes" "net/http" + + http2 "github.com/cloudevents/sdk-go/v2/protocol/http" ) const ( @@ -49,3 +51,9 @@ func GetBinaryMessageHeaders() http.Header { headers.Add(CeSpecVersionHeader, CeSpecVersion) return headers } + +func GetApplicationJSONHeaders() http.Header { + headers := make(http.Header) + headers.Add(http2.ContentType, "application/json") + return headers +} From dc1e406d82a9c8fd0f28d5def44cddc423934663 Mon Sep 17 00:00:00 2001 From: Sayan Hazra Date: Thu, 26 Nov 2020 10:54:21 +0100 Subject: [PATCH 007/194] Add /:app/v1/events/subscribed endpoint as that of event-service (#10005) --- README.md | 10 +- cmd/event-publisher-proxy/main.go | 33 +- go.mod | 16 +- go.sum | 888 +++++++++++++++++++++++++++ pkg/handler/handler.go | 42 +- pkg/handler/handler_test.go | 322 +++++----- pkg/legacy-events/constants.go | 1 + pkg/legacy-events/error_responses.go | 78 +++ pkg/legacy-events/helpers.go | 96 ++- pkg/legacy-events/helpers_test.go | 64 ++ pkg/legacy-events/legacy.go | 125 ++-- pkg/legacy-events/legacy_test.go | 59 -- pkg/receiver/receiver.go | 3 + pkg/receiver/receiver_test.go | 17 +- pkg/subscribed/helpers.go | 164 +++++ pkg/subscribed/helpers_test.go | 258 ++++++++ pkg/subscribed/processor.go | 44 ++ pkg/subscribed/response.go | 43 ++ testing/utils.go | 198 ++++++ 19 files changed, 2074 insertions(+), 387 deletions(-) create mode 100644 pkg/legacy-events/error_responses.go create mode 100644 pkg/legacy-events/helpers_test.go create mode 100644 pkg/subscribed/helpers.go create mode 100644 pkg/subscribed/helpers_test.go create mode 100644 pkg/subscribed/processor.go create mode 100644 pkg/subscribed/response.go diff --git a/README.md b/README.md index 3c48009..f583958 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Overview -The Event Publisher Proxy receives legacy and Cloud Event publishing requests from the cluster workloads (microservice or Serverless functions) and redirects them to the Enterprise Messaging Service Cloud Event Gateway. +The Event Publisher Proxy receives legacy and Cloud Event publishing requests from the cluster workloads (microservice or Serverless functions) and redirects them to the Enterprise Messaging Service Cloud Event Gateway. It also fetches a list of subscriptions for a connected application. ## Prerequisites @@ -66,6 +66,14 @@ EOF http:///application-name/v1/events ``` +### Get a list of subscriptions for a connected application + +```bash +curl -v -X GET \ + -H "Content-Type: application/json" \ + http://hostname/:application-name/v1/events/subscribed +``` + ## Environment Variables | Environment Variable | Default Value | Description | diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index a280aca..d5ae5a7 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -2,16 +2,20 @@ package main import ( "github.com/kelseyhightower/envconfig" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/sirupsen/logrus" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + "sigs.k8s.io/controller-runtime/pkg/client/config" + + "github.com/sirupsen/logrus" + + _ "k8s.io/client-go/plugin/pkg/client/auth" ) func main() { @@ -21,9 +25,6 @@ func main() { if err := envconfig.Process("", cfg); err != nil { logger.Fatalf("Start handler failed with error: %s", err) } - - logger.Info("Start the Event Publisher Proxy") - // configure message receiver messageReceiver := receiver.NewHttpMessageReceiver(cfg.Port) @@ -40,10 +41,24 @@ func main() { cfg.BEBNamespace, cfg.EventTypePrefix, ) + + // Configure Subscription Lister + k8sConfig := config.GetConfigOrDie() + subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig) + subLister := subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() + subscribedProcessor := &subscribed.Processor{ + SubscriptionLister: &subLister, + Config: cfg, + Logger: logger, + } + // Sync informer cache or die + logger.Info("Waiting for informers caches to sync") + subscribed.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory) + logger.Info("Informers are synced successfully") + // start handler which blocks until it receives a shutdown signal - if err := handler.NewHandler(messageReceiver, messageSender, cfg.RequestTimeout, legacyTransformer, opts, logger).Start(ctx); err != nil { + if err := handler.NewHandler(messageReceiver, messageSender, cfg.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logger).Start(ctx); err != nil { logger.Fatalf("Start handler failed with error: %s", err) } - logger.Info("Shutdown the Event Publisher Proxy") } diff --git a/go.mod b/go.mod index c509fcb..fc9943b 100644 --- a/go.mod +++ b/go.mod @@ -3,11 +3,25 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy go 1.15 require ( - github.com/cloudevents/sdk-go/v2 v2.2.0 + github.com/cloudevents/sdk-go/v2 v2.3.1 github.com/google/uuid v1.1.1 github.com/kelseyhightower/envconfig v1.4.0 + github.com/kyma-project/kyma/components/console-backend-service v0.0.0-20201116133707-dd0a4cf8e9d8 // indirect + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20201116133707-dd0a4cf8e9d8 github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.6.0 go.opencensus.io v0.22.4 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d + golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect + k8s.io/api v0.19.4 + k8s.io/apimachinery v0.19.4 + k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible + k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect + sigs.k8s.io/controller-runtime v0.6.0 +) + +replace ( + k8s.io/api => k8s.io/api v0.16.15 + k8s.io/apimachinery => k8s.io/apimachinery v0.16.15 + k8s.io/client-go => k8s.io/client-go v0.16.15 ) diff --git a/go.sum b/go.sum index a04bab7..9078fb9 100644 --- a/go.sum +++ b/go.sum @@ -1,126 +1,1014 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.47.0 h1:1JUtpcY9E7+eTospEwWS2QXP3DEn7poB3E2j0jN74mM= +cloud.google.com/go v0.47.0/go.mod h1:5p3Ky/7f3N10VBkhuR5LFtddroTiMyjZV/Kj5qOQFxU= +cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeSEBLPA9YJp5bjrofdU3pIXs= +contrib.go.opencensus.io/exporter/prometheus v0.1.0/go.mod h1:cGFniUXGZlKRjzOyuZJ6mgB+PgBcCIa79kEKR8YCW+A= +contrib.go.opencensus.io/exporter/stackdriver v0.12.9/go.mod h1:XyyafDnFOsqoxHJgTFycKZMrRUrPThLh2iYTJF6uoO0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/99designs/gqlgen v0.11.3/go.mod h1:RgX5GRRdDWNkh4pBrdzNpNPFVsdoUFY2+adM6nb1N+4= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= +github.com/Azure/go-autorest/autorest/adal v0.5.0 h1:q2gDruN08/guU9vAjuPWff0+QIrpH6ediguzdAzXAUU= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= +github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/sarama v1.26.0/go.mod h1:y/CFFTO9eaMTNriwu/Q+W4eioLqiDMGkA1W+gmdfj8w= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/agnivade/levenshtein v1.0.3/go.mod h1:4SFRZbbXWLF4MU1T9Qg0pGgH3Pjs+t6ie5efyrwRJXs= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30/go.mod h1:4AJxUpXUhv4N+ziTvIcWWXgeorXpxPZOfk9HdEVr96M= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asyncapi/converter-go v0.0.0-20190802111537-d8459b2bd403/go.mod h1:mpJYWYy+USNiLENQxiyGgRc3qtFPxYSWdSd/eS+R6bo= +github.com/asyncapi/converter-go v0.0.0-20190916120412-39eeca5e9df5/go.mod h1:mpJYWYy+USNiLENQxiyGgRc3qtFPxYSWdSd/eS+R6bo= +github.com/asyncapi/parser v0.0.0-20191002092055-f7b577d06d20/go.mod h1:MuJ++ZbwZV7Di4OtSGtgAe2whaMEZjYBPVnf8U/Qvo4= +github.com/avast/retry-go v2.4.1+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= +github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= +github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= +github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudevents/sdk-go/v2 v2.2.0 h1:FlBJg7W0QywbOjuZGmRXUyFk8qkCHx2euETp+tuopSU= github.com/cloudevents/sdk-go/v2 v2.2.0/go.mod h1:3CTrpB4+u7Iaj6fd7E2Xvm5IxMdRoaAhqaRVnOr2rCU= +github.com/cloudevents/sdk-go/v2 v2.3.1 h1:QRTu0yRA4FbznjRSds0/4Hy6cVYpWV2wInlNJSHWAtw= +github.com/cloudevents/sdk-go/v2 v2.3.1/go.mod h1:4fO2UjPMYYR1/7KPJQCwTPb0lFA8zYuitkUpAZFSY1Q= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/coreos/bbolt v1.3.1-coreos.6/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.15+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= +github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= +github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc= +github.com/evanphx/json-patch v4.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.1.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/gernest/front v0.0.0-20181129160812-ed80ca338b88/go.mod h1:FwEMwQ5+xky8tbzDLj72k2RAqXnFByLNwxg+9UZDtqU= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-chi/chi v3.3.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= +github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ini/ini v1.51.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +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-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= +github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= +github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= +github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= +github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= +github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= +github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= +github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= +github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= +github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= +github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= +github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= +github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= +github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= +github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= +github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= +github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= +github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= +github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= +github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= +github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= +github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= +github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= +github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobuffalo/envy v1.6.5/go.mod h1:N+GkhhZ/93bGZc6ZKhJLP6+m+tCNPKwgSpH9kaifseQ= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.5/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= +github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= +github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= +github.com/googleapis/gnostic v0.4.0 h1:BXDUo8p/DaxC+4FJY/SSx3gvnx9C1VdHNgaUkiEL5mk= +github.com/googleapis/gnostic v0.4.0/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= +github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/gophercloud/gophercloud v0.1.0 h1:P/nh25+rzXouhytV2pUHBb65fnds26Ghl8/391+sT5o= +github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= +github.com/grpc-ecosystem/grpc-gateway v1.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= +github.com/grpc-ecosystem/grpc-gateway v1.9.4/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= +github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= +github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= +github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +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/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kubernetes-sigs/service-catalog v0.2.2-0.20190920221325-ccab52343967/go.mod h1:fmRsWJ38Od93DQ7cOXR9mMSSwmjyDS1EAomWxBlumuo= +github.com/kyma-incubator/api-gateway v0.0.0-20191125140217-295e8fcaa03f/go.mod h1:EwSqotNAjdWdMGQdE7hQaRF68MM2raDRJlRnBi9sltY= +github.com/kyma-project/helm-broker v0.0.0-20190906085923-d07feb2d365a/go.mod h1:VFnkD5ddzF9s8qcY12DRzYOznJJlpMbSRWGRgM4P1XA= +github.com/kyma-project/kyma v0.5.0 h1:msjpImAtZ3l+y6j+dHvOwF4Nm0J4IGJXRRBw7VwnqpA= +github.com/kyma-project/kyma v0.5.1-0.20200609051543-f5997d4a36d6 h1:P3R3c4pewIa+IjzNldO9WRFA58s0r3WVqRxLK6feYc8= +github.com/kyma-project/kyma v0.5.1-0.20200609051543-f5997d4a36d6/go.mod h1:cfj5AQwIOmmoXLZUhW3bIiaB66Z6vgjCYu7TRK3+1lc= +github.com/kyma-project/kyma/components/console-backend-service v0.0.0-20201116133707-dd0a4cf8e9d8 h1:DvhO1yDD4KB/KOmiU8E33zOuH0BCYIMmgkMBDQUq/hc= +github.com/kyma-project/kyma/components/console-backend-service v0.0.0-20201116133707-dd0a4cf8e9d8/go.mod h1:VMlJrqyEmVRlVy1mhM6vjVKH5wC/oZZKa1ekItebJeQ= +github.com/kyma-project/kyma/components/event-publisher-proxy v0.0.0-20201014135541-82b304ab245a/go.mod h1:SzxIlsqx8zJXNhqyUabWs8NzYcfEv1SleJ1U0+Gp6Ms= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20201116133707-dd0a4cf8e9d8 h1:7SL5NKGZZjrTR71UXvs3l5LUczOxlRrken6EMCEua+o= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20201116133707-dd0a4cf8e9d8/go.mod h1:KsN8YoKL6hF9/kQeOaGuCrCMmzelOhjoHhmnXKAWfYE= +github.com/kyma-project/kyma/components/function-controller v0.0.0-20201012150043-858bc2c23ef5/go.mod h1:842PCaqaSMTkmr80oQsckxMyZ6WXBLy6E22/JPQeUl0= +github.com/kyma-project/rafter v0.0.0-20200402080904-a0157e52e150/go.mod h1:zlQEXkFdCYTii7GGjd0jLOudgPtxgZLJy2VDXW7j54I= github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac h1:+2b6iGRJe3hvV/yVXrd41yVEjxuFHxasJqDhkIjS4gk= github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac/go.mod h1:Frd2bnT3w5FB5q49ENTfVlztJES+1k/7lyWX2+9gq/M= +github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +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/markbates/inflect v1.0.4/go.mod h1:1fR9+pO2KHEO9ZRtto13gDwwZaAKstQzferVeWqbgNs= +github.com/matryer/moq v0.0.0-20200106131100-75d0ddfc0007/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/minio/minio-go v6.0.14+incompatible/go.mod h1:7guKYtitv8dktvNUGrhzmNlA5wrAABTQXCoesZdFQO8= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= +github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/moby/moby v17.12.0-ce-rc1.0.20200618181300-9dc6525e6118+incompatible/go.mod h1:fDXVQ6+S340veQPv35CzDahGBmHsiclFwfEygB/TWMc= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.4.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.2 h1:uqH7bpe+ERSiDa34FDOF7RikN6RzXgduUF8yarlZp94= github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.3.0/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.3.5/go.mod h1:uVHyebswE1cCXr2A73cRM2frx5ld1RJUCJkFNZ90ZiI= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go-opentracing v0.3.5/go.mod h1:js2AbwmHW0YD9DwIw2JhQWmbfFi/UnWyYwdVhqbCDOE= +github.com/ory/hydra-maester v0.0.19/go.mod h1:nLN4AAm6u1Iht1INnp4fl6blbCf2wDDZ+PbTWS1aDnA= +github.com/ory/oathkeeper-maester v0.0.2-beta.1/go.mod h1:pKLJLWu1AdMxyq9tufkZzS6+7bW2xz9aN/Sk04XGlmw= +github.com/ory/oathkeeper-maester v0.0.7/go.mod h1:I+J8vshTw2Eax35LzBOK4K/1+Pi4gQ+SgYZzTenEIMs= +github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 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/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= +github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.2.1 h1:JnMpQc6ppsNgw9QPAGF6Dod479itz7lvlsMzzNayLOI= +github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +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.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.0.11 h1:DhHlBtkHWPYi8O2y31JkK0TF+DGM+51OopZjH/Ia5qI= +github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= +github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= +github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U= +github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +github.com/vektah/gqlparser/v2 v2.0.1/go.mod h1:SyUiHgLATUR8BiYURfTirrTcGpcE+4XkV2se04Px1Ms= +github.com/vrischmann/envconfig v1.2.0/go.mod h1:c5DuUlkzfsnspy1g7qiqryPCsW+NjsrLsYq4zhwsoHo= +github.com/vrischmann/envconfig v1.3.0/go.mod h1:bbvxFYJdRSpXrhS63mBFtKJzkDiNkyArOLXtY6q0kuI= +github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= +github.com/xeipuuv/gojsonpointer v0.0.0-20190809123943-df4f5c81cb3b/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= +github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= +go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.14.0 h1:/pduUoebOeeJzTDFuoMgC6nRkiasr1sBCIEorly7m4o= +go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180112015858-5ccada7d0a7b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190514140710-3ec191127204/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190912160710-24e19bdeb0f2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190918130420-a8b05e9114ab/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180117170059-2c42eef0765b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190429190828-d89cdac9e872/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190912141932-bc967efca4b8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190919044723-0c1ff786ef13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4 h1:5/PjkGUjvEU5Gl6BxmvKRPpqo2uNMv4rcHBMwzk/st8= +golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20171227012246-e19ae1496984/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= +golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190501045030-23463209683d/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190515012406-7d7faa4812bd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191010171213-8abd42400456/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200114235610-7ae403b6b589/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200214144324-88be01311a71/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4 h1:v8Jgq9X6Es9K9otVr9jxENEJigepKMZgA9OmrIZDtFA= +golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gomodules.xyz/jsonpatch/v2 v2.0.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= +gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= +gomodules.xyz/jsonpatch/v2 v2.1.0 h1:Phva6wqu+xR//Njw6iorylFFgn/z547tw5Ne3HZPQ+k= +gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= +gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= +gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= +gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.10.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.48.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= +gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= +gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= +gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= +gopkg.in/jcmturner/gokrb5.v7 v7.4.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= +gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.4.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= +gopkg.in/yaml.v2 v2.0.0/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= +k8s.io/api v0.0.0-20190918155943-95b840bb6a1f/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= +k8s.io/api v0.0.0-20191003000013-35e20aa79eb8/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= +k8s.io/api v0.16.15 h1:6yvV9YNGwnebDAsA4Sfj+1b1S9j5OYfmckjTdc9b1bI= +k8s.io/api v0.16.15/go.mod h1:8z880CLtpCJqHWe9vmBkZMQeMKHNvdTQuqLW2QUefUA= +k8s.io/api v0.17.9/go.mod h1:avJJAA1fSV6tnbCGW2K+S+ilDFW7WpNr5BScoiZ1M1U= +k8s.io/api v0.17.11/go.mod h1:WR3CbTwCAxtfMcEB6c92W3l5aZw09unPCyxmxjYV3xg= +k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= +k8s.io/api v0.19.4 h1:I+1I4cgJYuCDgiLNjKx7SLmIbwgj9w7N7Zr5vSIdwpo= +k8s.io/api v0.19.4/go.mod h1:SbtJ2aHCItirzdJ36YslycFNzWADYH3tgOhvBEFtZAk= +k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= +k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783/go.mod h1:xvae1SZB3E17UpV59AWc271W/Ph25N+bjPyR63X6tPY= +k8s.io/apiextensions-apiserver v0.17.9/go.mod h1:p2C9cDflVAUPMl5/QOMHxnSzQWF/cDqu7AP2KUXHHMA= +k8s.io/apiextensions-apiserver v0.18.2 h1:I4v3/jAuQC+89L3Z7dDgAiN4EOjN6sbm6iBqQwHTah8= +k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= +k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= +k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655/go.mod h1:nL6pwRT8NgfF8TT68DBI8uEePRt89cSvoXUVqbkWHq4= +k8s.io/apimachinery v0.16.15 h1:4cmEfuRsKuV8pMpaQ6z0AKEUXZ3r+u/NKaz5dvIjySk= +k8s.io/apimachinery v0.16.15/go.mod h1:xAtIC8Gj83Pn2OCs2g57wZpZembRhJhiXIlQIqanwas= +k8s.io/apimachinery v0.17.9/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= +k8s.io/apimachinery v0.17.11/go.mod h1:q+iFxLyaMeWIBhSlQ4OMkvdwbwrb8Ux0ALl90XD9paU= +k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= +k8s.io/apimachinery v0.19.4 h1:+ZoddM7nbzrDCp0T3SWnyxqf8cbWPT2fkZImoyvHUG0= +k8s.io/apimachinery v0.19.4/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= +k8s.io/apiserver v0.0.0-20190918160949-bfa5e2e684ad/go.mod h1:XPCXEwhjaFN29a8NldXA901ElnKeKLrLtREO9ZhFyhg= +k8s.io/apiserver v0.17.9/go.mod h1:Qaxd3EbeoPRBHVMtFyuKNAObqP6VAkzIMyWYz8KuE2k= +k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= +k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90/go.mod h1:J69/JveO6XESwVgG53q3Uz5OSfgsv4uxpScmmyYOOlk= +k8s.io/client-go v0.0.0-20191003000419-f68efa97b39e/go.mod h1:UBFA5lo8nEOepaxS9koNccX/38rYMI3pa1EA1gaFZNg= +k8s.io/client-go v0.16.15 h1:cuSmM5begnN77V0beNgmhQ9yob6TFUnN+YaqAfRBD40= +k8s.io/client-go v0.16.15/go.mod h1:onpbkg9XeonG579HOlK9RS56ixfOJdbBM5dKluyFM8c= +k8s.io/client-go v0.17.9/go.mod h1:3cM92qAd1XknA5IRkRfpJhl9OQjkYy97ZEUio70wVnI= +k8s.io/client-go v0.17.11/go.mod h1:gCpWJ1+skW2CjzFGChniiXrX2e51gflrCsDsbykZLLQ= +k8s.io/client-go v0.17.14 h1:J+rMxOy+tAmsD4VBjW6CduZfygaUa3AhdxQsfsX8nhc= +k8s.io/client-go v0.17.14/go.mod h1:1SFRrpQKPcUNGwKy+M7IH+kAiMhw3DnkSth+XtWh5Tk= +k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= +k8s.io/client-go v0.18.9 h1:sPHX49yOtUqv1fl49TwV3f8cC0N3etSnwgFGsIsXnZc= +k8s.io/client-go v0.18.9/go.mod h1:UjkEetDmr40P9NX0Ok3Idt08FCf2I4mIHgjFsot77uY= +k8s.io/client-go v0.19.2 h1:gMJuU3xJZs86L1oQ99R4EViAADUPMHHtS9jFshasHSc= +k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= +k8s.io/client-go v1.5.1 h1:XaX/lo2/u3/pmFau8HN+sB5C/b4dc4Dmm2eXjBH4p1E= +k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= +k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= +k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible h1:U5Bt+dab9K8qaUmXINrkXO135kA11/i5Kg1RUydgaMQ= +k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= +k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269/go.mod h1:V5BD6M4CyaN5m+VthcclXWsVcT1Hu+glwa1bi3MIsyE= +k8s.io/code-generator v0.17.9/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= +k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= +k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090/go.mod h1:933PBGtQFJky3TEwYx4aEPZ4IxqhWh3R6DCmzqIn1hA= +k8s.io/component-base v0.17.9/go.mod h1:Wg22ePDK0mfTa+bEFgZHGwr0h40lXnYy6D7D+f7itFk= +k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= +k8s.io/klog v0.4.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= +k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= +k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= +k8s.io/kube-openapi v0.0.0-20190510232812-a01b7d5d6c22/go.mod h1:iU+ZGYsNlvU9XKUSso6SQfKTCCw7lFduMZy26Mgr2Fw= +k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= +k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= +k8s.io/kube-openapi v0.0.0-20200410163147-594e756bea31 h1:PsbYeEz2x7ll6JYUzBEG+DT78910DDTlvn5Ma10F5/E= +k8s.io/kube-openapi v0.0.0-20200410163147-594e756bea31/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= +k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +knative.dev/eventing v0.13.1/go.mod h1:UxweNv8yXhsdHJitcb9R6rmfNaUD2DFi9GWwNRyIs58= +knative.dev/pkg v0.0.0-20190807140856-4707aad818fe/go.mod h1:pgODObA1dTyhNoFxPZTTjNWfx6F0aKsKzn+vaT9XO/Q= +knative.dev/pkg v0.0.0-20200306230727-a56a6ea3fa56/go.mod h1:pgODObA1dTyhNoFxPZTTjNWfx6F0aKsKzn+vaT9XO/Q= +modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= +modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= +modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= +modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= +modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= +sigs.k8s.io/controller-runtime v0.2.0-beta.2/go.mod h1:TSH2R0nSz4WAlUUlNnOFcOR/VUhfwBLlmtq2X6AiQCA= +sigs.k8s.io/controller-runtime v0.2.0-beta.4/go.mod h1:HweyYKQ8fBuzdu2bdaeBJvsFgAi/OqBBnrVGXcqKhME= +sigs.k8s.io/controller-runtime v0.4.0/go.mod h1:ApC79lpY3PHW9xj/w9pj+lYkLgwAAUZwfXkME1Lajns= +sigs.k8s.io/controller-runtime v0.5.10/go.mod h1:OTqxLuz7gVcrq+BHGUgedRu6b2VIKCEc7Pu4Jbwui0A= +sigs.k8s.io/controller-runtime v0.6.0 h1:Fzna3DY7c4BIP6KwfSlrfnj20DJ+SeMBK8HSFvOk9NM= +sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= +sigs.k8s.io/controller-tools v0.2.0-beta.2/go.mod h1:gC5UAnK1jbxWnDaqTi0yxKIsRsRwshzeRtTUGbM9vos= +sigs.k8s.io/controller-tools v0.2.4/go.mod h1:m/ztfQNocGYBgTTCmFdnK94uVvgxeZeE3LtJvd/jIzA= +sigs.k8s.io/kind v0.4.0/go.mod h1:bgGo2cWxKGQ7esVxtGp9H17Ttlexju92CTMjCg08HNQ= +sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= +sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca h1:6dsH6AYQWbyZmtttJNe8Gq1cXOeS1BdV3eW37zHilAQ= +sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA= +sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7mRH6DGaRcixXEJXTsE= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= +sigs.k8s.io/testing_frameworks v0.1.2/go.mod h1:ToQrwSC3s8Xf/lADdZp3Mktcql9CG0UAmdJG9th5i0w= +sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sourcegraph.com/sourcegraph/appdash v0.0.0-20180110180208-2cc67fd64755/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= +sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67/go.mod h1:L5q+DGLGOQFpo1snNEkLOJT2d1YTW66rWNzatr3He1k= diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 6c29e90..a9d670d 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -7,8 +7,10 @@ import ( "strings" "time" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" "github.com/sirupsen/logrus" @@ -19,7 +21,6 @@ import ( cloudevents "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/ems" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" ) @@ -28,8 +29,9 @@ const ( // noDuration signals that the dispatch step has not started yet. noDuration = -1 - publishEndpoint = "/publish" - legacyEndpointSuffix = "/v1/events" + publishEndpoint = "/publish" + legacyEndpointSuffix = "/v1/events" + subscribedEndpointSuffix = "/v1/events/subscribed" ) var ( @@ -54,6 +56,8 @@ type Handler struct { LegacyTransformer *legacy.Transformer // RequestTimeout timeout for outgoing requests RequestTimeout time.Duration + //SubscribedProcessor processes requests for /:app/v1/events/subscribed endpoint + SubscribedProcessor *subscribed.Processor // Logger default logger Logger *logrus.Logger // Options configures HTTP server @@ -61,14 +65,15 @@ type Handler struct { } // NewHandler returns a new Handler instance for the Event Publisher Proxy. -func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.HttpMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, options *options.Options, logger *logrus.Logger) *Handler { +func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.HttpMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logrus.Logger) *Handler { return &Handler{ - Receiver: receiver, - Sender: sender, - RequestTimeout: requestTimeout, - LegacyTransformer: legacyTransformer, - Logger: logger, - Options: options, + Receiver: receiver, + Sender: sender, + RequestTimeout: requestTimeout, + LegacyTransformer: legacyTransformer, + SubscribedProcessor: subscribedProcessor, + Logger: logger, + Options: opts, } } @@ -82,7 +87,7 @@ func (h *Handler) Start(ctx context.Context) error { // to the EMS gateway and writes back the HTTP response. func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { // validate request method - if request.Method != http.MethodPost { + if request.Method != http.MethodPost && request.Method != http.MethodGet { h.Logger.Warnf("Unexpected request method: %s", request.Method) h.writeResponse(writer, http.StatusMethodNotAllowed, nil) return @@ -105,6 +110,13 @@ func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { return } + // Process /:application/v1/events/subscribed + // Fetches the list of subscriptions available for the given application + if isARequestForSubscriptions(uri) { + h.SubscribedProcessor.ExtractEventsFromSubscriptions(writer, request) + return + } + h.writeResponse(writer, http.StatusNotFound, nil) return } @@ -130,6 +142,14 @@ func isARequestWithLegacyEvent(uri string) bool { return true } +func isARequestForSubscriptions(uri string) bool { + // Assuming the path should be of the form /:application/v1/events/subscribed + if !strings.HasSuffix(uri, subscribedEndpointSuffix) { + return false + } + return true +} + func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { event := h.LegacyTransformer.TransformsLegacyRequestsToCE(writer, request) if event == nil { diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index 13f96c2..1919dc8 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -2,28 +2,32 @@ package handler import ( "context" - "crypto/rand" "encoding/json" "fmt" - "io" "io/ioutil" "net/http" "reflect" - "regexp" - "strconv" "testing" "time" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" - "github.com/sirupsen/logrus" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/dynamic/dynamicinformer" + dynamicfake "k8s.io/client-go/dynamic/fake" legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + "github.com/sirupsen/logrus" ) const ( @@ -123,7 +127,7 @@ func TestHandler(t *testing.T) { }, } - port, err := generatePort() + port, err := testingutils.GeneratePort() if err != nil { t.Fatalf("failed to generate port: %v", err) } @@ -155,14 +159,14 @@ func TestHandler(t *testing.T) { msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) legacyTransformer := legacy.NewTransformer("beb.ns", "event.type.prefix") opts := &options.Options{MaxRequestSize: 65536} - handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, logrus.New()) + handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, nil, logrus.New()) go func() { if err := handler.Start(ctx); err != nil { t.Errorf("failed to start handler with error: %v", err) } }() - waitForHandlerToStart(t, healthEndpoint) + testingutils.WaitForHandlerToStart(t, healthEndpoint) for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { @@ -182,7 +186,7 @@ func TestHandler(t *testing.T) { func TestHandlerTimeout(t *testing.T) { t.Parallel() - port, err := generatePort() + port, err := testingutils.GeneratePort() if err != nil { t.Fatalf("failed to generate port: %v", err) } @@ -215,14 +219,14 @@ func TestHandlerTimeout(t *testing.T) { legacyTransformer := legacy.NewTransformer("beb.ns", "event.type.prefix") opts := &options.Options{MaxRequestSize: 65536} - handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, logrus.New()) + handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, nil, logrus.New()) go func() { if err := handler.Start(ctx); err != nil { t.Errorf("failed to start handler with error: %v", err) } }() - waitForHandlerToStart(t, healthEndpoint) + testingutils.WaitForHandlerToStart(t, healthEndpoint) body, headers := testingutils.StructuredCloudEventPayload, testingutils.GetStructuredMessageHeaders() resp, err := testingutils.SendEvent(publishEndpoint, body, headers) @@ -235,31 +239,9 @@ func TestHandlerTimeout(t *testing.T) { } } -func waitForHandlerToStart(t *testing.T, healthEndpoint string) { - timeout := time.After(time.Second * 30) - tick := time.Tick(time.Second * 1) - - for { - select { - case <-timeout: - { - t.Fatal("Failed to start handler") - } - case <-tick: - { - if resp, err := http.Get(healthEndpoint); err != nil { - continue - } else if resp.StatusCode == http.StatusOK { - return - } - } - } - } -} - func TestHandlerForLegacyEvents(t *testing.T) { t.Parallel() - port, err := generatePort() + port, err := testingutils.GeneratePort() if err != nil { t.Fatalf("failed to generate port: %v", err) } @@ -311,7 +293,7 @@ func TestHandlerForLegacyEvents(t *testing.T) { }, wantStatusCode: http.StatusBadRequest, wantResponse: legacyapi.PublishEventResponses{ - Error: getInvalidValidationErrorFor("event-id"), + Error: testingutils.GetInvalidValidationErrorFor("event-id"), }, }, { @@ -321,7 +303,7 @@ func TestHandlerForLegacyEvents(t *testing.T) { }, wantStatusCode: http.StatusBadRequest, wantResponse: legacyapi.PublishEventResponses{ - Error: getMissingFieldValidationErrorFor("event-time"), + Error: testingutils.GetMissingFieldValidationErrorFor("event-time"), }, }, { @@ -331,7 +313,7 @@ func TestHandlerForLegacyEvents(t *testing.T) { }, wantStatusCode: http.StatusBadRequest, wantResponse: legacyapi.PublishEventResponses{ - Error: getMissingFieldValidationErrorFor("event-type"), + Error: testingutils.GetMissingFieldValidationErrorFor("event-type"), }, }, { @@ -341,7 +323,7 @@ func TestHandlerForLegacyEvents(t *testing.T) { }, wantStatusCode: http.StatusBadRequest, wantResponse: legacyapi.PublishEventResponses{ - Error: getInvalidValidationErrorFor("event-time"), + Error: testingutils.GetInvalidValidationErrorFor("event-time"), }, }, { @@ -351,7 +333,7 @@ func TestHandlerForLegacyEvents(t *testing.T) { }, wantStatusCode: http.StatusBadRequest, wantResponse: legacyapi.PublishEventResponses{ - Error: getMissingFieldValidationErrorFor("event-type-version"), + Error: testingutils.GetMissingFieldValidationErrorFor("event-type-version"), }, }, { @@ -361,7 +343,7 @@ func TestHandlerForLegacyEvents(t *testing.T) { }, wantStatusCode: http.StatusBadRequest, wantResponse: legacyapi.PublishEventResponses{ - Error: getMissingFieldValidationErrorFor("data"), + Error: testingutils.GetMissingFieldValidationErrorFor("data"), }, }, } @@ -390,14 +372,14 @@ func TestHandlerForLegacyEvents(t *testing.T) { msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) legacyTransformer := legacy.NewTransformer(cfg.BEBNamespace, cfg.EventTypePrefix) opts := &options.Options{MaxRequestSize: 65536} - handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, logrus.New()) + handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, nil, logrus.New()) go func() { if err := handler.Start(ctx); err != nil { t.Errorf("failed to start handler with error: %v", err) } }() - waitForHandlerToStart(t, healthEndpoint) + testingutils.WaitForHandlerToStart(t, healthEndpoint) for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { @@ -413,9 +395,9 @@ func TestHandlerForLegacyEvents(t *testing.T) { } if testCase.wantStatusCode == http.StatusOK { - validateOkResponse(t, *resp, &testCase.wantResponse) + testingutils.ValidateOkResponse(t, *resp, &testCase.wantResponse) } else { - validateErrorResponse(t, *resp, &testCase.wantResponse) + testingutils.ValidateErrorResponse(t, *resp, &testCase.wantResponse) } }) } @@ -423,7 +405,7 @@ func TestHandlerForLegacyEvents(t *testing.T) { func TestHandlerForBEBFailures(t *testing.T) { t.Parallel() - port, err := generatePort() + port, err := testingutils.GeneratePort() if err != nil { t.Fatalf("failed to generate port: %v", err) } @@ -458,14 +440,14 @@ func TestHandlerForBEBFailures(t *testing.T) { msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) legacyTransformer := legacy.NewTransformer(cfg.BEBNamespace, cfg.EventTypePrefix) opts := &options.Options{MaxRequestSize: 65536} - handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, logrus.New()) + handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, nil, logrus.New()) go func() { if err := handler.Start(ctx); err != nil { t.Errorf("failed to start handler with error: %v", err) } }() - waitForHandlerToStart(t, healthEndpoint) + testingutils.WaitForHandlerToStart(t, healthEndpoint) testCases := []struct { name string @@ -512,7 +494,7 @@ func TestHandlerForBEBFailures(t *testing.T) { } if testCase.endPoint == publishLegacyEndpoint { - validateErrorResponse(t, *resp, &testCase.wantResponse) + testingutils.ValidateErrorResponse(t, *resp, &testCase.wantResponse) } }) } @@ -520,7 +502,7 @@ func TestHandlerForBEBFailures(t *testing.T) { func TestHandlerForHugeRequests(t *testing.T) { t.Parallel() - port, err := generatePort() + port, err := testingutils.GeneratePort() if err != nil { t.Fatalf("failed to generate port: %v", err) } @@ -556,14 +538,14 @@ func TestHandlerForHugeRequests(t *testing.T) { // Limiting the accepted size of the request to 2 Bytes opts := &options.Options{MaxRequestSize: 2} - handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, logrus.New()) + handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, nil, logrus.New()) go func() { if err := handler.Start(ctx); err != nil { t.Errorf("failed to start handler with error: %v", err) } }() - waitForHandlerToStart(t, healthEndpoint) + testingutils.WaitForHandlerToStart(t, healthEndpoint) testCases := []struct { name string @@ -606,43 +588,138 @@ func TestHandlerForHugeRequests(t *testing.T) { } } -// getMissingFieldValidationErrorFor generates an Error message for a missing field -func getMissingFieldValidationErrorFor(field string) *legacyapi.Error { - return &legacyapi.Error{ - Status: 400, - Type: "validation_violation", - Message: "Missing field", - Details: []legacyapi.ErrorDetail{ - { - Field: field, - Type: "missing_field", - Message: "Missing field", - MoreInfo: "", - }, - }, +func TestHandlerForSubscribedEndpoint(t *testing.T) { + t.Parallel() + port, err := testingutils.GeneratePort() + if err != nil { + t.Fatalf("failed to generate port: %v", err) } -} + var ( + subscribedEndpointFormat = "http://localhost:%d/%s/v1/events/subscribed" + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + bebNs = "/beb.namespace" + eventTypePrefix = "event.type.prefix" + ) -// isValidEventID checks whether EventID is valid or not -func isValidEventID(id string) bool { - return regexp.MustCompile(legacy.AllowedEventIDChars).MatchString(id) -} + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() -// getInvalidValidationErrorFor generates an Error message for an invalid field -func getInvalidValidationErrorFor(field string) *legacyapi.Error { - return &legacyapi.Error{ - Status: 400, - Type: "validation_violation", - Message: "Invalid field", - Details: []legacyapi.ErrorDetail{ - { - Field: field, - Type: "invalid_field", - Message: "Invalid field", - MoreInfo: "", + cfg := testingutils.NewEnvConfig( + // BEB details are not needed in this test + "", + "", + testingutils.WithPort(port), + testingutils.WithBEBNamespace(bebNs), + testingutils.WithEventTypePrefix(eventTypePrefix), + ) + recv := receiver.NewHttpMessageReceiver(cfg.Port) + opts := &options.Options{MaxRequestSize: 65536} + legacyTransformer := legacy.NewTransformer(cfg.BEBNamespace, cfg.EventTypePrefix) + + // Setting up fake informers + scheme := runtime.NewScheme() + if err := corev1.AddToScheme(scheme); err != nil { + t.Fatalf("failed to add corev1 to scheme: %v", err) + } + if err := eventingv1alpha1.AddToScheme(scheme); err != nil { + t.Fatalf("failed to add eventing v1alpha1 to scheme: %v", err) + } + subscription := testingutils.NewSubscription() + + subUnstructuredMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(subscription) + if err != nil { + t.Fatalf("failed to convert subscription to unstructured obj: %v", err) + } + // Creating unstructured subscriptions + subUnstructured := &unstructured.Unstructured{ + Object: subUnstructuredMap, + } + // Setting Kind information in unstructured subscription + subscriptionGVK := schema.GroupVersionKind{ + Group: subscribed.GVR.Group, + Version: subscribed.GVR.Version, + Kind: "Subscription", + } + subUnstructured.SetGroupVersionKind(subscriptionGVK) + // Configuring fake dynamic client + dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subUnstructured) + + dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, + 10*time.Second, + v1.NamespaceAll, + nil, + ) + genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) + t.Logf("Waiting for cache to resync") + subscribed.WaitForCacheSyncOrDie(ctx, dFilteredSharedInfFactory) + t.Logf("Informers resynced successfully") + subLister := genericInf.Lister() + subscribedProcessor := &subscribed.Processor{ + SubscriptionLister: &subLister, + Config: cfg, + Logger: logrus.New(), + } + + handler := NewHandler(recv, nil, cfg.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logrus.New()) + go func() { + if err := handler.Start(ctx); err != nil { + t.Errorf("failed to start handler with error: %v", err) + } + }() + testingutils.WaitForHandlerToStart(t, healthEndpoint) + testCases := []struct { + name string + appName string + inputSubscriptions []eventingv1alpha1.Subscription + wantStatusCode int + wantResponse subscribed.Events + }{ + { + name: "Send a request with a valid application name", + appName: "valid-app", + wantStatusCode: http.StatusOK, + wantResponse: subscribed.Events{ + EventsInfo: []subscribed.Event{{ + Name: "order.created", + Version: "v1", + }}, + }, + }, { + name: "Send a request with an invalid application name", + appName: "invalid-app", + wantStatusCode: http.StatusOK, + wantResponse: subscribed.Events{ + EventsInfo: []subscribed.Event{}, }, }, } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + subscribedURL := fmt.Sprintf(subscribedEndpointFormat, port, testCase.appName) + resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) + if err != nil { + t.Errorf("failed to send event with error: %v", err) + } + + if testCase.wantStatusCode != resp.StatusCode { + t.Errorf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) + } + defer func() { _ = resp.Body.Close() }() + respBodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Errorf("failed to convert body to bytes: %v", err) + } + gotEventsResponse := subscribed.Events{} + err = json.Unmarshal(respBodyBytes, &gotEventsResponse) + if err != nil { + t.Errorf("failed to unmarshal body bytes to events response: %v", err) + } + if !reflect.DeepEqual(testCase.wantResponse, gotEventsResponse) { + t.Errorf("incorrect response, wanted: %v, got: %v", testCase.wantResponse, gotEventsResponse) + } + }) + } } func TestIsARequestWithLegacyEvent(t *testing.T) { @@ -675,80 +752,3 @@ func TestIsARequestWithLegacyEvent(t *testing.T) { } } } - -// validateErrorResponse validates Error Response -func validateErrorResponse(t *testing.T, resp http.Response, tcWantResponse *legacyapi.PublishEventResponses) { - legacyResponse := legacyapi.PublishEventResponses{} - legacyError := legacyapi.Error{} - bodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatalf("failed to read response body: %v", err) - } - t.Logf("response body : %s", string(bodyBytes)) - if err = json.Unmarshal(bodyBytes, &legacyError); err != nil { - t.Fatalf("failed to unmarshal response body: %v", err) - } - legacyResponse.Error = &legacyError - if !reflect.DeepEqual(tcWantResponse.Error, legacyResponse.Error) { - t.Fatalf("Invalid error, want: %v, got: %v", tcWantResponse.Error, legacyResponse.Error) - } -} - -// validateOkResponse validates Ok Response -func validateOkResponse(t *testing.T, resp http.Response, tcWantResponse *legacyapi.PublishEventResponses) { - legacyOkResponse := legacyapi.PublishResponse{} - legacyResponse := legacyapi.PublishEventResponses{} - bodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatalf("failed to read response body: %v", err) - } - t.Logf("response body : %s", string(bodyBytes)) - if err = json.Unmarshal(bodyBytes, &legacyOkResponse); err != nil { - t.Fatalf("failed to unmarshal response body: %v", err) - } - legacyResponse.Ok = &legacyOkResponse - if err = resp.Body.Close(); err != nil { - t.Fatalf("failed to close body: %v", err) - } - - if tcWantResponse.Ok.EventID != "" && tcWantResponse.Ok.EventID != legacyResponse.Ok.EventID { - t.Errorf("invalid event-id, want: %v, got: %v", tcWantResponse.Ok.EventID, legacyResponse.Ok.EventID) - } - - if tcWantResponse.Ok.EventID == "" && !isValidEventID(legacyResponse.Ok.EventID) { - t.Errorf("should match regex: [%s] Not a valid event-id: %v ", legacy.AllowedEventIDChars, legacyResponse.Ok.EventID) - } - if tcWantResponse.Ok.Reason != legacyResponse.Ok.Reason { - t.Errorf("invalid reason, want: %v, got: %v", tcWantResponse.Ok.Reason, legacyResponse.Ok.Reason) - } - if tcWantResponse.Ok.Status != legacyResponse.Ok.Status { - t.Errorf("invalid status, want: %v, got: %v", tcWantResponse.Ok.Status, legacyResponse.Ok.Status) - } -} - -// generatePort generates a random 5 digit port -func generatePort() (int, error) { - max := 4 - // Add 4 as prefix to make it 5 digits but less than 65535 - add4AsPrefix := "4" - b := make([]byte, max) - n, err := io.ReadAtLeast(rand.Reader, b, max) - if n != max { - return 0, err - } - if err != nil { - return 0, err - } - for i := 0; i < len(b); i++ { - b[i] = table[int(b[i])%len(table)] - } - - num, err := strconv.Atoi(fmt.Sprintf("%s%s", add4AsPrefix, string(b))) - if err != nil { - return 0, err - } - - return num, nil -} - -var table = [...]byte{'1', '2', '3', '4', '5', '6', '7', '8', '9'} diff --git a/pkg/legacy-events/constants.go b/pkg/legacy-events/constants.go index 5f5891d..843a33b 100644 --- a/pkg/legacy-events/constants.go +++ b/pkg/legacy-events/constants.go @@ -36,4 +36,5 @@ const ( // HTTP ContentType constants const ( ContentTypeApplicationJSON = "application/json" + HeaderContentType = "Content-Type" ) diff --git a/pkg/legacy-events/error_responses.go b/pkg/legacy-events/error_responses.go new file mode 100644 index 0000000..118c6ba --- /dev/null +++ b/pkg/legacy-events/error_responses.go @@ -0,0 +1,78 @@ +package legacy + +import ( + "net/http" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" +) + +// An ErrorResponse represents an error with a status code and an error message +type HTTPErrorResponse struct { + Code int `json:"code"` + Error string `json:"error"` +} + +// ErrorResponseBadRequest returns an error of type PublishEventResponses with BadRequest status code +func ErrorResponseBadRequest(moreInfo string) (response *api.PublishEventResponses) { + var details []api.ErrorDetail + apiError := api.Error{Status: http.StatusBadRequest, Type: ErrorTypeBadPayload, Message: ErrorMessageBadPayload, MoreInfo: moreInfo, Details: details} + return &api.PublishEventResponses{Ok: nil, Error: &apiError} +} + +// ErrorResponseRequestBodyTooLarge returns an error of type PublishEventResponses with BadRequest status code +func ErrorResponseRequestBodyTooLarge(moreInfo string) (response *api.PublishEventResponses) { + var details []api.ErrorDetail + apiError := api.Error{Status: http.StatusRequestEntityTooLarge, Type: ErrorTypeRequestBodyTooLarge, Message: ErrorMessageRequestBodyTooLarge, MoreInfo: moreInfo, Details: details} + return &api.PublishEventResponses{Ok: nil, Error: &apiError} +} + +// ErrorResponseMissingFieldEventType returns an error of type PublishEventResponses for missing EventType field +func ErrorResponseMissingFieldEventType() (response *api.PublishEventResponses) { + return CreateMissingFieldError(FieldEventType) +} + +// ErrorResponseMissingFieldEventTypeVersion returns an error of type PublishEventResponses for missing EventTypeVersion field +func ErrorResponseMissingFieldEventTypeVersion() (response *api.PublishEventResponses) { + return CreateMissingFieldError(FieldEventTypeVersion) +} + +// ErrorResponseWrongEventTypeVersion returns an error of type PublishEventResponses for wrong EventTypeVersion field +func ErrorResponseWrongEventTypeVersion() (response *api.PublishEventResponses) { + return CreateInvalidFieldError(FieldEventTypeVersion) +} + +// ErrorResponseMissingFieldEventTime returns an error of type PublishEventResponses for missing EventTime field +func ErrorResponseMissingFieldEventTime() (response *api.PublishEventResponses) { + return CreateMissingFieldError(FieldEventTime) +} + +// ErrorResponseWrongEventTime returns an error of type PublishEventResponses for wrong EventTime field +func ErrorResponseWrongEventTime() (response *api.PublishEventResponses) { + return CreateInvalidFieldError(FieldEventTime) +} + +// ErrorResponseWrongEventID returns an error of type PublishEventResponses for wrong EventID field +func ErrorResponseWrongEventID() (response *api.PublishEventResponses) { + return CreateInvalidFieldError(FieldEventID) +} + +// ErrorResponseMissingFieldData returns an error of type PublishEventResponses for missing Data field +func ErrorResponseMissingFieldData() (response *api.PublishEventResponses) { + return CreateMissingFieldError(FieldData) +} + +//CreateMissingFieldError create an error for a missing field +func CreateMissingFieldError(field interface{}) (response *api.PublishEventResponses) { + apiErrorDetail := api.ErrorDetail{Field: field.(string), Type: ErrorTypeMissingField, Message: ErrorMessageMissingField, MoreInfo: ""} + details := []api.ErrorDetail{apiErrorDetail} + apiError := api.Error{Status: http.StatusBadRequest, Type: ErrorTypeValidationViolation, Message: ErrorMessageMissingField, MoreInfo: "", Details: details} + return &api.PublishEventResponses{Ok: nil, Error: &apiError} +} + +//CreateInvalidFieldError creates an error for an invalid field +func CreateInvalidFieldError(field interface{}) (response *api.PublishEventResponses) { + apiErrorDetail := api.ErrorDetail{Field: field.(string), Type: ErrorTypeInvalidField, Message: ErrorMessageInvalidField, MoreInfo: ""} + details := []api.ErrorDetail{apiErrorDetail} + apiError := api.Error{Status: http.StatusBadRequest, Type: ErrorTypeValidationViolation, Message: ErrorMessageInvalidField, MoreInfo: "", Details: details} + return &api.PublishEventResponses{Ok: nil, Error: &apiError} +} diff --git a/pkg/legacy-events/helpers.go b/pkg/legacy-events/helpers.go index 70ea4de..431861f 100644 --- a/pkg/legacy-events/helpers.go +++ b/pkg/legacy-events/helpers.go @@ -1,72 +1,56 @@ package legacy import ( - "net/http" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" -) - -// ErrorResponseBadRequest returns an error of type PublishEventResponses with BadRequest status code -func ErrorResponseBadRequest(moreInfo string) (response *api.PublishEventResponses) { - var details []api.ErrorDetail - apiError := api.Error{Status: http.StatusBadRequest, Type: ErrorTypeBadPayload, Message: ErrorMessageBadPayload, MoreInfo: moreInfo, Details: details} - return &api.PublishEventResponses{Ok: nil, Error: &apiError} -} - -// ErrorResponseRequestBodyTooLarge returns an error of type PublishEventResponses with BadRequest status code -func ErrorResponseRequestBodyTooLarge(moreInfo string) (response *api.PublishEventResponses) { - var details []api.ErrorDetail - apiError := api.Error{Status: http.StatusRequestEntityTooLarge, Type: ErrorTypeRequestBodyTooLarge, Message: ErrorMessageRequestBodyTooLarge, MoreInfo: moreInfo, Details: details} - return &api.PublishEventResponses{Ok: nil, Error: &apiError} -} + "fmt" -// ErrorResponseMissingFieldEventType returns an error of type PublishEventResponses for missing EventType field -func ErrorResponseMissingFieldEventType() (response *api.PublishEventResponses) { - return CreateMissingFieldError(FieldEventType) -} + api "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + log "github.com/sirupsen/logrus" -// ErrorResponseMissingFieldEventTypeVersion returns an error of type PublishEventResponses for missing EventTypeVersion field -func ErrorResponseMissingFieldEventTypeVersion() (response *api.PublishEventResponses) { - return CreateMissingFieldError(FieldEventTypeVersion) -} + "encoding/json" + "net/http" + "strings" +) -// ErrorResponseWrongEventTypeVersion returns an error of type PublishEventResponses for wrong EventTypeVersion field -func ErrorResponseWrongEventTypeVersion() (response *api.PublishEventResponses) { - return CreateInvalidFieldError(FieldEventTypeVersion) +// ParseApplicationNameFromPath returns application name from the URL. +// The format of the URL is: /:application-name/v1/... +func ParseApplicationNameFromPath(path string) string { + // Assumption: Clients(application validator which has a flag for the path(https://github.com/kyma-project/kyma/blob/master/components/application-connectivity-validator/cmd/applicationconnectivityvalidator/applicationconnectivityvalidator.go#L49) using this endpoint must be sending request to path /:application/v1/events + // Hence it should be safe to return 0th index as the application name + pathSegments := make([]string, 0) + for _, segment := range strings.Split(path, "/") { + if strings.TrimSpace(segment) != "" { + pathSegments = append(pathSegments, segment) + } + } + return pathSegments[0] } -// ErrorResponseMissingFieldEventTime returns an error of type PublishEventResponses for missing EventTime field -func ErrorResponseMissingFieldEventTime() (response *api.PublishEventResponses) { - return CreateMissingFieldError(FieldEventTime) +// is2XXStatusCode checks whether status code is a 2XX status code +func is2XXStatusCode(statusCode int) bool { + return statusCode >= http.StatusOK && statusCode < http.StatusMultipleChoices } -// ErrorResponseWrongEventTime returns an error of type PublishEventResponses for wrong EventTime field -func ErrorResponseWrongEventTime() (response *api.PublishEventResponses) { - return CreateInvalidFieldError(FieldEventTime) -} +// writeJSONResponse writes a JSON response +func writeJSONResponse(w http.ResponseWriter, resp *api.PublishEventResponses) { + encoder := json.NewEncoder(w) + w.Header().Set("Content-Type", ContentTypeApplicationJSON) -// ErrorResponseWrongEventID returns an error of type PublishEventResponses for wrong EventID field -func ErrorResponseWrongEventID() (response *api.PublishEventResponses) { - return CreateInvalidFieldError(FieldEventID) -} + if resp.Error != nil { + w.WriteHeader(resp.Error.Status) + _ = encoder.Encode(resp.Error) + return + } -// ErrorResponseMissingFieldData returns an error of type PublishEventResponses for missing Data field -func ErrorResponseMissingFieldData() (response *api.PublishEventResponses) { - return CreateMissingFieldError(FieldData) -} + if resp.Ok != nil { + _ = encoder.Encode(resp.Ok) + return + } -//CreateMissingFieldError create an error for a missing field -func CreateMissingFieldError(field interface{}) (response *api.PublishEventResponses) { - apiErrorDetail := api.ErrorDetail{Field: field.(string), Type: ErrorTypeMissingField, Message: ErrorMessageMissingField, MoreInfo: ""} - details := []api.ErrorDetail{apiErrorDetail} - apiError := api.Error{Status: http.StatusBadRequest, Type: ErrorTypeValidationViolation, Message: ErrorMessageMissingField, MoreInfo: "", Details: details} - return &api.PublishEventResponses{Ok: nil, Error: &apiError} + log.Errorf("received an empty response") } -//CreateInvalidFieldError creates an error for an invalid field -func CreateInvalidFieldError(field interface{}) (response *api.PublishEventResponses) { - apiErrorDetail := api.ErrorDetail{Field: field.(string), Type: ErrorTypeInvalidField, Message: ErrorMessageInvalidField, MoreInfo: ""} - details := []api.ErrorDetail{apiErrorDetail} - apiError := api.Error{Status: http.StatusBadRequest, Type: ErrorTypeValidationViolation, Message: ErrorMessageInvalidField, MoreInfo: "", Details: details} - return &api.PublishEventResponses{Ok: nil, Error: &apiError} +// formatEventType4BEB format eventType as per BEB spec +func formatEventType4BEB(eventTypePrefix, app, eventType, version string) string { + eventType4BEB := fmt.Sprintf(eventTypePrefixFormat, eventTypePrefix, app, eventType, version) + return strings.ReplaceAll(eventType4BEB, "-", ".") } diff --git a/pkg/legacy-events/helpers_test.go b/pkg/legacy-events/helpers_test.go new file mode 100644 index 0000000..237a27f --- /dev/null +++ b/pkg/legacy-events/helpers_test.go @@ -0,0 +1,64 @@ +package legacy + +import ( + "testing" +) + +func TestParseApplicationNameFromPath(t *testing.T) { + testCases := []struct { + name string + inputPath string + wantedAppName string + }{ + { + name: "should return application when correct path is used", + inputPath: "/application/v1/events", + wantedAppName: "application", + }, { + name: "should return application when extra slash is in the path", + inputPath: "//application/v1/events", + wantedAppName: "application", + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + gotAppName := ParseApplicationNameFromPath(tc.inputPath) + if tc.wantedAppName != gotAppName { + t.Errorf("incorrect parsing, wanted: %s, got: %s", tc.wantedAppName, gotAppName) + } + }) + } +} + +func TestFormatEventType4BEB(t *testing.T) { + testCases := []struct { + eventTypePrefix string + app string + eventType string + version string + wantedEventType string + }{ + { + eventTypePrefix: "prefix", + app: "app", + eventType: "order.foo", + version: "v1", + wantedEventType: "prefix.app.order.foo.v1", + }, + { + eventTypePrefix: "prefix", + app: "app", + eventType: "order-foo", + version: "v1", + wantedEventType: "prefix.app.order.foo.v1", + }, + } + + for _, tc := range testCases { + gotEventType := formatEventType4BEB(tc.eventTypePrefix, tc.app, tc.eventType, tc.version) + if tc.wantedEventType != gotEventType { + t.Errorf("incorrect formatting of eventType: "+ + "%s, wanted: %s got: %s", tc.eventType, tc.wantedEventType, gotEventType) + } + } +} diff --git a/pkg/legacy-events/legacy.go b/pkg/legacy-events/legacy.go index 0684adc..f0b1181 100644 --- a/pkg/legacy-events/legacy.go +++ b/pkg/legacy-events/legacy.go @@ -2,17 +2,14 @@ package legacy import ( "encoding/json" - "fmt" "net/http" "regexp" - "strings" "time" cev2event "github.com/cloudevents/sdk-go/v2/event" "github.com/google/uuid" apiv1 "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" "github.com/pkg/errors" - log "github.com/sirupsen/logrus" ) var ( @@ -24,6 +21,11 @@ var ( eventTypePrefixFormat = "%s.%s.%s.%s" ) +const ( + requestBodyTooLargeErrorMessage = "http: request body too large" + eventTypeVersionExtensionKey = "eventtypeversion" +) + type Transformer struct { bebNamespace string eventTypePrefix string @@ -36,10 +38,39 @@ func NewTransformer(bebNamespace string, eventTypePrefix string) *Transformer { } } -const ( - requestBodyTooLargeErrorMessage = "http: request body too large" - eventTypeVersionExtensionKey = "eventtypeversion" -) +// CheckParameters validates the parameters in the request and sends error responses if found invalid +func (t Transformer) checkParameters(parameters *apiv1.PublishEventParametersV1) (response *apiv1.PublishEventResponses) { + if parameters == nil { + return ErrorResponseBadRequest(ErrorMessageBadPayload) + } + if len(parameters.PublishrequestV1.EventType) == 0 { + return ErrorResponseMissingFieldEventType() + } + if len(parameters.PublishrequestV1.EventTypeVersion) == 0 { + return ErrorResponseMissingFieldEventTypeVersion() + } + if !isValidEventTypeVersion(parameters.PublishrequestV1.EventTypeVersion) { + return ErrorResponseWrongEventTypeVersion() + } + if len(parameters.PublishrequestV1.EventTime) == 0 { + + return ErrorResponseMissingFieldEventTime() + } + if _, err := time.Parse(time.RFC3339, parameters.PublishrequestV1.EventTime); err != nil { + return ErrorResponseWrongEventTime() + } + if len(parameters.PublishrequestV1.EventID) > 0 && !isValidEventID(parameters.PublishrequestV1.EventID) { + return ErrorResponseWrongEventID() + } + if parameters.PublishrequestV1.Data == nil { + return ErrorResponseMissingFieldData() + } + if d, ok := (parameters.PublishrequestV1.Data).(string); ok && len(d) == 0 { + return ErrorResponseMissingFieldData() + } + // OK + return &apiv1.PublishEventResponses{} +} func (t Transformer) TransformsLegacyRequestsToCE(writer http.ResponseWriter, request *http.Request) *cev2event.Event { @@ -49,7 +80,7 @@ func (t Transformer) TransformsLegacyRequestsToCE(writer http.ResponseWriter, re writeJSONResponse(writer, resp) return nil } - appName := parseApplicationNameFromPath(request.URL.Path) + appName := ParseApplicationNameFromPath(request.URL.Path) var err error parameters := &apiv1.PublishEventParametersV1{} decoder := json.NewDecoder(request.Body) @@ -66,7 +97,7 @@ func (t Transformer) TransformsLegacyRequestsToCE(writer http.ResponseWriter, re } // validate the PublishRequestV1 for missing / incoherent values - checkResp := checkParameters(parameters) + checkResp := t.checkParameters(parameters) if checkResp.Error != nil { writeJSONResponse(writer, checkResp) return nil @@ -87,53 +118,6 @@ func (t Transformer) TransformsLegacyRequestsToCE(writer http.ResponseWriter, re return event } -func parseApplicationNameFromPath(path string) string { - // Assumption: Clients(e.g. ApplicationConnectivity validator which has a flag for - // the path(https://github.com/kyma-project/kyma/blob/master/components/application-connectivity-validator/cmd/applicationconnectivityvalidator/applicationconnectivityvalidator.go#L49) - // using this endpoint must be sending request to path /:application/v1/events - // Hence it should be safe to return 0th index as the application name - pathSegments := make([]string, 0) - for _, segment := range strings.Split(path, "/") { - if strings.TrimSpace(segment) != "" { - pathSegments = append(pathSegments, segment) - } - } - return pathSegments[0] -} - -func checkParameters(parameters *apiv1.PublishEventParametersV1) (response *apiv1.PublishEventResponses) { - if parameters == nil { - return ErrorResponseBadRequest(ErrorMessageBadPayload) - } - if len(parameters.PublishrequestV1.EventType) == 0 { - return ErrorResponseMissingFieldEventType() - } - if len(parameters.PublishrequestV1.EventTypeVersion) == 0 { - return ErrorResponseMissingFieldEventTypeVersion() - } - if !isValidEventTypeVersion(parameters.PublishrequestV1.EventTypeVersion) { - return ErrorResponseWrongEventTypeVersion() - } - if len(parameters.PublishrequestV1.EventTime) == 0 { - - return ErrorResponseMissingFieldEventTime() - } - if _, err := time.Parse(time.RFC3339, parameters.PublishrequestV1.EventTime); err != nil { - return ErrorResponseWrongEventTime() - } - if len(parameters.PublishrequestV1.EventID) > 0 && !isValidEventID(parameters.PublishrequestV1.EventID) { - return ErrorResponseWrongEventID() - } - if parameters.PublishrequestV1.Data == nil { - return ErrorResponseMissingFieldData() - } - if d, ok := (parameters.PublishrequestV1.Data).(string); ok && len(d) == 0 { - return ErrorResponseMissingFieldData() - } - // OK - return &apiv1.PublishEventResponses{} -} - func (t Transformer) TransformsCEResponseToLegacyResponse(writer http.ResponseWriter, statusCode int, event *cev2event.Event, msg string) { response := &apiv1.PublishEventResponses{} // Fail @@ -152,29 +136,6 @@ func (t Transformer) TransformsCEResponseToLegacyResponse(writer http.ResponseWr return } -// is2XXStatusCode checks whether status code is a 2XX status code -func is2XXStatusCode(statusCode int) bool { - return statusCode >= http.StatusOK && statusCode < http.StatusMultipleChoices -} - -func writeJSONResponse(w http.ResponseWriter, resp *apiv1.PublishEventResponses) { - encoder := json.NewEncoder(w) - w.Header().Set("Content-Type", ContentTypeApplicationJSON) - - if resp.Error != nil { - w.WriteHeader(resp.Error.Status) - _ = encoder.Encode(resp.Error) - return - } - - if resp.Ok != nil { - _ = encoder.Encode(resp.Ok) - return - } - - log.Errorf("received an empty response") -} - // convertPublishRequestToCloudEvent converts the given publish request to a CloudEvent. func (t Transformer) convertPublishRequestToCloudEvent(appName string, publishRequest *apiv1.PublishEventParametersV1) (*cev2event.Event, error) { event := cev2event.New(cev2event.CloudEventsVersionV1) @@ -204,9 +165,3 @@ func (t Transformer) convertPublishRequestToCloudEvent(appName string, publishRe event.SetDataContentType(ContentTypeApplicationJSON) return &event, nil } - -// formatEventType4BEB format eventType as per BEB spec -func formatEventType4BEB(eventTypePrefix, app, eventType, version string) string { - eventType4BEB := fmt.Sprintf(eventTypePrefixFormat, eventTypePrefix, app, eventType, version) - return strings.ReplaceAll(eventType4BEB, "-", ".") -} diff --git a/pkg/legacy-events/legacy_test.go b/pkg/legacy-events/legacy_test.go index 9994bb5..fe3b5da 100644 --- a/pkg/legacy-events/legacy_test.go +++ b/pkg/legacy-events/legacy_test.go @@ -7,65 +7,6 @@ import ( legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" ) -func TestParseApplicationNameFromPath(t *testing.T) { - testCases := []struct { - name string - inputPath string - wantedAppName string - }{ - { - name: "should return application when correct path is used", - inputPath: "/application/v1/events", - wantedAppName: "application", - }, { - name: "should return application when extra slash is in the path", - inputPath: "//application/v1/events", - wantedAppName: "application", - }, - } - for _, tc := range testCases { - t.Run(tc.name, func(t *testing.T) { - gotAppName := parseApplicationNameFromPath(tc.inputPath) - if tc.wantedAppName != gotAppName { - t.Errorf("incorrect parsing, wanted: %s, got: %s", tc.wantedAppName, gotAppName) - } - }) - } -} - -func TestFormatEventType4BEB(t *testing.T) { - testCases := []struct { - eventTypePrefix string - app string - eventType string - version string - wantedEventType string - }{ - { - eventTypePrefix: "prefix", - app: "app", - eventType: "order.foo", - version: "v1", - wantedEventType: "prefix.app.order.foo.v1", - }, - { - eventTypePrefix: "prefix", - app: "app", - eventType: "order-foo", - version: "v1", - wantedEventType: "prefix.app.order.foo.v1", - }, - } - - for _, tc := range testCases { - gotEventType := formatEventType4BEB(tc.eventTypePrefix, tc.app, tc.eventType, tc.version) - if tc.wantedEventType != gotEventType { - t.Errorf("incorrect formatting of eventType: "+ - "%s, wanted: %s got: %s", tc.eventType, tc.wantedEventType, gotEventType) - } - } -} - func TestConvertPublishRequestToCloudEvent(t *testing.T) { bebNs := "beb.namespace" eventTypePrefix := "event.type.prefix" diff --git a/pkg/receiver/receiver.go b/pkg/receiver/receiver.go index d3ea9bc..755e4e4 100644 --- a/pkg/receiver/receiver.go +++ b/pkg/receiver/receiver.go @@ -7,6 +7,8 @@ import ( "net/http" "time" + "github.com/sirupsen/logrus" + "go.opencensus.io/plugin/ochttp" ) @@ -45,6 +47,7 @@ func (recv *HttpMessageReceiver) StartListen(ctx context.Context, handler http.H go func() { errChan <- recv.server.Serve(recv.listener) }() + logrus.Info("Event Publisher Proxy server has started.") // wait for the server to return or ctx.Done(). select { diff --git a/pkg/receiver/receiver_test.go b/pkg/receiver/receiver_test.go index 22c2b6f..cd979b0 100644 --- a/pkg/receiver/receiver_test.go +++ b/pkg/receiver/receiver_test.go @@ -6,6 +6,8 @@ import ( "sync" "testing" "time" + + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) // a mocked http.Handler @@ -16,7 +18,10 @@ func (h *testHandler) ServeHTTP(http.ResponseWriter, *http.Request) {} var _ http.Handler = (*testHandler)(nil) func TestNewHttpMessageReceiver(t *testing.T) { - port := 9091 + port, err := testingutils.GeneratePort() + if err != nil { + t.Fatalf("failed to generate port: %v", err) + } r := NewHttpMessageReceiver(port) if r == nil { t.Fatalf("Could not create HttpMessageReceiver") @@ -29,7 +34,7 @@ func TestNewHttpMessageReceiver(t *testing.T) { // Test that tht receiver shuts down properly then receiving stop signal func TestStartListener(t *testing.T) { timeout := time.Second * 10 - r := fixtureReceiver() + r := fixtureReceiver(t) ctx := context.Background() // used to simulate sending a stop signal @@ -68,6 +73,10 @@ func TestStartListener(t *testing.T) { } } -func fixtureReceiver() *HttpMessageReceiver { - return NewHttpMessageReceiver(9091) +func fixtureReceiver(t *testing.T) *HttpMessageReceiver { + port, err := testingutils.GeneratePort() + if err != nil { + t.Fatalf("failed to generate port: %v", err) + } + return NewHttpMessageReceiver(port) } diff --git a/pkg/subscribed/helpers.go b/pkg/subscribed/helpers.go new file mode 100644 index 0000000..7284e2d --- /dev/null +++ b/pkg/subscribed/helpers.go @@ -0,0 +1,164 @@ +package subscribed + +import ( + "context" + "fmt" + "log" + "strings" + "time" + + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/dynamic/dynamicinformer" + "k8s.io/client-go/rest" +) + +const ( + DefaultResyncPeriod = 10 * time.Second +) + +var ( + GVR = schema.GroupVersionResource{ + Version: eventingv1alpha1.GroupVersion.Version, + Group: eventingv1alpha1.GroupVersion.Group, + Resource: "subscriptions", + } +) + +// ConvertRuntimeObjToSubscription converts a runtime.Object to a Subscription object by converting to Unstructed in between +func ConvertRuntimeObjToSubscription(sObj runtime.Object) (*eventingv1alpha1.Subscription, error) { + sub := &eventingv1alpha1.Subscription{} + if subUnstructured, ok := sObj.(*unstructured.Unstructured); ok { + err := runtime.DefaultUnstructuredConverter.FromUnstructured(subUnstructured.Object, sub) + if err != nil { + return nil, err + } + } + return sub, nil +} + +// GenerateSubscriptionInfFactory generates DynamicSharedInformerFactory for Subscription +func GenerateSubscriptionInfFactory(k8sConfig *rest.Config) dynamicinformer.DynamicSharedInformerFactory { + subDynamicClient := dynamic.NewForConfigOrDie(k8sConfig) + dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(subDynamicClient, + DefaultResyncPeriod, + v1.NamespaceAll, + nil, + ) + dFilteredSharedInfFactory.ForResource(GVR) + return dFilteredSharedInfFactory +} + +type waitForCacheSyncFunc func(stopCh <-chan struct{}) map[schema.GroupVersionResource]bool + +// WaitForCacheSyncOrDie waits for the cache to sync. If sync fails everything stops +func WaitForCacheSyncOrDie(ctx context.Context, dc dynamicinformer.DynamicSharedInformerFactory) { + dc.Start(ctx.Done()) + + ctx, cancel := context.WithTimeout(context.Background(), DefaultResyncPeriod) + defer cancel() + + err := hasSynced(ctx, dc.WaitForCacheSync) + if err != nil { + log.Fatalf("Failed to sync informer caches: %v", err) + } +} + +func hasSynced(ctx context.Context, fn waitForCacheSyncFunc) error { + // synced gets closed as soon as fn returns + synced := make(chan struct{}) + // closing stopWait forces fn to return, which happens whenever ctx + // gets canceled + stopWait := make(chan struct{}) + defer close(stopWait) + + // close the synced channel if the `WaitForCacheSync()` finished the execution cleanly + go func() { + informersCacheSync := fn(stopWait) + res := true + for _, sync := range informersCacheSync { + if !sync { + res = false + } + } + if res { + close(synced) + } + }() + + select { + case <-ctx.Done(): + return ctx.Err() + case <-synced: + } + + return nil +} + +// ConvertEventsMapToSlice converts a map of Events to a slice of Events +func ConvertEventsMapToSlice(eventsMap map[Event]bool) []Event { + result := make([]Event, 0) + for k, _ := range eventsMap { + result = append(result, k) + } + return result +} + +// AddUniqueEventsToResult returns a map of unique Events which also contains the events eventsSubSet +func AddUniqueEventsToResult(eventsSubSet []Event, uniqEvents map[Event]bool) map[Event]bool { + if len(uniqEvents) == 0 { + uniqEvents = make(map[Event]bool) + } + for _, event := range eventsSubSet { + if !uniqEvents[event] { + uniqEvents[event] = true + } + } + return uniqEvents +} + +// FilterEventTypeVersions returns a slice of Events: +// 1. if the eventType matches the format: .. +// E.g. sap.kyma.custom.varkes.order.created.v0 +// 2. if the eventSource matches BEBNamespace name +func FilterEventTypeVersions(eventTypePrefix, bebNs, appName string, filters *eventingv1alpha1.BebFilters) []Event { + events := make([]Event, 0) + if filters == nil { + return events + } + for _, filter := range filters.Filters { + if filter == nil { + continue + } + searchingForEventPrefix := strings.ToLower(fmt.Sprintf("%s.%s.", eventTypePrefix, appName)) + + if filter.EventSource != nil && filter.EventType != nil { + if strings.ToLower(filter.EventSource.Value) == strings.ToLower(bebNs) && strings.HasPrefix(filter.EventType.Value, searchingForEventPrefix) { + eventTypeVersion := strings.ReplaceAll(filter.EventType.Value, searchingForEventPrefix, "") + eventTypeVersionArr := strings.Split(eventTypeVersion, ".") + version := eventTypeVersionArr[len(eventTypeVersionArr)-1] + eventType := "" + for i, part := range eventTypeVersionArr { + if i == 0 { + eventType = part + continue + } + // Adding the segments till last but 1 as the last one is the version + if i < (len(eventTypeVersionArr) - 1) { + eventType = fmt.Sprintf("%s.%s", eventType, part) + } + } + event := Event{ + Name: eventType, + Version: version, + } + events = append(events, event) + } + } + } + return events +} diff --git a/pkg/subscribed/helpers_test.go b/pkg/subscribed/helpers_test.go new file mode 100644 index 0000000..1d81936 --- /dev/null +++ b/pkg/subscribed/helpers_test.go @@ -0,0 +1,258 @@ +package subscribed + +import ( + "reflect" + "testing" + + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" +) + +func TestFilterEventTypeVersions(t *testing.T) { + testCases := []struct { + name string + appName string + eventTypePrefix string + bebNs string + filters *eventingv1alpha1.BebFilters + expectedEvents []Event + }{ + { + name: "should return no events when nil filters are provided", + appName: "fooapp", + eventTypePrefix: "foo.prefix", + bebNs: "foo.bebns", + filters: nil, + expectedEvents: make([]Event, 0), + }, { + name: "should return a slice of events when filters are provided", + appName: "foovarkes", + eventTypePrefix: "foo.prefix.custom", + bebNs: "/default/foo.kyma/kt1", + filters: NewBEBFilters(WithOneBEBFilter), + expectedEvents: []Event{ + NewEvent("order.created", "v1"), + }, + }, { + name: "should return multiple events in a slice when multiple filters are provided", + appName: "foovarkes", + eventTypePrefix: "foo.prefix.custom", + bebNs: "/default/foo.kyma/kt1", + filters: NewBEBFilters(WithMultipleBEBFiltersFromSameSource), + expectedEvents: []Event{ + NewEvent("order.created", "v1"), + NewEvent("order.created", "v1"), + NewEvent("order.created", "v1"), + }, + }, { + name: "should return no events when filters sources(bebNamespace) don't match", + appName: "foovarkes", + eventTypePrefix: "foo.prefix.custom", + bebNs: "foo-dont-match", + filters: NewBEBFilters(WithMultipleBEBFiltersFromSameSource), + expectedEvents: []Event{}, + }, { + name: "should return 1 event(out of multiple) which matches one source(bebNamespace)", + appName: "foovarkes", + eventTypePrefix: "foo.prefix.custom", + bebNs: "foo-match", + filters: NewBEBFilters(WithMultipleBEBFiltersFromDiffSource), + expectedEvents: []Event{ + NewEvent("order.created", "v1"), + }, + }, { + name: "should return 2 out 3 events in a slice when filters with different eventTypePrefix are provided", + appName: "foovarkes", + eventTypePrefix: "foo.prefix.custom", + bebNs: "/default/foo.kyma/kt1", + filters: NewBEBFilters(WithMultipleBEBFiltersFromDiffEventTypePrefix), + expectedEvents: []Event{ + NewEvent("order.created", "v1"), + NewEvent("order.created", "v1"), + }, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + gotEvents := FilterEventTypeVersions(tc.eventTypePrefix, tc.bebNs, tc.appName, tc.filters) + if !reflect.DeepEqual(tc.expectedEvents, gotEvents) { + t.Errorf("Received incorrect events, Wanted: %v, Got: %v", tc.expectedEvents, gotEvents) + } + + }) + } +} + +func TestConvertEventsMapToSlice(t *testing.T) { + testCases := []struct { + name string + inputMap map[Event]bool + wantedEvents []Event + }{ + { + name: "should return events from the map in a slice", + inputMap: map[Event]bool{ + NewEvent("foo", "v1"): true, + NewEvent("bar", "v2"): true, + }, + wantedEvents: []Event{ + NewEvent("foo", "v1"), + NewEvent("bar", "v2"), + }, + }, { + name: "should return no events for an empty map of events", + inputMap: map[Event]bool{}, + wantedEvents: []Event{}, + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + gotEvents := ConvertEventsMapToSlice(tc.inputMap) + for _, event := range gotEvents { + found := false + for _, wantEvent := range tc.wantedEvents { + if event == wantEvent { + found = true + continue + } + } + if !found { + t.Errorf("incorrect slice of events, wanted: %v, got: %v", tc.wantedEvents, gotEvents) + } + } + }) + } +} + +func TestAddUniqueEventsToResult(t *testing.T) { + testCases := []struct { + name string + eventsSubSet []Event + givenUniqEventsAlready map[Event]bool + wantedUniqEvents map[Event]bool + }{ + { + name: "should return unique events along with the existing ones", + eventsSubSet: []Event{ + NewEvent("foo", "v1"), + NewEvent("bar", "v1"), + }, + givenUniqEventsAlready: map[Event]bool{ + NewEvent("bar-already-existing", "v1"): true, + }, + wantedUniqEvents: map[Event]bool{ + NewEvent("foo", "v1"): true, + NewEvent("bar", "v1"): true, + NewEvent("bar-already-existing", "v1"): true, + }, + }, { + name: "should return unique new events from the subset provided only", + eventsSubSet: []Event{ + NewEvent("foo", "v1"), + NewEvent("bar", "v1"), + }, + givenUniqEventsAlready: nil, + wantedUniqEvents: map[Event]bool{ + NewEvent("foo", "v1"): true, + NewEvent("bar", "v1"): true, + }, + }, { + name: "should return existing unique events when an empty subset provided", + eventsSubSet: []Event{}, + givenUniqEventsAlready: map[Event]bool{ + NewEvent("foo", "v1"): true, + NewEvent("bar", "v1"): true, + }, + wantedUniqEvents: map[Event]bool{ + NewEvent("foo", "v1"): true, + NewEvent("bar", "v1"): true, + }, + }, { + name: "should return no unique events when an empty subset provided", + eventsSubSet: []Event{}, + givenUniqEventsAlready: map[Event]bool{}, + wantedUniqEvents: map[Event]bool{}, + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + gotUniqEvents := AddUniqueEventsToResult(tc.eventsSubSet, tc.givenUniqEventsAlready) + if !reflect.DeepEqual(tc.wantedUniqEvents, gotUniqEvents) { + t.Errorf("incorrect unique events, wanted: %v, got: %v", tc.wantedUniqEvents, gotUniqEvents) + } + }) + } +} + +type BEBFilterOption func(filter *eventingv1alpha1.BebFilters) + +func NewBEBFilters(opts ...BEBFilterOption) *eventingv1alpha1.BebFilters { + newFilters := &eventingv1alpha1.BebFilters{} + for _, opt := range opts { + opt(newFilters) + } + + return newFilters +} + +func WithOneBEBFilter(bebFilters *eventingv1alpha1.BebFilters) { + evSource := "/default/foo.kyma/kt1" + evType := "foo.prefix.custom.foovarkes.order.created.v1" + bebFilters.Filters = []*eventingv1alpha1.BebFilter{ + NewBEBFilter(evSource, evType), + } + +} + +func WithMultipleBEBFiltersFromSameSource(bebFilters *eventingv1alpha1.BebFilters) { + evSource := "/default/foo.kyma/kt1" + evType := "foo.prefix.custom.foovarkes.order.created.v1" + bebFilters.Filters = []*eventingv1alpha1.BebFilter{ + NewBEBFilter(evSource, evType), + NewBEBFilter(evSource, evType), + NewBEBFilter(evSource, evType), + } +} + +func WithMultipleBEBFiltersFromDiffSource(bebFilters *eventingv1alpha1.BebFilters) { + evSource1 := "foo-match" + evSource2 := "/default/foo.different/kt1" + evSource3 := "/default/foo.different2/kt1" + evType := "foo.prefix.custom.foovarkes.order.created.v1" + bebFilters.Filters = []*eventingv1alpha1.BebFilter{ + NewBEBFilter(evSource1, evType), + NewBEBFilter(evSource2, evType), + NewBEBFilter(evSource3, evType), + } +} + +func WithMultipleBEBFiltersFromDiffEventTypePrefix(bebFilters *eventingv1alpha1.BebFilters) { + evSource := "/default/foo.kyma/kt1" + evType1 := "foo.prefix.custom.foovarkes.order.created.v1" + evType2 := "foo.prefixdifferent.custom.foovarkes.order.created.v1" + bebFilters.Filters = []*eventingv1alpha1.BebFilter{ + NewBEBFilter(evSource, evType1), + NewBEBFilter(evSource, evType2), + NewBEBFilter(evSource, evType1), + } +} + +func NewBEBFilter(evSource, evType string) *eventingv1alpha1.BebFilter { + return &eventingv1alpha1.BebFilter{ + EventSource: &eventingv1alpha1.Filter{ + Property: "source", + Value: evSource, + }, + EventType: &eventingv1alpha1.Filter{ + Property: "type", + Value: evType, + }, + } +} + +func NewEvent(name, version string) Event { + return Event{ + Name: name, + Version: version, + } +} diff --git a/pkg/subscribed/processor.go b/pkg/subscribed/processor.go new file mode 100644 index 0000000..a757dca --- /dev/null +++ b/pkg/subscribed/processor.go @@ -0,0 +1,44 @@ +package subscribed + +import ( + "net/http" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/sirupsen/logrus" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +type Processor struct { + SubscriptionLister *cache.GenericLister + Config *env.Config + Logger *logrus.Logger +} + +func (p Processor) ExtractEventsFromSubscriptions(writer http.ResponseWriter, request *http.Request) { + eventsMap := make(map[Event]bool) + subsList, err := (*p.SubscriptionLister).List(labels.Everything()) + if err != nil { + p.Logger.Errorf("failed to fetch subscriptions: %v", err) + RespondWithErrorAndLog(err, writer) + return + } + + appName := legacy.ParseApplicationNameFromPath(request.URL.Path) + for _, sObj := range subsList { + sub, err := ConvertRuntimeObjToSubscription(sObj) + if err != nil { + p.Logger.Errorf("failed to convert a runtime obj to a Subscription: %v", err) + continue + } + if sub.Spec.Filter != nil { + eventsForSub := FilterEventTypeVersions(p.Config.EventTypePrefix, p.Config.BEBNamespace, appName, sub.Spec.Filter) + eventsMap = AddUniqueEventsToResult(eventsForSub, eventsMap) + } + } + events := ConvertEventsMapToSlice(eventsMap) + RespondWithBody(writer, Events{ + EventsInfo: events, + }, http.StatusOK) +} diff --git a/pkg/subscribed/response.go b/pkg/subscribed/response.go new file mode 100644 index 0000000..c005742 --- /dev/null +++ b/pkg/subscribed/response.go @@ -0,0 +1,43 @@ +package subscribed + +import ( + "net/http" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/sirupsen/logrus" + + "encoding/json" +) + +//RespondWithBody sends http response with json body +func RespondWithBody(w http.ResponseWriter, events Events, httpCode int) { + respond(w, httpCode) + json.NewEncoder(w).Encode(events) +} + +//RespondWithErrorAndLog logs error and sends http response with error json body +func RespondWithErrorAndLog(e error, w http.ResponseWriter) { + logrus.Errorln(e.Error()) + respond(w, http.StatusInternalServerError) + json.NewEncoder(w).Encode(legacy.HTTPErrorResponse{ + Code: http.StatusInternalServerError, + Error: e.Error(), + }) +} + +func respond(w http.ResponseWriter, httpCode int) { + w.Header().Set(legacy.HeaderContentType, legacy.ContentTypeApplicationJSON) + w.WriteHeader(httpCode) + logrus.Infof("Response code: HTTP %d", httpCode) +} + +//Events represents collection of all events with subscriptions +type Events struct { + EventsInfo []Event `json:"eventsInfo"` +} + +//Event represents basic information about event +type Event struct { + Name string `json:"name"` + Version string `json:"version"` +} diff --git a/testing/utils.go b/testing/utils.go index 4cf9be6..c345c37 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -2,9 +2,23 @@ package testing import ( "bytes" + "crypto/rand" + "encoding/json" + "fmt" + "io" + "io/ioutil" "net/http" + "reflect" + "regexp" + "strconv" + "testing" + "time" http2 "github.com/cloudevents/sdk-go/v2/protocol/http" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( @@ -21,6 +35,19 @@ const ( CeSpecVersion = "1.0" ) +func QuerySubscribedEndpoint(endpoint string) (*http.Response, error) { + emptyBody := bytes.NewBuffer([]byte("")) + req, err := http.NewRequest(http.MethodGet, endpoint, emptyBody) + if err != nil { + return nil, err + } + + client := http.Client{} + defer client.CloseIdleConnections() + + return client.Do(req) +} + func SendEvent(endpoint, body string, headers http.Header) (*http.Response, error) { req, err := http.NewRequest(http.MethodPost, endpoint, bytes.NewBuffer([]byte(body))) if err != nil { @@ -57,3 +84,174 @@ func GetApplicationJSONHeaders() http.Header { headers.Add(http2.ContentType, "application/json") return headers } + +func NewSubscription() *eventingv1alpha1.Subscription { + filter := &eventingv1alpha1.BebFilter{ + EventSource: &eventingv1alpha1.Filter{ + Type: "exact", + Property: "source", + Value: "/beb.namespace", + }, + EventType: &eventingv1alpha1.Filter{ + Type: "exact", + Property: "type", + Value: "event.type.prefix.valid-app.order.created.v1", + }, + } + return &eventingv1alpha1.Subscription{ + ObjectMeta: metav1.ObjectMeta{ + Name: "foo", + Labels: map[string]string{ + "foo": "bar", + }, + }, + Spec: eventingv1alpha1.SubscriptionSpec{ + ID: "", + Protocol: "", + ProtocolSettings: nil, + Sink: "", + Filter: &eventingv1alpha1.BebFilters{ + Filters: []*eventingv1alpha1.BebFilter{ + filter, + }, + }, + }, + } +} + +// GetMissingFieldValidationErrorFor generates an Error message for a missing field +func GetMissingFieldValidationErrorFor(field string) *legacyapi.Error { + return &legacyapi.Error{ + Status: 400, + Type: "validation_violation", + Message: "Missing field", + Details: []legacyapi.ErrorDetail{ + { + Field: field, + Type: "missing_field", + Message: "Missing field", + MoreInfo: "", + }, + }, + } +} + +// IsValidEventID checks whether EventID is valid or not +func IsValidEventID(id string) bool { + return regexp.MustCompile(legacy.AllowedEventIDChars).MatchString(id) +} + +// GetInvalidValidationErrorFor generates an Error message for an invalid field +func GetInvalidValidationErrorFor(field string) *legacyapi.Error { + return &legacyapi.Error{ + Status: 400, + Type: "validation_violation", + Message: "Invalid field", + Details: []legacyapi.ErrorDetail{ + { + Field: field, + Type: "invalid_field", + Message: "Invalid field", + MoreInfo: "", + }, + }, + } +} + +// ValidateErrorResponse validates Error Response +func ValidateErrorResponse(t *testing.T, resp http.Response, tcWantResponse *legacyapi.PublishEventResponses) { + legacyResponse := legacyapi.PublishEventResponses{} + legacyError := legacyapi.Error{} + bodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Fatalf("failed to read response body: %v", err) + } + if err = json.Unmarshal(bodyBytes, &legacyError); err != nil { + t.Fatalf("failed to unmarshal response body: %v", err) + } + legacyResponse.Error = &legacyError + if !reflect.DeepEqual(tcWantResponse.Error, legacyResponse.Error) { + t.Fatalf("Invalid error, want: %v, got: %v", tcWantResponse.Error, legacyResponse.Error) + } +} + +// ValidateOkResponse validates Ok Response +func ValidateOkResponse(t *testing.T, resp http.Response, tcWantResponse *legacyapi.PublishEventResponses) { + legacyOkResponse := legacyapi.PublishResponse{} + legacyResponse := legacyapi.PublishEventResponses{} + bodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Fatalf("failed to read response body: %v", err) + } + if err = json.Unmarshal(bodyBytes, &legacyOkResponse); err != nil { + t.Fatalf("failed to unmarshal response body: %v", err) + } + legacyResponse.Ok = &legacyOkResponse + if err = resp.Body.Close(); err != nil { + t.Fatalf("failed to close body: %v", err) + } + + if tcWantResponse.Ok.EventID != "" && tcWantResponse.Ok.EventID != legacyResponse.Ok.EventID { + t.Errorf("invalid event-id, want: %v, got: %v", tcWantResponse.Ok.EventID, legacyResponse.Ok.EventID) + } + + if tcWantResponse.Ok.EventID == "" && !IsValidEventID(legacyResponse.Ok.EventID) { + t.Errorf("should match regex: [%s] Not a valid event-id: %v ", legacy.AllowedEventIDChars, legacyResponse.Ok.EventID) + } + if tcWantResponse.Ok.Reason != legacyResponse.Ok.Reason { + t.Errorf("invalid reason, want: %v, got: %v", tcWantResponse.Ok.Reason, legacyResponse.Ok.Reason) + } + if tcWantResponse.Ok.Status != legacyResponse.Ok.Status { + t.Errorf("invalid status, want: %v, got: %v", tcWantResponse.Ok.Status, legacyResponse.Ok.Status) + } +} + +// WaitForHandlerToStart is waits for the test handler to start before testing could start +func WaitForHandlerToStart(t *testing.T, healthEndpoint string) { + timeout := time.After(time.Second * 30) + tick := time.Tick(time.Second * 1) + + for { + select { + case <-timeout: + { + t.Fatal("Failed to start handler") + } + case <-tick: + { + if resp, err := http.Get(healthEndpoint); err != nil { + continue + } else if resp.StatusCode == http.StatusOK { + return + } + } + } + } +} + +// GeneratePort generates a random 5 digit port +func GeneratePort() (int, error) { + max := 4 + // Add 4 as prefix to make it 5 digits but less than 65535 + add4AsPrefix := "4" + b := make([]byte, max) + n, err := io.ReadAtLeast(rand.Reader, b, max) + if n != max { + return 0, err + } + if err != nil { + return 0, err + } + for i := 0; i < len(b); i++ { + b[i] = table[int(b[i])%len(table)] + } + + num, err := strconv.Atoi(fmt.Sprintf("%s%s", add4AsPrefix, string(b))) + if err != nil { + return 0, err + } + + return num, nil +} + +var table = [...]byte{'1', '2', '3', '4', '5', '6', '7', '8', '9'} From f8a54c4213933e4572c631dc9f82ed3724cf17b1 Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Thu, 17 Dec 2020 11:42:05 +0100 Subject: [PATCH 008/194] Scaffold NATS publisher (#10165) * Scaffold NATS publisher * Format imports * Add support for ko * Update makefile --- .gitignore | 6 ++ Makefile | 56 +++++++++++++++++++ README.md | 2 +- cmd/event-publisher-nats/Dockerfile | 20 +++++++ cmd/event-publisher-nats/main.go | 24 ++++++++ .../event-publisher-proxy/Dockerfile | 1 + config/event-publisher-nats/100-service.yaml | 12 ++++ .../event-publisher-nats/200-deployment.yaml | 42 ++++++++++++++ .../100-secret.yaml | 0 .../200-service.yaml | 0 .../300-deployment.yaml | 0 11 files changed, 162 insertions(+), 1 deletion(-) create mode 100755 .gitignore create mode 100644 cmd/event-publisher-nats/Dockerfile create mode 100644 cmd/event-publisher-nats/main.go rename Dockerfile => cmd/event-publisher-proxy/Dockerfile (96%) create mode 100644 config/event-publisher-nats/100-service.yaml create mode 100644 config/event-publisher-nats/200-deployment.yaml rename config/{ => event-publisher-proxy}/100-secret.yaml (100%) rename config/{ => event-publisher-proxy}/200-service.yaml (100%) rename config/{ => event-publisher-proxy}/300-deployment.yaml (100%) diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..3dc6895 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.idea +*.iml +/event-publisher-nats +/event-publisher-proxy +vendor +licenses diff --git a/Makefile b/Makefile index 90b89fb..b6a8b25 100644 --- a/Makefile +++ b/Makefile @@ -35,3 +35,59 @@ $(eval $(call buildpack-mount,test)) path-to-referenced-charts: @echo "resources/event-publisher-proxy" + +# produce goals for each cmd program ("bin1 bin2 ...") +cmds := $(foreach dir,$(wildcard cmd/*),$(notdir $(dir))) +# produce goals to build images for each cmd program ("bin1.image bin2.image ...") +cmds_images = $(foreach cmd,$(cmds),$(cmd).image) +cmds_clean = $(foreach cmd,$(cmds),$(cmd).clean) +# produce goals to push images for each cmd program ("bin1.image.push bin2.image.push ...") +cmds_images_push = $(foreach img,$(cmds_images),$(img).push) + +MOUNT_TARGETS = $(cmds) +$(foreach t,$(MOUNT_TARGETS),$(eval $(call buildpack-mount,$(t)))) + +.PHONY: clean +clean: $(cmds_clean) resolve_clean licenses_clean + +$(cmds_clean): %.clean: + rm -f $* + +resolve_clean: + rm -rf vendor + +licenses_clean: + rm -rf licenses + +build-local: $(cmds) test-local ; + +.PHONY: $(cmds_images) $(cmds_images_push) + +# override image goals from common Makefile because we need to build several images +build-image: $(cmds_images) ; +push-image: $(cmds_images_push) ; + +# Example: +# make event-publisher-proxy +GOBUILD_FLAGS := -v +PKG := github.com/kyma-project/kyma/components/event-publisher-proxy +$(cmds): %: resolve-local + @echo "+ Building $*" + @CGO_ENABLED=0 go build -o $* \ + $(GOBUILD_FLAGS) \ + $(PKG)/cmd/$* + +# Example: +# make event-publisher-proxy.image +$(cmds_images): %.image: build pull-licenses + $(eval $@_img_name := $*) + @echo "+ Building container image $($@_img_name)" + docker image build -f cmd/$*/Dockerfile -t $($@_img_name) . + +# Example: +# make event-publisher-proxy.image.push +$(cmds_images_push): %.push: % + $(eval $@_img_name := $(subst .image,,$*)) + @echo "+ Pushing container image $($@_img_name)" + docker image tag $($@_img_name) $(DOCKER_PUSH_REPOSITORY)$(DOCKER_PUSH_DIRECTORY)/$($@_img_name):$(TAG) + docker image push $(DOCKER_PUSH_REPOSITORY)$(DOCKER_PUSH_DIRECTORY)/$($@_img_name):$(TAG) diff --git a/README.md b/README.md index f583958..af640c8 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ $ make test-local ### Deploy inside a cluster ```bash -$ ko apply -f config/ +$ ko apply -f config/event-publisher-proxy/ ``` ### Send Events diff --git a/cmd/event-publisher-nats/Dockerfile b/cmd/event-publisher-nats/Dockerfile new file mode 100644 index 0000000..3ff9793 --- /dev/null +++ b/cmd/event-publisher-nats/Dockerfile @@ -0,0 +1,20 @@ +FROM golang:1.15-alpine as builder + +ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-nats + +WORKDIR $DOCK_PKG_DIR +COPY . $DOCK_PKG_DIR + +RUN GOOS=linux GO111MODULE=on go mod vendor && \ + CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -o event-publisher-nats ./cmd/event-publisher-nats + +FROM gcr.io/distroless/static:nonroot +LABEL source = git@github.com:kyma-project/kyma.git +USER nonroot:nonroot + +WORKDIR / +COPY --from=builder /go/src/github.com/kyma-project/kyma/components/event-publisher-nats/event-publisher-nats . + +COPY licenses/ /licenses/ + +ENTRYPOINT ["/event-publisher-nats"] diff --git a/cmd/event-publisher-nats/main.go b/cmd/event-publisher-nats/main.go new file mode 100644 index 0000000..bc2d802 --- /dev/null +++ b/cmd/event-publisher-nats/main.go @@ -0,0 +1,24 @@ +package main + +import ( + "os" + "os/signal" + "syscall" + + "github.com/sirupsen/logrus" + + _ "k8s.io/client-go/plugin/pkg/client/auth" +) + +func main() { + logger := logrus.New() + logger.Info("Event Publisher NATS Started") + + // wait for shutdown signal + shutdown := make(chan os.Signal) + signal.Notify(shutdown, syscall.SIGINT, syscall.SIGTERM) + <-shutdown + close(shutdown) + + logger.Info("Event Publisher NATS Shutdown") +} diff --git a/Dockerfile b/cmd/event-publisher-proxy/Dockerfile similarity index 96% rename from Dockerfile rename to cmd/event-publisher-proxy/Dockerfile index 3a230aa..36f85c8 100644 --- a/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -10,6 +10,7 @@ RUN GOOS=linux GO111MODULE=on go mod vendor && \ FROM gcr.io/distroless/static:nonroot LABEL source = git@github.com:kyma-project/kyma.git +USER nonroot:nonroot WORKDIR / COPY --from=builder /go/src/github.com/kyma-project/kyma/components/event-publisher-proxy/event-publisher-proxy . diff --git a/config/event-publisher-nats/100-service.yaml b/config/event-publisher-nats/100-service.yaml new file mode 100644 index 0000000..d118bc2 --- /dev/null +++ b/config/event-publisher-nats/100-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: event-publisher-nats +spec: + type: ClusterIP + selector: + app: event-publisher-nats + ports: + - protocol: TCP + port: 80 + targetPort: 8080 diff --git a/config/event-publisher-nats/200-deployment.yaml b/config/event-publisher-nats/200-deployment.yaml new file mode 100644 index 0000000..9a97d7c --- /dev/null +++ b/config/event-publisher-nats/200-deployment.yaml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: event-publisher-nats + name: event-publisher-nats +spec: + replicas: 1 + selector: + matchLabels: + app: event-publisher-nats + strategy: + type: RollingUpdate + template: + metadata: + labels: + app: event-publisher-nats + spec: + containers: + - image: github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-nats + imagePullPolicy: IfNotPresent + name: event-publisher-nats + ports: + - containerPort: 8080 + name: http + protocol: TCP + livenessProbe: + failureThreshold: 3 + httpGet: + path: /healthz + port: 8080 + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 1 + readinessProbe: + failureThreshold: 3 + httpGet: + path: /readyz + port: 8080 + scheme: HTTP diff --git a/config/100-secret.yaml b/config/event-publisher-proxy/100-secret.yaml similarity index 100% rename from config/100-secret.yaml rename to config/event-publisher-proxy/100-secret.yaml diff --git a/config/200-service.yaml b/config/event-publisher-proxy/200-service.yaml similarity index 100% rename from config/200-service.yaml rename to config/event-publisher-proxy/200-service.yaml diff --git a/config/300-deployment.yaml b/config/event-publisher-proxy/300-deployment.yaml similarity index 100% rename from config/300-deployment.yaml rename to config/event-publisher-proxy/300-deployment.yaml From b5b515d72c6d823ff5cfecb949aca0b6358a02a6 Mon Sep 17 00:00:00 2001 From: Radu Fantaziu Date: Fri, 15 Jan 2021 16:18:25 +0100 Subject: [PATCH 009/194] Event publisher to NATS (#10331) * Initial commit * Add tests * Solve make imports * Update comments * Remove unused code * Use '/' at the begining of test namespaces, for both BEB and NATS * Solve comments * Update log message * Solve other comments * Solve make imports * Generate a random port for Nats --- cmd/event-publisher-nats/main.go | 61 ++++++-- go.mod | 6 +- go.sum | 125 +++++++++++++++ pkg/env/nats_config.go | 24 +++ pkg/handler/handler_test.go | 260 ++++++++++++++++--------------- pkg/handler/nats.go | 175 +++++++++++++++++++++ pkg/handler/nats_test.go | 207 ++++++++++++++++++++++++ pkg/legacy-events/legacy_test.go | 2 +- pkg/receiver/receiver.go | 2 +- pkg/sender/nats.go | 61 ++++++++ pkg/sender/nats_test.go | 97 ++++++++++++ pkg/subscribed/response.go | 2 +- 12 files changed, 878 insertions(+), 144 deletions(-) create mode 100644 pkg/env/nats_config.go create mode 100644 pkg/handler/nats.go create mode 100644 pkg/handler/nats_test.go create mode 100644 pkg/sender/nats.go create mode 100644 pkg/sender/nats_test.go diff --git a/cmd/event-publisher-nats/main.go b/cmd/event-publisher-nats/main.go index bc2d802..22f3828 100644 --- a/cmd/event-publisher-nats/main.go +++ b/cmd/event-publisher-nats/main.go @@ -1,24 +1,63 @@ package main import ( - "os" - "os/signal" - "syscall" - + "github.com/kelseyhightower/envconfig" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" "github.com/sirupsen/logrus" + "sigs.k8s.io/controller-runtime/pkg/client/config" _ "k8s.io/client-go/plugin/pkg/client/auth" ) func main() { logger := logrus.New() - logger.Info("Event Publisher NATS Started") + logger.Info("Event Publisher NATS started") + opts := options.ParseArgs() + cfgNats := new(env.NatsConfig) + if err := envconfig.Process("", cfgNats); err != nil { + logger.Fatalf("Read NATS configuration failed with error: %s", err) + } + + // configure message receiver + messageReceiver := receiver.NewHttpMessageReceiver(cfgNats.Port) + + // assure uniqueness + ctx := signals.NewContext() + + // configure message sender + messageSenderToNats := sender.NewNatsMessageSender(ctx, cfgNats.NatsPublishURL, logger) + + // configure legacyTransformer + legacyTransformer := legacy.NewTransformer( + cfgNats.ToConfig().BEBNamespace, + cfgNats.ToConfig().EventTypePrefix, + ) + + // Configure Subscription Lister + k8sConfig := config.GetConfigOrDie() + subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig) + subLister := subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() + subscribedProcessor := &subscribed.Processor{ + SubscriptionLister: &subLister, + Config: cfgNats.ToConfig(), + Logger: logger, + } + // Sync informer cache or die + logger.Info("Waiting for informers caches to sync") + subscribed.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory) + logger.Info("Informers are synced successfully") - // wait for shutdown signal - shutdown := make(chan os.Signal) - signal.Notify(shutdown, syscall.SIGINT, syscall.SIGTERM) - <-shutdown - close(shutdown) + // start handler which blocks until it receives a shutdown signal + if err := handler.NewNatsHandler(messageReceiver, messageSenderToNats, cfgNats.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logger).Start(ctx); err != nil { + logger.Fatalf("Start handler failed with error: %s", err) + } - logger.Info("Event Publisher NATS Shutdown") + logger.Info("Event Publisher NATS shutdown") } diff --git a/go.mod b/go.mod index fc9943b..d184dc8 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,17 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy go 1.15 require ( + github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 github.com/cloudevents/sdk-go/v2 v2.3.1 + github.com/go-logr/logr v0.3.0 github.com/google/uuid v1.1.1 github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/console-backend-service v0.0.0-20201116133707-dd0a4cf8e9d8 // indirect - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20201116133707-dd0a4cf8e9d8 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316 + github.com/nats-io/nats.go v1.10.1-0.20201204000952-090c71e95cd0 github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.6.0 + github.com/stretchr/testify v1.6.1 go.opencensus.io v0.22.4 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect diff --git a/go.sum b/go.sum index 9078fb9..7b141c6 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.40.0/go.mod h1:Tk58MuI9rbLMKlAjeO/bDnteAx7tX2gJIXw4T5Jwlro= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= @@ -12,15 +13,19 @@ cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbf cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeSEBLPA9YJp5bjrofdU3pIXs= contrib.go.opencensus.io/exporter/prometheus v0.1.0/go.mod h1:cGFniUXGZlKRjzOyuZJ6mgB+PgBcCIa79kEKR8YCW+A= contrib.go.opencensus.io/exporter/stackdriver v0.12.9/go.mod h1:XyyafDnFOsqoxHJgTFycKZMrRUrPThLh2iYTJF6uoO0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/99designs/gqlgen v0.11.3/go.mod h1:RgX5GRRdDWNkh4pBrdzNpNPFVsdoUFY2+adM6nb1N+4= +github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest/autorest v0.2.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg= github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= +github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= github.com/Azure/go-autorest/autorest/adal v0.5.0 h1:q2gDruN08/guU9vAjuPWff0+QIrpH6ediguzdAzXAUU= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= @@ -30,8 +35,11 @@ github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+v github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= +github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -52,8 +60,10 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053/go.mod h1:xW8sBma2LE3QxFSzCnH9qe6gAE2yO9GvQaWwX89HxbE= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30/go.mod h1:4AJxUpXUhv4N+ziTvIcWWXgeorXpxPZOfk9HdEVr96M= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= @@ -64,6 +74,7 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l github.com/asyncapi/converter-go v0.0.0-20190802111537-d8459b2bd403/go.mod h1:mpJYWYy+USNiLENQxiyGgRc3qtFPxYSWdSd/eS+R6bo= github.com/asyncapi/converter-go v0.0.0-20190916120412-39eeca5e9df5/go.mod h1:mpJYWYy+USNiLENQxiyGgRc3qtFPxYSWdSd/eS+R6bo= github.com/asyncapi/parser v0.0.0-20191002092055-f7b577d06d20/go.mod h1:MuJ++ZbwZV7Di4OtSGtgAe2whaMEZjYBPVnf8U/Qvo4= +github.com/avast/retry-go v2.4.1+incompatible h1:WMHc0mwoz20UVmBYK89mUB/KFRlxO0p+s+sgpmJMviY= github.com/avast/retry-go v2.4.1+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= @@ -75,6 +86,7 @@ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kB github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= @@ -82,10 +94,15 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudevents/sdk-go v1.2.0 h1:2AxI14EJUw1PclJ5gZJtzbxnHIfNMdi76Qq3P3G1BRU= +github.com/cloudevents/sdk-go v1.2.0/go.mod h1:ss+jWJ88wypiewnPEzChSBzTYXGpdcILoN9YHk8uhTQ= +github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 h1:LY5dKsBPIcY6NQajjgGyQO2hlfSD96FnMpoISZ2lxJo= +github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1/go.mod h1:xEjXKvch0fuLkmYyNlznjNpwgtMVhELY6aeyruXKXjQ= github.com/cloudevents/sdk-go/v2 v2.2.0 h1:FlBJg7W0QywbOjuZGmRXUyFk8qkCHx2euETp+tuopSU= github.com/cloudevents/sdk-go/v2 v2.2.0/go.mod h1:3CTrpB4+u7Iaj6fd7E2Xvm5IxMdRoaAhqaRVnOr2rCU= github.com/cloudevents/sdk-go/v2 v2.3.1 h1:QRTu0yRA4FbznjRSds0/4Hy6cVYpWV2wInlNJSHWAtw= github.com/cloudevents/sdk-go/v2 v2.3.1/go.mod h1:4fO2UjPMYYR1/7KPJQCwTPb0lFA8zYuitkUpAZFSY1Q= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/coreos/bbolt v1.3.1-coreos.6/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -127,7 +144,9 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc= github.com/evanphx/json-patch v4.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -142,6 +161,7 @@ github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHqu github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/gernest/front v0.0.0-20181129160812-ed80ca338b88/go.mod h1:FwEMwQ5+xky8tbzDLj72k2RAqXnFByLNwxg+9UZDtqU= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -166,6 +186,8 @@ github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs= +github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= @@ -222,6 +244,7 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -242,6 +265,7 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -303,8 +327,12 @@ github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79/ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= +github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.4/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -362,6 +390,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/service-catalog v0.2.2-0.20190920221325-ccab52343967/go.mod h1:fmRsWJ38Od93DQ7cOXR9mMSSwmjyDS1EAomWxBlumuo= github.com/kyma-incubator/api-gateway v0.0.0-20191125140217-295e8fcaa03f/go.mod h1:EwSqotNAjdWdMGQdE7hQaRF68MM2raDRJlRnBi9sltY= +github.com/kyma-incubator/api-gateway v0.0.0-20200930072023-5d3f2107a1ef h1:YkBUaF/CdwgbdTt1eBeaiy1W/ZU/dzSRP2BBPmFm6jc= +github.com/kyma-incubator/api-gateway v0.0.0-20200930072023-5d3f2107a1ef/go.mod h1:DGeKJ2GUH1cOAxUKVbUUl55DuIX6w2DXgZjlg8UTwrU= github.com/kyma-project/helm-broker v0.0.0-20190906085923-d07feb2d365a/go.mod h1:VFnkD5ddzF9s8qcY12DRzYOznJJlpMbSRWGRgM4P1XA= github.com/kyma-project/kyma v0.5.0 h1:msjpImAtZ3l+y6j+dHvOwF4Nm0J4IGJXRRBw7VwnqpA= github.com/kyma-project/kyma v0.5.1-0.20200609051543-f5997d4a36d6 h1:P3R3c4pewIa+IjzNldO9WRFA58s0r3WVqRxLK6feYc8= @@ -371,12 +401,15 @@ github.com/kyma-project/kyma/components/console-backend-service v0.0.0-202011161 github.com/kyma-project/kyma/components/event-publisher-proxy v0.0.0-20201014135541-82b304ab245a/go.mod h1:SzxIlsqx8zJXNhqyUabWs8NzYcfEv1SleJ1U0+Gp6Ms= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20201116133707-dd0a4cf8e9d8 h1:7SL5NKGZZjrTR71UXvs3l5LUczOxlRrken6EMCEua+o= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20201116133707-dd0a4cf8e9d8/go.mod h1:KsN8YoKL6hF9/kQeOaGuCrCMmzelOhjoHhmnXKAWfYE= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316 h1:wZ2BvFuElkG6K3pOFxLiT/oXeH07N/wfJqj1LlL76rY= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316/go.mod h1:ZBfptvrdh3YUmdJac/1IFm2pgyk+YAfyLET05ztKTlI= github.com/kyma-project/kyma/components/function-controller v0.0.0-20201012150043-858bc2c23ef5/go.mod h1:842PCaqaSMTkmr80oQsckxMyZ6WXBLy6E22/JPQeUl0= github.com/kyma-project/rafter v0.0.0-20200402080904-a0157e52e150/go.mod h1:zlQEXkFdCYTii7GGjd0jLOudgPtxgZLJy2VDXW7j54I= github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac h1:+2b6iGRJe3hvV/yVXrd41yVEjxuFHxasJqDhkIjS4gk= github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac/go.mod h1:Frd2bnT3w5FB5q49ENTfVlztJES+1k/7lyWX2+9gq/M= github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= +github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -391,12 +424,15 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= github.com/minio/minio-go v6.0.14+incompatible/go.mod h1:7guKYtitv8dktvNUGrhzmNlA5wrAABTQXCoesZdFQO8= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -412,8 +448,41 @@ github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8m github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2 h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/jwt v0.3.3-0.20200519195258-f2bf5ce574c7/go.mod h1:n3cvmLfBfnpV4JJRN7lRYCyZnw48ksGsbThGXEk4w9M= +github.com/nats-io/jwt v1.1.0 h1:+vOlgtM0ZsF46GbmUoadq0/2rChNS45gtxHEa3H1gqM= +github.com/nats-io/jwt v1.1.0/go.mod h1:n3cvmLfBfnpV4JJRN7lRYCyZnw48ksGsbThGXEk4w9M= +github.com/nats-io/jwt/v2 v2.0.0-20200916203241-1f8ce17dff02/go.mod h1:vs+ZEjP+XKy8szkBmQwCB7RjYdIlMaPsFPs4VdS4bTQ= +github.com/nats-io/jwt/v2 v2.0.0-20201015190852-e11ce317263c/go.mod h1:vs+ZEjP+XKy8szkBmQwCB7RjYdIlMaPsFPs4VdS4bTQ= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats-server/v2 v2.1.7/go.mod h1:rbRrRE/Iv93O/rUvZ9dh4NfT0Cm9HWjW/BqOWLGgYiE= +github.com/nats-io/nats-server/v2 v2.1.8-0.20200524125952-51ebd92a9093/go.mod h1:rQnBf2Rv4P9adtAs/Ti6LfFmVtFG6HLhl/H7cVshcJU= +github.com/nats-io/nats-server/v2 v2.1.8-0.20200601203034-f8d6dd992b71/go.mod h1:Nan/1L5Sa1JRW+Thm4HNYcIDcVRFc5zK9OpSZeI2kk4= +github.com/nats-io/nats-server/v2 v2.1.8-0.20200929001935-7f44d075f7ad/go.mod h1:TkHpUIDETmTI7mrHN40D1pzxfzHZuGmtMbtb83TGVQw= +github.com/nats-io/nats-server/v2 v2.1.8-0.20201129161730-ebe63db3e3ed/go.mod h1:XD0zHR/jTXdZvWaQfS5mQgsXj6x12kMjKLyAk/cOGgY= +github.com/nats-io/nats-server/v2 v2.1.9 h1:Sxr2zpaapgpBT9ElTxTVe62W+qjnhPcKY/8W5cnA/Qk= +github.com/nats-io/nats-server/v2 v2.1.9/go.mod h1:9qVyoewoYXzG1ME9ox0HwkkzyYvnlBDugfR4Gg/8uHU= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nats.go v1.10.0 h1:L8qnKaofSfNFbXg0C5F71LdjPRnmQwSsA4ukmkt1TvY= +github.com/nats-io/nats.go v1.10.0/go.mod h1:AjGArbfyR50+afOUotNX2Xs5SYHf+CoOa5HH1eEl2HE= +github.com/nats-io/nats.go v1.10.1-0.20200531124210-96f2130e4d55/go.mod h1:ARiFsjW9DVxk48WJbO3OSZ2DG8fjkMi7ecLmXoY/n9I= +github.com/nats-io/nats.go v1.10.1-0.20200606002146-fc6fed82929a/go.mod h1:8eAIv96Mo9QW6Or40jUHejS7e4VwZ3VRYD6Sf0BTDp4= +github.com/nats-io/nats.go v1.10.1-0.20201021145452-94be476ad6e0/go.mod h1:VU2zERjp8xmF+Lw2NH4u2t5qWZxwc7jB3+7HVMWQXPI= +github.com/nats-io/nats.go v1.10.1-0.20201204000952-090c71e95cd0 h1:wyJhRLDJBRwl4OR0Q/nhdt/0rYPw3jbHgLklpyxGj/w= +github.com/nats-io/nats.go v1.10.1-0.20201204000952-090c71e95cd0/go.mod h1:Sa3kLIonafChP5IF0b55i9uvGR10I3hPETFbi4+9kOI= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.4 h1:aEsHIssIk6ETN5m2/MD8Y4B2X7FfXrBAUdkyRvbVYzA= +github.com/nats-io/nkeys v0.1.4/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= +github.com/nats-io/nkeys v0.2.0 h1:WXKF7diOaPU9cJdLD7nuzwasQy9vT1tBqzXZZf3AMJM= +github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= +github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -427,6 +496,7 @@ github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.3.0/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -438,25 +508,33 @@ github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs= +github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/openzipkin-contrib/zipkin-go-opentracing v0.3.5/go.mod h1:uVHyebswE1cCXr2A73cRM2frx5ld1RJUCJkFNZ90ZiI= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go-opentracing v0.3.5/go.mod h1:js2AbwmHW0YD9DwIw2JhQWmbfFi/UnWyYwdVhqbCDOE= github.com/ory/hydra-maester v0.0.19/go.mod h1:nLN4AAm6u1Iht1INnp4fl6blbCf2wDDZ+PbTWS1aDnA= github.com/ory/oathkeeper-maester v0.0.2-beta.1/go.mod h1:pKLJLWu1AdMxyq9tufkZzS6+7bW2xz9aN/Sk04XGlmw= github.com/ory/oathkeeper-maester v0.0.7/go.mod h1:I+J8vshTw2Eax35LzBOK4K/1+Pi4gQ+SgYZzTenEIMs= +github.com/ory/oathkeeper-maester v0.1.0 h1:xqY4Px2ubPyAS/3bl0AcI6ctW2/lrXJUHHb5gXNz97U= +github.com/ory/oathkeeper-maester v0.1.0/go.mod h1:O692MD+MJP3dx0QUV1iOcSPxczdRZEj5WauFaD1vy7U= github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= @@ -468,22 +546,26 @@ github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35/go.mod h1:prY github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.2.1 h1:JnMpQc6ppsNgw9QPAGF6Dod479itz7lvlsMzzNayLOI= github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 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.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.11 h1:DhHlBtkHWPYi8O2y31JkK0TF+DGM+51OopZjH/Ia5qI= @@ -538,6 +620,7 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -566,6 +649,8 @@ go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mI go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= @@ -608,13 +693,18 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -652,6 +742,7 @@ golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -700,7 +791,9 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -726,10 +819,12 @@ golang.org/x/sys v0.0.0-20190919044723-0c1ff786ef13/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -751,9 +846,11 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -795,6 +892,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.0.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= @@ -803,7 +901,9 @@ gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3m gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -822,6 +922,7 @@ google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= @@ -829,15 +930,19 @@ google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBr google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -881,20 +986,27 @@ gopkg.in/yaml.v2 v2.0.0/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +istio.io/api v0.0.0-20200812202721-24be265d41c3/go.mod h1:88HN3o1fSD1jo+Z1WTLlJfMm9biopur6Ct9BFKjiB64= +istio.io/client-go v0.0.0-20200916161914-94f0e83444ca/go.mod h1:SO65MWt7I45dvUwuDowoiB0SVcGpfWZfUTlopvYpbZc= +istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a/go.mod h1:OzpAts7jljZceG4Vqi5/zXy/pOg1b209T3jb7Nv5wIs= k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20190918155943-95b840bb6a1f/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= k8s.io/api v0.0.0-20191003000013-35e20aa79eb8/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= @@ -907,9 +1019,12 @@ k8s.io/api v0.19.4 h1:I+1I4cgJYuCDgiLNjKx7SLmIbwgj9w7N7Zr5vSIdwpo= k8s.io/api v0.19.4/go.mod h1:SbtJ2aHCItirzdJ36YslycFNzWADYH3tgOhvBEFtZAk= k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783/go.mod h1:xvae1SZB3E17UpV59AWc271W/Ph25N+bjPyR63X6tPY= +k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= k8s.io/apiextensions-apiserver v0.17.9/go.mod h1:p2C9cDflVAUPMl5/QOMHxnSzQWF/cDqu7AP2KUXHHMA= k8s.io/apiextensions-apiserver v0.18.2 h1:I4v3/jAuQC+89L3Z7dDgAiN4EOjN6sbm6iBqQwHTah8= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= +k8s.io/apiextensions-apiserver v0.18.12 h1:b0jTgW/qwqZBMIJTMxkLvvAtNRDZboG5yZiIbOFgQv8= +k8s.io/apiextensions-apiserver v0.18.12/go.mod h1:nihADkPed1L37Vxpz2/BrtxO9mCtINH23aNtUe/CRLo= k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655/go.mod h1:nL6pwRT8NgfF8TT68DBI8uEePRt89cSvoXUVqbkWHq4= k8s.io/apimachinery v0.16.15 h1:4cmEfuRsKuV8pMpaQ6z0AKEUXZ3r+u/NKaz5dvIjySk= @@ -920,8 +1035,10 @@ k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftc k8s.io/apimachinery v0.19.4 h1:+ZoddM7nbzrDCp0T3SWnyxqf8cbWPT2fkZImoyvHUG0= k8s.io/apimachinery v0.19.4/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= k8s.io/apiserver v0.0.0-20190918160949-bfa5e2e684ad/go.mod h1:XPCXEwhjaFN29a8NldXA901ElnKeKLrLtREO9ZhFyhg= +k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= k8s.io/apiserver v0.17.9/go.mod h1:Qaxd3EbeoPRBHVMtFyuKNAObqP6VAkzIMyWYz8KuE2k= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= +k8s.io/apiserver v0.18.12/go.mod h1:uFOeW4LlxS6KDgLWy3n3gh0DhC6m41QIFgL33ouk+4w= k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90/go.mod h1:J69/JveO6XESwVgG53q3Uz5OSfgsv4uxpScmmyYOOlk= k8s.io/client-go v0.0.0-20191003000419-f68efa97b39e/go.mod h1:UBFA5lo8nEOepaxS9koNccX/38rYMI3pa1EA1gaFZNg= k8s.io/client-go v0.16.15 h1:cuSmM5begnN77V0beNgmhQ9yob6TFUnN+YaqAfRBD40= @@ -941,11 +1058,15 @@ k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyod k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible h1:U5Bt+dab9K8qaUmXINrkXO135kA11/i5Kg1RUydgaMQ= k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269/go.mod h1:V5BD6M4CyaN5m+VthcclXWsVcT1Hu+glwa1bi3MIsyE= +k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= k8s.io/code-generator v0.17.9/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= +k8s.io/code-generator v0.18.12/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090/go.mod h1:933PBGtQFJky3TEwYx4aEPZ4IxqhWh3R6DCmzqIn1hA= +k8s.io/component-base v0.17.8/go.mod h1:xfNNdTAMsYzdiAa8vXnqDhRVSEgkfza0iMt0FrZDY7s= k8s.io/component-base v0.17.9/go.mod h1:Wg22ePDK0mfTa+bEFgZHGwr0h40lXnYy6D7D+f7itFk= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= +k8s.io/component-base v0.18.12/go.mod h1:pRGKXsx2KWfsJqlDi4sbCc1jpaB87rXIIqupjhr5wj0= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -964,6 +1085,7 @@ k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH k8s.io/kube-openapi v0.0.0-20190510232812-a01b7d5d6c22/go.mod h1:iU+ZGYsNlvU9XKUSso6SQfKTCCw7lFduMZy26Mgr2Fw= k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= +k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= k8s.io/kube-openapi v0.0.0-20200410163147-594e756bea31 h1:PsbYeEz2x7ll6JYUzBEG+DT78910DDTlvn5Ma10F5/E= k8s.io/kube-openapi v0.0.0-20200410163147-594e756bea31/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= @@ -984,17 +1106,20 @@ modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +pack.ag/amqp v0.11.0/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= sigs.k8s.io/controller-runtime v0.2.0-beta.2/go.mod h1:TSH2R0nSz4WAlUUlNnOFcOR/VUhfwBLlmtq2X6AiQCA= sigs.k8s.io/controller-runtime v0.2.0-beta.4/go.mod h1:HweyYKQ8fBuzdu2bdaeBJvsFgAi/OqBBnrVGXcqKhME= sigs.k8s.io/controller-runtime v0.4.0/go.mod h1:ApC79lpY3PHW9xj/w9pj+lYkLgwAAUZwfXkME1Lajns= +sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+aqSv/M3njpmo= sigs.k8s.io/controller-runtime v0.5.10/go.mod h1:OTqxLuz7gVcrq+BHGUgedRu6b2VIKCEc7Pu4Jbwui0A= sigs.k8s.io/controller-runtime v0.6.0 h1:Fzna3DY7c4BIP6KwfSlrfnj20DJ+SeMBK8HSFvOk9NM= sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= sigs.k8s.io/controller-tools v0.2.0-beta.2/go.mod h1:gC5UAnK1jbxWnDaqTi0yxKIsRsRwshzeRtTUGbM9vos= sigs.k8s.io/controller-tools v0.2.4/go.mod h1:m/ztfQNocGYBgTTCmFdnK94uVvgxeZeE3LtJvd/jIzA= sigs.k8s.io/kind v0.4.0/go.mod h1:bgGo2cWxKGQ7esVxtGp9H17Ttlexju92CTMjCg08HNQ= +sigs.k8s.io/kind v0.7.0/go.mod h1:An/AbWHT6pA/Lm0Og8j3ukGhfJP3RiVN/IBU6Lo3zl8= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go new file mode 100644 index 0000000..ea21187 --- /dev/null +++ b/pkg/env/nats_config.go @@ -0,0 +1,24 @@ +package env + +import "time" + +// Config represents the environment config for the Event Publisher NATS. +type NatsConfig struct { + Port int `envconfig:"INGRESS_PORT" default:"8080"` + NatsPublishURL string `envconfig:"NATS_URL" default:"nats.nats.svc.cluster.local"` + RequestTimeout time.Duration `envconfig:"REQUEST_TIMEOUT" default:"5s"` + // Legacy Namespace is used as the event source for legacy events + LegacyNamespace string `envconfig:"LEGACY_NAMESPACE" default:"kyma"` + // LegacyEventTypePrefix is the prefix of each event as per the eventing specification, used for legacy events + // It follows the eventType format: ... + LegacyEventTypePrefix string `envconfig:"LEGACY_EVENT_TYPE_PREFIX" default:"kyma"` +} + +// Convert to a default BEB Config +func (c *NatsConfig) ToConfig() *Config { + cfg := &Config{ + BEBNamespace: c.LegacyNamespace, + EventTypePrefix: c.LegacyEventTypePrefix, + } + return cfg +} diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index 1919dc8..5174600 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -37,10 +37,8 @@ const ( eventsHTTP400Endpoint = "/events400" ) -func TestHandler(t *testing.T) { - t.Parallel() - - testCases := []struct { +var ( + testCasesForCloudEvents = []struct { name string provideMessage func() (string, http.Header) wantStatusCode int @@ -126,6 +124,132 @@ func TestHandler(t *testing.T) { wantStatusCode: http.StatusNoContent, }, } + testCasesForLegacyEvents = []struct { + name string + targetEndpoint string + provideMessage func() (string, http.Header) + wantStatusCode int + wantResponse legacyapi.PublishEventResponses + }{ + { + name: "Send a legacy event successfully with event-id", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusOK, + wantResponse: legacyapi.PublishEventResponses{ + Ok: &legacyapi.PublishResponse{ + EventID: "8945ec08-256b-11eb-9928-acde48001122", + Status: "", + Reason: "", + }, + }, + }, + { + name: "Send a legacy event successfully without event-id", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithoutEventId, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusOK, + wantResponse: legacyapi.PublishEventResponses{ + Ok: &legacyapi.PublishResponse{ + EventID: "", + Status: "", + Reason: "", + }, + }, + }, + { + name: "Send a legacy event with invalid event id", + provideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithInvalidEventId, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: testingutils.GetInvalidValidationErrorFor("event-id"), + }, + }, + { + name: "Send a legacy event without event time", + provideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithoutEventTime, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: testingutils.GetMissingFieldValidationErrorFor("event-time"), + }, + }, + { + name: "Send a legacy event without event type", + provideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithoutEventType, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: testingutils.GetMissingFieldValidationErrorFor("event-type"), + }, + }, + { + name: "Send a legacy event with invalid event time", + provideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithInvalidEventTime, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: testingutils.GetInvalidValidationErrorFor("event-time"), + }, + }, + { + name: "Send a legacy event without event version", + provideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithWithoutEventVersion, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: testingutils.GetMissingFieldValidationErrorFor("event-type-version"), + }, + }, + { + name: "Send a legacy event without data field", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithoutData, testingutils.GetApplicationJSONHeaders() + }, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: testingutils.GetMissingFieldValidationErrorFor("data"), + }, + }, + } + testCasesForSubscribedEndpoint = []struct { + name string + appName string + inputSubscriptions []eventingv1alpha1.Subscription + wantStatusCode int + wantResponse subscribed.Events + }{ + { + name: "Send a request with a valid application name", + appName: "valid-app", + wantStatusCode: http.StatusOK, + wantResponse: subscribed.Events{ + EventsInfo: []subscribed.Event{{ + Name: "order.created", + Version: "v1", + }}, + }, + }, { + name: "Send a request with an invalid application name", + appName: "invalid-app", + wantStatusCode: http.StatusOK, + wantResponse: subscribed.Events{ + EventsInfo: []subscribed.Event{}, + }, + }, + } +) + +func TestHandler(t *testing.T) { + t.Parallel() port, err := testingutils.GeneratePort() if err != nil { @@ -168,7 +292,7 @@ func TestHandler(t *testing.T) { testingutils.WaitForHandlerToStart(t, healthEndpoint) - for _, testCase := range testCases { + for _, testCase := range testCasesForCloudEvents { t.Run(testCase.name, func(t *testing.T) { body, headers := testCase.provideMessage() resp, err := testingutils.SendEvent(publishEndpoint, body, headers) @@ -251,102 +375,6 @@ func TestHandlerForLegacyEvents(t *testing.T) { bebNs = "/beb.namespace" eventTypePrefix = "event.type.prefix" ) - testCases := []struct { - name string - targetEndpoint string - provideMessage func() (string, http.Header) - wantStatusCode int - wantResponse legacyapi.PublishEventResponses - }{ - { - name: "Send a legacy event successfully with event-id", - provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusOK, - wantResponse: legacyapi.PublishEventResponses{ - Ok: &legacyapi.PublishResponse{ - EventID: "8945ec08-256b-11eb-9928-acde48001122", - Status: "", - Reason: "", - }, - }, - }, - { - name: "Send a legacy event successfully without event-id", - provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithoutEventId, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusOK, - wantResponse: legacyapi.PublishEventResponses{ - Ok: &legacyapi.PublishResponse{ - EventID: "", - Status: "", - Reason: "", - }, - }, - }, - { - name: "Send a legacy event with invalid event id", - provideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithInvalidEventId, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: testingutils.GetInvalidValidationErrorFor("event-id"), - }, - }, - { - name: "Send a legacy event without event time", - provideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithoutEventTime, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: testingutils.GetMissingFieldValidationErrorFor("event-time"), - }, - }, - { - name: "Send a legacy event without event type", - provideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithoutEventType, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: testingutils.GetMissingFieldValidationErrorFor("event-type"), - }, - }, - { - name: "Send a legacy event with invalid event time", - provideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithInvalidEventTime, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: testingutils.GetInvalidValidationErrorFor("event-time"), - }, - }, - { - name: "Send a legacy event without event version", - provideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithWithoutEventVersion, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: testingutils.GetMissingFieldValidationErrorFor("event-type-version"), - }, - }, - { - name: "Send a legacy event without data field", - provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithoutData, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: testingutils.GetMissingFieldValidationErrorFor("data"), - }, - }, - } mockServer := testingutils.NewMockServer() mockServer.Start(t, tokenEndpoint, eventsEndpoint, eventsHTTP400Endpoint) @@ -381,7 +409,7 @@ func TestHandlerForLegacyEvents(t *testing.T) { testingutils.WaitForHandlerToStart(t, healthEndpoint) - for _, testCase := range testCases { + for _, testCase := range testCasesForLegacyEvents { t.Run(testCase.name, func(t *testing.T) { body, headers := testCase.provideMessage() @@ -667,34 +695,8 @@ func TestHandlerForSubscribedEndpoint(t *testing.T) { } }() testingutils.WaitForHandlerToStart(t, healthEndpoint) - testCases := []struct { - name string - appName string - inputSubscriptions []eventingv1alpha1.Subscription - wantStatusCode int - wantResponse subscribed.Events - }{ - { - name: "Send a request with a valid application name", - appName: "valid-app", - wantStatusCode: http.StatusOK, - wantResponse: subscribed.Events{ - EventsInfo: []subscribed.Event{{ - Name: "order.created", - Version: "v1", - }}, - }, - }, { - name: "Send a request with an invalid application name", - appName: "invalid-app", - wantStatusCode: http.StatusOK, - wantResponse: subscribed.Events{ - EventsInfo: []subscribed.Event{}, - }, - }, - } - for _, testCase := range testCases { + for _, testCase := range testCasesForSubscribedEndpoint { t.Run(testCase.name, func(t *testing.T) { subscribedURL := fmt.Sprintf(subscribedEndpointFormat, port, testCase.appName) resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) diff --git a/pkg/handler/nats.go b/pkg/handler/nats.go new file mode 100644 index 0000000..1f7351d --- /dev/null +++ b/pkg/handler/nats.go @@ -0,0 +1,175 @@ +package handler + +import ( + "context" + "net/http" + "time" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/health" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + + "github.com/sirupsen/logrus" + + "github.com/cloudevents/sdk-go/v2/binding" + cev2client "github.com/cloudevents/sdk-go/v2/client" + cev2event "github.com/cloudevents/sdk-go/v2/event" + cehttp "github.com/cloudevents/sdk-go/v2/protocol/http" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" +) + +// Handler is responsible for receiving HTTP requests and dispatching them to NATS. +// It also assures that the messages received are compliant with the Cloud Events spec. +type NatsHandler struct { + // Receiver receives incoming HTTP requests + Receiver *receiver.HttpMessageReceiver + // Sender sends requests to the broker + Sender *sender.NatsMessageSender + // Defaulter sets default values to incoming events + Defaulter cev2client.EventDefaulter + // LegacyTransformer handles transformations needed to handle legacy events + LegacyTransformer *legacy.Transformer + // RequestTimeout timeout for outgoing requests + RequestTimeout time.Duration + //SubscribedProcessor processes requests for /:app/v1/events/subscribed endpoint + SubscribedProcessor *subscribed.Processor + // Logger default logger + Logger *logrus.Logger + // Options configures HTTP server + Options *options.Options +} + +// NewHandler returns a new Handler instance for the Event Publisher Proxy. +func NewNatsHandler(receiver *receiver.HttpMessageReceiver, sender *sender.NatsMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logrus.Logger) *NatsHandler { + return &NatsHandler{ + Receiver: receiver, + Sender: sender, + RequestTimeout: requestTimeout, + LegacyTransformer: legacyTransformer, + SubscribedProcessor: subscribedProcessor, + Logger: logger, + Options: opts, + } +} + +// Start starts the Handler with the given context. +func (h *NatsHandler) Start(ctx context.Context) error { + return h.Receiver.StartListen(ctx, health.CheckHealth(h)) +} + +// ServeHTTP serves an HTTP request and returns back an HTTP response. +// It ensures that the incoming request is a valid Cloud Event, then dispatches it +// to NATS and writes back the HTTP response. +func (h *NatsHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { + // validate request method + if request.Method != http.MethodPost && request.Method != http.MethodGet { + h.Logger.Warnf("Unexpected request method: %s", request.Method) + h.writeResponse(writer, http.StatusMethodNotAllowed, nil) + return + } + // Limit server from reading a huge payload + request.Body = http.MaxBytesReader(writer, request.Body, h.Options.MaxRequestSize) + uri := request.RequestURI + + // Process /publish endpoint + // Gets a CE and sends it to NATS + if isARequestWithCE(uri) { + h.publishCloudEvents(writer, request) + return + } + + // Process /:application/v1/events + // Publishes a legacy event as CE v1.0 to NATS + if isARequestWithLegacyEvent(uri) { + h.publishLegacyEventsAsCE(writer, request) + return + } + + // Process /:application/v1/events/subscribed + // Fetches the list of subscriptions available for the given application + if isARequestForSubscriptions(uri) { + h.SubscribedProcessor.ExtractEventsFromSubscriptions(writer, request) + return + } + + h.writeResponse(writer, http.StatusNotFound, nil) + return +} + +func (h *NatsHandler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { + event := h.LegacyTransformer.TransformsLegacyRequestsToCE(writer, request) + if event == nil { + h.Logger.Debug("failed to transform legacy event to CE, event is nil") + return + } + ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) + defer cancel() + h.receive(ctx, event) + statusCode, dispatchTime, respBody := h.send(ctx, event) + // Change response as per old error codes + h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, statusCode, event, string(respBody)) + h.Logger.Infof("Event dispatched id:[%s] statusCode:[%d] duration:[%s] responseBody:[%s]", event.ID(), statusCode, dispatchTime, respBody) +} + +func (h *NatsHandler) publishCloudEvents(writer http.ResponseWriter, request *http.Request) { + ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) + defer cancel() + + message := cehttp.NewMessageFromHttpRequest(request) + defer func() { _ = message.Finish(nil) }() + + event, err := binding.ToEvent(ctx, message) + if err != nil { + h.Logger.Warnf("Failed to extract event from request with error: %s", err) + h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) + return + } + + if err := event.Validate(); err != nil { + h.Logger.Warnf("Request is invalid as per CE spec with error: %s", err) + h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) + return + } + + h.receive(ctx, event) + statusCode, dispatchTime, respBody := h.send(ctx, event) + h.writeResponse(writer, statusCode, respBody) + + h.Logger.Infof("Event dispatched id:[%s] statusCode:[%d] duration:[%s] responseBody:[%s]", event.ID(), statusCode, dispatchTime, respBody) +} + +// writeResponse writes the HTTP response given the status code and response body. +func (h *NatsHandler) writeResponse(writer http.ResponseWriter, statusCode int, respBody []byte) { + writer.WriteHeader(statusCode) + + if respBody == nil { + return + } + if _, err := writer.Write(respBody); err != nil { + h.Logger.Errorf("Failed to write response body with error: %s", err) + } +} + +// receive applies the default values (if any) to the given Cloud Event. +func (h *NatsHandler) receive(ctx context.Context, event *cev2event.Event) { + if h.Defaulter != nil { + newEvent := h.Defaulter(ctx, *event) + event = &newEvent + } + + h.Logger.Infof("Event received id:[%s]", event.ID()) +} + +// send dispatches the given Cloud Event to NATS and returns the response details and dispatch time. +func (h *NatsHandler) send(ctx context.Context, event *cev2event.Event) (int, time.Duration, []byte) { + start := time.Now() + resp, err := h.Sender.Send(ctx, event) + dispatchTime := time.Since(start) + if err != nil { + return resp, dispatchTime, []byte(err.Error()) + } + return resp, dispatchTime, []byte{} +} diff --git a/pkg/handler/nats_test.go b/pkg/handler/nats_test.go new file mode 100644 index 0000000..bce5501 --- /dev/null +++ b/pkg/handler/nats_test.go @@ -0,0 +1,207 @@ +package handler + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "reflect" + "testing" + "time" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" + eventingtesting "github.com/kyma-project/kyma/components/eventing-controller/testing" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/assert" + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/dynamic/dynamicinformer" + dynamicfake "k8s.io/client-go/dynamic/fake" +) + +func TestNatsHandler(t *testing.T) { + t.Parallel() + + logger := logrus.New() + logger.Info("TestNatsHandler started") + + // a cancelable context to be used + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + port, err := testingutils.GeneratePort() + if err != nil { + t.Fatalf("failed to generate ingress port: %v", err) + } + natsPort, err := testingutils.GeneratePort() + if err != nil { + t.Fatalf("failed to generate Nats port: %v", err) + } + cfgNats := newEnvConfig(port, natsPort) + + // configure message receiver + messageReceiver := receiver.NewHttpMessageReceiver(cfgNats.Port) + assert.NotNil(t, messageReceiver) + + // Start Nats server + natsServer := eventingtesting.RunNatsServerOnPort(cfgNats.Port + 1) + assert.NotNil(t, natsServer) + defer natsServer.Shutdown() + + // create a Nats sender + natsUrl := natsServer.ClientURL() + assert.NotEmpty(t, natsUrl) + msgSender := sender.NewNatsMessageSender(ctx, natsUrl, logger) + + // configure legacyTransformer + legacyTransformer := legacy.NewTransformer( + cfgNats.ToConfig().BEBNamespace, + cfgNats.ToConfig().EventTypePrefix, + ) + + // Setting up fake informers + scheme := runtime.NewScheme() + if err := corev1.AddToScheme(scheme); err != nil { + t.Fatalf("failed to add corev1 to scheme: %v", err) + } + if err := eventingv1alpha1.AddToScheme(scheme); err != nil { + t.Fatalf("failed to add eventing v1alpha1 to scheme: %v", err) + } + subscription := testingutils.NewSubscription() + + subUnstructuredMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(subscription) + if err != nil { + t.Fatalf("failed to convert subscription to unstructured obj: %v", err) + } + // Creating unstructured subscriptions + subUnstructured := &unstructured.Unstructured{ + Object: subUnstructuredMap, + } + // Setting Kind information in unstructured subscription + subscriptionGVK := schema.GroupVersionKind{ + Group: subscribed.GVR.Group, + Version: subscribed.GVR.Version, + Kind: "Subscription", + } + subUnstructured.SetGroupVersionKind(subscriptionGVK) + // Configuring fake dynamic client + dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subUnstructured) + + dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, + 10*time.Second, + v1.NamespaceAll, + nil, + ) + genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) + t.Logf("Waiting for cache to resync") + subscribed.WaitForCacheSyncOrDie(ctx, dFilteredSharedInfFactory) + t.Logf("Informers resynced successfully") + subLister := genericInf.Lister() + subscribedProcessor := &subscribed.Processor{ + SubscriptionLister: &subLister, + Config: cfgNats.ToConfig(), + Logger: logrus.New(), + } + + // start handler which blocks until it receives a shutdown signal + opts := &options.Options{MaxRequestSize: 65536} + natsHandler := NewNatsHandler(messageReceiver, msgSender, cfgNats.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logger) + assert.NotNil(t, natsHandler) + go func() { + if err := natsHandler.Start(ctx); err != nil { + t.Errorf("Failed to start handler with error: %v", err) + } + }() + + // test environment + healthEndpoint := fmt.Sprintf("http://localhost:%d/healthz", port) + publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", port) + publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/app/v1/events", port) + subscribedEndpointFormat := "http://localhost:%d/%s/v1/events/subscribed" + // wait that the embedded servers are started + testingutils.WaitForHandlerToStart(t, healthEndpoint) + + // run the tests for publishing cloudevents + for _, testCase := range testCasesForCloudEvents { + t.Run(testCase.name, func(t *testing.T) { + body, headers := testCase.provideMessage() + resp, err := testingutils.SendEvent(publishEndpoint, body, headers) + if err != nil { + t.Errorf("Failed to send event with error: %v", err) + } + _ = resp.Body.Close() + if testCase.wantStatusCode != resp.StatusCode { + t.Errorf("Test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) + } + }) + } + // run the tests for publishing legacy events + for _, testCase := range testCasesForLegacyEvents { + t.Run(testCase.name, func(t *testing.T) { + body, headers := testCase.provideMessage() + + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + if err != nil { + t.Errorf("Failed to send event with error: %v", err) + } + + if testCase.wantStatusCode != resp.StatusCode { + t.Errorf("Test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) + } + + if testCase.wantStatusCode == http.StatusOK { + testingutils.ValidateOkResponse(t, *resp, &testCase.wantResponse) + } else { + testingutils.ValidateErrorResponse(t, *resp, &testCase.wantResponse) + } + }) + } + // run the tests for subscribed endpoint + for _, testCase := range testCasesForSubscribedEndpoint { + t.Run(testCase.name, func(t *testing.T) { + subscribedURL := fmt.Sprintf(subscribedEndpointFormat, port, testCase.appName) + resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) + if err != nil { + t.Errorf("failed to send event with error: %v", err) + } + + if testCase.wantStatusCode != resp.StatusCode { + t.Errorf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) + } + defer func() { _ = resp.Body.Close() }() + respBodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Errorf("failed to convert body to bytes: %v", err) + } + gotEventsResponse := subscribed.Events{} + err = json.Unmarshal(respBodyBytes, &gotEventsResponse) + if err != nil { + t.Errorf("failed to unmarshal body bytes to events response: %v", err) + } + if !reflect.DeepEqual(testCase.wantResponse, gotEventsResponse) { + t.Errorf("incorrect response, wanted: %v, got: %v", testCase.wantResponse, gotEventsResponse) + } + }) + } +} + +func newEnvConfig(port, natsPort int) *env.NatsConfig { + return &env.NatsConfig{ + Port: port, + NatsPublishURL: fmt.Sprintf("http://localhost:%d", natsPort), + RequestTimeout: 2 * time.Second, + LegacyNamespace: "/beb.namespace", + LegacyEventTypePrefix: "event.type.prefix", + } +} diff --git a/pkg/legacy-events/legacy_test.go b/pkg/legacy-events/legacy_test.go index fe3b5da..67c0806 100644 --- a/pkg/legacy-events/legacy_test.go +++ b/pkg/legacy-events/legacy_test.go @@ -8,7 +8,7 @@ import ( ) func TestConvertPublishRequestToCloudEvent(t *testing.T) { - bebNs := "beb.namespace" + bebNs := "/beb.namespace" eventTypePrefix := "event.type.prefix" legacyTransformer := NewTransformer(bebNs, eventTypePrefix) eventID := "id" diff --git a/pkg/receiver/receiver.go b/pkg/receiver/receiver.go index 755e4e4..3e4d97c 100644 --- a/pkg/receiver/receiver.go +++ b/pkg/receiver/receiver.go @@ -47,7 +47,7 @@ func (recv *HttpMessageReceiver) StartListen(ctx context.Context, handler http.H go func() { errChan <- recv.server.Serve(recv.listener) }() - logrus.Info("Event Publisher Proxy server has started.") + logrus.Info("Event Publisher Receiver has started.") // wait for the server to return or ctx.Done(). select { diff --git a/pkg/sender/nats.go b/pkg/sender/nats.go new file mode 100644 index 0000000..3ef76e6 --- /dev/null +++ b/pkg/sender/nats.go @@ -0,0 +1,61 @@ +package sender + +import ( + "context" + "net/http" + + cenats "github.com/cloudevents/sdk-go/protocol/nats/v2" + cev2 "github.com/cloudevents/sdk-go/v2" + cev2event "github.com/cloudevents/sdk-go/v2/event" + "github.com/sirupsen/logrus" +) + +// compile time check +var _ GenericSender = &NatsMessageSender{} + +type GenericSender interface { + Send(context.Context, *cev2event.Event) (int, error) +} + +// HttpMessageSender is responsible for sending messages over HTTP. +type NatsMessageSender struct { + Ctx context.Context + Target string + Logger *logrus.Logger +} + +// NewNatsMessageSender returns a new NewNatsMessageSender instance with the given target and client. +func NewNatsMessageSender(ctx context.Context, target string, logger *logrus.Logger) *NatsMessageSender { + return &NatsMessageSender{Ctx: ctx, Target: target, Logger: logger} +} + +// Send dispatches the given Cloud Event to NATS and returns the response details and dispatch time. +func (h *NatsMessageSender) Send(ctx context.Context, event *cev2event.Event) (int, error) { + h.Logger.Infof("Sending event to NATS, id:[%s]", event.ID()) + // The same Nats subject used by Nats subscription + subject := event.Type() + + p, err := cenats.NewSender(h.Target, subject, cenats.NatsOptions()) + if err != nil { + h.Logger.Errorf("Failed to create nats protocol, %s", err.Error()) + return http.StatusInternalServerError, err + } + + ctxWithCancel, cancel := context.WithCancel(ctx) + defer cancel() + + c, err := cev2.NewClient(p) + if err != nil { + h.Logger.Errorf("Failed to create client, %s", err.Error()) + return http.StatusInternalServerError, err + } + + err = c.Send(ctxWithCancel, *event) + if cev2.IsUndelivered(err) { + h.Logger.Errorf("Failed to send: %s", err.Error()) + return http.StatusBadGateway, err + } + + h.Logger.Infof("sent id:[%s], accepted: %t", event.ID(), cev2.IsACK(err)) + return http.StatusNoContent, nil +} diff --git a/pkg/sender/nats_test.go b/pkg/sender/nats_test.go new file mode 100644 index 0000000..80ca5c7 --- /dev/null +++ b/pkg/sender/nats_test.go @@ -0,0 +1,97 @@ +package sender + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + + cloudevents "github.com/cloudevents/sdk-go/v2" + "github.com/go-logr/logr" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + "github.com/kyma-project/kyma/components/eventing-controller/pkg/env" + "github.com/kyma-project/kyma/components/eventing-controller/pkg/handlers" + eventingtesting "github.com/kyma-project/kyma/components/eventing-controller/testing" + "github.com/nats-io/nats.go" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/assert" + + "testing" + "time" +) + +func TestNatsSender(t *testing.T) { + logger := logrus.New() + logger.Info("TestNatsSender started") + + // test environment + natsPort := 5222 + subscriberPort := 8080 + subscriberReceiveURL := fmt.Sprintf("http://localhost:%d/store", subscriberPort) + subscriberCheckURL := fmt.Sprintf("http://localhost:%d/check", subscriberPort) + + // Start Nats server + natsServer := eventingtesting.RunNatsServerOnPort(natsPort) + assert.NotNil(t, natsServer) + defer natsServer.Shutdown() + + natsURL := natsServer.ClientURL() + natsClient := handlers.Nats{ + Subscriptions: make(map[string]*nats.Subscription), + Config: env.NatsConfig{ + Url: natsURL, + MaxReconnects: 2, + ReconnectWait: time.Second, + }, + Log: logr.Discard(), + } + err := natsClient.Initialize() + if err != nil { + t.Fatalf("failed to connect to Nats Server: %v", err) + } + + // create a Nats sender + natsUrl := natsServer.ClientURL() + assert.NotEmpty(t, natsUrl) + ctx := context.Background() + sender := NewNatsMessageSender(ctx, natsUrl, logger) + + // Create a new subscriber + subscriber := eventingtesting.NewSubscriber(fmt.Sprintf(":%d", subscriberPort)) + subscriber.Start() + defer subscriber.Shutdown() + + // Check subscriber is running or not by checking the store + err = subscriber.CheckEvent("", subscriberCheckURL) + if err != nil { + t.Errorf("failed to check subscriber's store: %v", err) + } + + // Create a subscription + sub := eventingtesting.NewSubscription("sub", "foo", eventingtesting.WithFilterForNats) + sub.Spec.Sink = subscriberReceiveURL + err = natsClient.SyncSubscription(sub) + if err != nil { + t.Fatalf("failed to Sync subscription: %v", err) + } + + // create a CE event + ce := testingutils.StructuredCloudEventPayload + event := cloudevents.NewEvent() + err = json.Unmarshal([]byte(ce), &event) + assert.Nil(t, err) + // set ce event type the same as the event type from subscription's filter. The Nats subject is defined by ce.Type + event.SetType("kyma.ev2.poc.event1.v1") + + // send the event + c, err := sender.Send(ctx, &event) + assert.Nil(t, err) + assert.Equal(t, c, http.StatusNoContent) + + // Check for the event + expectedDataInStore := fmt.Sprintf("\"%s\"", "{\\\"foo\\\":\\\"bar\\\"}") + err = subscriber.CheckEvent(expectedDataInStore, subscriberCheckURL) + if err != nil { + t.Errorf("subscriber did not receive the event: %v", err) + } +} diff --git a/pkg/subscribed/response.go b/pkg/subscribed/response.go index c005742..7eeab22 100644 --- a/pkg/subscribed/response.go +++ b/pkg/subscribed/response.go @@ -28,7 +28,7 @@ func RespondWithErrorAndLog(e error, w http.ResponseWriter) { func respond(w http.ResponseWriter, httpCode int) { w.Header().Set(legacy.HeaderContentType, legacy.ContentTypeApplicationJSON) w.WriteHeader(httpCode) - logrus.Infof("Response code: HTTP %d", httpCode) + logrus.Infof("Response code from \"subscribed\" request: HTTP %d", httpCode) } //Events represents collection of all events with subscriptions From cc68ed87cfdd05ec723257fccea1e2a8e2d5af1c Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Mon, 25 Jan 2021 14:49:22 +0100 Subject: [PATCH 010/194] Fix the event-publisher-proxy receiver test to be more resilient (#10432) --- pkg/receiver/receiver_test.go | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pkg/receiver/receiver_test.go b/pkg/receiver/receiver_test.go index cd979b0..3c7ccab 100644 --- a/pkg/receiver/receiver_test.go +++ b/pkg/receiver/receiver_test.go @@ -34,7 +34,7 @@ func TestNewHttpMessageReceiver(t *testing.T) { // Test that tht receiver shuts down properly then receiving stop signal func TestStartListener(t *testing.T) { timeout := time.Second * 10 - r := fixtureReceiver(t) + r := fixtureReceiver() ctx := context.Background() // used to simulate sending a stop signal @@ -42,15 +42,21 @@ func TestStartListener(t *testing.T) { // start receiver wg := sync.WaitGroup{} - go func() { + started := make(chan bool, 1) + defer close(started) + go func(t *testing.T) { wg.Add(1) + started <- true t.Log("starting receiver in goroutine") if err := r.StartListen(ctx, &testHandler{}); err != nil { t.Fatalf("error while starting HTTPMessageReceiver: %v", err) } t.Log("receiver goroutine ends here") wg.Done() - }() + }(t) + + // wait for receiver to start + <-started // stop it cancelFunc() @@ -73,10 +79,6 @@ func TestStartListener(t *testing.T) { } } -func fixtureReceiver(t *testing.T) *HttpMessageReceiver { - port, err := testingutils.GeneratePort() - if err != nil { - t.Fatalf("failed to generate port: %v", err) - } - return NewHttpMessageReceiver(port) +func fixtureReceiver() *HttpMessageReceiver { + return NewHttpMessageReceiver(0) } From db5e68c456c89ac2eafbbc29826b9b0c80950bb9 Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Thu, 11 Feb 2021 13:26:04 +0100 Subject: [PATCH 011/194] Clean the application name from none-alphanumeric characters for the Event publisher apps (#10523) --- cmd/event-publisher-nats/main.go | 32 +- cmd/event-publisher-proxy/main.go | 28 +- go.mod | 14 +- go.sum | 326 +------- .../applicationtest/applicationtest.go | 17 + pkg/application/clean.go | 36 + pkg/application/clean_test.go | 76 ++ pkg/application/fake/lister.go | 42 + pkg/application/lister.go | 67 ++ pkg/handler/common.go | 38 + pkg/handler/handler_test.go | 756 ------------------ pkg/handler/handlertest/handlertest.go | 330 ++++++++ pkg/handler/{ => http}/handler.go | 61 +- pkg/handler/http/handler_test.go | 474 +++++++++++ pkg/handler/{nats.go => nats/handler.go} | 46 +- pkg/handler/nats/handler_test.go | 306 +++++++ pkg/handler/nats_test.go | 207 ----- pkg/informers/sync.go | 60 ++ pkg/legacy-events/constants.go | 1 - pkg/legacy-events/error_responses.go | 5 + pkg/legacy-events/helpers.go | 11 +- pkg/legacy-events/helpers_test.go | 2 +- pkg/legacy-events/legacy.go | 48 +- pkg/legacy-events/legacy_test.go | 17 +- pkg/receiver/receiver_test.go | 23 +- pkg/sender/nats_test.go | 18 +- pkg/subscribed/helpers.go | 61 +- testing/fixtures.go | 184 ++--- testing/mock_server.go | 33 +- testing/utils.go | 168 ++-- 30 files changed, 1795 insertions(+), 1692 deletions(-) create mode 100644 pkg/application/applicationtest/applicationtest.go create mode 100644 pkg/application/clean.go create mode 100644 pkg/application/clean_test.go create mode 100644 pkg/application/fake/lister.go create mode 100644 pkg/application/lister.go create mode 100644 pkg/handler/common.go delete mode 100644 pkg/handler/handler_test.go create mode 100644 pkg/handler/handlertest/handlertest.go rename pkg/handler/{ => http}/handler.go (87%) create mode 100644 pkg/handler/http/handler_test.go rename pkg/handler/{nats.go => nats/handler.go} (81%) create mode 100644 pkg/handler/nats/handler_test.go delete mode 100644 pkg/handler/nats_test.go create mode 100644 pkg/informers/sync.go diff --git a/cmd/event-publisher-nats/main.go b/cmd/event-publisher-nats/main.go index 22f3828..2c58fbe 100644 --- a/cmd/event-publisher-nats/main.go +++ b/cmd/event-publisher-nats/main.go @@ -1,19 +1,23 @@ package main import ( + "k8s.io/client-go/dynamic" + _ "k8s.io/client-go/plugin/pkg/client/auth" + "sigs.k8s.io/controller-runtime/pkg/client/config" + "github.com/kelseyhightower/envconfig" + "github.com/sirupsen/logrus" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - "github.com/sirupsen/logrus" - "sigs.k8s.io/controller-runtime/pkg/client/config" - - _ "k8s.io/client-go/plugin/pkg/client/auth" ) func main() { @@ -34,14 +38,21 @@ func main() { // configure message sender messageSenderToNats := sender.NewNatsMessageSender(ctx, cfgNats.NatsPublishURL, logger) + // cluster config + k8sConfig := config.GetConfigOrDie() + + // setup application lister + dynamicClient := dynamic.NewForConfigOrDie(k8sConfig) + applicationLister := application.NewLister(ctx, dynamicClient) + // configure legacyTransformer legacyTransformer := legacy.NewTransformer( cfgNats.ToConfig().BEBNamespace, cfgNats.ToConfig().EventTypePrefix, + applicationLister, ) - // Configure Subscription Lister - k8sConfig := config.GetConfigOrDie() + // configure Subscription Lister subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig) subLister := subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() subscribedProcessor := &subscribed.Processor{ @@ -49,13 +60,14 @@ func main() { Config: cfgNats.ToConfig(), Logger: logger, } - // Sync informer cache or die + + // sync informer cache or die logger.Info("Waiting for informers caches to sync") - subscribed.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory) + informers.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory) logger.Info("Informers are synced successfully") // start handler which blocks until it receives a shutdown signal - if err := handler.NewNatsHandler(messageReceiver, messageSenderToNats, cfgNats.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logger).Start(ctx); err != nil { + if err := nats.NewHandler(messageReceiver, messageSenderToNats, cfgNats.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logger).Start(ctx); err != nil { logger.Fatalf("Start handler failed with error: %s", err) } diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index d5ae5a7..a59c7b1 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -1,9 +1,17 @@ package main import ( + "k8s.io/client-go/dynamic" + _ "k8s.io/client-go/plugin/pkg/client/auth" + "sigs.k8s.io/controller-runtime/pkg/client/config" + "github.com/kelseyhightower/envconfig" + "github.com/sirupsen/logrus" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/http" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" @@ -11,11 +19,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - "sigs.k8s.io/controller-runtime/pkg/client/config" - - "github.com/sirupsen/logrus" - - _ "k8s.io/client-go/plugin/pkg/client/auth" ) func main() { @@ -36,14 +39,21 @@ func main() { // configure message sender messageSender := sender.NewHttpMessageSender(cfg.EmsPublishURL, client) + // cluster config + k8sConfig := config.GetConfigOrDie() + + // setup application lister + dynamicClient := dynamic.NewForConfigOrDie(k8sConfig) + applicationLister := application.NewLister(ctx, dynamicClient) + // configure legacyTransformer legacyTransformer := legacy.NewTransformer( cfg.BEBNamespace, cfg.EventTypePrefix, + applicationLister, ) // Configure Subscription Lister - k8sConfig := config.GetConfigOrDie() subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig) subLister := subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() subscribedProcessor := &subscribed.Processor{ @@ -53,11 +63,11 @@ func main() { } // Sync informer cache or die logger.Info("Waiting for informers caches to sync") - subscribed.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory) + informers.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory) logger.Info("Informers are synced successfully") // start handler which blocks until it receives a shutdown signal - if err := handler.NewHandler(messageReceiver, messageSender, cfg.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logger).Start(ctx); err != nil { + if err := http.NewHandler(messageReceiver, messageSender, cfg.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logger).Start(ctx); err != nil { logger.Fatalf("Start handler failed with error: %s", err) } logger.Info("Shutdown the Event Publisher Proxy") diff --git a/go.mod b/go.mod index d184dc8..fe648f0 100644 --- a/go.mod +++ b/go.mod @@ -3,20 +3,32 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy go 1.15 require ( + cloud.google.com/go v0.47.0 // indirect github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 github.com/cloudevents/sdk-go/v2 v2.3.1 github.com/go-logr/logr v0.3.0 + github.com/go-logr/zapr v0.1.1 // indirect github.com/google/uuid v1.1.1 + github.com/googleapis/gnostic v0.4.0 // indirect github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/console-backend-service v0.0.0-20201116133707-dd0a4cf8e9d8 // indirect + github.com/kyma-project/kyma v0.5.1-0.20200609051543-f5997d4a36d6 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316 + github.com/nats-io/nats-server/v2 v2.1.9 github.com/nats-io/nats.go v1.10.1-0.20201204000952-090c71e95cd0 github.com/pkg/errors v0.9.1 + github.com/prometheus/client_golang v1.2.1 // indirect github.com/sirupsen/logrus v1.6.0 github.com/stretchr/testify v1.6.1 go.opencensus.io v0.22.4 + go.uber.org/multierr v1.5.0 // indirect + go.uber.org/zap v1.14.0 // indirect + golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect + golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4 // indirect + gomodules.xyz/jsonpatch/v2 v2.1.0 // indirect + google.golang.org/appengine v1.6.5 // indirect + gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect k8s.io/api v0.19.4 k8s.io/apimachinery v0.19.4 k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible diff --git a/go.sum b/go.sum index 7b141c6..f4fdfe5 100644 --- a/go.sum +++ b/go.sum @@ -8,33 +8,26 @@ cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTj cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.47.0 h1:1JUtpcY9E7+eTospEwWS2QXP3DEn7poB3E2j0jN74mM= cloud.google.com/go v0.47.0/go.mod h1:5p3Ky/7f3N10VBkhuR5LFtddroTiMyjZV/Kj5qOQFxU= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= -contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeSEBLPA9YJp5bjrofdU3pIXs= contrib.go.opencensus.io/exporter/prometheus v0.1.0/go.mod h1:cGFniUXGZlKRjzOyuZJ6mgB+PgBcCIa79kEKR8YCW+A= -contrib.go.opencensus.io/exporter/stackdriver v0.12.9/go.mod h1:XyyafDnFOsqoxHJgTFycKZMrRUrPThLh2iYTJF6uoO0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/99designs/gqlgen v0.11.3/go.mod h1:RgX5GRRdDWNkh4pBrdzNpNPFVsdoUFY2+adM6nb1N+4= github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest/autorest v0.2.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg= github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= github.com/Azure/go-autorest/autorest/adal v0.5.0 h1:q2gDruN08/guU9vAjuPWff0+QIrpH6ediguzdAzXAUU= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0 h1:Ww5g4zThfD/6cLb4z6xxgeyDa7QDkizMkJKe0ysZXp0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= @@ -42,6 +35,7 @@ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6L github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -51,33 +45,20 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/sarama v1.26.0/go.mod h1:y/CFFTO9eaMTNriwu/Q+W4eioLqiDMGkA1W+gmdfj8w= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= -github.com/agnivade/levenshtein v1.0.3/go.mod h1:4SFRZbbXWLF4MU1T9Qg0pGgH3Pjs+t6ie5efyrwRJXs= -github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053/go.mod h1:xW8sBma2LE3QxFSzCnH9qe6gAE2yO9GvQaWwX89HxbE= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30/go.mod h1:4AJxUpXUhv4N+ziTvIcWWXgeorXpxPZOfk9HdEVr96M= -github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asyncapi/converter-go v0.0.0-20190802111537-d8459b2bd403/go.mod h1:mpJYWYy+USNiLENQxiyGgRc3qtFPxYSWdSd/eS+R6bo= -github.com/asyncapi/converter-go v0.0.0-20190916120412-39eeca5e9df5/go.mod h1:mpJYWYy+USNiLENQxiyGgRc3qtFPxYSWdSd/eS+R6bo= -github.com/asyncapi/parser v0.0.0-20191002092055-f7b577d06d20/go.mod h1:MuJ++ZbwZV7Di4OtSGtgAe2whaMEZjYBPVnf8U/Qvo4= github.com/avast/retry-go v2.4.1+incompatible h1:WMHc0mwoz20UVmBYK89mUB/KFRlxO0p+s+sgpmJMviY= github.com/avast/retry-go v2.4.1+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= -github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -90,9 +71,6 @@ github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudevents/sdk-go v1.2.0 h1:2AxI14EJUw1PclJ5gZJtzbxnHIfNMdi76Qq3P3G1BRU= github.com/cloudevents/sdk-go v1.2.0/go.mod h1:ss+jWJ88wypiewnPEzChSBzTYXGpdcILoN9YHk8uhTQ= @@ -104,12 +82,9 @@ github.com/cloudevents/sdk-go/v2 v2.3.1 h1:QRTu0yRA4FbznjRSds0/4Hy6cVYpWV2wInlNJ github.com/cloudevents/sdk-go/v2 v2.3.1/go.mod h1:4fO2UjPMYYR1/7KPJQCwTPb0lFA8zYuitkUpAZFSY1Q= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/coreos/bbolt v1.3.1-coreos.6/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.15+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= @@ -117,7 +92,6 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -126,7 +100,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= @@ -135,60 +108,40 @@ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3 github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc= -github.com/evanphx/json-patch v4.0.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.1.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/gernest/front v0.0.0-20181129160812-ed80ca338b88/go.mod h1:FwEMwQ5+xky8tbzDLj72k2RAqXnFByLNwxg+9UZDtqU= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-chi/chi v3.3.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= -github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.51.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 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-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs= github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= +github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= @@ -219,7 +172,6 @@ github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29g github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= @@ -235,11 +187,6 @@ github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+ github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gobuffalo/envy v1.6.5/go.mod h1:N+GkhhZ/93bGZc6ZKhJLP6+m+tCNPKwgSpH9kaifseQ= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.5/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -249,17 +196,13 @@ github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.0.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= @@ -271,11 +214,9 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -286,56 +227,37 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/googleapis/gnostic v0.4.0 h1:BXDUo8p/DaxC+4FJY/SSx3gvnx9C1VdHNgaUkiEL5mk= github.com/googleapis/gnostic v0.4.0/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gophercloud/gophercloud v0.1.0 h1:P/nh25+rzXouhytV2pUHBb65fnds26Ghl8/391+sT5o= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v0.0.0-20190222133341-cfaf5686ec79/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.3.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.4/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= @@ -345,38 +267,25 @@ github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uG github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= -github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.9.8/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -388,27 +297,15 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubernetes-sigs/service-catalog v0.2.2-0.20190920221325-ccab52343967/go.mod h1:fmRsWJ38Od93DQ7cOXR9mMSSwmjyDS1EAomWxBlumuo= -github.com/kyma-incubator/api-gateway v0.0.0-20191125140217-295e8fcaa03f/go.mod h1:EwSqotNAjdWdMGQdE7hQaRF68MM2raDRJlRnBi9sltY= github.com/kyma-incubator/api-gateway v0.0.0-20200930072023-5d3f2107a1ef h1:YkBUaF/CdwgbdTt1eBeaiy1W/ZU/dzSRP2BBPmFm6jc= github.com/kyma-incubator/api-gateway v0.0.0-20200930072023-5d3f2107a1ef/go.mod h1:DGeKJ2GUH1cOAxUKVbUUl55DuIX6w2DXgZjlg8UTwrU= -github.com/kyma-project/helm-broker v0.0.0-20190906085923-d07feb2d365a/go.mod h1:VFnkD5ddzF9s8qcY12DRzYOznJJlpMbSRWGRgM4P1XA= -github.com/kyma-project/kyma v0.5.0 h1:msjpImAtZ3l+y6j+dHvOwF4Nm0J4IGJXRRBw7VwnqpA= github.com/kyma-project/kyma v0.5.1-0.20200609051543-f5997d4a36d6 h1:P3R3c4pewIa+IjzNldO9WRFA58s0r3WVqRxLK6feYc8= github.com/kyma-project/kyma v0.5.1-0.20200609051543-f5997d4a36d6/go.mod h1:cfj5AQwIOmmoXLZUhW3bIiaB66Z6vgjCYu7TRK3+1lc= -github.com/kyma-project/kyma/components/console-backend-service v0.0.0-20201116133707-dd0a4cf8e9d8 h1:DvhO1yDD4KB/KOmiU8E33zOuH0BCYIMmgkMBDQUq/hc= -github.com/kyma-project/kyma/components/console-backend-service v0.0.0-20201116133707-dd0a4cf8e9d8/go.mod h1:VMlJrqyEmVRlVy1mhM6vjVKH5wC/oZZKa1ekItebJeQ= github.com/kyma-project/kyma/components/event-publisher-proxy v0.0.0-20201014135541-82b304ab245a/go.mod h1:SzxIlsqx8zJXNhqyUabWs8NzYcfEv1SleJ1U0+Gp6Ms= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20201116133707-dd0a4cf8e9d8 h1:7SL5NKGZZjrTR71UXvs3l5LUczOxlRrken6EMCEua+o= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20201116133707-dd0a4cf8e9d8/go.mod h1:KsN8YoKL6hF9/kQeOaGuCrCMmzelOhjoHhmnXKAWfYE= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316 h1:wZ2BvFuElkG6K3pOFxLiT/oXeH07N/wfJqj1LlL76rY= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316/go.mod h1:ZBfptvrdh3YUmdJac/1IFm2pgyk+YAfyLET05ztKTlI= -github.com/kyma-project/kyma/components/function-controller v0.0.0-20201012150043-858bc2c23ef5/go.mod h1:842PCaqaSMTkmr80oQsckxMyZ6WXBLy6E22/JPQeUl0= -github.com/kyma-project/rafter v0.0.0-20200402080904-a0157e52e150/go.mod h1:zlQEXkFdCYTii7GGjd0jLOudgPtxgZLJy2VDXW7j54I= github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac h1:+2b6iGRJe3hvV/yVXrd41yVEjxuFHxasJqDhkIjS4gk= github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac/go.mod h1:Frd2bnT3w5FB5q49ENTfVlztJES+1k/7lyWX2+9gq/M= -github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -417,26 +314,17 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN 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/markbates/inflect v1.0.4/go.mod h1:1fR9+pO2KHEO9ZRtto13gDwwZaAKstQzferVeWqbgNs= -github.com/matryer/moq v0.0.0-20200106131100-75d0ddfc0007/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= -github.com/minio/minio-go v6.0.14+incompatible/go.mod h1:7guKYtitv8dktvNUGrhzmNlA5wrAABTQXCoesZdFQO8= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/moby/moby v17.12.0-ce-rc1.0.20200618181300-9dc6525e6118+incompatible/go.mod h1:fDXVQ6+S340veQPv35CzDahGBmHsiclFwfEygB/TWMc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -486,21 +374,16 @@ github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.4.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.2 h1:uqH7bpe+ERSiDa34FDOF7RikN6RzXgduUF8yarlZp94= github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.3.0/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= @@ -510,40 +393,23 @@ github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.3.5/go.mod h1:uVHyebswE1cCXr2A73cRM2frx5ld1RJUCJkFNZ90ZiI= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go-opentracing v0.3.5/go.mod h1:js2AbwmHW0YD9DwIw2JhQWmbfFi/UnWyYwdVhqbCDOE= -github.com/ory/hydra-maester v0.0.19/go.mod h1:nLN4AAm6u1Iht1INnp4fl6blbCf2wDDZ+PbTWS1aDnA= -github.com/ory/oathkeeper-maester v0.0.2-beta.1/go.mod h1:pKLJLWu1AdMxyq9tufkZzS6+7bW2xz9aN/Sk04XGlmw= -github.com/ory/oathkeeper-maester v0.0.7/go.mod h1:I+J8vshTw2Eax35LzBOK4K/1+Pi4gQ+SgYZzTenEIMs= github.com/ory/oathkeeper-maester v0.1.0 h1:xqY4Px2ubPyAS/3bl0AcI6ctW2/lrXJUHHb5gXNz97U= github.com/ory/oathkeeper-maester v0.1.0/go.mod h1:O692MD+MJP3dx0QUV1iOcSPxczdRZEj5WauFaD1vy7U= -github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.4.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 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/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.9.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= @@ -556,13 +422,11 @@ github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1: github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 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.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -571,30 +435,15 @@ github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDa github.com/prometheus/procfs v0.0.11 h1:DhHlBtkHWPYi8O2y31JkK0TF+DGM+51OopZjH/Ia5qI= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= -github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.3/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= @@ -604,17 +453,14 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -626,21 +472,9 @@ github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhV github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= -github.com/vektah/gqlparser/v2 v2.0.1/go.mod h1:SyUiHgLATUR8BiYURfTirrTcGpcE+4XkV2se04Px1Ms= -github.com/vrischmann/envconfig v1.2.0/go.mod h1:c5DuUlkzfsnspy1g7qiqryPCsW+NjsrLsYq4zhwsoHo= -github.com/vrischmann/envconfig v1.3.0/go.mod h1:bbvxFYJdRSpXrhS63mBFtKJzkDiNkyArOLXtY6q0kuI= -github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -github.com/xeipuuv/gojsonpointer v0.0.0-20190809123943-df4f5c81cb3b/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= -github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -653,53 +487,39 @@ go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.uber.org/atomic v0.0.0-20181018215023-8dc6146f7569/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/multierr v0.0.0-20180122172545-ddea229ff1df/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v0.0.0-20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.0 h1:/pduUoebOeeJzTDFuoMgC6nRkiasr1sBCIEorly7m4o= go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -golang.org/x/crypto v0.0.0-20180820150726-614d502a4dac/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -712,7 +532,6 @@ golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxT golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -722,8 +541,6 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= @@ -731,9 +548,9 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180112015858-5ccada7d0a7b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -749,32 +566,20 @@ golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190514140710-3ec191127204/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190912160710-24e19bdeb0f2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190918130420-a8b05e9114ab/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -785,7 +590,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180117170059-2c42eef0765b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -796,47 +600,33 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190429190828-d89cdac9e872/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190912141932-bc967efca4b8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190919044723-0c1ff786ef13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4 h1:5/PjkGUjvEU5Gl6BxmvKRPpqo2uNMv4rcHBMwzk/st8= -golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20171227012246-e19ae1496984/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -845,7 +635,6 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -861,11 +650,8 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190501045030-23463209683d/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190515012406-7d7faa4812bd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -877,15 +663,10 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191010171213-8abd42400456/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200114235610-7ae403b6b589/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200214144324-88be01311a71/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4 h1:v8Jgq9X6Es9K9otVr9jxENEJigepKMZgA9OmrIZDtFA= golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -894,7 +675,6 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IV golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.0.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.1.0 h1:Phva6wqu+xR//Njw6iorylFFgn/z547tw5Ne3HZPQ+k= gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= @@ -907,14 +687,12 @@ google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1 google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.10.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -923,25 +701,19 @@ google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -951,9 +723,6 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -964,25 +733,14 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.48.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= -gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= -gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= -gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= -gopkg.in/jcmturner/gokrb5.v7 v7.4.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= -gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= -gopkg.in/square/go-jose.v2 v2.4.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.0.0/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -991,8 +749,6 @@ gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= @@ -1003,104 +759,51 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= istio.io/api v0.0.0-20200812202721-24be265d41c3/go.mod h1:88HN3o1fSD1jo+Z1WTLlJfMm9biopur6Ct9BFKjiB64= istio.io/client-go v0.0.0-20200916161914-94f0e83444ca/go.mod h1:SO65MWt7I45dvUwuDowoiB0SVcGpfWZfUTlopvYpbZc= istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a/go.mod h1:OzpAts7jljZceG4Vqi5/zXy/pOg1b209T3jb7Nv5wIs= -k8s.io/api v0.0.0-20190409021203-6e4e0e4f393b/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= -k8s.io/api v0.0.0-20190918155943-95b840bb6a1f/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= -k8s.io/api v0.0.0-20191003000013-35e20aa79eb8/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= k8s.io/api v0.16.15 h1:6yvV9YNGwnebDAsA4Sfj+1b1S9j5OYfmckjTdc9b1bI= k8s.io/api v0.16.15/go.mod h1:8z880CLtpCJqHWe9vmBkZMQeMKHNvdTQuqLW2QUefUA= -k8s.io/api v0.17.9/go.mod h1:avJJAA1fSV6tnbCGW2K+S+ilDFW7WpNr5BScoiZ1M1U= -k8s.io/api v0.17.11/go.mod h1:WR3CbTwCAxtfMcEB6c92W3l5aZw09unPCyxmxjYV3xg= -k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= -k8s.io/api v0.19.4 h1:I+1I4cgJYuCDgiLNjKx7SLmIbwgj9w7N7Zr5vSIdwpo= -k8s.io/api v0.19.4/go.mod h1:SbtJ2aHCItirzdJ36YslycFNzWADYH3tgOhvBEFtZAk= -k8s.io/apiextensions-apiserver v0.0.0-20190409022649-727a075fdec8/go.mod h1:IxkesAMoaCRoLrPJdZNZUQp9NfZnzqaVzLhb2VEQzXE= -k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783/go.mod h1:xvae1SZB3E17UpV59AWc271W/Ph25N+bjPyR63X6tPY= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= -k8s.io/apiextensions-apiserver v0.17.9/go.mod h1:p2C9cDflVAUPMl5/QOMHxnSzQWF/cDqu7AP2KUXHHMA= k8s.io/apiextensions-apiserver v0.18.2 h1:I4v3/jAuQC+89L3Z7dDgAiN4EOjN6sbm6iBqQwHTah8= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.18.12 h1:b0jTgW/qwqZBMIJTMxkLvvAtNRDZboG5yZiIbOFgQv8= k8s.io/apiextensions-apiserver v0.18.12/go.mod h1:nihADkPed1L37Vxpz2/BrtxO9mCtINH23aNtUe/CRLo= -k8s.io/apimachinery v0.0.0-20190404173353-6a84e37a896d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= -k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655/go.mod h1:nL6pwRT8NgfF8TT68DBI8uEePRt89cSvoXUVqbkWHq4= k8s.io/apimachinery v0.16.15 h1:4cmEfuRsKuV8pMpaQ6z0AKEUXZ3r+u/NKaz5dvIjySk= k8s.io/apimachinery v0.16.15/go.mod h1:xAtIC8Gj83Pn2OCs2g57wZpZembRhJhiXIlQIqanwas= -k8s.io/apimachinery v0.17.9/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= -k8s.io/apimachinery v0.17.11/go.mod h1:q+iFxLyaMeWIBhSlQ4OMkvdwbwrb8Ux0ALl90XD9paU= -k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= -k8s.io/apimachinery v0.19.4 h1:+ZoddM7nbzrDCp0T3SWnyxqf8cbWPT2fkZImoyvHUG0= -k8s.io/apimachinery v0.19.4/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= -k8s.io/apiserver v0.0.0-20190918160949-bfa5e2e684ad/go.mod h1:XPCXEwhjaFN29a8NldXA901ElnKeKLrLtREO9ZhFyhg= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= -k8s.io/apiserver v0.17.9/go.mod h1:Qaxd3EbeoPRBHVMtFyuKNAObqP6VAkzIMyWYz8KuE2k= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.18.12/go.mod h1:uFOeW4LlxS6KDgLWy3n3gh0DhC6m41QIFgL33ouk+4w= -k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90/go.mod h1:J69/JveO6XESwVgG53q3Uz5OSfgsv4uxpScmmyYOOlk= -k8s.io/client-go v0.0.0-20191003000419-f68efa97b39e/go.mod h1:UBFA5lo8nEOepaxS9koNccX/38rYMI3pa1EA1gaFZNg= k8s.io/client-go v0.16.15 h1:cuSmM5begnN77V0beNgmhQ9yob6TFUnN+YaqAfRBD40= k8s.io/client-go v0.16.15/go.mod h1:onpbkg9XeonG579HOlK9RS56ixfOJdbBM5dKluyFM8c= -k8s.io/client-go v0.17.9/go.mod h1:3cM92qAd1XknA5IRkRfpJhl9OQjkYy97ZEUio70wVnI= -k8s.io/client-go v0.17.11/go.mod h1:gCpWJ1+skW2CjzFGChniiXrX2e51gflrCsDsbykZLLQ= -k8s.io/client-go v0.17.14 h1:J+rMxOy+tAmsD4VBjW6CduZfygaUa3AhdxQsfsX8nhc= -k8s.io/client-go v0.17.14/go.mod h1:1SFRrpQKPcUNGwKy+M7IH+kAiMhw3DnkSth+XtWh5Tk= -k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= -k8s.io/client-go v0.18.9 h1:sPHX49yOtUqv1fl49TwV3f8cC0N3etSnwgFGsIsXnZc= -k8s.io/client-go v0.18.9/go.mod h1:UjkEetDmr40P9NX0Ok3Idt08FCf2I4mIHgjFsot77uY= -k8s.io/client-go v0.19.2 h1:gMJuU3xJZs86L1oQ99R4EViAADUPMHHtS9jFshasHSc= -k8s.io/client-go v0.19.2/go.mod h1:S5wPhCqyDNAlzM9CnEdgTGV4OqhsW3jGO1UM1epwfJA= -k8s.io/client-go v1.5.1 h1:XaX/lo2/u3/pmFau8HN+sB5C/b4dc4Dmm2eXjBH4p1E= -k8s.io/client-go v11.0.0+incompatible h1:LBbX2+lOwY9flffWlJM7f1Ct8V2SRNiMRDFeiwnJo9o= -k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible h1:U5Bt+dab9K8qaUmXINrkXO135kA11/i5Kg1RUydgaMQ= -k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/code-generator v0.0.0-20190912054826-cd179ad6a269/go.mod h1:V5BD6M4CyaN5m+VthcclXWsVcT1Hu+glwa1bi3MIsyE= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= -k8s.io/code-generator v0.17.9/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.12/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= -k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090/go.mod h1:933PBGtQFJky3TEwYx4aEPZ4IxqhWh3R6DCmzqIn1hA= k8s.io/component-base v0.17.8/go.mod h1:xfNNdTAMsYzdiAa8vXnqDhRVSEgkfza0iMt0FrZDY7s= -k8s.io/component-base v0.17.9/go.mod h1:Wg22ePDK0mfTa+bEFgZHGwr0h40lXnYy6D7D+f7itFk= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/component-base v0.18.12/go.mod h1:pRGKXsx2KWfsJqlDi4sbCc1jpaB87rXIIqupjhr5wj0= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.2.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.4.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= -k8s.io/kube-openapi v0.0.0-20190510232812-a01b7d5d6c22/go.mod h1:iU+ZGYsNlvU9XKUSso6SQfKTCCw7lFduMZy26Mgr2Fw= -k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= k8s.io/kube-openapi v0.0.0-20200410163147-594e756bea31 h1:PsbYeEz2x7ll6JYUzBEG+DT78910DDTlvn5Ma10F5/E= k8s.io/kube-openapi v0.0.0-20200410163147-594e756bea31/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= -k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -knative.dev/eventing v0.13.1/go.mod h1:UxweNv8yXhsdHJitcb9R6rmfNaUD2DFi9GWwNRyIs58= -knative.dev/pkg v0.0.0-20190807140856-4707aad818fe/go.mod h1:pgODObA1dTyhNoFxPZTTjNWfx6F0aKsKzn+vaT9XO/Q= -knative.dev/pkg v0.0.0-20200306230727-a56a6ea3fa56/go.mod h1:pgODObA1dTyhNoFxPZTTjNWfx6F0aKsKzn+vaT9XO/Q= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= @@ -1109,31 +812,14 @@ modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= pack.ag/amqp v0.11.0/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= -sigs.k8s.io/controller-runtime v0.2.0-beta.2/go.mod h1:TSH2R0nSz4WAlUUlNnOFcOR/VUhfwBLlmtq2X6AiQCA= -sigs.k8s.io/controller-runtime v0.2.0-beta.4/go.mod h1:HweyYKQ8fBuzdu2bdaeBJvsFgAi/OqBBnrVGXcqKhME= -sigs.k8s.io/controller-runtime v0.4.0/go.mod h1:ApC79lpY3PHW9xj/w9pj+lYkLgwAAUZwfXkME1Lajns= sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+aqSv/M3njpmo= -sigs.k8s.io/controller-runtime v0.5.10/go.mod h1:OTqxLuz7gVcrq+BHGUgedRu6b2VIKCEc7Pu4Jbwui0A= sigs.k8s.io/controller-runtime v0.6.0 h1:Fzna3DY7c4BIP6KwfSlrfnj20DJ+SeMBK8HSFvOk9NM= sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= -sigs.k8s.io/controller-tools v0.2.0-beta.2/go.mod h1:gC5UAnK1jbxWnDaqTi0yxKIsRsRwshzeRtTUGbM9vos= -sigs.k8s.io/controller-tools v0.2.4/go.mod h1:m/ztfQNocGYBgTTCmFdnK94uVvgxeZeE3LtJvd/jIzA= -sigs.k8s.io/kind v0.4.0/go.mod h1:bgGo2cWxKGQ7esVxtGp9H17Ttlexju92CTMjCg08HNQ= sigs.k8s.io/kind v0.7.0/go.mod h1:An/AbWHT6pA/Lm0Og8j3ukGhfJP3RiVN/IBU6Lo3zl8= -sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= -sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca h1:6dsH6AYQWbyZmtttJNe8Gq1cXOeS1BdV3eW37zHilAQ= -sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA= sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7mRH6DGaRcixXEJXTsE= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/testing_frameworks v0.1.1/go.mod h1:VVBKrHmJ6Ekkfz284YKhQePcdycOzNH9qL6ht1zEr/U= -sigs.k8s.io/testing_frameworks v0.1.2/go.mod h1:ToQrwSC3s8Xf/lADdZp3Mktcql9CG0UAmdJG9th5i0w= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sourcegraph.com/sourcegraph/appdash v0.0.0-20180110180208-2cc67fd64755/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= -sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67/go.mod h1:L5q+DGLGOQFpo1snNEkLOJT2d1YTW66rWNzatr3He1k= diff --git a/pkg/application/applicationtest/applicationtest.go b/pkg/application/applicationtest/applicationtest.go new file mode 100644 index 0000000..0755a37 --- /dev/null +++ b/pkg/application/applicationtest/applicationtest.go @@ -0,0 +1,17 @@ +// Package applicationtest provides utilities for Application testing. +package applicationtest + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + applicationv1alpha1 "github.com/kyma-project/kyma/components/application-operator/pkg/apis/applicationconnector/v1alpha1" +) + +func NewApplication(name string, labels map[string]string) *applicationv1alpha1.Application { + return &applicationv1alpha1.Application{ + ObjectMeta: metav1.ObjectMeta{ + Name: name, + Labels: labels, + }, + } +} diff --git a/pkg/application/clean.go b/pkg/application/clean.go new file mode 100644 index 0000000..7c2b95e --- /dev/null +++ b/pkg/application/clean.go @@ -0,0 +1,36 @@ +package application + +import ( + "regexp" + "strings" + + applicationv1alpha1 "github.com/kyma-project/kyma/components/application-operator/pkg/apis/applicationconnector/v1alpha1" +) + +const ( + // typeLabel is an optional label for the application to determine its type + typeLabel = "application-type" +) + +var ( + // invalidApplicationNameSegment used to match and replace none-alphanumeric characters in the application name + invalidApplicationNameSegment = regexp.MustCompile("\\W|_") +) + +// CleanName cleans the application name form none-alphanumeric characters and returns it +// if the application type label exists, it will be cleaned and returned instead of the application name +func CleanName(application *applicationv1alpha1.Application) string { + applicationName := application.Name + for k, v := range application.Labels { + if strings.ToLower(k) == typeLabel { + applicationName = v + break + } + } + return invalidApplicationNameSegment.ReplaceAllString(applicationName, "") +} + +// IsCleanName returns true if the name contains alphanumeric characters only, otherwise returns false +func IsCleanName(name string) bool { + return !invalidApplicationNameSegment.MatchString(name) +} diff --git a/pkg/application/clean_test.go b/pkg/application/clean_test.go new file mode 100644 index 0000000..f73b153 --- /dev/null +++ b/pkg/application/clean_test.go @@ -0,0 +1,76 @@ +package application + +import ( + "testing" + + applicationv1alpha1 "github.com/kyma-project/kyma/components/application-operator/pkg/apis/applicationconnector/v1alpha1" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" +) + +func TestCleanName(t *testing.T) { + testCases := []struct { + givenApplication *applicationv1alpha1.Application + wantName string + }{ + // application type label is missing, then use the application name + { + givenApplication: applicationtest.NewApplication("alphanumeric0123", nil), + wantName: "alphanumeric0123", + }, + { + givenApplication: applicationtest.NewApplication("alphanumeric0123", map[string]string{"ignore-me": "value"}), + wantName: "alphanumeric0123", + }, + { + givenApplication: applicationtest.NewApplication("with.!@#none-$%^alphanumeric_&*-characters", nil), + wantName: "withnonealphanumericcharacters", + }, + { + givenApplication: applicationtest.NewApplication("with.!@#none-$%^alphanumeric_&*-characters", map[string]string{"ignore-me": "value"}), + wantName: "withnonealphanumericcharacters", + }, + // application type label is available, then use it instead of the application name + { + givenApplication: applicationtest.NewApplication("alphanumeric0123", map[string]string{typeLabel: "apptype"}), + wantName: "apptype", + }, + { + givenApplication: applicationtest.NewApplication("with.!@#none-$%^alphanumeric_&*-characters", map[string]string{typeLabel: "apptype"}), + wantName: "apptype", + }, + { + givenApplication: applicationtest.NewApplication("alphanumeric0123", map[string]string{typeLabel: "apptype=with.!@#none-$%^alphanumeric_&*-characters"}), + wantName: "apptypewithnonealphanumericcharacters", + }, + { + givenApplication: applicationtest.NewApplication("with.!@#none-$%^alphanumeric_&*-characters", map[string]string{typeLabel: "apptype=with.!@#none-$%^alphanumeric_&*-characters"}), + wantName: "apptypewithnonealphanumericcharacters", + }, + } + + for _, tc := range testCases { + if gotName := CleanName(tc.givenApplication); tc.wantName != gotName { + t.Errorf("Clean application name:[%s] failed, want:[%v] but got:[%v]", tc.givenApplication.Name, tc.wantName, gotName) + } + } +} + +func TestIsCleanName(t *testing.T) { + testCases := []struct { + givenName string + wantClean bool + }{ + {givenName: "with.dot", wantClean: false}, + {givenName: "with-dash", wantClean: false}, + {givenName: "with_underscore", wantClean: false}, + {givenName: "with#special$characters", wantClean: false}, + {givenName: "alphabetical", wantClean: true}, + {givenName: "alphanumeric0123", wantClean: true}, + } + + for _, tc := range testCases { + if gotClean := IsCleanName(tc.givenName); tc.wantClean != gotClean { + t.Errorf("Is clean application name:[%s] failed, want:[%v] but got:[%v]", tc.givenName, tc.wantClean, gotClean) + } + } +} diff --git a/pkg/application/fake/lister.go b/pkg/application/fake/lister.go new file mode 100644 index 0000000..a267380 --- /dev/null +++ b/pkg/application/fake/lister.go @@ -0,0 +1,42 @@ +package fake + +import ( + "context" + "log" + + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + dynamicfake "k8s.io/client-go/dynamic/fake" + + applicationv1alpha1 "github.com/kyma-project/kyma/components/application-operator/pkg/apis/applicationconnector/v1alpha1" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" +) + +func NewListerOrDie(ctx context.Context, app *applicationv1alpha1.Application) *application.Lister { + scheme := setupSchemeOrDie() + unstructuredMap := mapToUnstructuredOrDie(app) + appUnstructured := &unstructured.Unstructured{Object: unstructuredMap} + appUnstructured.SetGroupVersionKind(application.GroupVersionKind()) + dynamicClient := dynamicfake.NewSimpleDynamicClient(scheme, appUnstructured) + return application.NewLister(ctx, dynamicClient) +} + +func setupSchemeOrDie() *runtime.Scheme { + scheme := runtime.NewScheme() + if err := corev1.AddToScheme(scheme); err != nil { + log.Fatalf("Failed to setup scheme with error: %v", err) + } + if err := applicationv1alpha1.AddToScheme(scheme); err != nil { + log.Fatalf("Failed to setup scheme with error: %v", err) + } + return scheme +} + +func mapToUnstructuredOrDie(app *applicationv1alpha1.Application) map[string]interface{} { + unstructuredMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(app) + if err != nil { + log.Fatalf("Failed to map application to unstruchtured object with error: %v", err) + } + return unstructuredMap +} diff --git a/pkg/application/lister.go b/pkg/application/lister.go new file mode 100644 index 0000000..fdce57b --- /dev/null +++ b/pkg/application/lister.go @@ -0,0 +1,67 @@ +package application + +import ( + "context" + "errors" + "time" + + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/dynamic/dynamicinformer" + "k8s.io/client-go/tools/cache" + + applicationv1alpha1 "github.com/kyma-project/kyma/components/application-operator/pkg/apis/applicationconnector/v1alpha1" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" +) + +type Lister struct { + lister cache.GenericLister +} + +func NewLister(ctx context.Context, client dynamic.Interface) *Lister { + const defaultResync = 10 * time.Second + gvr := GroupVersionResource() + factory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(client, defaultResync, v1.NamespaceAll, nil) + factory.ForResource(gvr) + lister := factory.ForResource(gvr).Lister() + informers.WaitForCacheSyncOrDie(ctx, factory) + return &Lister{lister: lister} +} + +func (l Lister) Get(name string) (*applicationv1alpha1.Application, error) { + object, err := l.lister.Get(name) + if err != nil { + return nil, err + } + + applicationUnstructured, ok := object.(*unstructured.Unstructured) + if !ok { + return nil, errors.New("failed to convert runtime object to unstructured") + } + + application := &applicationv1alpha1.Application{} + if err := runtime.DefaultUnstructuredConverter.FromUnstructured(applicationUnstructured.Object, application); err != nil { + return nil, err + } + + return application, nil +} + +func GroupVersionResource() schema.GroupVersionResource { + return schema.GroupVersionResource{ + Group: applicationv1alpha1.SchemeGroupVersion.Group, + Version: applicationv1alpha1.SchemeGroupVersion.Version, + Resource: "applications", + } +} + +func GroupVersionKind() schema.GroupVersionKind { + return schema.GroupVersionKind{ + Group: applicationv1alpha1.SchemeGroupVersion.Group, + Version: applicationv1alpha1.SchemeGroupVersion.Version, + Kind: "Application", + } +} diff --git a/pkg/handler/common.go b/pkg/handler/common.go new file mode 100644 index 0000000..f779e99 --- /dev/null +++ b/pkg/handler/common.go @@ -0,0 +1,38 @@ +package handler + +import "strings" + +const ( + PublishEndpoint = "/publish" + LegacyEndpointSuffix = "/v1/events" + SubscribedEndpointSuffix = "/v1/events/subscribed" +) + +func IsARequestWithCE(uri string) bool { + return uri == PublishEndpoint +} +func IsARequestWithLegacyEvent(uri string) bool { + // Assuming the path should be of the form /:application/v1/events + uriPathSegments := make([]string, 0) + + for _, segment := range strings.Split(uri, "/") { + if strings.TrimSpace(segment) != "" { + uriPathSegments = append(uriPathSegments, segment) + } + } + if len(uriPathSegments) != 3 { + return false + } + if !strings.HasSuffix(uri, LegacyEndpointSuffix) { + return false + } + return true +} + +func IsARequestForSubscriptions(uri string) bool { + // Assuming the path should be of the form /:application/v1/events/subscribed + if !strings.HasSuffix(uri, SubscribedEndpointSuffix) { + return false + } + return true +} diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go deleted file mode 100644 index 5174600..0000000 --- a/pkg/handler/handler_test.go +++ /dev/null @@ -1,756 +0,0 @@ -package handler - -import ( - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "reflect" - "testing" - "time" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/client-go/dynamic/dynamicinformer" - dynamicfake "k8s.io/client-go/dynamic/fake" - - legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" - "github.com/sirupsen/logrus" -) - -const ( - // mock server endpoints - tokenEndpoint = "/token" - eventsEndpoint = "/events" - eventsHTTP400Endpoint = "/events400" -) - -var ( - testCasesForCloudEvents = []struct { - name string - provideMessage func() (string, http.Header) - wantStatusCode int - }{ - // structured cloudevents - { - name: "Structured CloudEvent without id", - provideMessage: func() (string, http.Header) { - return testingutils.StructuredCloudEventPayloadWithoutID, testingutils.GetStructuredMessageHeaders() - }, - wantStatusCode: http.StatusBadRequest, - }, - { - name: "Structured CloudEvent without type", - provideMessage: func() (string, http.Header) { - return testingutils.StructuredCloudEventPayloadWithoutType, testingutils.GetStructuredMessageHeaders() - }, - wantStatusCode: http.StatusBadRequest, - }, - { - name: "Structured CloudEvent without specversion", - provideMessage: func() (string, http.Header) { - return testingutils.StructuredCloudEventPayloadWithoutSpecVersion, testingutils.GetStructuredMessageHeaders() - }, - wantStatusCode: http.StatusBadRequest, - }, - { - name: "Structured CloudEvent without source", - provideMessage: func() (string, http.Header) { - return testingutils.StructuredCloudEventPayloadWithoutSource, testingutils.GetStructuredMessageHeaders() - }, - wantStatusCode: http.StatusBadRequest, - }, - { - name: "Structured CloudEvent is valid", - provideMessage: func() (string, http.Header) { - return testingutils.StructuredCloudEventPayload, testingutils.GetStructuredMessageHeaders() - }, - wantStatusCode: http.StatusNoContent, - }, - // binary cloudevents - { - name: "Binary CloudEvent without CE-ID header", - provideMessage: func() (string, http.Header) { - headers := testingutils.GetBinaryMessageHeaders() - headers.Del(testingutils.CeIDHeader) - return testingutils.BinaryCloudEventPayload, headers - }, - wantStatusCode: http.StatusBadRequest, - }, - { - name: "Binary CloudEvent without CE-Type header", - provideMessage: func() (string, http.Header) { - headers := testingutils.GetBinaryMessageHeaders() - headers.Del(testingutils.CeTypeHeader) - return testingutils.BinaryCloudEventPayload, headers - }, - wantStatusCode: http.StatusBadRequest, - }, - { - name: "Binary CloudEvent without CE-SpecVersion header", - provideMessage: func() (string, http.Header) { - headers := testingutils.GetBinaryMessageHeaders() - headers.Del(testingutils.CeSpecVersionHeader) - return testingutils.BinaryCloudEventPayload, headers - }, - wantStatusCode: http.StatusBadRequest, - }, - { - name: "Binary CloudEvent without CE-Source header", - provideMessage: func() (string, http.Header) { - headers := testingutils.GetBinaryMessageHeaders() - headers.Del(testingutils.CeSourceHeader) - return testingutils.BinaryCloudEventPayload, headers - }, - wantStatusCode: http.StatusBadRequest, - }, - { - name: "Binary CloudEvent is valid with required headers", - provideMessage: func() (string, http.Header) { - return testingutils.BinaryCloudEventPayload, testingutils.GetBinaryMessageHeaders() - }, - wantStatusCode: http.StatusNoContent, - }, - } - testCasesForLegacyEvents = []struct { - name string - targetEndpoint string - provideMessage func() (string, http.Header) - wantStatusCode int - wantResponse legacyapi.PublishEventResponses - }{ - { - name: "Send a legacy event successfully with event-id", - provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusOK, - wantResponse: legacyapi.PublishEventResponses{ - Ok: &legacyapi.PublishResponse{ - EventID: "8945ec08-256b-11eb-9928-acde48001122", - Status: "", - Reason: "", - }, - }, - }, - { - name: "Send a legacy event successfully without event-id", - provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithoutEventId, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusOK, - wantResponse: legacyapi.PublishEventResponses{ - Ok: &legacyapi.PublishResponse{ - EventID: "", - Status: "", - Reason: "", - }, - }, - }, - { - name: "Send a legacy event with invalid event id", - provideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithInvalidEventId, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: testingutils.GetInvalidValidationErrorFor("event-id"), - }, - }, - { - name: "Send a legacy event without event time", - provideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithoutEventTime, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: testingutils.GetMissingFieldValidationErrorFor("event-time"), - }, - }, - { - name: "Send a legacy event without event type", - provideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithoutEventType, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: testingutils.GetMissingFieldValidationErrorFor("event-type"), - }, - }, - { - name: "Send a legacy event with invalid event time", - provideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithInvalidEventTime, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: testingutils.GetInvalidValidationErrorFor("event-time"), - }, - }, - { - name: "Send a legacy event without event version", - provideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithWithoutEventVersion, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: testingutils.GetMissingFieldValidationErrorFor("event-type-version"), - }, - }, - { - name: "Send a legacy event without data field", - provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithoutData, testingutils.GetApplicationJSONHeaders() - }, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: testingutils.GetMissingFieldValidationErrorFor("data"), - }, - }, - } - testCasesForSubscribedEndpoint = []struct { - name string - appName string - inputSubscriptions []eventingv1alpha1.Subscription - wantStatusCode int - wantResponse subscribed.Events - }{ - { - name: "Send a request with a valid application name", - appName: "valid-app", - wantStatusCode: http.StatusOK, - wantResponse: subscribed.Events{ - EventsInfo: []subscribed.Event{{ - Name: "order.created", - Version: "v1", - }}, - }, - }, { - name: "Send a request with an invalid application name", - appName: "invalid-app", - wantStatusCode: http.StatusOK, - wantResponse: subscribed.Events{ - EventsInfo: []subscribed.Event{}, - }, - }, - } -) - -func TestHandler(t *testing.T) { - t.Parallel() - - port, err := testingutils.GeneratePort() - if err != nil { - t.Fatalf("failed to generate port: %v", err) - } - - var ( - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) - ) - - mockServer := testingutils.NewMockServer() - mockServer.Start(t, tokenEndpoint, eventsEndpoint, eventsHTTP400Endpoint) - defer mockServer.Close() - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - emsCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) - authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) - cfg := testingutils.NewEnvConfig( - emsCEURL, - authURL, - testingutils.WithPort(port), - ) - client := oauth.NewClient(ctx, cfg) - defer client.CloseIdleConnections() - - msgSender := sender.NewHttpMessageSender(emsCEURL, client) - - msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) - legacyTransformer := legacy.NewTransformer("beb.ns", "event.type.prefix") - opts := &options.Options{MaxRequestSize: 65536} - handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, nil, logrus.New()) - go func() { - if err := handler.Start(ctx); err != nil { - t.Errorf("failed to start handler with error: %v", err) - } - }() - - testingutils.WaitForHandlerToStart(t, healthEndpoint) - - for _, testCase := range testCasesForCloudEvents { - t.Run(testCase.name, func(t *testing.T) { - body, headers := testCase.provideMessage() - resp, err := testingutils.SendEvent(publishEndpoint, body, headers) - if err != nil { - t.Errorf("failed to send event with error: %v", err) - } - _ = resp.Body.Close() - if testCase.wantStatusCode != resp.StatusCode { - t.Errorf("Test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) - } - }) - } -} - -func TestHandlerTimeout(t *testing.T) { - t.Parallel() - - port, err := testingutils.GeneratePort() - if err != nil { - t.Fatalf("failed to generate port: %v", err) - } - var ( - requestTimeout = time.Nanosecond // short request timeout - serverResponseTime = time.Millisecond // long server response time - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) - ) - mockServer := testingutils.NewMockServer(testingutils.WithResponseTime(serverResponseTime)) - mockServer.Start(t, tokenEndpoint, eventsEndpoint, "") - defer mockServer.Close() - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - emsCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) - authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) - cfg := testingutils.NewEnvConfig(emsCEURL, - authURL, - testingutils.WithPort(port), - testingutils.WithRequestTimeout(requestTimeout), - ) - client := oauth.NewClient(ctx, cfg) - defer client.CloseIdleConnections() - - msgSender := sender.NewHttpMessageSender(emsCEURL, client) - - msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) - - legacyTransformer := legacy.NewTransformer("beb.ns", "event.type.prefix") - opts := &options.Options{MaxRequestSize: 65536} - handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, nil, logrus.New()) - go func() { - if err := handler.Start(ctx); err != nil { - t.Errorf("failed to start handler with error: %v", err) - } - }() - - testingutils.WaitForHandlerToStart(t, healthEndpoint) - - body, headers := testingutils.StructuredCloudEventPayload, testingutils.GetStructuredMessageHeaders() - resp, err := testingutils.SendEvent(publishEndpoint, body, headers) - if err != nil { - t.Errorf("Failed to send event with error: %v", err) - } - _ = resp.Body.Close() - if http.StatusInternalServerError != resp.StatusCode { - t.Errorf("Test failed, want status code:%d but got:%d", http.StatusInternalServerError, resp.StatusCode) - } -} - -func TestHandlerForLegacyEvents(t *testing.T) { - t.Parallel() - port, err := testingutils.GeneratePort() - if err != nil { - t.Fatalf("failed to generate port: %v", err) - } - var ( - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/app/v1/events", port) - bebNs = "/beb.namespace" - eventTypePrefix = "event.type.prefix" - ) - - mockServer := testingutils.NewMockServer() - mockServer.Start(t, tokenEndpoint, eventsEndpoint, eventsHTTP400Endpoint) - defer mockServer.Close() - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - bebCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) - authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) - - cfg := testingutils.NewEnvConfig( - bebCEURL, - authURL, - testingutils.WithPort(port), - testingutils.WithBEBNamespace(bebNs), - testingutils.WithEventTypePrefix(eventTypePrefix), - ) - client := oauth.NewClient(ctx, cfg) - defer client.CloseIdleConnections() - - msgSender := sender.NewHttpMessageSender(bebCEURL, client) - msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) - legacyTransformer := legacy.NewTransformer(cfg.BEBNamespace, cfg.EventTypePrefix) - opts := &options.Options{MaxRequestSize: 65536} - handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, nil, logrus.New()) - go func() { - if err := handler.Start(ctx); err != nil { - t.Errorf("failed to start handler with error: %v", err) - } - }() - - testingutils.WaitForHandlerToStart(t, healthEndpoint) - - for _, testCase := range testCasesForLegacyEvents { - t.Run(testCase.name, func(t *testing.T) { - body, headers := testCase.provideMessage() - - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - if err != nil { - t.Errorf("Failed to send event with error: %v", err) - } - - if testCase.wantStatusCode != resp.StatusCode { - t.Errorf("Test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) - } - - if testCase.wantStatusCode == http.StatusOK { - testingutils.ValidateOkResponse(t, *resp, &testCase.wantResponse) - } else { - testingutils.ValidateErrorResponse(t, *resp, &testCase.wantResponse) - } - }) - } -} - -func TestHandlerForBEBFailures(t *testing.T) { - t.Parallel() - port, err := testingutils.GeneratePort() - if err != nil { - t.Fatalf("failed to generate port: %v", err) - } - var ( - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/app/v1/events", port) - publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) - bebNs = "/beb.namespace" - eventTypePrefix = "event.type.prefix" - ) - mockServer := testingutils.NewMockServer() - mockServer.Start(t, tokenEndpoint, eventsEndpoint, eventsHTTP400Endpoint) - defer mockServer.Close() - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - beb400CEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsHTTP400Endpoint) - authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) - - cfg := testingutils.NewEnvConfig( - beb400CEURL, - authURL, - testingutils.WithPort(port), - testingutils.WithBEBNamespace(bebNs), - testingutils.WithEventTypePrefix(eventTypePrefix), - ) - client := oauth.NewClient(ctx, cfg) - defer client.CloseIdleConnections() - - msgSender := sender.NewHttpMessageSender(beb400CEURL, client) - msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) - legacyTransformer := legacy.NewTransformer(cfg.BEBNamespace, cfg.EventTypePrefix) - opts := &options.Options{MaxRequestSize: 65536} - handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, nil, logrus.New()) - go func() { - if err := handler.Start(ctx); err != nil { - t.Errorf("failed to start handler with error: %v", err) - } - }() - - testingutils.WaitForHandlerToStart(t, healthEndpoint) - - testCases := []struct { - name string - targetEndpoint string - provideMessage func() (string, http.Header) - endPoint string - wantStatusCode int - wantResponse legacyapi.PublishEventResponses - }{ - { - name: "Send a legacy event with event-id", - provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() - }, - endPoint: publishLegacyEndpoint, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: &legacyapi.Error{ - Status: 400, - Message: "invalid request"}, - }, - }, - { - name: "Binary CloudEvent is valid with required headers", - provideMessage: func() (string, http.Header) { - return testingutils.BinaryCloudEventPayload, testingutils.GetBinaryMessageHeaders() - }, - endPoint: publishEndpoint, - wantStatusCode: http.StatusBadRequest, - }, - } - - for _, testCase := range testCases { - t.Run(testCase.name, func(t *testing.T) { - body, headers := testCase.provideMessage() - _ = legacyapi.PublishEventResponses{} - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - if err != nil { - t.Errorf("failed to send event with error: %v", err) - } - - if testCase.wantStatusCode != resp.StatusCode { - t.Errorf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) - } - - if testCase.endPoint == publishLegacyEndpoint { - testingutils.ValidateErrorResponse(t, *resp, &testCase.wantResponse) - } - }) - } -} - -func TestHandlerForHugeRequests(t *testing.T) { - t.Parallel() - port, err := testingutils.GeneratePort() - if err != nil { - t.Fatalf("failed to generate port: %v", err) - } - var ( - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/app/v1/events", port) - bebNs = "/beb.namespace" - eventTypePrefix = "event.type.prefix" - ) - mockServer := testingutils.NewMockServer() - mockServer.Start(t, tokenEndpoint, eventsEndpoint, eventsHTTP400Endpoint) - defer mockServer.Close() - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - beb400CEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsHTTP400Endpoint) - authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) - - cfg := testingutils.NewEnvConfig( - beb400CEURL, - authURL, - testingutils.WithPort(port), - testingutils.WithBEBNamespace(bebNs), - testingutils.WithEventTypePrefix(eventTypePrefix), - ) - client := oauth.NewClient(ctx, cfg) - defer client.CloseIdleConnections() - - msgSender := sender.NewHttpMessageSender(beb400CEURL, client) - msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) - legacyTransformer := legacy.NewTransformer(cfg.BEBNamespace, cfg.EventTypePrefix) - - // Limiting the accepted size of the request to 2 Bytes - opts := &options.Options{MaxRequestSize: 2} - handler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, nil, logrus.New()) - go func() { - if err := handler.Start(ctx); err != nil { - t.Errorf("failed to start handler with error: %v", err) - } - }() - - testingutils.WaitForHandlerToStart(t, healthEndpoint) - - testCases := []struct { - name string - targetEndpoint string - provideMessage func() (string, http.Header) - endPoint string - wantStatusCode int - }{ - { - name: "Should fail with HTTP 413 with a request which is larger than 2 Bytes as the maximum accepted size is 2 Bytes", - provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() - }, - endPoint: publishLegacyEndpoint, - wantStatusCode: http.StatusRequestEntityTooLarge, - }, - { - name: "Should accept a request which is lesser than 2 Bytes as the maximum accepted size is 2 Bytes", - provideMessage: func() (string, http.Header) { - return "{}", testingutils.GetBinaryMessageHeaders() - }, - endPoint: publishEndpoint, - wantStatusCode: http.StatusBadRequest, - }, - } - - for _, testCase := range testCases { - t.Run(testCase.name, func(t *testing.T) { - body, headers := testCase.provideMessage() - _ = legacyapi.PublishEventResponses{} - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - if err != nil { - t.Errorf("failed to send event with error: %v", err) - } - - if testCase.wantStatusCode != resp.StatusCode { - t.Errorf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) - } - }) - } -} - -func TestHandlerForSubscribedEndpoint(t *testing.T) { - t.Parallel() - port, err := testingutils.GeneratePort() - if err != nil { - t.Fatalf("failed to generate port: %v", err) - } - var ( - subscribedEndpointFormat = "http://localhost:%d/%s/v1/events/subscribed" - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - bebNs = "/beb.namespace" - eventTypePrefix = "event.type.prefix" - ) - - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - cfg := testingutils.NewEnvConfig( - // BEB details are not needed in this test - "", - "", - testingutils.WithPort(port), - testingutils.WithBEBNamespace(bebNs), - testingutils.WithEventTypePrefix(eventTypePrefix), - ) - recv := receiver.NewHttpMessageReceiver(cfg.Port) - opts := &options.Options{MaxRequestSize: 65536} - legacyTransformer := legacy.NewTransformer(cfg.BEBNamespace, cfg.EventTypePrefix) - - // Setting up fake informers - scheme := runtime.NewScheme() - if err := corev1.AddToScheme(scheme); err != nil { - t.Fatalf("failed to add corev1 to scheme: %v", err) - } - if err := eventingv1alpha1.AddToScheme(scheme); err != nil { - t.Fatalf("failed to add eventing v1alpha1 to scheme: %v", err) - } - subscription := testingutils.NewSubscription() - - subUnstructuredMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(subscription) - if err != nil { - t.Fatalf("failed to convert subscription to unstructured obj: %v", err) - } - // Creating unstructured subscriptions - subUnstructured := &unstructured.Unstructured{ - Object: subUnstructuredMap, - } - // Setting Kind information in unstructured subscription - subscriptionGVK := schema.GroupVersionKind{ - Group: subscribed.GVR.Group, - Version: subscribed.GVR.Version, - Kind: "Subscription", - } - subUnstructured.SetGroupVersionKind(subscriptionGVK) - // Configuring fake dynamic client - dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subUnstructured) - - dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, - 10*time.Second, - v1.NamespaceAll, - nil, - ) - genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) - t.Logf("Waiting for cache to resync") - subscribed.WaitForCacheSyncOrDie(ctx, dFilteredSharedInfFactory) - t.Logf("Informers resynced successfully") - subLister := genericInf.Lister() - subscribedProcessor := &subscribed.Processor{ - SubscriptionLister: &subLister, - Config: cfg, - Logger: logrus.New(), - } - - handler := NewHandler(recv, nil, cfg.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logrus.New()) - go func() { - if err := handler.Start(ctx); err != nil { - t.Errorf("failed to start handler with error: %v", err) - } - }() - testingutils.WaitForHandlerToStart(t, healthEndpoint) - - for _, testCase := range testCasesForSubscribedEndpoint { - t.Run(testCase.name, func(t *testing.T) { - subscribedURL := fmt.Sprintf(subscribedEndpointFormat, port, testCase.appName) - resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) - if err != nil { - t.Errorf("failed to send event with error: %v", err) - } - - if testCase.wantStatusCode != resp.StatusCode { - t.Errorf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) - } - defer func() { _ = resp.Body.Close() }() - respBodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Errorf("failed to convert body to bytes: %v", err) - } - gotEventsResponse := subscribed.Events{} - err = json.Unmarshal(respBodyBytes, &gotEventsResponse) - if err != nil { - t.Errorf("failed to unmarshal body bytes to events response: %v", err) - } - if !reflect.DeepEqual(testCase.wantResponse, gotEventsResponse) { - t.Errorf("incorrect response, wanted: %v, got: %v", testCase.wantResponse, gotEventsResponse) - } - }) - } -} - -func TestIsARequestWithLegacyEvent(t *testing.T) { - testCases := []struct { - inputURI string - wantedResult bool - }{ - { - inputURI: "/app/v1/events", - wantedResult: true, - }, - { - inputURI: "///app/v1/events", - wantedResult: true, - }, - { - inputURI: "///app/v1//events", - wantedResult: false, - }, - { - inputURI: "///app/v1/foo/events", - wantedResult: false, - }, - } - - for _, tc := range testCases { - got := isARequestWithLegacyEvent(tc.inputURI) - if tc.wantedResult != got { - t.Errorf("incorrect result with inputURI: %s, wanted: %v, got: %v", tc.inputURI, tc.wantedResult, got) - } - } -} diff --git a/pkg/handler/handlertest/handlertest.go b/pkg/handler/handlertest/handlertest.go new file mode 100644 index 0000000..4b7af8c --- /dev/null +++ b/pkg/handler/handlertest/handlertest.go @@ -0,0 +1,330 @@ +// Package handlertest provides utilities for Handler testing. +package handlertest + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "reflect" + "regexp" + "testing" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" +) + +// isValidEventID checks whether EventID is valid or not +func isValidEventID(id string) bool { + return regexp.MustCompile(legacy.AllowedEventIDChars).MatchString(id) +} + +// validateErrorResponse validates Error Response +func ValidateErrorResponse(t *testing.T, resp http.Response, tcWantResponse *legacyapi.PublishEventResponses) { + legacyResponse := legacyapi.PublishEventResponses{} + legacyError := legacyapi.Error{} + bodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Fatalf("failed to read response body: %v", err) + } + if err = json.Unmarshal(bodyBytes, &legacyError); err != nil { + t.Fatalf("failed to unmarshal response body: %v", err) + } + legacyResponse.Error = &legacyError + if !reflect.DeepEqual(tcWantResponse.Error, legacyResponse.Error) { + t.Fatalf("Invalid error, want: %v, got: %v", tcWantResponse.Error, legacyResponse.Error) + } +} + +// validateOkResponse validates Ok Response +func ValidateOkResponse(t *testing.T, resp http.Response, tcWantResponse *legacyapi.PublishEventResponses) { + legacyOkResponse := legacyapi.PublishResponse{} + legacyResponse := legacyapi.PublishEventResponses{} + bodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Fatalf("failed to read response body: %v", err) + } + fmt.Println(string(bodyBytes)) + if err = json.Unmarshal(bodyBytes, &legacyOkResponse); err != nil { + t.Fatalf("failed to unmarshal response body: %v", err) + } + legacyResponse.Ok = &legacyOkResponse + if err = resp.Body.Close(); err != nil { + t.Fatalf("failed to close body: %v", err) + } + + if tcWantResponse.Ok.EventID != "" && tcWantResponse.Ok.EventID != legacyResponse.Ok.EventID { + t.Errorf("invalid event-id, want: %v, got: %v", tcWantResponse.Ok.EventID, legacyResponse.Ok.EventID) + } + + if tcWantResponse.Ok.EventID == "" && !isValidEventID(legacyResponse.Ok.EventID) { + t.Errorf("should match regex: [%s] Not a valid event-id: %v ", legacy.AllowedEventIDChars, legacyResponse.Ok.EventID) + } + if tcWantResponse.Ok.Reason != legacyResponse.Ok.Reason { + t.Errorf("invalid reason, want: %v, got: %v", tcWantResponse.Ok.Reason, legacyResponse.Ok.Reason) + } + if tcWantResponse.Ok.Status != legacyResponse.Ok.Status { + t.Errorf("invalid status, want: %v, got: %v", tcWantResponse.Ok.Status, legacyResponse.Ok.Status) + } +} + +// getMissingFieldValidationError generates an Error message for a missing field +func getMissingFieldValidationError(field string) *legacyapi.Error { + return &legacyapi.Error{ + Status: 400, + Type: "validation_violation", + Message: "Missing field", + Details: []legacyapi.ErrorDetail{ + { + Field: field, + Type: "missing_field", + Message: "Missing field", + MoreInfo: "", + }, + }, + } +} + +// getInvalidValidationError generates an Error message for an invalid field +func getInvalidValidationError(field string) *legacyapi.Error { + return &legacyapi.Error{ + Status: 400, + Type: "validation_violation", + Message: "Invalid field", + Details: []legacyapi.ErrorDetail{ + { + Field: field, + Type: "invalid_field", + Message: "Invalid field", + MoreInfo: "", + }, + }, + } +} + +func NewApplicationListerOrDie(ctx context.Context, appName string) *application.Lister { + app := applicationtest.NewApplication(appName, nil) + appLister := fake.NewListerOrDie(ctx, app) + return appLister +} + +// common test-cases for the HTTP handler and NATS handler +var ( + TestCasesForCloudEvents = []struct { + Name string + ProvideMessage func() (string, http.Header) + WantStatusCode int + }{ + // structured cloudevents + { + Name: "Structured CloudEvent without id", + ProvideMessage: func() (string, http.Header) { + return testingutils.StructuredCloudEventPayloadWithoutID, testingutils.GetStructuredMessageHeaders() + }, + WantStatusCode: http.StatusBadRequest, + }, + { + Name: "Structured CloudEvent without type", + ProvideMessage: func() (string, http.Header) { + return testingutils.StructuredCloudEventPayloadWithoutType, testingutils.GetStructuredMessageHeaders() + }, + WantStatusCode: http.StatusBadRequest, + }, + { + Name: "Structured CloudEvent without specversion", + ProvideMessage: func() (string, http.Header) { + return testingutils.StructuredCloudEventPayloadWithoutSpecVersion, testingutils.GetStructuredMessageHeaders() + }, + WantStatusCode: http.StatusBadRequest, + }, + { + Name: "Structured CloudEvent without source", + ProvideMessage: func() (string, http.Header) { + return testingutils.StructuredCloudEventPayloadWithoutSource, testingutils.GetStructuredMessageHeaders() + }, + WantStatusCode: http.StatusBadRequest, + }, + { + Name: "Structured CloudEvent is valid", + ProvideMessage: func() (string, http.Header) { + return testingutils.StructuredCloudEventPayload, testingutils.GetStructuredMessageHeaders() + }, + WantStatusCode: http.StatusNoContent, + }, + // binary cloudevents + { + Name: "Binary CloudEvent without CE-ID header", + ProvideMessage: func() (string, http.Header) { + headers := testingutils.GetBinaryMessageHeaders() + headers.Del(testingutils.CeIDHeader) + return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), headers + }, + WantStatusCode: http.StatusBadRequest, + }, + { + Name: "Binary CloudEvent without CE-Type header", + ProvideMessage: func() (string, http.Header) { + headers := testingutils.GetBinaryMessageHeaders() + headers.Del(testingutils.CeTypeHeader) + return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), headers + }, + WantStatusCode: http.StatusBadRequest, + }, + { + Name: "Binary CloudEvent without CE-SpecVersion header", + ProvideMessage: func() (string, http.Header) { + headers := testingutils.GetBinaryMessageHeaders() + headers.Del(testingutils.CeSpecVersionHeader) + return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), headers + }, + WantStatusCode: http.StatusBadRequest, + }, + { + Name: "Binary CloudEvent without CE-Source header", + ProvideMessage: func() (string, http.Header) { + headers := testingutils.GetBinaryMessageHeaders() + headers.Del(testingutils.CeSourceHeader) + return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), headers + }, + WantStatusCode: http.StatusBadRequest, + }, + { + Name: "Binary CloudEvent is valid with required headers", + ProvideMessage: func() (string, http.Header) { + return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), testingutils.GetBinaryMessageHeaders() + }, + WantStatusCode: http.StatusNoContent, + }, + } + + TestCasesForLegacyEvents = []struct { + Name string + ProvideMessage func() (string, http.Header) + WantStatusCode int + WantResponse legacyapi.PublishEventResponses + }{ + { + Name: "Send a legacy event successfully with event-id", + ProvideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() + }, + WantStatusCode: http.StatusOK, + WantResponse: legacyapi.PublishEventResponses{ + Ok: &legacyapi.PublishResponse{ + EventID: testingutils.EventID, + Status: "", + Reason: "", + }, + }, + }, + { + Name: "Send a legacy event successfully without event-id", + ProvideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithoutEventId, testingutils.GetApplicationJSONHeaders() + }, + WantStatusCode: http.StatusOK, + WantResponse: legacyapi.PublishEventResponses{ + Ok: &legacyapi.PublishResponse{ + EventID: "", + Status: "", + Reason: "", + }, + }, + }, + { + Name: "Send a legacy event with invalid event id", + ProvideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithInvalidEventId, testingutils.GetApplicationJSONHeaders() + }, + WantStatusCode: http.StatusBadRequest, + WantResponse: legacyapi.PublishEventResponses{ + Error: getInvalidValidationError("event-id"), + }, + }, + { + Name: "Send a legacy event without event time", + ProvideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithoutEventTime, testingutils.GetApplicationJSONHeaders() + }, + WantStatusCode: http.StatusBadRequest, + WantResponse: legacyapi.PublishEventResponses{ + Error: getMissingFieldValidationError("event-time"), + }, + }, + { + Name: "Send a legacy event without event type", + ProvideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithoutEventType, testingutils.GetApplicationJSONHeaders() + }, + WantStatusCode: http.StatusBadRequest, + WantResponse: legacyapi.PublishEventResponses{ + Error: getMissingFieldValidationError("event-type"), + }, + }, + { + Name: "Send a legacy event with invalid event time", + ProvideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithInvalidEventTime, testingutils.GetApplicationJSONHeaders() + }, + WantStatusCode: http.StatusBadRequest, + WantResponse: legacyapi.PublishEventResponses{ + Error: getInvalidValidationError("event-time"), + }, + }, + { + Name: "Send a legacy event without event version", + ProvideMessage: func() (string, http.Header) { + return testingutils.LegacyEventPayloadWithWithoutEventVersion, testingutils.GetApplicationJSONHeaders() + }, + WantStatusCode: http.StatusBadRequest, + WantResponse: legacyapi.PublishEventResponses{ + Error: getMissingFieldValidationError("event-type-version"), + }, + }, + { + Name: "Send a legacy event without data field", + ProvideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithoutData, testingutils.GetApplicationJSONHeaders() + }, + WantStatusCode: http.StatusBadRequest, + WantResponse: legacyapi.PublishEventResponses{ + Error: getMissingFieldValidationError("data"), + }, + }, + } + + TestCasesForSubscribedEndpoint = []struct { + Name string + AppName string + InputSubscriptions []eventingv1alpha1.Subscription + WantStatusCode int + WantResponse subscribed.Events + }{ + { + Name: "Send a request with a valid application Name", + AppName: testingutils.ApplicationName, + WantStatusCode: http.StatusOK, + WantResponse: subscribed.Events{ + EventsInfo: []subscribed.Event{{ + Name: testingutils.LegacyEventType, + Version: testingutils.LegacyEventTypeVersion, + }}, + }, + }, + { + Name: "Send a request with an invalid application Name", + AppName: "invalid-app", + WantStatusCode: http.StatusOK, + WantResponse: subscribed.Events{ + EventsInfo: []subscribed.Event{}, + }, + }, + } +) diff --git a/pkg/handler/handler.go b/pkg/handler/http/handler.go similarity index 87% rename from pkg/handler/handler.go rename to pkg/handler/http/handler.go index a9d670d..b27d4b2 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/http/handler.go @@ -1,37 +1,32 @@ -package handler +package http import ( "context" "io/ioutil" "net/http" - "strings" "time" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/health" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - - "github.com/sirupsen/logrus" - "github.com/cloudevents/sdk-go/v2/binding" cev2client "github.com/cloudevents/sdk-go/v2/client" cev2event "github.com/cloudevents/sdk-go/v2/event" cehttp "github.com/cloudevents/sdk-go/v2/protocol/http" + "github.com/sirupsen/logrus" + cloudevents "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/ems" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/health" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" ) const ( // noDuration signals that the dispatch step has not started yet. noDuration = -1 - - publishEndpoint = "/publish" - legacyEndpointSuffix = "/v1/events" - subscribedEndpointSuffix = "/v1/events/subscribed" ) var ( @@ -64,7 +59,7 @@ type Handler struct { Options *options.Options } -// NewHandler returns a new Handler instance for the Event Publisher Proxy. +// NewHandler returns a new HTTP Handler instance. func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.HttpMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logrus.Logger) *Handler { return &Handler{ Receiver: receiver, @@ -98,21 +93,21 @@ func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { // Process /publish endpoint // Gets a CE and sends it to BEB - if isARequestWithCE(uri) { + if handler.IsARequestWithCE(uri) { h.publishCloudEvents(writer, request) return } // Process /:application/v1/events // Publishes a legacy event as CE v1.0 to BEB - if isARequestWithLegacyEvent(uri) { + if handler.IsARequestWithLegacyEvent(uri) { h.publishLegacyEventsAsCE(writer, request) return } // Process /:application/v1/events/subscribed // Fetches the list of subscriptions available for the given application - if isARequestForSubscriptions(uri) { + if handler.IsARequestForSubscriptions(uri) { h.SubscribedProcessor.ExtractEventsFromSubscriptions(writer, request) return } @@ -121,41 +116,13 @@ func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { return } -func isARequestWithCE(uri string) bool { - return uri == publishEndpoint -} -func isARequestWithLegacyEvent(uri string) bool { - // Assuming the path should be of the form /:application/v1/events - uriPathSegments := make([]string, 0) - - for _, segment := range strings.Split(uri, "/") { - if strings.TrimSpace(segment) != "" { - uriPathSegments = append(uriPathSegments, segment) - } - } - if len(uriPathSegments) != 3 { - return false - } - if !strings.HasSuffix(uri, legacyEndpointSuffix) { - return false - } - return true -} - -func isARequestForSubscriptions(uri string) bool { - // Assuming the path should be of the form /:application/v1/events/subscribed - if !strings.HasSuffix(uri, subscribedEndpointSuffix) { - return false - } - return true -} - func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { - event := h.LegacyTransformer.TransformsLegacyRequestsToCE(writer, request) + event := h.LegacyTransformer.TransformLegacyRequestsToCE(writer, request) if event == nil { h.Logger.Debug("failed to transform legacy event to CE, event is nil") return } + ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) defer cancel() h.receive(ctx, event) diff --git a/pkg/handler/http/handler_test.go b/pkg/handler/http/handler_test.go new file mode 100644 index 0000000..6262647 --- /dev/null +++ b/pkg/handler/http/handler_test.go @@ -0,0 +1,474 @@ +package http + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "net/http" + "reflect" + "strings" + "testing" + "time" + + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/dynamic/dynamicinformer" + dynamicfake "k8s.io/client-go/dynamic/fake" + + "github.com/sirupsen/logrus" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" +) + +const ( + // mock server endpoints + defaultTokenEndpoint = "/token" + defaultEventsEndpoint = "/events" + defaultEventsHTTP400Endpoint = "/events400" + + // request size + smallRequestSize = 2 + bigRequestSize = 65536 +) + +func TestHandlerForCloudEvents(t *testing.T) { + t.Parallel() + + exec := func(t *testing.T, applicationName, expectedApplicationName string) { + var ( + port = testingutils.GeneratePortOrDie() + requestSize = bigRequestSize + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + bebNs = testingutils.MessagingNamespace + eventTypePrefix = testingutils.MessagingEventTypePrefix + eventsEndpoint = defaultEventsEndpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) + ) + + cancel, mockServer := setupTestResources(t, port, requestSize, applicationName, expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) + defer cancel() + defer mockServer.Close() + + for _, testCase := range handlertest.TestCasesForCloudEvents { + t.Run(testCase.Name, func(tt *testing.T) { + body, headers := testCase.ProvideMessage() + resp, err := testingutils.SendEvent(publishEndpoint, body, headers) + if err != nil { + tt.Fatalf("failed to send event with error: %v", err) + } + _ = resp.Body.Close() + if testCase.WantStatusCode != resp.StatusCode { + tt.Fatalf("Test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) + } + }) + } + } + + // make sure not to change the cloudevent, even if its event-type contains none-alphanumeric characters + exec(t, testingutils.ApplicationName, testingutils.ApplicationNameNotClean) + exec(t, testingutils.ApplicationNameNotClean, testingutils.ApplicationNameNotClean) +} + +func TestHandlerForLegacyEvents(t *testing.T) { + t.Parallel() + + exec := func(t *testing.T, applicationName, expectedApplicationName string) { + var ( + port = testingutils.GeneratePortOrDie() + requestSize = bigRequestSize + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + bebNs = testingutils.MessagingNamespace + eventTypePrefix = testingutils.MessagingEventTypePrefix + eventsEndpoint = defaultEventsEndpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/%s/v1/events", port, applicationName) + ) + + cancel, mockServer := setupTestResources(t, port, requestSize, applicationName, expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) + defer cancel() + defer mockServer.Close() + + for _, testCase := range handlertest.TestCasesForLegacyEvents { + t.Run(testCase.Name, func(t *testing.T) { + body, headers := testCase.ProvideMessage() + + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + if err != nil { + t.Fatalf("Failed to send event with error: %v", err) + } + + if testCase.WantStatusCode != resp.StatusCode { + t.Fatalf("Test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) + } + + if testCase.WantStatusCode == http.StatusOK { + handlertest.ValidateOkResponse(t, *resp, &testCase.WantResponse) + } else { + handlertest.ValidateErrorResponse(t, *resp, &testCase.WantResponse) + } + }) + } + } + + // make sure to clean the legacy event, so that its event-type is free from none-alphanumeric characters + exec(t, testingutils.ApplicationName, testingutils.ApplicationName) + exec(t, testingutils.ApplicationNameNotClean, testingutils.ApplicationName) +} + +func TestHandlerForBEBFailures(t *testing.T) { + t.Parallel() + + var ( + port = testingutils.GeneratePortOrDie() + requestSize = bigRequestSize + applicationName = testingutils.ApplicationName + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + bebNs = testingutils.MessagingNamespace + eventTypePrefix = testingutils.MessagingEventTypePrefix + eventsEndpoint = defaultEventsHTTP400Endpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) + publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/%s/v1/events", port, applicationName) + ) + + cancel, mockServer := setupTestResources(t, port, requestSize, applicationName, applicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) + defer cancel() + defer mockServer.Close() + + testCases := []struct { + name string + targetEndpoint string + provideMessage func() (string, http.Header) + endPoint string + wantStatusCode int + wantResponse legacyapi.PublishEventResponses + }{ + { + name: "Send a legacy event with event-id", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() + }, + endPoint: publishLegacyEndpoint, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: &legacyapi.Error{ + Status: 400, + Message: "invalid request"}, + }, + }, + { + name: "Binary CloudEvent is valid with required headers", + provideMessage: func() (string, http.Header) { + return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), testingutils.GetBinaryMessageHeaders() + }, + endPoint: publishEndpoint, + wantStatusCode: http.StatusBadRequest, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + body, headers := testCase.provideMessage() + _ = legacyapi.PublishEventResponses{} + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + if err != nil { + t.Fatalf("failed to send event with error: %v", err) + } + + if testCase.wantStatusCode != resp.StatusCode { + t.Fatalf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) + } + + if testCase.endPoint == publishLegacyEndpoint { + handlertest.ValidateErrorResponse(t, *resp, &testCase.wantResponse) + } + }) + } +} + +func TestHandlerForHugeRequests(t *testing.T) { + t.Parallel() + + var ( + port = testingutils.GeneratePortOrDie() + requestSize = smallRequestSize + applicationName = testingutils.ApplicationName + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + bebNs = testingutils.MessagingNamespace + eventTypePrefix = testingutils.MessagingEventTypePrefix + eventsEndpoint = defaultEventsHTTP400Endpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/%s/v1/events", port, applicationName) + ) + + cancel, mockServer := setupTestResources(t, port, requestSize, applicationName, applicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) + defer cancel() + defer mockServer.Close() + + testCases := []struct { + name string + targetEndpoint string + provideMessage func() (string, http.Header) + endPoint string + wantStatusCode int + }{ + { + name: "Should fail with HTTP 413 with a request which is larger than 2 Bytes as the maximum accepted size is 2 Bytes", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() + }, + endPoint: publishLegacyEndpoint, + wantStatusCode: http.StatusRequestEntityTooLarge, + }, + { + name: "Should accept a request which is lesser than 2 Bytes as the maximum accepted size is 2 Bytes", + provideMessage: func() (string, http.Header) { + return "{}", testingutils.GetBinaryMessageHeaders() + }, + endPoint: handler.PublishEndpoint, + wantStatusCode: http.StatusBadRequest, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + body, headers := testCase.provideMessage() + _ = legacyapi.PublishEventResponses{} + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + if err != nil { + t.Fatalf("failed to send event with error: %v", err) + } + + if testCase.wantStatusCode != resp.StatusCode { + t.Fatalf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) + } + }) + } +} + +func TestHandlerForSubscribedEndpoint(t *testing.T) { + t.Parallel() + + var ( + port = testingutils.GeneratePortOrDie() + requestSize = smallRequestSize + applicationName = testingutils.ApplicationName + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + bebNs = testingutils.MessagingNamespace + eventTypePrefix = testingutils.MessagingEventTypePrefix + eventsEndpoint = defaultEventsHTTP400Endpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + subscribedEndpointFormat = "http://localhost:%d/%s/v1/events/subscribed" + ) + + cancel, mockServer := setupTestResources(t, port, requestSize, applicationName, applicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) + defer cancel() + defer mockServer.Close() + + for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { + t.Run(testCase.Name, func(t *testing.T) { + subscribedURL := fmt.Sprintf(subscribedEndpointFormat, port, testCase.AppName) + resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) + if err != nil { + t.Fatalf("failed to send event with error: %v", err) + } + + if testCase.WantStatusCode != resp.StatusCode { + t.Fatalf("test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) + } + defer func() { _ = resp.Body.Close() }() + respBodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Fatalf("failed to convert body to bytes: %v", err) + } + gotEventsResponse := subscribed.Events{} + err = json.Unmarshal(respBodyBytes, &gotEventsResponse) + if err != nil { + t.Fatalf("failed to unmarshal body bytes to events response: %v", err) + } + if !reflect.DeepEqual(testCase.WantResponse, gotEventsResponse) { + t.Fatalf("incorrect response, wanted: %v, got: %v", testCase.WantResponse, gotEventsResponse) + } + }) + } +} + +func TestHandlerTimeout(t *testing.T) { + t.Parallel() + + var ( + port = testingutils.GeneratePortOrDie() + requestSize = bigRequestSize + applicationName = testingutils.ApplicationName + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + bebNs = testingutils.MessagingNamespace + eventTypePrefix = testingutils.MessagingEventTypePrefix + eventsEndpoint = defaultEventsHTTP400Endpoint + requestTimeout = time.Nanosecond // short request timeout + serverResponseTime = time.Millisecond // long server response time + publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) + ) + + cancel, mockServer := setupTestResources(t, port, requestSize, applicationName, applicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) + defer cancel() + defer mockServer.Close() + + body, headers := testingutils.StructuredCloudEventPayload, testingutils.GetStructuredMessageHeaders() + resp, err := testingutils.SendEvent(publishEndpoint, body, headers) + if err != nil { + t.Fatalf("Failed to send event with error: %v", err) + } + _ = resp.Body.Close() + if http.StatusInternalServerError != resp.StatusCode { + t.Fatalf("Test failed, want status code:%d but got:%d", http.StatusInternalServerError, resp.StatusCode) + } +} + +func TestIsARequestWithLegacyEvent(t *testing.T) { + testCases := []struct { + inputURI string + wantedResult bool + }{ + { + inputURI: "/app/v1/events", + wantedResult: true, + }, + { + inputURI: "///app/v1/events", + wantedResult: true, + }, + { + inputURI: "///app/v1//events", + wantedResult: false, + }, + { + inputURI: "///app/v1/foo/events", + wantedResult: false, + }, + } + + for _, tc := range testCases { + got := handler.IsARequestWithLegacyEvent(tc.inputURI) + if tc.wantedResult != got { + t.Errorf("incorrect result with inputURI: %s, wanted: %v, got: %v", tc.inputURI, tc.wantedResult, got) + } + } +} + +func setupTestResources(t *testing.T, port, maxRequestSize int, applicationName, expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint string, requestTimeout, serverResponseTime time.Duration) (context.CancelFunc, *testingutils.MockServer) { + validator := validateApplicationName(expectedApplicationName) + mockServer := testingutils.NewMockServer(testingutils.WithResponseTime(serverResponseTime), testingutils.WithValidator(validator)) + mockServer.Start(t, defaultTokenEndpoint, defaultEventsEndpoint, defaultEventsHTTP400Endpoint) + + ctx, cancel := context.WithCancel(context.Background()) + + emsCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) + authURL := fmt.Sprintf("%s%s", mockServer.URL(), defaultTokenEndpoint) + cfg := testingutils.NewEnvConfig( + emsCEURL, + authURL, + testingutils.WithPort(port), + testingutils.WithBEBNamespace(bebNs), + testingutils.WithRequestTimeout(requestTimeout), + testingutils.WithEventTypePrefix(eventTypePrefix), + ) + client := oauth.NewClient(ctx, cfg) + defer client.CloseIdleConnections() + + msgSender := sender.NewHttpMessageSender(emsCEURL, client) + msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) + opts := &options.Options{MaxRequestSize: int64(maxRequestSize)} + appLister := handlertest.NewApplicationListerOrDie(ctx, applicationName) + legacyTransformer := legacy.NewTransformer(cfg.BEBNamespace, cfg.EventTypePrefix, appLister) + + // Setting up fake informers + scheme := runtime.NewScheme() + if err := corev1.AddToScheme(scheme); err != nil { + t.Fatalf("failed to add corev1 to scheme: %v", err) + } + if err := eventingv1alpha1.AddToScheme(scheme); err != nil { + t.Fatalf("failed to add eventing v1alpha1 to scheme: %v", err) + } + subscription := testingutils.NewSubscription() + + subUnstructuredMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(subscription) + if err != nil { + t.Fatalf("failed to convert subscription to unstructured obj: %v", err) + } + // Creating unstructured subscriptions + subUnstructured := &unstructured.Unstructured{ + Object: subUnstructuredMap, + } + // Setting Kind information in unstructured subscription + subscriptionGVK := schema.GroupVersionKind{ + Group: subscribed.GVR.Group, + Version: subscribed.GVR.Version, + Kind: "Subscription", + } + subUnstructured.SetGroupVersionKind(subscriptionGVK) + // Configuring fake dynamic client + dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subUnstructured) + + dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, + 10*time.Second, + v1.NamespaceAll, + nil, + ) + genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) + t.Logf("Waiting for cache to resync") + informers.WaitForCacheSyncOrDie(ctx, dFilteredSharedInfFactory) + t.Logf("Informers resynced successfully") + subLister := genericInf.Lister() + subscribedProcessor := &subscribed.Processor{ + SubscriptionLister: &subLister, + Config: cfg, + Logger: logrus.New(), + } + + msgHandler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logrus.New()) + go func() { + if err := msgHandler.Start(ctx); err != nil { + t.Errorf("failed to start handler with error: %v", err) + } + }() + testingutils.WaitForHandlerToStart(t, healthEndpoint) + + return cancel, mockServer +} + +func validateApplicationName(appName string) testingutils.Validator { + return func(r *http.Request) error { + for k, v := range r.Header { + if strings.ToLower(k) != strings.ToLower(testingutils.CeTypeHeader) { + continue + } + if strings.Contains(v[0], appName) { + return nil + } + return errors.New(fmt.Sprintf("expected the event-type [%s] to contain the application name [%s]", v[0], appName)) + } + return errors.New("event-type header is not found") + } +} diff --git a/pkg/handler/nats.go b/pkg/handler/nats/handler.go similarity index 81% rename from pkg/handler/nats.go rename to pkg/handler/nats/handler.go index 1f7351d..449ea1c 100644 --- a/pkg/handler/nats.go +++ b/pkg/handler/nats/handler.go @@ -1,29 +1,29 @@ -package handler +package nats import ( "context" "net/http" "time" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/health" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - - "github.com/sirupsen/logrus" - "github.com/cloudevents/sdk-go/v2/binding" cev2client "github.com/cloudevents/sdk-go/v2/client" cev2event "github.com/cloudevents/sdk-go/v2/event" cehttp "github.com/cloudevents/sdk-go/v2/protocol/http" + "github.com/sirupsen/logrus" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/health" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" ) // Handler is responsible for receiving HTTP requests and dispatching them to NATS. // It also assures that the messages received are compliant with the Cloud Events spec. -type NatsHandler struct { +type Handler struct { // Receiver receives incoming HTTP requests Receiver *receiver.HttpMessageReceiver // Sender sends requests to the broker @@ -42,9 +42,9 @@ type NatsHandler struct { Options *options.Options } -// NewHandler returns a new Handler instance for the Event Publisher Proxy. -func NewNatsHandler(receiver *receiver.HttpMessageReceiver, sender *sender.NatsMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logrus.Logger) *NatsHandler { - return &NatsHandler{ +// NewHandler returns a new NATS Handler instance. +func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.NatsMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logrus.Logger) *Handler { + return &Handler{ Receiver: receiver, Sender: sender, RequestTimeout: requestTimeout, @@ -56,14 +56,14 @@ func NewNatsHandler(receiver *receiver.HttpMessageReceiver, sender *sender.NatsM } // Start starts the Handler with the given context. -func (h *NatsHandler) Start(ctx context.Context) error { +func (h *Handler) Start(ctx context.Context) error { return h.Receiver.StartListen(ctx, health.CheckHealth(h)) } // ServeHTTP serves an HTTP request and returns back an HTTP response. // It ensures that the incoming request is a valid Cloud Event, then dispatches it // to NATS and writes back the HTTP response. -func (h *NatsHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { +func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { // validate request method if request.Method != http.MethodPost && request.Method != http.MethodGet { h.Logger.Warnf("Unexpected request method: %s", request.Method) @@ -76,21 +76,21 @@ func (h *NatsHandler) ServeHTTP(writer http.ResponseWriter, request *http.Reques // Process /publish endpoint // Gets a CE and sends it to NATS - if isARequestWithCE(uri) { + if handler.IsARequestWithCE(uri) { h.publishCloudEvents(writer, request) return } // Process /:application/v1/events // Publishes a legacy event as CE v1.0 to NATS - if isARequestWithLegacyEvent(uri) { + if handler.IsARequestWithLegacyEvent(uri) { h.publishLegacyEventsAsCE(writer, request) return } // Process /:application/v1/events/subscribed // Fetches the list of subscriptions available for the given application - if isARequestForSubscriptions(uri) { + if handler.IsARequestForSubscriptions(uri) { h.SubscribedProcessor.ExtractEventsFromSubscriptions(writer, request) return } @@ -99,8 +99,8 @@ func (h *NatsHandler) ServeHTTP(writer http.ResponseWriter, request *http.Reques return } -func (h *NatsHandler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { - event := h.LegacyTransformer.TransformsLegacyRequestsToCE(writer, request) +func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { + event := h.LegacyTransformer.TransformLegacyRequestsToCE(writer, request) if event == nil { h.Logger.Debug("failed to transform legacy event to CE, event is nil") return @@ -114,7 +114,7 @@ func (h *NatsHandler) publishLegacyEventsAsCE(writer http.ResponseWriter, reques h.Logger.Infof("Event dispatched id:[%s] statusCode:[%d] duration:[%s] responseBody:[%s]", event.ID(), statusCode, dispatchTime, respBody) } -func (h *NatsHandler) publishCloudEvents(writer http.ResponseWriter, request *http.Request) { +func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.Request) { ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) defer cancel() @@ -142,7 +142,7 @@ func (h *NatsHandler) publishCloudEvents(writer http.ResponseWriter, request *ht } // writeResponse writes the HTTP response given the status code and response body. -func (h *NatsHandler) writeResponse(writer http.ResponseWriter, statusCode int, respBody []byte) { +func (h *Handler) writeResponse(writer http.ResponseWriter, statusCode int, respBody []byte) { writer.WriteHeader(statusCode) if respBody == nil { @@ -154,7 +154,7 @@ func (h *NatsHandler) writeResponse(writer http.ResponseWriter, statusCode int, } // receive applies the default values (if any) to the given Cloud Event. -func (h *NatsHandler) receive(ctx context.Context, event *cev2event.Event) { +func (h *Handler) receive(ctx context.Context, event *cev2event.Event) { if h.Defaulter != nil { newEvent := h.Defaulter(ctx, *event) event = &newEvent @@ -164,7 +164,7 @@ func (h *NatsHandler) receive(ctx context.Context, event *cev2event.Event) { } // send dispatches the given Cloud Event to NATS and returns the response details and dispatch time. -func (h *NatsHandler) send(ctx context.Context, event *cev2event.Event) (int, time.Duration, []byte) { +func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.Duration, []byte) { start := time.Now() resp, err := h.Sender.Send(ctx, event) dispatchTime := time.Since(start) diff --git a/pkg/handler/nats/handler_test.go b/pkg/handler/nats/handler_test.go new file mode 100644 index 0000000..204f234 --- /dev/null +++ b/pkg/handler/nats/handler_test.go @@ -0,0 +1,306 @@ +package nats + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "os" + "reflect" + "testing" + "time" + + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/dynamic/dynamicinformer" + dynamicfake "k8s.io/client-go/dynamic/fake" + + "github.com/nats-io/nats-server/v2/server" + "github.com/nats-io/nats.go" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/assert" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" + eventingtesting "github.com/kyma-project/kyma/components/eventing-controller/testing" +) + +type Test struct { + logger *logrus.Logger + natsConfig *env.NatsConfig + natsServer *server.Server + natsUrl string + healthEndpoint string +} + +func (test *Test) init() { + port := testingutils.GeneratePortOrDie() + natsPort := testingutils.GeneratePortOrDie() + + test.logger = logrus.New() + test.natsConfig = newEnvConfig(port, natsPort) + test.natsServer = eventingtesting.RunNatsServerOnPort(natsPort) + test.natsUrl = test.natsServer.ClientURL() + test.healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) +} + +func (test *Test) setupResources(t *testing.T, subscription *eventingv1alpha1.Subscription, applicationName string) context.CancelFunc { + // a cancelable context to be used + ctx, cancel := context.WithCancel(context.Background()) + + // configure message receiver + messageReceiver := receiver.NewHttpMessageReceiver(test.natsConfig.Port) + assert.NotNil(t, messageReceiver) + + // create a Nats sender + msgSender := sender.NewNatsMessageSender(ctx, test.natsUrl, test.logger) + assert.NotNil(t, msgSender) + + // configure legacyTransformer + appLister := handlertest.NewApplicationListerOrDie(ctx, applicationName) + legacyTransformer := legacy.NewTransformer( + test.natsConfig.ToConfig().BEBNamespace, + test.natsConfig.ToConfig().EventTypePrefix, + appLister, + ) + + // Setting up fake informers + scheme := runtime.NewScheme() + if err := corev1.AddToScheme(scheme); err != nil { + t.Fatalf("failed to add corev1 to scheme: %v", err) + } + if err := eventingv1alpha1.AddToScheme(scheme); err != nil { + t.Fatalf("failed to add eventing v1alpha1 to scheme: %v", err) + } + + subUnstructuredMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(subscription) + if err != nil { + t.Fatalf("failed to convert subscription to unstructured obj: %v", err) + } + // Creating unstructured subscriptions + subUnstructured := &unstructured.Unstructured{ + Object: subUnstructuredMap, + } + // Setting Kind information in unstructured subscription + subscriptionGVK := schema.GroupVersionKind{ + Group: subscribed.GVR.Group, + Version: subscribed.GVR.Version, + Kind: "Subscription", + } + subUnstructured.SetGroupVersionKind(subscriptionGVK) + // Configuring fake dynamic client + dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subUnstructured) + + dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, 10*time.Second, v1.NamespaceAll, nil) + genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) + t.Logf("Waiting for cache to resync") + informers.WaitForCacheSyncOrDie(ctx, dFilteredSharedInfFactory) + t.Logf("Informers resynced successfully") + subLister := genericInf.Lister() + subscribedProcessor := &subscribed.Processor{ + SubscriptionLister: &subLister, + Config: test.natsConfig.ToConfig(), + Logger: logrus.New(), + } + + // start handler which blocks until it receives a shutdown signal + opts := &options.Options{MaxRequestSize: 65536} + natsHandler := NewHandler(messageReceiver, msgSender, test.natsConfig.RequestTimeout, legacyTransformer, opts, subscribedProcessor, test.logger) + assert.NotNil(t, natsHandler) + go func() { + if err := natsHandler.Start(ctx); err != nil { + t.Errorf("Failed to start handler with error: %v", err) + } + }() + + // wait that the embedded servers are started + testingutils.WaitForHandlerToStart(t, test.healthEndpoint) + + return cancel +} + +func (test *Test) cleanup() { + test.natsServer.Shutdown() +} + +var test = Test{} + +func TestMain(m *testing.M) { + test.init() + code := m.Run() + test.cleanup() + os.Exit(code) +} + +func TestNatsHandlerForCloudEvents(t *testing.T) { + exec := func(t *testing.T, applicationName, expectedNatsSubject string) { + test.logger.Info("TestNatsHandlerForCloudEvents started") + + // setup test environment + publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", test.natsConfig.Port) + subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, testingutils.CloudEventTypeNotClean)) + cancel := test.setupResources(t, subscription, applicationName) + defer cancel() + + // prepare event type from subscription + assert.NotNil(t, subscription.Spec.Filter) + assert.NotEmpty(t, subscription.Spec.Filter.Filters) + eventType := subscription.Spec.Filter.Filters[0].EventType.Value + + // publish a message to NATS and validate it + connection := connectToNatsOrFail(t, test.natsUrl) + validator := validateNatsSubject(t, expectedNatsSubject) + subscribeToEventOrFail(t, connection, eventType, validator) + + // run the tests for publishing cloudevents + for _, testCase := range handlertest.TestCasesForCloudEvents { + t.Run(testCase.Name, func(t *testing.T) { + body, headers := testCase.ProvideMessage() + resp, err := testingutils.SendEvent(publishEndpoint, body, headers) + if err != nil { + t.Errorf("Failed to send event with error: %v", err) + } + _ = resp.Body.Close() + if testCase.WantStatusCode != resp.StatusCode { + t.Errorf("Test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) + } + }) + } + } + + // make sure not to change the cloudevent, even if its event-type contains none-alphanumeric characters + exec(t, testingutils.ApplicationName, testingutils.CloudEventTypeNotClean) + exec(t, testingutils.ApplicationNameNotClean, testingutils.CloudEventTypeNotClean) +} + +func TestNatsHandlerForLegacyEvents(t *testing.T) { + exec := func(t *testing.T, applicationName string, expectedNatsSubject string) { + test.logger.Info("TestNatsHandlerForLegacyEvents started") + + // setup test environment + publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/%s/v1/events", test.natsConfig.Port, applicationName) + subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, testingutils.CloudEventTypeNotClean)) + cancel := test.setupResources(t, subscription, applicationName) + defer cancel() + + // prepare event type from subscription + assert.NotNil(t, subscription.Spec.Filter) + assert.NotEmpty(t, subscription.Spec.Filter.Filters) + eventType := subscription.Spec.Filter.Filters[0].EventType.Value + + // publish a message to NATS and validate it + connection := connectToNatsOrFail(t, test.natsUrl) + validator := validateNatsSubject(t, expectedNatsSubject) + subscribeToEventOrFail(t, connection, eventType, validator) + + // run the tests for publishing legacy events + for _, testCase := range handlertest.TestCasesForLegacyEvents { + t.Run(testCase.Name, func(t *testing.T) { + body, headers := testCase.ProvideMessage() + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + if err != nil { + t.Fatalf("Failed to send event with error: %v", err) + } + + if testCase.WantStatusCode != resp.StatusCode { + t.Fatalf("Test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) + } + + if testCase.WantStatusCode == http.StatusOK { + handlertest.ValidateOkResponse(t, *resp, &testCase.WantResponse) + } else { + handlertest.ValidateErrorResponse(t, *resp, &testCase.WantResponse) + } + }) + } + } + + // make sure to clean the legacy event, so that its event-type is free from none-alphanumeric characters + exec(t, testingutils.ApplicationName, testingutils.CloudEventType) + exec(t, testingutils.ApplicationNameNotClean, testingutils.CloudEventType) +} + +func TestNatsHandlerForSubscribedEndpoint(t *testing.T) { + test.logger.Info("TestNatsHandlerForSubscribedEndpoint started") + + // setup test environment + subscribedEndpointFormat := "http://localhost:%d/%s/v1/events/subscribed" + subscription := testingutils.NewSubscription() + cancel := test.setupResources(t, subscription, testingutils.ApplicationName) + defer cancel() + + // run the tests for subscribed endpoint + for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { + t.Run(testCase.Name, func(t *testing.T) { + subscribedURL := fmt.Sprintf(subscribedEndpointFormat, test.natsConfig.Port, testCase.AppName) + resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) + if err != nil { + t.Fatalf("failed to send event with error: %v", err) + } + + if testCase.WantStatusCode != resp.StatusCode { + t.Fatalf("test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) + } + defer func() { _ = resp.Body.Close() }() + respBodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Errorf("failed to convert body to bytes: %v", err) + } + gotEventsResponse := subscribed.Events{} + err = json.Unmarshal(respBodyBytes, &gotEventsResponse) + if err != nil { + t.Errorf("failed to unmarshal body bytes to events response: %v", err) + } + if !reflect.DeepEqual(testCase.WantResponse, gotEventsResponse) { + t.Errorf("incorrect response, wanted: %v, got: %v", testCase.WantResponse, gotEventsResponse) + } + }) + } +} + +func newEnvConfig(port, natsPort int) *env.NatsConfig { + return &env.NatsConfig{ + Port: port, + NatsPublishURL: fmt.Sprintf("http://localhost:%d", natsPort), + RequestTimeout: 2 * time.Second, + LegacyNamespace: testingutils.MessagingNamespace, + LegacyEventTypePrefix: testingutils.MessagingEventTypePrefix, + } +} + +func connectToNatsOrFail(t *testing.T, natsUrl string) *nats.Conn { + connection, err := nats.Connect(natsUrl, nats.RetryOnFailedConnect(true), nats.MaxReconnects(3), nats.ReconnectWait(time.Second)) + if err != nil { + t.Fatalf("Failed to connect to NATS server with error: %v", err) + } + if connection.Status() != nats.CONNECTED { + t.Fatal("Failed to connect to NATS server") + } + return connection +} + +func subscribeToEventOrFail(t *testing.T, connection *nats.Conn, eventType string, validator nats.MsgHandler) { + if _, err := connection.Subscribe(eventType, validator); err != nil { + t.Fatalf("Failed to subscribe to event with error: %v", err) + } +} + +func validateNatsSubject(t *testing.T, subject string) nats.MsgHandler { + return func(msg *nats.Msg) { + if msg != nil && msg.Subject != subject { + t.Errorf("invalid NATS subject, expected [%s] but found [%s]", subject, msg.Subject) + } + } +} diff --git a/pkg/handler/nats_test.go b/pkg/handler/nats_test.go deleted file mode 100644 index bce5501..0000000 --- a/pkg/handler/nats_test.go +++ /dev/null @@ -1,207 +0,0 @@ -package handler - -import ( - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "reflect" - "testing" - "time" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" - eventingtesting "github.com/kyma-project/kyma/components/eventing-controller/testing" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/assert" - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/client-go/dynamic/dynamicinformer" - dynamicfake "k8s.io/client-go/dynamic/fake" -) - -func TestNatsHandler(t *testing.T) { - t.Parallel() - - logger := logrus.New() - logger.Info("TestNatsHandler started") - - // a cancelable context to be used - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - port, err := testingutils.GeneratePort() - if err != nil { - t.Fatalf("failed to generate ingress port: %v", err) - } - natsPort, err := testingutils.GeneratePort() - if err != nil { - t.Fatalf("failed to generate Nats port: %v", err) - } - cfgNats := newEnvConfig(port, natsPort) - - // configure message receiver - messageReceiver := receiver.NewHttpMessageReceiver(cfgNats.Port) - assert.NotNil(t, messageReceiver) - - // Start Nats server - natsServer := eventingtesting.RunNatsServerOnPort(cfgNats.Port + 1) - assert.NotNil(t, natsServer) - defer natsServer.Shutdown() - - // create a Nats sender - natsUrl := natsServer.ClientURL() - assert.NotEmpty(t, natsUrl) - msgSender := sender.NewNatsMessageSender(ctx, natsUrl, logger) - - // configure legacyTransformer - legacyTransformer := legacy.NewTransformer( - cfgNats.ToConfig().BEBNamespace, - cfgNats.ToConfig().EventTypePrefix, - ) - - // Setting up fake informers - scheme := runtime.NewScheme() - if err := corev1.AddToScheme(scheme); err != nil { - t.Fatalf("failed to add corev1 to scheme: %v", err) - } - if err := eventingv1alpha1.AddToScheme(scheme); err != nil { - t.Fatalf("failed to add eventing v1alpha1 to scheme: %v", err) - } - subscription := testingutils.NewSubscription() - - subUnstructuredMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(subscription) - if err != nil { - t.Fatalf("failed to convert subscription to unstructured obj: %v", err) - } - // Creating unstructured subscriptions - subUnstructured := &unstructured.Unstructured{ - Object: subUnstructuredMap, - } - // Setting Kind information in unstructured subscription - subscriptionGVK := schema.GroupVersionKind{ - Group: subscribed.GVR.Group, - Version: subscribed.GVR.Version, - Kind: "Subscription", - } - subUnstructured.SetGroupVersionKind(subscriptionGVK) - // Configuring fake dynamic client - dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subUnstructured) - - dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, - 10*time.Second, - v1.NamespaceAll, - nil, - ) - genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) - t.Logf("Waiting for cache to resync") - subscribed.WaitForCacheSyncOrDie(ctx, dFilteredSharedInfFactory) - t.Logf("Informers resynced successfully") - subLister := genericInf.Lister() - subscribedProcessor := &subscribed.Processor{ - SubscriptionLister: &subLister, - Config: cfgNats.ToConfig(), - Logger: logrus.New(), - } - - // start handler which blocks until it receives a shutdown signal - opts := &options.Options{MaxRequestSize: 65536} - natsHandler := NewNatsHandler(messageReceiver, msgSender, cfgNats.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logger) - assert.NotNil(t, natsHandler) - go func() { - if err := natsHandler.Start(ctx); err != nil { - t.Errorf("Failed to start handler with error: %v", err) - } - }() - - // test environment - healthEndpoint := fmt.Sprintf("http://localhost:%d/healthz", port) - publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", port) - publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/app/v1/events", port) - subscribedEndpointFormat := "http://localhost:%d/%s/v1/events/subscribed" - // wait that the embedded servers are started - testingutils.WaitForHandlerToStart(t, healthEndpoint) - - // run the tests for publishing cloudevents - for _, testCase := range testCasesForCloudEvents { - t.Run(testCase.name, func(t *testing.T) { - body, headers := testCase.provideMessage() - resp, err := testingutils.SendEvent(publishEndpoint, body, headers) - if err != nil { - t.Errorf("Failed to send event with error: %v", err) - } - _ = resp.Body.Close() - if testCase.wantStatusCode != resp.StatusCode { - t.Errorf("Test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) - } - }) - } - // run the tests for publishing legacy events - for _, testCase := range testCasesForLegacyEvents { - t.Run(testCase.name, func(t *testing.T) { - body, headers := testCase.provideMessage() - - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - if err != nil { - t.Errorf("Failed to send event with error: %v", err) - } - - if testCase.wantStatusCode != resp.StatusCode { - t.Errorf("Test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) - } - - if testCase.wantStatusCode == http.StatusOK { - testingutils.ValidateOkResponse(t, *resp, &testCase.wantResponse) - } else { - testingutils.ValidateErrorResponse(t, *resp, &testCase.wantResponse) - } - }) - } - // run the tests for subscribed endpoint - for _, testCase := range testCasesForSubscribedEndpoint { - t.Run(testCase.name, func(t *testing.T) { - subscribedURL := fmt.Sprintf(subscribedEndpointFormat, port, testCase.appName) - resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) - if err != nil { - t.Errorf("failed to send event with error: %v", err) - } - - if testCase.wantStatusCode != resp.StatusCode { - t.Errorf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) - } - defer func() { _ = resp.Body.Close() }() - respBodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Errorf("failed to convert body to bytes: %v", err) - } - gotEventsResponse := subscribed.Events{} - err = json.Unmarshal(respBodyBytes, &gotEventsResponse) - if err != nil { - t.Errorf("failed to unmarshal body bytes to events response: %v", err) - } - if !reflect.DeepEqual(testCase.wantResponse, gotEventsResponse) { - t.Errorf("incorrect response, wanted: %v, got: %v", testCase.wantResponse, gotEventsResponse) - } - }) - } -} - -func newEnvConfig(port, natsPort int) *env.NatsConfig { - return &env.NatsConfig{ - Port: port, - NatsPublishURL: fmt.Sprintf("http://localhost:%d", natsPort), - RequestTimeout: 2 * time.Second, - LegacyNamespace: "/beb.namespace", - LegacyEventTypePrefix: "event.type.prefix", - } -} diff --git a/pkg/informers/sync.go b/pkg/informers/sync.go new file mode 100644 index 0000000..96bd13a --- /dev/null +++ b/pkg/informers/sync.go @@ -0,0 +1,60 @@ +package informers + +import ( + "context" + "log" + "time" + + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/dynamic/dynamicinformer" +) + +const ( + DefaultResyncPeriod = 10 * time.Second +) + +type waitForCacheSyncFunc func(stopCh <-chan struct{}) map[schema.GroupVersionResource]bool + +// WaitForCacheSyncOrDie waits for the cache to sync. If sync fails everything stops +func WaitForCacheSyncOrDie(ctx context.Context, dc dynamicinformer.DynamicSharedInformerFactory) { + dc.Start(ctx.Done()) + + ctx, cancel := context.WithTimeout(context.Background(), DefaultResyncPeriod) + defer cancel() + + err := hasSynced(ctx, dc.WaitForCacheSync) + if err != nil { + log.Fatalf("Failed to sync informer caches: %v", err) + } +} + +func hasSynced(ctx context.Context, fn waitForCacheSyncFunc) error { + // synced gets closed as soon as fn returns + synced := make(chan struct{}) + // closing stopWait forces fn to return, which happens whenever ctx + // gets canceled + stopWait := make(chan struct{}) + defer close(stopWait) + + // close the synced channel if the `WaitForCacheSync()` finished the execution cleanly + go func() { + informersCacheSync := fn(stopWait) + res := true + for _, sync := range informersCacheSync { + if !sync { + res = false + } + } + if res { + close(synced) + } + }() + + select { + case <-ctx.Done(): + return ctx.Err() + case <-synced: + } + + return nil +} diff --git a/pkg/legacy-events/constants.go b/pkg/legacy-events/constants.go index 843a33b..a591544 100644 --- a/pkg/legacy-events/constants.go +++ b/pkg/legacy-events/constants.go @@ -21,7 +21,6 @@ const ( ErrorTypeMissingField = "missing_field" ErrorTypeValidationViolation = "validation_violation" ErrorTypeInvalidField = "invalid_field" - ErrorTypeInternalServer = "internal_server" ) // Field definition diff --git a/pkg/legacy-events/error_responses.go b/pkg/legacy-events/error_responses.go index 118c6ba..5ade8e8 100644 --- a/pkg/legacy-events/error_responses.go +++ b/pkg/legacy-events/error_responses.go @@ -61,6 +61,11 @@ func ErrorResponseMissingFieldData() (response *api.PublishEventResponses) { return CreateMissingFieldError(FieldData) } +// ErrorResponse returns an error of type PublishEventResponses with the given status and error +func ErrorResponse(status int, err error) *api.PublishEventResponses { + return &api.PublishEventResponses{Error: &api.Error{Status: status, Message: err.Error()}} +} + //CreateMissingFieldError create an error for a missing field func CreateMissingFieldError(field interface{}) (response *api.PublishEventResponses) { apiErrorDetail := api.ErrorDetail{Field: field.(string), Type: ErrorTypeMissingField, Message: ErrorMessageMissingField, MoreInfo: ""} diff --git a/pkg/legacy-events/helpers.go b/pkg/legacy-events/helpers.go index 431861f..583804a 100644 --- a/pkg/legacy-events/helpers.go +++ b/pkg/legacy-events/helpers.go @@ -1,14 +1,14 @@ package legacy import ( + "encoding/json" "fmt" + "net/http" + "strings" - api "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" log "github.com/sirupsen/logrus" - "encoding/json" - "net/http" - "strings" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" ) // ParseApplicationNameFromPath returns application name from the URL. @@ -51,6 +51,5 @@ func writeJSONResponse(w http.ResponseWriter, resp *api.PublishEventResponses) { // formatEventType4BEB format eventType as per BEB spec func formatEventType4BEB(eventTypePrefix, app, eventType, version string) string { - eventType4BEB := fmt.Sprintf(eventTypePrefixFormat, eventTypePrefix, app, eventType, version) - return strings.ReplaceAll(eventType4BEB, "-", ".") + return fmt.Sprintf(eventTypePrefixFormat, eventTypePrefix, app, eventType, version) } diff --git a/pkg/legacy-events/helpers_test.go b/pkg/legacy-events/helpers_test.go index 237a27f..9def2c1 100644 --- a/pkg/legacy-events/helpers_test.go +++ b/pkg/legacy-events/helpers_test.go @@ -50,7 +50,7 @@ func TestFormatEventType4BEB(t *testing.T) { app: "app", eventType: "order-foo", version: "v1", - wantedEventType: "prefix.app.order.foo.v1", + wantedEventType: "prefix.app.order-foo.v1", }, } diff --git a/pkg/legacy-events/legacy.go b/pkg/legacy-events/legacy.go index f0b1181..cd91ffa 100644 --- a/pkg/legacy-events/legacy.go +++ b/pkg/legacy-events/legacy.go @@ -8,15 +8,17 @@ import ( cev2event "github.com/cloudevents/sdk-go/v2/event" "github.com/google/uuid" - apiv1 "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" "github.com/pkg/errors" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + apiv1 "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" ) var ( isValidEventTypeVersion = regexp.MustCompile(AllowedEventTypeVersionChars).MatchString isValidEventID = regexp.MustCompile(AllowedEventIDChars).MatchString // eventTypePrefixFormat is driven by BEB specification. - // An eventtype must have atleast 4 segments separated by dots in the form of: + // An EventType must have at least 4 segments separated by dots in the form of: // ... eventTypePrefixFormat = "%s.%s.%s.%s" ) @@ -27,14 +29,16 @@ const ( ) type Transformer struct { - bebNamespace string - eventTypePrefix string + bebNamespace string + eventTypePrefix string + applicationLister *application.Lister } -func NewTransformer(bebNamespace string, eventTypePrefix string) *Transformer { +func NewTransformer(bebNamespace string, eventTypePrefix string, applicationLister *application.Lister) *Transformer { return &Transformer{ - bebNamespace: bebNamespace, - eventTypePrefix: eventTypePrefix, + bebNamespace: bebNamespace, + eventTypePrefix: eventTypePrefix, + applicationLister: applicationLister, } } @@ -72,20 +76,17 @@ func (t Transformer) checkParameters(parameters *apiv1.PublishEventParametersV1) return &apiv1.PublishEventResponses{} } -func (t Transformer) TransformsLegacyRequestsToCE(writer http.ResponseWriter, request *http.Request) *cev2event.Event { - +func (t Transformer) TransformLegacyRequestsToCE(writer http.ResponseWriter, request *http.Request) *cev2event.Event { // parse request body to PublishRequestV1 if request.Body == nil || request.ContentLength == 0 { resp := ErrorResponseBadRequest(ErrorMessageBadPayload) writeJSONResponse(writer, resp) return nil } - appName := ParseApplicationNameFromPath(request.URL.Path) - var err error + parameters := &apiv1.PublishEventParametersV1{} decoder := json.NewDecoder(request.Body) - err = decoder.Decode(¶meters.PublishrequestV1) - if err != nil { + if err := decoder.Decode(¶meters.PublishrequestV1); err != nil { var resp *apiv1.PublishEventResponses if err.Error() == requestBodyTooLargeErrorMessage { resp = ErrorResponseRequestBodyTooLarge(err.Error()) @@ -103,14 +104,19 @@ func (t Transformer) TransformsLegacyRequestsToCE(writer http.ResponseWriter, re return nil } - response := &apiv1.PublishEventResponses{} + // clean the application name form non-alphanumeric characters + applicationName := ParseApplicationNameFromPath(request.URL.Path) + app, err := t.applicationLister.Get(applicationName) + if err != nil { + response := ErrorResponse(http.StatusInternalServerError, err) + writeJSONResponse(writer, response) + return nil + } + applicationName = application.CleanName(app) - event, err := t.convertPublishRequestToCloudEvent(appName, parameters) + event, err := t.convertPublishRequestToCloudEvent(applicationName, parameters) if err != nil { - response.Error = &apiv1.Error{ - Status: http.StatusInternalServerError, - Message: err.Error(), - } + response := ErrorResponse(http.StatusInternalServerError, err) writeJSONResponse(writer, response) return nil } @@ -138,6 +144,10 @@ func (t Transformer) TransformsCEResponseToLegacyResponse(writer http.ResponseWr // convertPublishRequestToCloudEvent converts the given publish request to a CloudEvent. func (t Transformer) convertPublishRequestToCloudEvent(appName string, publishRequest *apiv1.PublishEventParametersV1) (*cev2event.Event, error) { + if !application.IsCleanName(appName) { + return nil, errors.New("application name should be cleaned from none-alphanumeric characters") + } + event := cev2event.New(cev2event.CloudEventsVersionV1) evTime, err := time.Parse(time.RFC3339, publishRequest.PublishrequestV1.EventTime) diff --git a/pkg/legacy-events/legacy_test.go b/pkg/legacy-events/legacy_test.go index 67c0806..871fabd 100644 --- a/pkg/legacy-events/legacy_test.go +++ b/pkg/legacy-events/legacy_test.go @@ -5,17 +5,18 @@ import ( "time" legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + . "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) func TestConvertPublishRequestToCloudEvent(t *testing.T) { - bebNs := "/beb.namespace" - eventTypePrefix := "event.type.prefix" - legacyTransformer := NewTransformer(bebNs, eventTypePrefix) - eventID := "id" - appName := "foo-app" - legacyEventType := "foo.bar" - legacyEventVersion := "v1" - data := "{\"foo\": \"bar\"}" + bebNs := MessagingNamespace + eventTypePrefix := MessagingEventTypePrefix + legacyTransformer := NewTransformer(bebNs, eventTypePrefix, nil) + eventID := EventID + appName := ApplicationName + legacyEventType := LegacyEventType + legacyEventVersion := LegacyEventTypeVersion + data := LegacyEventData timeNow := time.Now() expectedEventType := formatEventType4BEB(eventTypePrefix, appName, legacyEventType, legacyEventVersion) timeNowStr := timeNow.Format(time.RFC3339) diff --git a/pkg/receiver/receiver_test.go b/pkg/receiver/receiver_test.go index 3c7ccab..82d83b3 100644 --- a/pkg/receiver/receiver_test.go +++ b/pkg/receiver/receiver_test.go @@ -18,10 +18,7 @@ func (h *testHandler) ServeHTTP(http.ResponseWriter, *http.Request) {} var _ http.Handler = (*testHandler)(nil) func TestNewHttpMessageReceiver(t *testing.T) { - port, err := testingutils.GeneratePort() - if err != nil { - t.Fatalf("failed to generate port: %v", err) - } + port := testingutils.GeneratePortOrDie() r := NewHttpMessageReceiver(port) if r == nil { t.Fatalf("Could not create HttpMessageReceiver") @@ -31,22 +28,23 @@ func TestNewHttpMessageReceiver(t *testing.T) { } } -// Test that tht receiver shuts down properly then receiving stop signal +// Test that the receiver shutdown when receiving stop signal func TestStartListener(t *testing.T) { timeout := time.Second * 10 r := fixtureReceiver() ctx := context.Background() + // used to simulate sending a stop signal ctx, cancelFunc := context.WithCancel(ctx) // start receiver wg := sync.WaitGroup{} - started := make(chan bool, 1) - defer close(started) + start := make(chan bool, 1) + defer close(start) go func(t *testing.T) { wg.Add(1) - started <- true + start <- true t.Log("starting receiver in goroutine") if err := r.StartListen(ctx, &testHandler{}); err != nil { t.Fatalf("error while starting HTTPMessageReceiver: %v", err) @@ -55,8 +53,8 @@ func TestStartListener(t *testing.T) { wg.Done() }(t) - // wait for receiver to start - <-started + // wait for goroutine to start + <-start // stop it cancelFunc() @@ -66,14 +64,13 @@ func TestStartListener(t *testing.T) { wg.Wait() }() - // wait for it t.Log("Waiting for receiver to stop") select { - // receiver dit shut down properly + // receiver shutdown properly case <-c: t.Log("Waiting for receiver to stop [done]") break - // receiver dit shut down in time + // receiver shutdown in time case <-time.Tick(timeout): t.Fatalf("Expected receiver to shutdown after timeout: %v\n", timeout) } diff --git a/pkg/sender/nats_test.go b/pkg/sender/nats_test.go index 80ca5c7..c245c01 100644 --- a/pkg/sender/nats_test.go +++ b/pkg/sender/nats_test.go @@ -5,19 +5,19 @@ import ( "encoding/json" "fmt" "net/http" + "testing" + "time" cloudevents "github.com/cloudevents/sdk-go/v2" "github.com/go-logr/logr" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" - "github.com/kyma-project/kyma/components/eventing-controller/pkg/env" - "github.com/kyma-project/kyma/components/eventing-controller/pkg/handlers" - eventingtesting "github.com/kyma-project/kyma/components/eventing-controller/testing" "github.com/nats-io/nats.go" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" - "testing" - "time" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + "github.com/kyma-project/kyma/components/eventing-controller/pkg/env" + "github.com/kyma-project/kyma/components/eventing-controller/pkg/handlers" + eventingtesting "github.com/kyma-project/kyma/components/eventing-controller/testing" ) func TestNatsSender(t *testing.T) { @@ -68,7 +68,7 @@ func TestNatsSender(t *testing.T) { } // Create a subscription - sub := eventingtesting.NewSubscription("sub", "foo", eventingtesting.WithFilterForNats) + sub := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, testingutils.CloudEventType)) sub.Spec.Sink = subscriberReceiveURL err = natsClient.SyncSubscription(sub) if err != nil { @@ -81,7 +81,7 @@ func TestNatsSender(t *testing.T) { err = json.Unmarshal([]byte(ce), &event) assert.Nil(t, err) // set ce event type the same as the event type from subscription's filter. The Nats subject is defined by ce.Type - event.SetType("kyma.ev2.poc.event1.v1") + event.SetType(testingutils.CloudEventType) // send the event c, err := sender.Send(ctx, &event) @@ -89,7 +89,7 @@ func TestNatsSender(t *testing.T) { assert.Equal(t, c, http.StatusNoContent) // Check for the event - expectedDataInStore := fmt.Sprintf("\"%s\"", "{\\\"foo\\\":\\\"bar\\\"}") + expectedDataInStore := fmt.Sprintf(`"%s"`, testingutils.CloudEventData) err = subscriber.CheckEvent(expectedDataInStore, subscriberCheckURL) if err != nil { t.Errorf("subscriber did not receive the event: %v", err) diff --git a/pkg/subscribed/helpers.go b/pkg/subscribed/helpers.go index 7284e2d..5dc768c 100644 --- a/pkg/subscribed/helpers.go +++ b/pkg/subscribed/helpers.go @@ -1,13 +1,9 @@ package subscribed import ( - "context" "fmt" - "log" "strings" - "time" - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" @@ -15,10 +11,9 @@ import ( "k8s.io/client-go/dynamic" "k8s.io/client-go/dynamic/dynamicinformer" "k8s.io/client-go/rest" -) -const ( - DefaultResyncPeriod = 10 * time.Second + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) var ( @@ -29,7 +24,7 @@ var ( } ) -// ConvertRuntimeObjToSubscription converts a runtime.Object to a Subscription object by converting to Unstructed in between +// ConvertRuntimeObjToSubscription converts a runtime.Object to a Subscription object by converting to unstructured in between func ConvertRuntimeObjToSubscription(sObj runtime.Object) (*eventingv1alpha1.Subscription, error) { sub := &eventingv1alpha1.Subscription{} if subUnstructured, ok := sObj.(*unstructured.Unstructured); ok { @@ -45,7 +40,7 @@ func ConvertRuntimeObjToSubscription(sObj runtime.Object) (*eventingv1alpha1.Sub func GenerateSubscriptionInfFactory(k8sConfig *rest.Config) dynamicinformer.DynamicSharedInformerFactory { subDynamicClient := dynamic.NewForConfigOrDie(k8sConfig) dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(subDynamicClient, - DefaultResyncPeriod, + informers.DefaultResyncPeriod, v1.NamespaceAll, nil, ) @@ -53,56 +48,10 @@ func GenerateSubscriptionInfFactory(k8sConfig *rest.Config) dynamicinformer.Dyna return dFilteredSharedInfFactory } -type waitForCacheSyncFunc func(stopCh <-chan struct{}) map[schema.GroupVersionResource]bool - -// WaitForCacheSyncOrDie waits for the cache to sync. If sync fails everything stops -func WaitForCacheSyncOrDie(ctx context.Context, dc dynamicinformer.DynamicSharedInformerFactory) { - dc.Start(ctx.Done()) - - ctx, cancel := context.WithTimeout(context.Background(), DefaultResyncPeriod) - defer cancel() - - err := hasSynced(ctx, dc.WaitForCacheSync) - if err != nil { - log.Fatalf("Failed to sync informer caches: %v", err) - } -} - -func hasSynced(ctx context.Context, fn waitForCacheSyncFunc) error { - // synced gets closed as soon as fn returns - synced := make(chan struct{}) - // closing stopWait forces fn to return, which happens whenever ctx - // gets canceled - stopWait := make(chan struct{}) - defer close(stopWait) - - // close the synced channel if the `WaitForCacheSync()` finished the execution cleanly - go func() { - informersCacheSync := fn(stopWait) - res := true - for _, sync := range informersCacheSync { - if !sync { - res = false - } - } - if res { - close(synced) - } - }() - - select { - case <-ctx.Done(): - return ctx.Err() - case <-synced: - } - - return nil -} - // ConvertEventsMapToSlice converts a map of Events to a slice of Events func ConvertEventsMapToSlice(eventsMap map[Event]bool) []Event { result := make([]Event, 0) - for k, _ := range eventsMap { + for k := range eventsMap { result = append(result, k) } return result diff --git a/testing/fixtures.go b/testing/fixtures.go index 541d235..6eb741d 100644 --- a/testing/fixtures.go +++ b/testing/fixtures.go @@ -1,118 +1,122 @@ package testing const ( + ApplicationName = "testapp1023" + ApplicationNameNotClean = "test.app_1-0+2=3" + + // messaging system properties + MessagingNamespace = "/messaging.namespace" + MessagingEventTypePrefix = "sap.kyma" + + // event properties + EventID = "8945ec08-256b-11eb-9928-acde48001122" + CloudEventType = MessagingEventTypePrefix + "." + ApplicationName + ".order.created.v1" + CloudEventTypeNotClean = MessagingEventTypePrefix + "." + ApplicationNameNotClean + ".order.created.v1" + CloudEventSource = "/default/sap.kyma/id" + CloudEventSpecVersion = "1.0" + CloudEventData = `{\"key\":\"value\"}` + CloudEventDataContentType = "application/json" + LegacyEventType = "order.created" + LegacyEventTypeVersion = "v1" + LegacyEventTime = "2020-04-02T21:37:00Z" + LegacyEventData = `{"key": "value"}` + StructuredCloudEventPayloadWithoutID = `{ - "type":"someType", - "specversion":"1.0", - "source":"someSource", - "data":"{\"foo\":\"bar\"}", - "datacontenttype":"application/json" - }` + "type":"` + CloudEventTypeNotClean + `", + "specversion":"` + CloudEventSpecVersion + `", + "source":"` + CloudEventSource + `", + "data":"` + CloudEventData + `", + "datacontenttype":"` + CloudEventDataContentType + `" + }` StructuredCloudEventPayloadWithoutType = `{ - "id":"00000", - "specversion":"1.0", - "source":"someSource", - "data":"{\"foo\":\"bar\"}", - "datacontenttype":"application/json" - }` + "id":"` + EventID + `", + "specversion":"` + CloudEventSpecVersion + `", + "source":"` + CloudEventSource + `", + "data":"` + CloudEventData + `", + "datacontenttype":"` + CloudEventDataContentType + `" + }` StructuredCloudEventPayloadWithoutSpecVersion = `{ - "id":"00000", - "type":"someType", - "source":"someSource", - "data":"{\"foo\":\"bar\"}", - "datacontenttype":"application/json" - }` + "id":"` + EventID + `", + "type":"` + CloudEventTypeNotClean + `", + "source":"` + CloudEventSource + `", + "data":"` + CloudEventData + `", + "datacontenttype":"` + CloudEventDataContentType + `" + }` StructuredCloudEventPayloadWithoutSource = `{ - "id":"00000", - "type":"someType", - "specversion":"1.0", - "data":"{\"foo\":\"bar\"}", - "datacontenttype":"application/json" - }` + "id":"` + EventID + `", + "type":"` + CloudEventTypeNotClean + `", + "specversion":"` + CloudEventSpecVersion + `", + "data":"` + CloudEventData + `", + "datacontenttype":"` + CloudEventDataContentType + `" + }` StructuredCloudEventPayload = `{ - "id":"00000", - "type":"someType", - "specversion":"1.0", - "source":"someSource", - "data":"{\"foo\":\"bar\"}", - "datacontenttype":"application/json" - }` - - BinaryCloudEventPayload = `"{\"foo\":\"bar\"}"` + "id":"` + EventID + `", + "type":"` + CloudEventTypeNotClean + `", + "specversion":"` + CloudEventSpecVersion + `", + "source":"` + CloudEventSource + `", + "data":"` + CloudEventData + `", + "datacontenttype":"` + CloudEventDataContentType + `" + }` ValidLegacyEventPayloadWithEventId = `{ - "event-id": "8945ec08-256b-11eb-9928-acde48001122", - "event-type":"someType", - "event-type-version":"v0", - "event-time": "2020-04-02T21:37:00Z", - "data": { - "foo": "bar" - } - }` + "event-id": "` + EventID + `", + "event-type":"` + LegacyEventType + `", + "event-type-version":"` + LegacyEventTypeVersion + `", + "event-time": "` + LegacyEventTime + `", + "data": ` + LegacyEventData + ` + }` ValidLegacyEventPayloadWithoutEventId = `{ - "event-type":"someType", - "event-type-version":"v0", - "event-time": "2020-04-02T21:37:00Z", - "data": { - "foo": "bar" - } - }` + "event-type":"` + LegacyEventType + `", + "event-type-version":"` + LegacyEventTypeVersion + `", + "event-time": "` + LegacyEventTime + `", + "data": ` + LegacyEventData + ` + }` LegacyEventPayloadWithInvalidEventId = `{ - "event-id":"foo-bar", - "event-type":"someType", - "event-type-version":"v0", - "event-time": "2020-04-02T21:37:00Z", - "data": { - "foo": "bar" - } - }` + "event-id":"foo-bar", + "event-type":"` + LegacyEventType + `", + "event-type-version":"` + LegacyEventTypeVersion + `", + "event-time": "` + LegacyEventTime + `", + "data": ` + LegacyEventData + ` + }` LegacyEventPayloadWithoutEventTime = `{ - "event-id":"8945ec08-256b-11eb-9928-acde48001122", - "event-type":"someType", - "event-type-version":"v0", - "data": { - "foo": "bar" - } - }` + "event-id": "` + EventID + `", + "event-type":"` + LegacyEventType + `", + "event-type-version":"` + LegacyEventTypeVersion + `", + "data": ` + LegacyEventData + ` + }` LegacyEventPayloadWithoutEventType = `{ - "event-id":"8945ec08-256b-11eb-9928-acde48001122", - "event-type-version":"v0", - "event-time": "2020-04-02T21:37:00Z", - "data": { - "foo": "bar" - } - }` + "event-id": "` + EventID + `", + "event-type-version":"` + LegacyEventTypeVersion + `", + "event-time": "` + LegacyEventTime + `", + "data": ` + LegacyEventData + ` + }` LegacyEventPayloadWithInvalidEventTime = `{ - "event-id":"8945ec08-256b-11eb-9928-acde48001122", - "event-type":"someType", - "event-type-version":"v0", - "event-time": "some time 10:23", - "data": { - "foo": "bar" - } - }` + "event-id": "` + EventID + `", + "event-type":"` + LegacyEventType + `", + "event-type-version":"` + LegacyEventTypeVersion + `", + "event-time": "some time 10:23", + "data": ` + LegacyEventData + ` + }` LegacyEventPayloadWithWithoutEventVersion = `{ - "event-id":"8945ec08-256b-11eb-9928-acde48001122", - "event-type":"someType", - "event-time": "2020-04-02T21:37:00Z", - "data": { - "foo": "bar" - } - }` + "event-id": "` + EventID + `", + "event-type":"` + LegacyEventType + `", + "event-time": "` + LegacyEventTime + `", + "data": ` + LegacyEventData + ` + }` ValidLegacyEventPayloadWithoutData = `{ - "event-id": "8945ec08-256b-11eb-9928-acde48001122", - "event-type":"someType", - "event-type-version":"v0", - "event-time": "2020-04-02T21:37:00Z" - }` + "event-id": "` + EventID + `", + "event-type":"` + LegacyEventType + `", + "event-type-version":"` + LegacyEventTypeVersion + `", + "event-time": "` + LegacyEventTime + `" + }` ) diff --git a/testing/mock_server.go b/testing/mock_server.go index 9ad4241..ca14230 100644 --- a/testing/mock_server.go +++ b/testing/mock_server.go @@ -8,11 +8,15 @@ import ( "time" ) +// Validator is used to validate incoming requests to the mock server +type Validator func(r *http.Request) error + type MockServer struct { server *httptest.Server responseTime time.Duration // server response time expiresInSec int // token expiry in seconds generatedTokensCount int // generated tokens count + validator Validator // validate the received requests form publishers } func NewMockServer(opts ...MockServerOption) *MockServer { @@ -37,6 +41,12 @@ func WithResponseTime(responseTime time.Duration) MockServerOption { } } +func WithValidator(validator Validator) MockServerOption { + return func(m *MockServer) { + m.validator = validator + } +} + func (m *MockServer) Start(t *testing.T, tokenEndpoint, eventsEndpoint, eventsWithHTTP400 string) { m.server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { time.Sleep(m.responseTime) @@ -52,13 +62,24 @@ func (m *MockServer) Start(t *testing.T, tokenEndpoint, eventsEndpoint, eventsWi } case eventsEndpoint: { + if err := m.validateRequest(r); err != nil { + t.Errorf("request validatation failed with error: %v", err) + w.WriteHeader(http.StatusInternalServerError) + return + } + w.WriteHeader(http.StatusNoContent) } case eventsWithHTTP400: { + if err := m.validateRequest(r); err != nil { + t.Errorf("request validatation failed with error: %v", err) + w.WriteHeader(http.StatusInternalServerError) + return + } + w.WriteHeader(http.StatusBadRequest) - _, err := w.Write([]byte("invalid request")) - if err != nil { + if _, err := w.Write([]byte("invalid request")); err != nil { t.Errorf("failed to write message: %v", err) } } @@ -70,6 +91,14 @@ func (m *MockServer) Start(t *testing.T, tokenEndpoint, eventsEndpoint, eventsWi })) } +func (m *MockServer) validateRequest(r *http.Request) error { + if m.validator == nil { + return nil + } + + return m.validator(r) +} + func (m *MockServer) URL() string { return m.server.URL } diff --git a/testing/utils.go b/testing/utils.go index c345c37..d624a77 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -3,22 +3,19 @@ package testing import ( "bytes" "crypto/rand" - "encoding/json" "fmt" "io" - "io/ioutil" + "log" "net/http" - "reflect" - "regexp" "strconv" "testing" "time" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + http2 "github.com/cloudevents/sdk-go/v2/protocol/http" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( @@ -27,12 +24,6 @@ const ( CeTypeHeader = "CE-Type" CeSourceHeader = "CE-Source" CeSpecVersionHeader = "CE-SpecVersion" - - // cloudevent attributes - CeID = "00000" - CeType = "someType" - CeSource = "someSource" - CeSpecVersion = "1.0" ) func QuerySubscribedEndpoint(endpoint string) (*http.Response, error) { @@ -72,10 +63,10 @@ func GetStructuredMessageHeaders() http.Header { func GetBinaryMessageHeaders() http.Header { headers := make(http.Header) - headers.Add(CeIDHeader, CeID) - headers.Add(CeTypeHeader, CeType) - headers.Add(CeSourceHeader, CeSource) - headers.Add(CeSpecVersionHeader, CeSpecVersion) + headers.Add(CeIDHeader, EventID) + headers.Add(CeTypeHeader, CloudEventTypeNotClean) + headers.Add(CeSourceHeader, CloudEventSource) + headers.Add(CeSpecVersionHeader, CloudEventSpecVersion) return headers } @@ -85,20 +76,10 @@ func GetApplicationJSONHeaders() http.Header { return headers } -func NewSubscription() *eventingv1alpha1.Subscription { - filter := &eventingv1alpha1.BebFilter{ - EventSource: &eventingv1alpha1.Filter{ - Type: "exact", - Property: "source", - Value: "/beb.namespace", - }, - EventType: &eventingv1alpha1.Filter{ - Type: "exact", - Property: "type", - Value: "event.type.prefix.valid-app.order.created.v1", - }, - } - return &eventingv1alpha1.Subscription{ +type SubscriptionOpt func(*eventingv1alpha1.Subscription) + +func NewSubscription(opts ...SubscriptionOpt) *eventingv1alpha1.Subscription { + subscription := &eventingv1alpha1.Subscription{ ObjectMeta: metav1.ObjectMeta{ Name: "foo", Labels: map[string]string{ @@ -112,97 +93,48 @@ func NewSubscription() *eventingv1alpha1.Subscription { Sink: "", Filter: &eventingv1alpha1.BebFilters{ Filters: []*eventingv1alpha1.BebFilter{ - filter, + { + EventSource: &eventingv1alpha1.Filter{ + Type: "exact", + Property: "source", + Value: MessagingNamespace, + }, + EventType: &eventingv1alpha1.Filter{ + Type: "exact", + Property: "type", + Value: CloudEventType, + }, + }, }, }, }, } -} -// GetMissingFieldValidationErrorFor generates an Error message for a missing field -func GetMissingFieldValidationErrorFor(field string) *legacyapi.Error { - return &legacyapi.Error{ - Status: 400, - Type: "validation_violation", - Message: "Missing field", - Details: []legacyapi.ErrorDetail{ - { - Field: field, - Type: "missing_field", - Message: "Missing field", - MoreInfo: "", - }, - }, + for _, opt := range opts { + opt(subscription) } -} -// IsValidEventID checks whether EventID is valid or not -func IsValidEventID(id string) bool { - return regexp.MustCompile(legacy.AllowedEventIDChars).MatchString(id) + return subscription } -// GetInvalidValidationErrorFor generates an Error message for an invalid field -func GetInvalidValidationErrorFor(field string) *legacyapi.Error { - return &legacyapi.Error{ - Status: 400, - Type: "validation_violation", - Message: "Invalid field", - Details: []legacyapi.ErrorDetail{ - { - Field: field, - Type: "invalid_field", - Message: "Invalid field", - MoreInfo: "", +func SubscriptionWithFilter(eventSource, eventType string) SubscriptionOpt { + return func(subscription *eventingv1alpha1.Subscription) { + subscription.Spec.Filter = &eventingv1alpha1.BebFilters{ + Filters: []*eventingv1alpha1.BebFilter{ + { + EventSource: &eventingv1alpha1.Filter{ + Type: "exact", + Property: "source", + Value: eventSource, + }, + EventType: &eventingv1alpha1.Filter{ + Type: "exact", + Property: "type", + Value: eventType, + }, + }, }, - }, - } -} - -// ValidateErrorResponse validates Error Response -func ValidateErrorResponse(t *testing.T, resp http.Response, tcWantResponse *legacyapi.PublishEventResponses) { - legacyResponse := legacyapi.PublishEventResponses{} - legacyError := legacyapi.Error{} - bodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatalf("failed to read response body: %v", err) - } - if err = json.Unmarshal(bodyBytes, &legacyError); err != nil { - t.Fatalf("failed to unmarshal response body: %v", err) - } - legacyResponse.Error = &legacyError - if !reflect.DeepEqual(tcWantResponse.Error, legacyResponse.Error) { - t.Fatalf("Invalid error, want: %v, got: %v", tcWantResponse.Error, legacyResponse.Error) - } -} - -// ValidateOkResponse validates Ok Response -func ValidateOkResponse(t *testing.T, resp http.Response, tcWantResponse *legacyapi.PublishEventResponses) { - legacyOkResponse := legacyapi.PublishResponse{} - legacyResponse := legacyapi.PublishEventResponses{} - bodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatalf("failed to read response body: %v", err) - } - if err = json.Unmarshal(bodyBytes, &legacyOkResponse); err != nil { - t.Fatalf("failed to unmarshal response body: %v", err) - } - legacyResponse.Ok = &legacyOkResponse - if err = resp.Body.Close(); err != nil { - t.Fatalf("failed to close body: %v", err) - } - - if tcWantResponse.Ok.EventID != "" && tcWantResponse.Ok.EventID != legacyResponse.Ok.EventID { - t.Errorf("invalid event-id, want: %v, got: %v", tcWantResponse.Ok.EventID, legacyResponse.Ok.EventID) - } - - if tcWantResponse.Ok.EventID == "" && !IsValidEventID(legacyResponse.Ok.EventID) { - t.Errorf("should match regex: [%s] Not a valid event-id: %v ", legacy.AllowedEventIDChars, legacyResponse.Ok.EventID) - } - if tcWantResponse.Ok.Reason != legacyResponse.Ok.Reason { - t.Errorf("invalid reason, want: %v, got: %v", tcWantResponse.Ok.Reason, legacyResponse.Ok.Reason) - } - if tcWantResponse.Ok.Status != legacyResponse.Ok.Status { - t.Errorf("invalid status, want: %v, got: %v", tcWantResponse.Ok.Status, legacyResponse.Ok.Status) + } } } @@ -229,8 +161,16 @@ func WaitForHandlerToStart(t *testing.T, healthEndpoint string) { } } -// GeneratePort generates a random 5 digit port -func GeneratePort() (int, error) { +// GeneratePortOrDie generates a random 5 digit port or fail +func GeneratePortOrDie() int { + port, err := generatePort() + if err != nil { + log.Fatalf("Failed to generate port with error: %v", err) + } + return port +} + +func generatePort() (int, error) { max := 4 // Add 4 as prefix to make it 5 digits but less than 65535 add4AsPrefix := "4" From 14be96f32ff68ae5292bf51abece988b3879c0c5 Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Fri, 26 Feb 2021 09:03:36 +0100 Subject: [PATCH 012/194] Fix CVE-2020-26160 (#10740) --- cmd/event-publisher-nats/main.go | 2 +- cmd/event-publisher-proxy/main.go | 2 +- go.mod | 15 +--- go.sum | 136 ++++++++++++++++-------------- 4 files changed, 81 insertions(+), 74 deletions(-) diff --git a/cmd/event-publisher-nats/main.go b/cmd/event-publisher-nats/main.go index 2c58fbe..541028f 100644 --- a/cmd/event-publisher-nats/main.go +++ b/cmd/event-publisher-nats/main.go @@ -2,7 +2,7 @@ package main import ( "k8s.io/client-go/dynamic" - _ "k8s.io/client-go/plugin/pkg/client/auth" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "sigs.k8s.io/controller-runtime/pkg/client/config" "github.com/kelseyhightower/envconfig" diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index a59c7b1..14c01c9 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -2,7 +2,7 @@ package main import ( "k8s.io/client-go/dynamic" - _ "k8s.io/client-go/plugin/pkg/client/auth" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "sigs.k8s.io/controller-runtime/pkg/client/config" "github.com/kelseyhightower/envconfig" diff --git a/go.mod b/go.mod index fe648f0..8c319c8 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,11 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy go 1.15 require ( - cloud.google.com/go v0.47.0 // indirect github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 github.com/cloudevents/sdk-go/v2 v2.3.1 github.com/go-logr/logr v0.3.0 github.com/go-logr/zapr v0.1.1 // indirect github.com/google/uuid v1.1.1 - github.com/googleapis/gnostic v0.4.0 // indirect github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma v0.5.1-0.20200609051543-f5997d4a36d6 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316 @@ -27,17 +25,12 @@ require ( golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4 // indirect gomodules.xyz/jsonpatch/v2 v2.1.0 // indirect - google.golang.org/appengine v1.6.5 // indirect gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect - k8s.io/api v0.19.4 - k8s.io/apimachinery v0.19.4 - k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible + k8s.io/api v0.19.8 + k8s.io/apimachinery v0.19.8 + k8s.io/client-go v0.19.8 k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect sigs.k8s.io/controller-runtime v0.6.0 ) -replace ( - k8s.io/api => k8s.io/api v0.16.15 - k8s.io/apimachinery => k8s.io/apimachinery v0.16.15 - k8s.io/client-go => k8s.io/client-go v0.16.15 -) +replace github.com/dgrijalva/jwt-go => github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 // fix CVE-2020-26160 diff --git a/go.sum b/go.sum index f4fdfe5..3f21ce1 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.47.0 h1:1JUtpcY9E7+eTospEwWS2QXP3DEn7poB3E2j0jN74mM= -cloud.google.com/go v0.47.0/go.mod h1:5p3Ky/7f3N10VBkhuR5LFtddroTiMyjZV/Kj5qOQFxU= +cloud.google.com/go v0.51.0 h1:PvKAVQWCtlGUSlZkGW3QLelKaWq7KYv/MW1EboG8bfM= +cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= @@ -18,22 +18,20 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest/autorest v0.2.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg= -github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= -github.com/Azure/go-autorest/autorest/adal v0.5.0 h1:q2gDruN08/guU9vAjuPWff0+QIrpH6ediguzdAzXAUU= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/date v0.1.0 h1:YGrhWfrgtFs84+h0o46rJrlmsZtyZRg470CqAXTZaGM= +github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0 h1:Ww5g4zThfD/6cLb4z6xxgeyDa7QDkizMkJKe0ysZXp0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= -github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= -github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -71,12 +69,14 @@ github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudevents/sdk-go v1.2.0 h1:2AxI14EJUw1PclJ5gZJtzbxnHIfNMdi76Qq3P3G1BRU= github.com/cloudevents/sdk-go v1.2.0/go.mod h1:ss+jWJ88wypiewnPEzChSBzTYXGpdcILoN9YHk8uhTQ= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 h1:LY5dKsBPIcY6NQajjgGyQO2hlfSD96FnMpoISZ2lxJo= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1/go.mod h1:xEjXKvch0fuLkmYyNlznjNpwgtMVhELY6aeyruXKXjQ= -github.com/cloudevents/sdk-go/v2 v2.2.0 h1:FlBJg7W0QywbOjuZGmRXUyFk8qkCHx2euETp+tuopSU= github.com/cloudevents/sdk-go/v2 v2.2.0/go.mod h1:3CTrpB4+u7Iaj6fd7E2Xvm5IxMdRoaAhqaRVnOr2rCU= github.com/cloudevents/sdk-go/v2 v2.3.1 h1:QRTu0yRA4FbznjRSds0/4Hy6cVYpWV2wInlNJSHWAtw= github.com/cloudevents/sdk-go/v2 v2.3.1/go.mod h1:4fO2UjPMYYR1/7KPJQCwTPb0lFA8zYuitkUpAZFSY1Q= @@ -98,8 +98,7 @@ github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= @@ -111,6 +110,7 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -123,7 +123,6 @@ github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQo github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -131,13 +130,13 @@ github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2H github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs= github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= @@ -197,15 +196,15 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= @@ -214,6 +213,7 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -222,7 +222,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -233,6 +232,7 @@ github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= @@ -242,9 +242,8 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/googleapis/gnostic v0.4.0 h1:BXDUo8p/DaxC+4FJY/SSx3gvnx9C1VdHNgaUkiEL5mk= -github.com/googleapis/gnostic v0.4.0/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/gophercloud/gophercloud v0.1.0 h1:P/nh25+rzXouhytV2pUHBb65fnds26Ghl8/391+sT5o= +github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -260,13 +259,12 @@ github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrj github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= @@ -280,6 +278,7 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= @@ -306,7 +305,6 @@ github.com/kyma-project/kyma/components/eventing-controller v0.0.0-2021011221582 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316/go.mod h1:ZBfptvrdh3YUmdJac/1IFm2pgyk+YAfyLET05ztKTlI= github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac h1:+2b6iGRJe3hvV/yVXrd41yVEjxuFHxasJqDhkIjS4gk= github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac/go.mod h1:Frd2bnT3w5FB5q49ENTfVlztJES+1k/7lyWX2+9gq/M= -github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -337,7 +335,6 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2 h1:+RB5hMpXUUA2dfxuhBTEkMOrYmM+gKIZYS1KjSostMI= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/jwt v0.3.3-0.20200519195258-f2bf5ce574c7/go.mod h1:n3cvmLfBfnpV4JJRN7lRYCyZnw48ksGsbThGXEk4w9M= github.com/nats-io/jwt v1.1.0 h1:+vOlgtM0ZsF46GbmUoadq0/2rChNS45gtxHEa3H1gqM= @@ -353,7 +350,6 @@ github.com/nats-io/nats-server/v2 v2.1.8-0.20201129161730-ebe63db3e3ed/go.mod h1 github.com/nats-io/nats-server/v2 v2.1.9 h1:Sxr2zpaapgpBT9ElTxTVe62W+qjnhPcKY/8W5cnA/Qk= github.com/nats-io/nats-server/v2 v2.1.9/go.mod h1:9qVyoewoYXzG1ME9ox0HwkkzyYvnlBDugfR4Gg/8uHU= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nats.go v1.10.0 h1:L8qnKaofSfNFbXg0C5F71LdjPRnmQwSsA4ukmkt1TvY= github.com/nats-io/nats.go v1.10.0/go.mod h1:AjGArbfyR50+afOUotNX2Xs5SYHf+CoOa5HH1eEl2HE= github.com/nats-io/nats.go v1.10.1-0.20200531124210-96f2130e4d55/go.mod h1:ARiFsjW9DVxk48WJbO3OSZ2DG8fjkMi7ecLmXoY/n9I= github.com/nats-io/nats.go v1.10.1-0.20200606002146-fc6fed82929a/go.mod h1:8eAIv96Mo9QW6Or40jUHejS7e4VwZ3VRYD6Sf0BTDp4= @@ -362,7 +358,6 @@ github.com/nats-io/nats.go v1.10.1-0.20201204000952-090c71e95cd0 h1:wyJhRLDJBRwl github.com/nats-io/nats.go v1.10.1-0.20201204000952-090c71e95cd0/go.mod h1:Sa3kLIonafChP5IF0b55i9uvGR10I3hPETFbi4+9kOI= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.4 h1:aEsHIssIk6ETN5m2/MD8Y4B2X7FfXrBAUdkyRvbVYzA= github.com/nats-io/nkeys v0.1.4/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nkeys v0.2.0 h1:WXKF7diOaPU9cJdLD7nuzwasQy9vT1tBqzXZZf3AMJM= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= @@ -376,8 +371,7 @@ github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:v github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.2 h1:uqH7bpe+ERSiDa34FDOF7RikN6RzXgduUF8yarlZp94= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -385,8 +379,6 @@ github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= @@ -464,7 +456,6 @@ github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRci github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -487,29 +478,26 @@ go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.14.0 h1:/pduUoebOeeJzTDFuoMgC6nRkiasr1sBCIEorly7m4o= go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -518,10 +506,10 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -531,7 +519,7 @@ golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3/go.mod h1:NOZ3BPKG0ec/BKJQgnvsSFpcKLM5xXVWnvZS97DWHgE= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -541,6 +529,7 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= @@ -572,14 +561,17 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -610,7 +602,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -618,23 +609,26 @@ golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201112073958-5cba982894dd h1:5CtCZbICpIOFdgO940moixOPjc0178IU44m4EjOO5IY= +golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -661,17 +655,17 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191010171213-8abd42400456/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4 h1:v8Jgq9X6Es9K9otVr9jxENEJigepKMZgA9OmrIZDtFA= golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -689,7 +683,6 @@ google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEn google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -704,7 +697,8 @@ google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dT google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -714,6 +708,7 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -721,8 +716,10 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -745,7 +742,6 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -764,20 +760,32 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt istio.io/api v0.0.0-20200812202721-24be265d41c3/go.mod h1:88HN3o1fSD1jo+Z1WTLlJfMm9biopur6Ct9BFKjiB64= istio.io/client-go v0.0.0-20200916161914-94f0e83444ca/go.mod h1:SO65MWt7I45dvUwuDowoiB0SVcGpfWZfUTlopvYpbZc= istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a/go.mod h1:OzpAts7jljZceG4Vqi5/zXy/pOg1b209T3jb7Nv5wIs= -k8s.io/api v0.16.15 h1:6yvV9YNGwnebDAsA4Sfj+1b1S9j5OYfmckjTdc9b1bI= -k8s.io/api v0.16.15/go.mod h1:8z880CLtpCJqHWe9vmBkZMQeMKHNvdTQuqLW2QUefUA= +k8s.io/api v0.17.8/go.mod h1:N++Llhs8kCixMUoCaXXAyMMPbo8dDVnh+IQ36xZV2/0= +k8s.io/api v0.18.1/go.mod h1:3My4jorQWzSs5a+l7Ge6JBbIxChLnY8HnuT58ZWolss= +k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= +k8s.io/api v0.18.12/go.mod h1:3sS78jmUoGHwERyMbEhxP6owcQ77UxGo+Yy+dKNWrh0= +k8s.io/api v0.19.8 h1:U50vBUCb5kc2J483mnITLKfdyoITaC7PnaOJwT7oRRM= +k8s.io/api v0.19.8/go.mod h1:9TMGoKoidvicOK0LSqj+Mj98pugQycbViPKyZHqutBc= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= -k8s.io/apiextensions-apiserver v0.18.2 h1:I4v3/jAuQC+89L3Z7dDgAiN4EOjN6sbm6iBqQwHTah8= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.18.12 h1:b0jTgW/qwqZBMIJTMxkLvvAtNRDZboG5yZiIbOFgQv8= k8s.io/apiextensions-apiserver v0.18.12/go.mod h1:nihADkPed1L37Vxpz2/BrtxO9mCtINH23aNtUe/CRLo= -k8s.io/apimachinery v0.16.15 h1:4cmEfuRsKuV8pMpaQ6z0AKEUXZ3r+u/NKaz5dvIjySk= -k8s.io/apimachinery v0.16.15/go.mod h1:xAtIC8Gj83Pn2OCs2g57wZpZembRhJhiXIlQIqanwas= +k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= +k8s.io/apimachinery v0.17.8/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= +k8s.io/apimachinery v0.18.1/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= +k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= +k8s.io/apimachinery v0.18.12/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk= +k8s.io/apimachinery v0.19.8 h1:MaehcNcx8brsgvMsqspcI0bi22E1np/DACnjf2mhJ5A= +k8s.io/apimachinery v0.19.8/go.mod h1:6sRbGRAVY5DOCuZwB5XkqguBqpqLU6q/kOaOdk29z6Q= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.18.12/go.mod h1:uFOeW4LlxS6KDgLWy3n3gh0DhC6m41QIFgL33ouk+4w= -k8s.io/client-go v0.16.15 h1:cuSmM5begnN77V0beNgmhQ9yob6TFUnN+YaqAfRBD40= -k8s.io/client-go v0.16.15/go.mod h1:onpbkg9XeonG579HOlK9RS56ixfOJdbBM5dKluyFM8c= +k8s.io/client-go v0.17.8/go.mod h1:SJsDS64AAtt9VZyeaQMb4Ck5etCitZ/FwajWdzua5eY= +k8s.io/client-go v0.18.1/go.mod h1:iCikYRiXOj/yRRFE/aWqrpPtDt4P2JVWhtHkmESTcfY= +k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= +k8s.io/client-go v0.18.12/go.mod h1:0aC8XkA09dX/goYqHQJ/kVv0zL1t+weOZt3pmz9LpxA= +k8s.io/client-go v0.19.8 h1:rcb2BrXb1HUBiBCoP3m/9Q2VZIMWhZUAmH49EmAyRUA= +k8s.io/client-go v0.19.8/go.mod h1:5Op2bSbK+COBz8mwH62rrRgqhA9wOcORkWZ03+GL0Ow= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.12/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= @@ -787,21 +795,24 @@ k8s.io/component-base v0.18.12/go.mod h1:pRGKXsx2KWfsJqlDi4sbCc1jpaB87rXIIqupjhr k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= -k8s.io/kube-openapi v0.0.0-20200410163147-594e756bea31 h1:PsbYeEz2x7ll6JYUzBEG+DT78910DDTlvn5Ma10F5/E= -k8s.io/kube-openapi v0.0.0-20200410163147-594e756bea31/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= +k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 h1:+WnxoVtG8TMiudHBSEtrVL1egv36TkkJm+bA8AxicmQ= +k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= @@ -816,10 +827,13 @@ sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+a sigs.k8s.io/controller-runtime v0.6.0 h1:Fzna3DY7c4BIP6KwfSlrfnj20DJ+SeMBK8HSFvOk9NM= sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= sigs.k8s.io/kind v0.7.0/go.mod h1:An/AbWHT6pA/Lm0Og8j3ukGhfJP3RiVN/IBU6Lo3zl8= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7mRH6DGaRcixXEJXTsE= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= +sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From a29e47f4130d1290a4f43c62f91f5d6cc1e527de Mon Sep 17 00:00:00 2001 From: Radu Fantaziu Date: Wed, 3 Mar 2021 17:45:08 +0100 Subject: [PATCH 013/194] Preserve CE event's mode (structured or binary) (#10721) --- pkg/handler/http/handler.go | 10 ++++++++-- pkg/handler/http/handler_test.go | 20 +++++++++++++++++++- pkg/handler/nats/handler.go | 10 ++++++++-- pkg/sender/nats.go | 5 +---- 4 files changed, 36 insertions(+), 9 deletions(-) diff --git a/pkg/handler/http/handler.go b/pkg/handler/http/handler.go index b27d4b2..fe29359 100644 --- a/pkg/handler/http/handler.go +++ b/pkg/handler/http/handler.go @@ -9,7 +9,7 @@ import ( "github.com/cloudevents/sdk-go/v2/binding" cev2client "github.com/cloudevents/sdk-go/v2/client" cev2event "github.com/cloudevents/sdk-go/v2/event" - cehttp "github.com/cloudevents/sdk-go/v2/protocol/http" + cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" "github.com/sirupsen/logrus" @@ -136,7 +136,7 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) defer cancel() - message := cehttp.NewMessageFromHttpRequest(request) + message := cev2http.NewMessageFromHttpRequest(request) defer func() { _ = message.Finish(nil) }() event, err := binding.ToEvent(ctx, message) @@ -152,6 +152,12 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R return } + if request.Header.Get(cev2http.ContentType) == cev2event.ApplicationCloudEventsJSON { + ctx = binding.WithForceStructured(ctx) + } else { + ctx = binding.WithForceBinary(ctx) + } + h.receive(ctx, event) statusCode, dispatchTime, respBody := h.send(ctx, event) h.writeResponse(writer, statusCode, respBody) diff --git a/pkg/handler/http/handler_test.go b/pkg/handler/http/handler_test.go index 6262647..3e857f5 100644 --- a/pkg/handler/http/handler_test.go +++ b/pkg/handler/http/handler_test.go @@ -12,6 +12,9 @@ import ( "testing" "time" + "github.com/cloudevents/sdk-go/v2/binding" + cev2event "github.com/cloudevents/sdk-go/v2/event" + cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -460,6 +463,21 @@ func setupTestResources(t *testing.T, port, maxRequestSize int, applicationName, func validateApplicationName(appName string) testingutils.Validator { return func(r *http.Request) error { + if r.Header.Get(cev2http.ContentType) == cev2event.ApplicationCloudEventsJSON { + // CE structured mode + message := cev2http.NewMessageFromHttpRequest(r) + defer func() { _ = message.Finish(nil) }() + var event *cev2event.Event + var err error + if event, err = binding.ToEvent(context.Background(), message); err != nil { + return err + } + if strings.Contains(event.Type(), appName) { + return nil + } + return errors.New(fmt.Sprintf("expected the event-type [%s] to contain the application name [%s] for structured mode", event.Type(), appName)) + } + // default CE binary mode for k, v := range r.Header { if strings.ToLower(k) != strings.ToLower(testingutils.CeTypeHeader) { continue @@ -467,7 +485,7 @@ func validateApplicationName(appName string) testingutils.Validator { if strings.Contains(v[0], appName) { return nil } - return errors.New(fmt.Sprintf("expected the event-type [%s] to contain the application name [%s]", v[0], appName)) + return errors.New(fmt.Sprintf("expected the event-type [%s] to contain the application name [%s] for binary mode", v[0], appName)) } return errors.New("event-type header is not found") } diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index 449ea1c..2ee36ae 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -8,7 +8,7 @@ import ( "github.com/cloudevents/sdk-go/v2/binding" cev2client "github.com/cloudevents/sdk-go/v2/client" cev2event "github.com/cloudevents/sdk-go/v2/event" - cehttp "github.com/cloudevents/sdk-go/v2/protocol/http" + cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" "github.com/sirupsen/logrus" @@ -118,7 +118,7 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) defer cancel() - message := cehttp.NewMessageFromHttpRequest(request) + message := cev2http.NewMessageFromHttpRequest(request) defer func() { _ = message.Finish(nil) }() event, err := binding.ToEvent(ctx, message) @@ -134,6 +134,12 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R return } + if request.Header.Get(cev2http.ContentType) == cev2event.ApplicationCloudEventsJSON { + ctx = binding.WithForceStructured(ctx) + } else { + ctx = binding.WithForceBinary(ctx) + } + h.receive(ctx, event) statusCode, dispatchTime, respBody := h.send(ctx, event) h.writeResponse(writer, statusCode, respBody) diff --git a/pkg/sender/nats.go b/pkg/sender/nats.go index 3ef76e6..4a91b92 100644 --- a/pkg/sender/nats.go +++ b/pkg/sender/nats.go @@ -41,16 +41,13 @@ func (h *NatsMessageSender) Send(ctx context.Context, event *cev2event.Event) (i return http.StatusInternalServerError, err } - ctxWithCancel, cancel := context.WithCancel(ctx) - defer cancel() - c, err := cev2.NewClient(p) if err != nil { h.Logger.Errorf("Failed to create client, %s", err.Error()) return http.StatusInternalServerError, err } - err = c.Send(ctxWithCancel, *event) + err = c.Send(ctx, *event) if cev2.IsUndelivered(err) { h.Logger.Errorf("Failed to send: %s", err.Error()) return http.StatusBadGateway, err From fccbf657cd6718c479f64825d5fb45e278c2abd4 Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Mon, 8 Mar 2021 14:26:06 +0100 Subject: [PATCH 014/194] Reuse NATS connection to enhance NATS publisher performance (#10723) --- cmd/event-publisher-nats/main.go | 10 +++- pkg/env/nats_config.go | 10 ++-- pkg/handler/nats/handler_test.go | 59 +++++++++-------------- pkg/nats/connect.go | 20 ++++++++ pkg/nats/connect_test.go | 23 +++++++++ pkg/sender/nats.go | 29 +++++------ pkg/sender/nats_test.go | 83 +++++++++----------------------- testing/fixtures.go | 9 ++++ testing/nats.go | 65 +++++++++++++++++++++++++ 9 files changed, 193 insertions(+), 115 deletions(-) create mode 100644 pkg/nats/connect.go create mode 100644 pkg/nats/connect_test.go create mode 100644 testing/nats.go diff --git a/cmd/event-publisher-nats/main.go b/cmd/event-publisher-nats/main.go index 541028f..4796c5a 100644 --- a/cmd/event-publisher-nats/main.go +++ b/cmd/event-publisher-nats/main.go @@ -13,6 +13,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" @@ -35,8 +36,15 @@ func main() { // assure uniqueness ctx := signals.NewContext() + // connect to nats + connection, err := pkgnats.ConnectToNats(cfgNats.URL, cfgNats.RetryOnFailedConnect, cfgNats.MaxReconnects, cfgNats.ReconnectWait) + if err != nil { + logger.Fatalf("Failed to connect to NATS server with error: %s", err) + } + defer connection.Close() + // configure message sender - messageSenderToNats := sender.NewNatsMessageSender(ctx, cfgNats.NatsPublishURL, logger) + messageSenderToNats := sender.NewNatsMessageSender(ctx, connection, logger) // cluster config k8sConfig := config.GetConfigOrDie() diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go index ea21187..be86881 100644 --- a/pkg/env/nats_config.go +++ b/pkg/env/nats_config.go @@ -4,9 +4,13 @@ import "time" // Config represents the environment config for the Event Publisher NATS. type NatsConfig struct { - Port int `envconfig:"INGRESS_PORT" default:"8080"` - NatsPublishURL string `envconfig:"NATS_URL" default:"nats.nats.svc.cluster.local"` - RequestTimeout time.Duration `envconfig:"REQUEST_TIMEOUT" default:"5s"` + Port int `envconfig:"INGRESS_PORT" default:"8080"` + URL string `envconfig:"NATS_URL" default:"nats.nats.svc.cluster.local"` + RetryOnFailedConnect bool `envconfig:"RETRY_ON_FAILED_CONNECT" default:"true"` + MaxReconnects int `envconfig:"MAX_RECONNECTS" default:"10"` + ReconnectWait time.Duration `envconfig:"RECONNECT_WAIT" default:"5s"` + RequestTimeout time.Duration `envconfig:"REQUEST_TIMEOUT" default:"5s"` + // Legacy Namespace is used as the event source for legacy events LegacyNamespace string `envconfig:"LEGACY_NAMESPACE" default:"kyma"` // LegacyEventTypePrefix is the prefix of each event as per the eventing specification, used for legacy events diff --git a/pkg/handler/nats/handler_test.go b/pkg/handler/nats/handler_test.go index 204f234..312c698 100644 --- a/pkg/handler/nats/handler_test.go +++ b/pkg/handler/nats/handler_test.go @@ -20,7 +20,6 @@ import ( dynamicfake "k8s.io/client-go/dynamic/fake" "github.com/nats-io/nats-server/v2/server" - "github.com/nats-io/nats.go" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" @@ -28,13 +27,13 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" - eventingtesting "github.com/kyma-project/kyma/components/eventing-controller/testing" ) type Test struct { @@ -51,7 +50,7 @@ func (test *Test) init() { test.logger = logrus.New() test.natsConfig = newEnvConfig(port, natsPort) - test.natsServer = eventingtesting.RunNatsServerOnPort(natsPort) + test.natsServer = testingutils.StartNatsServer() test.natsUrl = test.natsServer.ClientURL() test.healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) } @@ -64,8 +63,13 @@ func (test *Test) setupResources(t *testing.T, subscription *eventingv1alpha1.Su messageReceiver := receiver.NewHttpMessageReceiver(test.natsConfig.Port) assert.NotNil(t, messageReceiver) + // connect to nats + connection, err := pkgnats.ConnectToNats(test.natsUrl, true, 3, time.Second) + assert.Nil(t, err) + assert.NotNil(t, connection) + // create a Nats sender - msgSender := sender.NewNatsMessageSender(ctx, test.natsUrl, test.logger) + msgSender := sender.NewNatsMessageSender(ctx, connection, test.logger) assert.NotNil(t, msgSender) // configure legacyTransformer @@ -159,10 +163,14 @@ func TestNatsHandlerForCloudEvents(t *testing.T) { assert.NotEmpty(t, subscription.Spec.Filter.Filters) eventType := subscription.Spec.Filter.Filters[0].EventType.Value + // connect to nats + connection, err := pkgnats.ConnectToNats(test.natsUrl, true, 3, time.Second) + assert.Nil(t, err) + assert.NotNil(t, connection) + // publish a message to NATS and validate it - connection := connectToNatsOrFail(t, test.natsUrl) - validator := validateNatsSubject(t, expectedNatsSubject) - subscribeToEventOrFail(t, connection, eventType, validator) + validator := testingutils.ValidateNatsSubjectOrFail(t, expectedNatsSubject) + testingutils.SubscribeToEventOrFail(t, connection, eventType, validator) // run the tests for publishing cloudevents for _, testCase := range handlertest.TestCasesForCloudEvents { @@ -200,10 +208,14 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { assert.NotEmpty(t, subscription.Spec.Filter.Filters) eventType := subscription.Spec.Filter.Filters[0].EventType.Value + // connect to nats + connection, err := pkgnats.ConnectToNats(test.natsUrl, true, 3, time.Second) + assert.Nil(t, err) + assert.NotNil(t, connection) + // publish a message to NATS and validate it - connection := connectToNatsOrFail(t, test.natsUrl) - validator := validateNatsSubject(t, expectedNatsSubject) - subscribeToEventOrFail(t, connection, eventType, validator) + validator := testingutils.ValidateNatsSubjectOrFail(t, expectedNatsSubject) + testingutils.SubscribeToEventOrFail(t, connection, eventType, validator) // run the tests for publishing legacy events for _, testCase := range handlertest.TestCasesForLegacyEvents { @@ -273,34 +285,9 @@ func TestNatsHandlerForSubscribedEndpoint(t *testing.T) { func newEnvConfig(port, natsPort int) *env.NatsConfig { return &env.NatsConfig{ Port: port, - NatsPublishURL: fmt.Sprintf("http://localhost:%d", natsPort), + URL: fmt.Sprintf("http://localhost:%d", natsPort), RequestTimeout: 2 * time.Second, LegacyNamespace: testingutils.MessagingNamespace, LegacyEventTypePrefix: testingutils.MessagingEventTypePrefix, } } - -func connectToNatsOrFail(t *testing.T, natsUrl string) *nats.Conn { - connection, err := nats.Connect(natsUrl, nats.RetryOnFailedConnect(true), nats.MaxReconnects(3), nats.ReconnectWait(time.Second)) - if err != nil { - t.Fatalf("Failed to connect to NATS server with error: %v", err) - } - if connection.Status() != nats.CONNECTED { - t.Fatal("Failed to connect to NATS server") - } - return connection -} - -func subscribeToEventOrFail(t *testing.T, connection *nats.Conn, eventType string, validator nats.MsgHandler) { - if _, err := connection.Subscribe(eventType, validator); err != nil { - t.Fatalf("Failed to subscribe to event with error: %v", err) - } -} - -func validateNatsSubject(t *testing.T, subject string) nats.MsgHandler { - return func(msg *nats.Msg) { - if msg != nil && msg.Subject != subject { - t.Errorf("invalid NATS subject, expected [%s] but found [%s]", subject, msg.Subject) - } - } -} diff --git a/pkg/nats/connect.go b/pkg/nats/connect.go new file mode 100644 index 0000000..f685d4b --- /dev/null +++ b/pkg/nats/connect.go @@ -0,0 +1,20 @@ +package nats + +import ( + "fmt" + "time" + + "github.com/nats-io/nats.go" +) + +// ConnectToNats returns a nats connection that is ready for use, or error if connection to the nats server failed +func ConnectToNats(url string, retry bool, reconnects int, wait time.Duration) (*nats.Conn, error) { + connection, err := nats.Connect(url, nats.RetryOnFailedConnect(retry), nats.MaxReconnects(reconnects), nats.ReconnectWait(wait)) + if err != nil { + return nil, err + } + if status := connection.Status(); status != nats.CONNECTED { + return nil, fmt.Errorf("connection status not connected: %v", status) + } + return connection, nil +} diff --git a/pkg/nats/connect_test.go b/pkg/nats/connect_test.go new file mode 100644 index 0000000..310d216 --- /dev/null +++ b/pkg/nats/connect_test.go @@ -0,0 +1,23 @@ +package nats + +import ( + "testing" + + "github.com/nats-io/nats.go" + "github.com/stretchr/testify/assert" + + publishertesting "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" +) + +func TestConnectToNats(t *testing.T) { + natsServer := publishertesting.StartNatsServer() + assert.NotNil(t, natsServer) + assert.NotEmpty(t, natsServer.ClientURL()) + defer natsServer.Shutdown() + + connection, err := ConnectToNats(natsServer.ClientURL(), true, 1, 3) + assert.Nil(t, err) + assert.NotNil(t, connection) + assert.Equal(t, connection.Status(), nats.CONNECTED) + defer connection.Close() +} diff --git a/pkg/sender/nats.go b/pkg/sender/nats.go index 4a91b92..00369cc 100644 --- a/pkg/sender/nats.go +++ b/pkg/sender/nats.go @@ -7,6 +7,7 @@ import ( cenats "github.com/cloudevents/sdk-go/protocol/nats/v2" cev2 "github.com/cloudevents/sdk-go/v2" cev2event "github.com/cloudevents/sdk-go/v2/event" + "github.com/nats-io/nats.go" "github.com/sirupsen/logrus" ) @@ -19,40 +20,40 @@ type GenericSender interface { // HttpMessageSender is responsible for sending messages over HTTP. type NatsMessageSender struct { - Ctx context.Context - Target string - Logger *logrus.Logger + ctx context.Context + logger *logrus.Logger + connection *nats.Conn } -// NewNatsMessageSender returns a new NewNatsMessageSender instance with the given target and client. -func NewNatsMessageSender(ctx context.Context, target string, logger *logrus.Logger) *NatsMessageSender { - return &NatsMessageSender{Ctx: ctx, Target: target, Logger: logger} +// NewNatsMessageSender returns a new NewNatsMessageSender instance with the given nats connection. +func NewNatsMessageSender(ctx context.Context, connection *nats.Conn, logger *logrus.Logger) *NatsMessageSender { + return &NatsMessageSender{ctx: ctx, connection: connection, logger: logger} } // Send dispatches the given Cloud Event to NATS and returns the response details and dispatch time. func (h *NatsMessageSender) Send(ctx context.Context, event *cev2event.Event) (int, error) { - h.Logger.Infof("Sending event to NATS, id:[%s]", event.ID()) + h.logger.Infof("Sending event to NATS, id:[%s]", event.ID()) // The same Nats subject used by Nats subscription subject := event.Type() - p, err := cenats.NewSender(h.Target, subject, cenats.NatsOptions()) + sender, err := cenats.NewSenderFromConn(h.connection, subject) if err != nil { - h.Logger.Errorf("Failed to create nats protocol, %s", err.Error()) + h.logger.Errorf("Failed to create nats protocol, %s", err.Error()) return http.StatusInternalServerError, err } - c, err := cev2.NewClient(p) + client, err := cev2.NewClient(sender) if err != nil { - h.Logger.Errorf("Failed to create client, %s", err.Error()) + h.logger.Errorf("Failed to create client, %s", err.Error()) return http.StatusInternalServerError, err } - err = c.Send(ctx, *event) + err = client.Send(ctx, *event) if cev2.IsUndelivered(err) { - h.Logger.Errorf("Failed to send: %s", err.Error()) + h.logger.Errorf("Failed to send: %s", err.Error()) return http.StatusBadGateway, err } - h.Logger.Infof("sent id:[%s], accepted: %t", event.ID(), cev2.IsACK(err)) + h.logger.Infof("sent id:[%s], accepted: %t", event.ID(), cev2.IsACK(err)) return http.StatusNoContent, nil } diff --git a/pkg/sender/nats_test.go b/pkg/sender/nats_test.go index c245c01..d628dd8 100644 --- a/pkg/sender/nats_test.go +++ b/pkg/sender/nats_test.go @@ -9,89 +9,50 @@ import ( "time" cloudevents "github.com/cloudevents/sdk-go/v2" - "github.com/go-logr/logr" - "github.com/nats-io/nats.go" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" - "github.com/kyma-project/kyma/components/eventing-controller/pkg/env" - "github.com/kyma-project/kyma/components/eventing-controller/pkg/handlers" - eventingtesting "github.com/kyma-project/kyma/components/eventing-controller/testing" ) -func TestNatsSender(t *testing.T) { +func TestSendCloudEvent(t *testing.T) { logger := logrus.New() logger.Info("TestNatsSender started") - // test environment - natsPort := 5222 - subscriberPort := 8080 - subscriberReceiveURL := fmt.Sprintf("http://localhost:%d/store", subscriberPort) - subscriberCheckURL := fmt.Sprintf("http://localhost:%d/check", subscriberPort) - // Start Nats server - natsServer := eventingtesting.RunNatsServerOnPort(natsPort) + natsServer := testingutils.StartNatsServer() assert.NotNil(t, natsServer) defer natsServer.Shutdown() - natsURL := natsServer.ClientURL() - natsClient := handlers.Nats{ - Subscriptions: make(map[string]*nats.Subscription), - Config: env.NatsConfig{ - Url: natsURL, - MaxReconnects: 2, - ReconnectWait: time.Second, - }, - Log: logr.Discard(), - } - err := natsClient.Initialize() - if err != nil { - t.Fatalf("failed to connect to Nats Server: %v", err) - } + // connect to nats + connection, err := pkgnats.ConnectToNats(natsServer.ClientURL(), true, 1, time.Second) + assert.Nil(t, err) + assert.NotNil(t, connection) - // create a Nats sender - natsUrl := natsServer.ClientURL() - assert.NotEmpty(t, natsUrl) + // create message sender ctx := context.Background() - sender := NewNatsMessageSender(ctx, natsUrl, logger) - - // Create a new subscriber - subscriber := eventingtesting.NewSubscriber(fmt.Sprintf(":%d", subscriberPort)) - subscriber.Start() - defer subscriber.Shutdown() + sender := NewNatsMessageSender(ctx, connection, logger) - // Check subscriber is running or not by checking the store - err = subscriber.CheckEvent("", subscriberCheckURL) - if err != nil { - t.Errorf("failed to check subscriber's store: %v", err) - } - - // Create a subscription - sub := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, testingutils.CloudEventType)) - sub.Spec.Sink = subscriberReceiveURL - err = natsClient.SyncSubscription(sub) - if err != nil { - t.Fatalf("failed to Sync subscription: %v", err) - } + // subscribe to subject + done := make(chan bool, 1) + validator := testingutils.ValidateNatsMessageDataOrFail(t, fmt.Sprintf(`"%s"`, testingutils.CloudEventData), done) + testingutils.SubscribeToEventOrFail(t, connection, testingutils.CloudEventType, validator) - // create a CE event - ce := testingutils.StructuredCloudEventPayload + // create cloudevent + ce := testingutils.StructuredCloudEventPayloadWithCleanEventType event := cloudevents.NewEvent() + event.SetType(testingutils.CloudEventType) err = json.Unmarshal([]byte(ce), &event) assert.Nil(t, err) - // set ce event type the same as the event type from subscription's filter. The Nats subject is defined by ce.Type - event.SetType(testingutils.CloudEventType) - // send the event - c, err := sender.Send(ctx, &event) + // send cloudevent + status, err := sender.Send(ctx, &event) assert.Nil(t, err) - assert.Equal(t, c, http.StatusNoContent) + assert.Equal(t, status, http.StatusNoContent) - // Check for the event - expectedDataInStore := fmt.Sprintf(`"%s"`, testingutils.CloudEventData) - err = subscriber.CheckEvent(expectedDataInStore, subscriberCheckURL) - if err != nil { - t.Errorf("subscriber did not receive the event: %v", err) + // wait for subscriber to receive the messages + if err := testingutils.WaitForChannelOrTimeout(done, time.Second*3); err != nil { + t.Fatalf("Subscriber did not receive the message with error: %v", err) } } diff --git a/testing/fixtures.go b/testing/fixtures.go index 6eb741d..47e45a8 100644 --- a/testing/fixtures.go +++ b/testing/fixtures.go @@ -62,6 +62,15 @@ const ( "datacontenttype":"` + CloudEventDataContentType + `" }` + StructuredCloudEventPayloadWithCleanEventType = `{ + "id":"` + EventID + `", + "type":"` + CloudEventType + `", + "specversion":"` + CloudEventSpecVersion + `", + "source":"` + CloudEventSource + `", + "data":"` + CloudEventData + `", + "datacontenttype":"` + CloudEventDataContentType + `" + }` + ValidLegacyEventPayloadWithEventId = `{ "event-id": "` + EventID + `", "event-type":"` + LegacyEventType + `", diff --git a/testing/nats.go b/testing/nats.go new file mode 100644 index 0000000..fd94ca3 --- /dev/null +++ b/testing/nats.go @@ -0,0 +1,65 @@ +package testing + +import ( + "encoding/json" + "fmt" + "testing" + "time" + + cev2 "github.com/cloudevents/sdk-go/v2/event" + "github.com/nats-io/nats-server/v2/server" + "github.com/nats-io/nats-server/v2/test" + "github.com/nats-io/nats.go" +) + +func StartNatsServer() *server.Server { + opts := test.DefaultTestOptions + opts.Port = server.RANDOM_PORT + return test.RunServer(&opts) +} + +func SubscribeToEventOrFail(t *testing.T, connection *nats.Conn, eventType string, validator nats.MsgHandler) { + if _, err := connection.Subscribe(eventType, validator); err != nil { + t.Fatalf("Failed to subscribe to event with error: %v", err) + } +} + +func ValidateNatsSubjectOrFail(t *testing.T, subject string, notify ...chan bool) nats.MsgHandler { + return func(msg *nats.Msg) { + for _, n := range notify { + n <- true + } + if msg != nil && msg.Subject != subject { + t.Errorf("invalid NATS subject, expected [%s] but found [%s]", subject, msg.Subject) + } + } +} + +func ValidateNatsMessageDataOrFail(t *testing.T, data string, notify ...chan bool) nats.MsgHandler { + return func(msg *nats.Msg) { + for _, n := range notify { + n <- true + } + + event := cev2.New(cev2.CloudEventsVersionV1) + if err := json.Unmarshal(msg.Data, &event); err != nil { + t.Errorf("failed to unmarshal message with error: %v", err) + } + + if eventData := string(event.Data()); data != eventData { + t.Errorf("invalid message data, expected [%s] but found [%s]", data, eventData) + } + } +} + +func WaitForChannelOrTimeout(done chan bool, timeout time.Duration) error { + timer := time.NewTimer(timeout) + defer timer.Stop() + + select { + case <-done: + return nil + case <-timer.C: + return fmt.Errorf("timeout is reached %v", timeout) + } +} From 121ab1ee6208c548c6d71c3cb847def9b9ad04b8 Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Tue, 9 Mar 2021 16:52:12 +0100 Subject: [PATCH 015/194] Enable in-cluster Eventing without creating Kyma Applications (#10670) --- go.sum | 19 ------------------- pkg/application/clean.go | 14 +++++++++++--- pkg/application/clean_test.go | 2 +- pkg/legacy-events/legacy.go | 16 ++++++++-------- 4 files changed, 20 insertions(+), 31 deletions(-) diff --git a/go.sum b/go.sum index 3f21ce1..8ff281a 100644 --- a/go.sum +++ b/go.sum @@ -33,7 +33,6 @@ github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -59,7 +58,6 @@ github.com/avast/retry-go v2.4.1+incompatible h1:WMHc0mwoz20UVmBYK89mUB/KFRlxO0p github.com/avast/retry-go v2.4.1+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= @@ -67,7 +65,6 @@ github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnweb github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -140,7 +137,6 @@ github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTg github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs= github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= @@ -294,7 +290,6 @@ github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kyma-incubator/api-gateway v0.0.0-20200930072023-5d3f2107a1ef h1:YkBUaF/CdwgbdTt1eBeaiy1W/ZU/dzSRP2BBPmFm6jc= github.com/kyma-incubator/api-gateway v0.0.0-20200930072023-5d3f2107a1ef/go.mod h1:DGeKJ2GUH1cOAxUKVbUUl55DuIX6w2DXgZjlg8UTwrU= @@ -316,7 +311,6 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -363,7 +357,6 @@ github.com/nats-io/nkeys v0.2.0 h1:WXKF7diOaPU9cJdLD7nuzwasQy9vT1tBqzXZZf3AMJM= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -406,25 +399,21 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.2.1 h1:JnMpQc6ppsNgw9QPAGF6Dod479itz7lvlsMzzNayLOI= github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -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.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLyCY= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= -github.com/prometheus/procfs v0.0.11 h1:DhHlBtkHWPYi8O2y31JkK0TF+DGM+51OopZjH/Ia5qI= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= @@ -463,7 +452,6 @@ github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhV github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= @@ -490,7 +478,6 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.14.0 h1:/pduUoebOeeJzTDFuoMgC6nRkiasr1sBCIEorly7m4o= @@ -537,7 +524,6 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -670,7 +656,6 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= -gomodules.xyz/jsonpatch/v2 v2.1.0 h1:Phva6wqu+xR//Njw6iorylFFgn/z547tw5Ne3HZPQ+k= gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= @@ -724,11 +709,9 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -755,7 +738,6 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= istio.io/api v0.0.0-20200812202721-24be265d41c3/go.mod h1:88HN3o1fSD1jo+Z1WTLlJfMm9biopur6Ct9BFKjiB64= istio.io/client-go v0.0.0-20200916161914-94f0e83444ca/go.mod h1:SO65MWt7I45dvUwuDowoiB0SVcGpfWZfUTlopvYpbZc= @@ -768,7 +750,6 @@ k8s.io/api v0.19.8 h1:U50vBUCb5kc2J483mnITLKfdyoITaC7PnaOJwT7oRRM= k8s.io/api v0.19.8/go.mod h1:9TMGoKoidvicOK0LSqj+Mj98pugQycbViPKyZHqutBc= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= -k8s.io/apiextensions-apiserver v0.18.12 h1:b0jTgW/qwqZBMIJTMxkLvvAtNRDZboG5yZiIbOFgQv8= k8s.io/apiextensions-apiserver v0.18.12/go.mod h1:nihADkPed1L37Vxpz2/BrtxO9mCtINH23aNtUe/CRLo= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= k8s.io/apimachinery v0.17.8/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= diff --git a/pkg/application/clean.go b/pkg/application/clean.go index 7c2b95e..bc1ac51 100644 --- a/pkg/application/clean.go +++ b/pkg/application/clean.go @@ -17,9 +17,12 @@ var ( invalidApplicationNameSegment = regexp.MustCompile("\\W|_") ) -// CleanName cleans the application name form none-alphanumeric characters and returns it +// GetCleanTypeOrName cleans the application name form none-alphanumeric characters and returns it // if the application type label exists, it will be cleaned and returned instead of the application name -func CleanName(application *applicationv1alpha1.Application) string { +func GetCleanTypeOrName(application *applicationv1alpha1.Application) string { + if application == nil { + return "" + } applicationName := application.Name for k, v := range application.Labels { if strings.ToLower(k) == typeLabel { @@ -27,7 +30,12 @@ func CleanName(application *applicationv1alpha1.Application) string { break } } - return invalidApplicationNameSegment.ReplaceAllString(applicationName, "") + return GetCleanName(applicationName) +} + +// GetCleanName cleans the name form none-alphanumeric characters and returns the clean name +func GetCleanName(name string) string { + return invalidApplicationNameSegment.ReplaceAllString(name, "") } // IsCleanName returns true if the name contains alphanumeric characters only, otherwise returns false diff --git a/pkg/application/clean_test.go b/pkg/application/clean_test.go index f73b153..606a9b1 100644 --- a/pkg/application/clean_test.go +++ b/pkg/application/clean_test.go @@ -49,7 +49,7 @@ func TestCleanName(t *testing.T) { } for _, tc := range testCases { - if gotName := CleanName(tc.givenApplication); tc.wantName != gotName { + if gotName := GetCleanTypeOrName(tc.givenApplication); tc.wantName != gotName { t.Errorf("Clean application name:[%s] failed, want:[%v] but got:[%v]", tc.givenApplication.Name, tc.wantName, gotName) } } diff --git a/pkg/legacy-events/legacy.go b/pkg/legacy-events/legacy.go index cd91ffa..9fba1fe 100644 --- a/pkg/legacy-events/legacy.go +++ b/pkg/legacy-events/legacy.go @@ -105,16 +105,16 @@ func (t Transformer) TransformLegacyRequestsToCE(writer http.ResponseWriter, req } // clean the application name form non-alphanumeric characters - applicationName := ParseApplicationNameFromPath(request.URL.Path) - app, err := t.applicationLister.Get(applicationName) - if err != nil { - response := ErrorResponse(http.StatusInternalServerError, err) - writeJSONResponse(writer, response) - return nil + appName := ParseApplicationNameFromPath(request.URL.Path) + if appObj, err := t.applicationLister.Get(appName); err == nil { + // handle existing applications + appName = application.GetCleanTypeOrName(appObj) + } else { + // handle non-existing applications + appName = application.GetCleanName(appName) } - applicationName = application.CleanName(app) - event, err := t.convertPublishRequestToCloudEvent(applicationName, parameters) + event, err := t.convertPublishRequestToCloudEvent(appName, parameters) if err != nil { response := ErrorResponse(http.StatusInternalServerError, err) writeJSONResponse(writer, response) From 12ee7d307fedb6534282b32648f244dce32763f6 Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Wed, 17 Mar 2021 17:25:26 +0100 Subject: [PATCH 016/194] Fix the subscribed endpoint filtration logic for empty event-sources (#10902) --- pkg/subscribed/helpers.go | 9 ++++++++- pkg/subscribed/helpers_test.go | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pkg/subscribed/helpers.go b/pkg/subscribed/helpers.go index 5dc768c..2dfc81a 100644 --- a/pkg/subscribed/helpers.go +++ b/pkg/subscribed/helpers.go @@ -86,7 +86,14 @@ func FilterEventTypeVersions(eventTypePrefix, bebNs, appName string, filters *ev searchingForEventPrefix := strings.ToLower(fmt.Sprintf("%s.%s.", eventTypePrefix, appName)) if filter.EventSource != nil && filter.EventType != nil { - if strings.ToLower(filter.EventSource.Value) == strings.ToLower(bebNs) && strings.HasPrefix(filter.EventType.Value, searchingForEventPrefix) { + // TODO revisit the filtration logic as part of https://github.com/kyma-project/kyma/issues/10761 + + // filter by event-source if exists + if len(strings.TrimSpace(filter.EventSource.Value)) > 0 && strings.ToLower(filter.EventSource.Value) != strings.ToLower(bebNs) { + continue + } + + if strings.HasPrefix(filter.EventType.Value, searchingForEventPrefix) { eventTypeVersion := strings.ReplaceAll(filter.EventType.Value, searchingForEventPrefix, "") eventTypeVersionArr := strings.Split(eventTypeVersion, ".") version := eventTypeVersionArr[len(eventTypeVersionArr)-1] diff --git a/pkg/subscribed/helpers_test.go b/pkg/subscribed/helpers_test.go index 1d81936..36b46cf 100644 --- a/pkg/subscribed/helpers_test.go +++ b/pkg/subscribed/helpers_test.go @@ -51,13 +51,14 @@ func TestFilterEventTypeVersions(t *testing.T) { filters: NewBEBFilters(WithMultipleBEBFiltersFromSameSource), expectedEvents: []Event{}, }, { - name: "should return 1 event(out of multiple) which matches one source(bebNamespace)", + name: "should return 2 events(out of multiple) which matches two sources (bebNamespace and empty)", appName: "foovarkes", eventTypePrefix: "foo.prefix.custom", bebNs: "foo-match", filters: NewBEBFilters(WithMultipleBEBFiltersFromDiffSource), expectedEvents: []Event{ NewEvent("order.created", "v1"), + NewEvent("order.created", "v1"), }, }, { name: "should return 2 out 3 events in a slice when filters with different eventTypePrefix are provided", @@ -78,7 +79,6 @@ func TestFilterEventTypeVersions(t *testing.T) { if !reflect.DeepEqual(tc.expectedEvents, gotEvents) { t.Errorf("Received incorrect events, Wanted: %v, Got: %v", tc.expectedEvents, gotEvents) } - }) } } @@ -218,11 +218,13 @@ func WithMultipleBEBFiltersFromDiffSource(bebFilters *eventingv1alpha1.BebFilter evSource1 := "foo-match" evSource2 := "/default/foo.different/kt1" evSource3 := "/default/foo.different2/kt1" + evSource4 := "" evType := "foo.prefix.custom.foovarkes.order.created.v1" bebFilters.Filters = []*eventingv1alpha1.BebFilter{ NewBEBFilter(evSource1, evType), NewBEBFilter(evSource2, evType), NewBEBFilter(evSource3, evType), + NewBEBFilter(evSource4, evType), } } From d2d23c3d8d33f511141dbd0f81f5788a8f840798 Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Fri, 19 Mar 2021 08:54:27 +0100 Subject: [PATCH 017/194] Add basic metrics for Eventing publishers (#10919) Co-authored-by: Korbinian Stoemmer Co-authored-by: Aleksandra Simeonova --- README.md | 32 +++---- cmd/event-publisher-nats/main.go | 14 ++- cmd/event-publisher-proxy/main.go | 8 ++ go.mod | 5 +- go.sum | 150 +++++++++++++++++++++++++++--- pkg/metrics/metrics.go | 42 +++++++++ pkg/options/options.go | 6 +- 7 files changed, 223 insertions(+), 34 deletions(-) create mode 100644 pkg/metrics/metrics.go diff --git a/README.md b/README.md index af640c8..950e360 100644 --- a/README.md +++ b/README.md @@ -76,21 +76,21 @@ curl -v -X GET \ ## Environment Variables -| Environment Variable | Default Value | Description | -| ----------------------- | ------------- |---------------------------------------------------------------------------------------------- | -| INGRESS_PORT | 8080 | The ingress port for the CloudEvents Gateway Proxy. | -| MAX_IDLE_CONNS | 100 | The maximum number of idle (keep-alive) connections across all hosts. Zero means no limit. | -| MAX_IDLE_CONNS_PER_HOST | 2 | The maximum idle (keep-alive) connections to keep per-host. Zero means the default value. | -| REQUEST_TIMEOUT | 5s | The timeout for the outgoing requests to the Messaging server. | -| CLIENT_ID | | The Client ID used to acquire Access Tokens from the Authentication server. | -| CLIENT_SECRET | | The Client Secret used to acquire Access Tokens from the Authentication server. | -| TOKEN_ENDPOINT | | The Authentication Server Endpoint to provide Access Tokens. | -| EMS_PUBLISH_URL | | The Messaging Server Endpoint that accepts publishing CloudEvents to it. | -| BEB_NAMESPACE | | The name of the namespace in BEB. | -| EVENT_TYPE_PREFIX | | The prefix of the eventType as per the BEB event specification. | - +| Environment Variable | Default Value | Description | +| ----------------------- | ------------- |------------------------------------------------------------------------------------------- | +| INGRESS_PORT | 8080 | The ingress port for the Cloud Events Gateway Proxy. | +| MAX_IDLE_CONNS | 100 | The maximum number of idle (keep-alive) connections across all hosts. Zero means no limit. | +| MAX_IDLE_CONNS_PER_HOST | 2 | The maximum idle (keep-alive) connections to keep per-host. Zero means the default value. | +| REQUEST_TIMEOUT | 5s | The timeout for the outgoing requests to the Messaging server. | +| CLIENT_ID | | The Client ID used to acquire Access Tokens from the Authentication server. | +| CLIENT_SECRET | | The Client Secret used to acquire Access Tokens from the Authentication server. | +| TOKEN_ENDPOINT | | The Authentication Server Endpoint to provide Access Tokens. | +| EMS_PUBLISH_URL | | The Messaging Server Endpoint that accepts publishing Cloud Events to it. | +| BEB_NAMESPACE | | The name of the namespace in BEB. | +| EVENT_TYPE_PREFIX | | The prefix of the eventType as per the BEB event specification. | ## Flags -| Flag | Default Value | Description | -| ----------------------- | ------------- |---------------------------------------------------------------------------------------------- | -| maxRequestSize | 65536 | The maximum size of the request. | +| Flag | Default Value | Description | +| ----------------------- | ------------- |------------------------------------------------------------------------------------------- | +| max-request-size | 65536 | The maximum size of the request. | +| metrics-addr | :9090 | The address the metric endpoint binds to. | diff --git a/cmd/event-publisher-nats/main.go b/cmd/event-publisher-nats/main.go index 4796c5a..38625e1 100644 --- a/cmd/event-publisher-nats/main.go +++ b/cmd/event-publisher-nats/main.go @@ -1,13 +1,14 @@ package main import ( + "github.com/kelseyhightower/envconfig" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/sirupsen/logrus" + "k8s.io/client-go/dynamic" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "sigs.k8s.io/controller-runtime/pkg/client/config" - "github.com/kelseyhightower/envconfig" - "github.com/sirupsen/logrus" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" @@ -36,6 +37,13 @@ func main() { // assure uniqueness ctx := signals.NewContext() + // metrics + metricsServer := metrics.NewServer(logger) + defer metricsServer.Stop() + if err := metricsServer.Start(opts.MetricsAddress); err != nil { + logger.Infof("Metrics server failed to start with error: %v", err) + } + // connect to nats connection, err := pkgnats.ConnectToNats(cfgNats.URL, cfgNats.RetryOnFailedConnect, cfgNats.MaxReconnects, cfgNats.ReconnectWait) if err != nil { diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index 14c01c9..39f2baa 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -1,6 +1,7 @@ package main import ( + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "k8s.io/client-go/dynamic" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "sigs.k8s.io/controller-runtime/pkg/client/config" @@ -36,6 +37,13 @@ func main() { client := oauth.NewClient(ctx, cfg) defer client.CloseIdleConnections() + // metrics + metricsServer := metrics.NewServer(logger) + defer metricsServer.Stop() + if err := metricsServer.Start(opts.MetricsAddress); err != nil { + logger.Infof("Metrics server failed to start with error: %v", err) + } + // configure message sender messageSender := sender.NewHttpMessageSender(cfg.EmsPublishURL, client) diff --git a/go.mod b/go.mod index 8c319c8..b2d04a9 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 github.com/cloudevents/sdk-go/v2 v2.3.1 - github.com/go-logr/logr v0.3.0 + github.com/go-logr/logr v0.3.0 // indirect github.com/go-logr/zapr v0.1.1 // indirect github.com/google/uuid v1.1.1 github.com/kelseyhightower/envconfig v1.4.0 @@ -14,7 +14,7 @@ require ( github.com/nats-io/nats-server/v2 v2.1.9 github.com/nats-io/nats.go v1.10.1-0.20201204000952-090c71e95cd0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.2.1 // indirect + github.com/prometheus/client_golang v1.9.0 github.com/sirupsen/logrus v1.6.0 github.com/stretchr/testify v1.6.1 go.opencensus.io v0.22.4 @@ -24,7 +24,6 @@ require ( golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4 // indirect - gomodules.xyz/jsonpatch/v2 v2.1.0 // indirect gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect k8s.io/api v0.19.8 k8s.io/apimachinery v0.19.8 diff --git a/go.sum b/go.sum index 8ff281a..7e35480 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,10 @@ github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -43,32 +45,47 @@ github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdko github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053/go.mod h1:xW8sBma2LE3QxFSzCnH9qe6gAE2yO9GvQaWwX89HxbE= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/avast/retry-go v2.4.1+incompatible h1:WMHc0mwoz20UVmBYK89mUB/KFRlxO0p+s+sgpmJMviY= github.com/avast/retry-go v2.4.1+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudevents/sdk-go v1.2.0 h1:2AxI14EJUw1PclJ5gZJtzbxnHIfNMdi76Qq3P3G1BRU= github.com/cloudevents/sdk-go v1.2.0/go.mod h1:ss+jWJ88wypiewnPEzChSBzTYXGpdcILoN9YHk8uhTQ= @@ -79,6 +96,7 @@ github.com/cloudevents/sdk-go/v2 v2.3.1 h1:QRTu0yRA4FbznjRSds0/4Hy6cVYpWV2wInlNJ github.com/cloudevents/sdk-go/v2 v2.3.1/go.mod h1:4fO2UjPMYYR1/7KPJQCwTPb0lFA8zYuitkUpAZFSY1Q= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= @@ -89,6 +107,7 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7 github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -106,10 +125,12 @@ github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25Kn github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -120,6 +141,8 @@ github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQo github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -130,13 +153,16 @@ github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 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-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs= github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= +github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= @@ -181,7 +207,9 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -210,8 +238,9 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -241,8 +270,10 @@ github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1a github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= @@ -250,23 +281,44 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -275,7 +327,9 @@ github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -290,16 +344,19 @@ github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kyma-incubator/api-gateway v0.0.0-20200930072023-5d3f2107a1ef h1:YkBUaF/CdwgbdTt1eBeaiy1W/ZU/dzSRP2BBPmFm6jc= github.com/kyma-incubator/api-gateway v0.0.0-20200930072023-5d3f2107a1ef/go.mod h1:DGeKJ2GUH1cOAxUKVbUUl55DuIX6w2DXgZjlg8UTwrU= github.com/kyma-project/kyma v0.5.1-0.20200609051543-f5997d4a36d6 h1:P3R3c4pewIa+IjzNldO9WRFA58s0r3WVqRxLK6feYc8= github.com/kyma-project/kyma v0.5.1-0.20200609051543-f5997d4a36d6/go.mod h1:cfj5AQwIOmmoXLZUhW3bIiaB66Z6vgjCYu7TRK3+1lc= github.com/kyma-project/kyma/components/event-publisher-proxy v0.0.0-20201014135541-82b304ab245a/go.mod h1:SzxIlsqx8zJXNhqyUabWs8NzYcfEv1SleJ1U0+Gp6Ms= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316 h1:wZ2BvFuElkG6K3pOFxLiT/oXeH07N/wfJqj1LlL76rY= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316/go.mod h1:ZBfptvrdh3YUmdJac/1IFm2pgyk+YAfyLET05ztKTlI= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac h1:+2b6iGRJe3hvV/yVXrd41yVEjxuFHxasJqDhkIjS4gk= github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac/go.mod h1:Frd2bnT3w5FB5q49ENTfVlztJES+1k/7lyWX2+9gq/M= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -308,14 +365,22 @@ github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN 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/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -327,6 +392,7 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= @@ -357,9 +423,12 @@ github.com/nats-io/nkeys v0.2.0 h1:WXKF7diOaPU9cJdLD7nuzwasQy9vT1tBqzXZZf3AMJM= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -378,54 +447,86 @@ github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/ory/oathkeeper-maester v0.1.0 h1:xqY4Px2ubPyAS/3bl0AcI6ctW2/lrXJUHHb5gXNz97U= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/ory/oathkeeper-maester v0.1.0/go.mod h1:O692MD+MJP3dx0QUV1iOcSPxczdRZEj5WauFaD1vy7U= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= +github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +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.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -438,6 +539,9 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -452,6 +556,8 @@ github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhV github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= @@ -478,11 +584,14 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.14.0 h1:/pduUoebOeeJzTDFuoMgC6nRkiasr1sBCIEorly7m4o= go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -524,12 +633,14 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -551,6 +662,7 @@ golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -568,9 +680,11 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -591,20 +705,23 @@ golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd h1:5CtCZbICpIOFdgO940moixOPjc0178IU44m4EjOO5IY= golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -630,6 +747,7 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -647,6 +765,7 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4 h1:v8Jgq9X6Es9K9otVr9jxENEJigepKMZgA9OmrIZDtFA= golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= @@ -656,7 +775,6 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= -gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= @@ -668,6 +786,7 @@ google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEn google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -687,8 +806,11 @@ google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEY google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= @@ -709,10 +831,12 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= @@ -720,10 +844,12 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= @@ -738,6 +864,7 @@ honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= istio.io/api v0.0.0-20200812202721-24be265d41c3/go.mod h1:88HN3o1fSD1jo+Z1WTLlJfMm9biopur6Ct9BFKjiB64= istio.io/client-go v0.0.0-20200916161914-94f0e83444ca/go.mod h1:SO65MWt7I45dvUwuDowoiB0SVcGpfWZfUTlopvYpbZc= @@ -818,3 +945,4 @@ sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go new file mode 100644 index 0000000..92234ec --- /dev/null +++ b/pkg/metrics/metrics.go @@ -0,0 +1,42 @@ +package metrics + +import ( + "context" + "net" + "net/http" + "strings" + + "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/sirupsen/logrus" +) + +type Server struct { + srv http.Server + logger *logrus.Logger +} + +func NewServer(logger *logrus.Logger) *Server { + return &Server{logger: logger} +} + +func (s *Server) Start(address string) error { + if len(strings.TrimSpace(address)) > 0 { + s.srv = http.Server{Handler: promhttp.Handler()} + + listener, err := net.Listen("tcp", address) + if err != nil { + return err + } + + s.logger.Infof("Metrics server started on %v", address) + go s.srv.Serve(listener) + } + + return nil +} + +func (s *Server) Stop() { + if err := s.srv.Shutdown(context.Background()); err != nil { + s.logger.Infof("Metrics server failed to shutdown with error: %v", err) + } +} diff --git a/pkg/options/options.go b/pkg/options/options.go index 6d57313..d43b8b8 100644 --- a/pkg/options/options.go +++ b/pkg/options/options.go @@ -4,13 +4,17 @@ import "flag" type Options struct { MaxRequestSize int64 + MetricsAddress string } func ParseArgs() *Options { - maxRequestSize := flag.Int64("maxRequestSize", 65536, "The maximum request size in bytes") + maxRequestSize := flag.Int64("max-request-size", 65536, "The maximum request size in bytes.") + metricsAddress := flag.String("metrics-addr", ":9090", "The address the metric endpoint binds to.") + flag.Parse() return &Options{ MaxRequestSize: *maxRequestSize, + MetricsAddress: *metricsAddress, } } From 351ce1c01a40fc18189eaac78edaaef58d86df2d Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Thu, 1 Apr 2021 12:03:46 +0200 Subject: [PATCH 018/194] Update the event-type cleanup logic (#11007) --- pkg/handler/http/handler.go | 21 ++++++++++++++++-- pkg/handler/nats/handler.go | 21 ++++++++++++++++-- pkg/legacy-events/legacy.go | 17 ++++++++++++++- pkg/legacy-events/legacy_test.go | 37 +++++++++++++++++++++++++++++--- 4 files changed, 88 insertions(+), 8 deletions(-) diff --git a/pkg/handler/http/handler.go b/pkg/handler/http/handler.go index fe29359..3f110fa 100644 --- a/pkg/handler/http/handler.go +++ b/pkg/handler/http/handler.go @@ -129,7 +129,16 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h statusCode, dispatchTime, respBody := h.send(ctx, event) // Change response as per old error codes h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, statusCode, event, string(respBody)) - h.Logger.Infof("Event dispatched id:[%s] statusCode:[%d] duration:[%s] responseBody:[%s]", event.ID(), statusCode, dispatchTime, respBody) + + h.Logger.WithFields( + logrus.Fields{ + "id": event.ID(), + "source": event.Source(), + "type": event.Type(), + "statusCode": statusCode, + "duration": dispatchTime, + "responseBody": respBody, + }).Info("Event dispatched") } func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.Request) { @@ -162,7 +171,15 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R statusCode, dispatchTime, respBody := h.send(ctx, event) h.writeResponse(writer, statusCode, respBody) - h.Logger.Infof("Event dispatched id:[%s] statusCode:[%d] duration:[%s] responseBody:[%s]", event.ID(), statusCode, dispatchTime, respBody) + h.Logger.WithFields( + logrus.Fields{ + "id": event.ID(), + "source": event.Source(), + "type": event.Type(), + "statusCode": statusCode, + "duration": dispatchTime, + "responseBody": respBody, + }).Info("Event dispatched") } // writeResponse writes the HTTP response given the status code and response body. diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index 2ee36ae..6798e24 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -111,7 +111,16 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h statusCode, dispatchTime, respBody := h.send(ctx, event) // Change response as per old error codes h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, statusCode, event, string(respBody)) - h.Logger.Infof("Event dispatched id:[%s] statusCode:[%d] duration:[%s] responseBody:[%s]", event.ID(), statusCode, dispatchTime, respBody) + + h.Logger.WithFields( + logrus.Fields{ + "id": event.ID(), + "source": event.Source(), + "type": event.Type(), + "statusCode": statusCode, + "duration": dispatchTime, + "responseBody": respBody, + }).Info("Event dispatched") } func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.Request) { @@ -144,7 +153,15 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R statusCode, dispatchTime, respBody := h.send(ctx, event) h.writeResponse(writer, statusCode, respBody) - h.Logger.Infof("Event dispatched id:[%s] statusCode:[%d] duration:[%s] responseBody:[%s]", event.ID(), statusCode, dispatchTime, respBody) + h.Logger.WithFields( + logrus.Fields{ + "id": event.ID(), + "source": event.Source(), + "type": event.Type(), + "statusCode": statusCode, + "duration": dispatchTime, + "responseBody": respBody, + }).Info("Event dispatched") } // writeResponse writes the HTTP response given the status code and response body. diff --git a/pkg/legacy-events/legacy.go b/pkg/legacy-events/legacy.go index 9fba1fe..c2ccfcc 100644 --- a/pkg/legacy-events/legacy.go +++ b/pkg/legacy-events/legacy.go @@ -2,8 +2,10 @@ package legacy import ( "encoding/json" + "fmt" "net/http" "regexp" + "strings" "time" cev2event "github.com/cloudevents/sdk-go/v2/event" @@ -168,10 +170,23 @@ func (t Transformer) convertPublishRequestToCloudEvent(appName string, publishRe event.SetID(uuid.New().String()) } - eventType := formatEventType4BEB(t.eventTypePrefix, appName, publishRequest.PublishrequestV1.EventType, publishRequest.PublishrequestV1.EventTypeVersion) + eventTypeCombined := combineEventTypeSegments(publishRequest.PublishrequestV1.EventType) + eventType := formatEventType4BEB(t.eventTypePrefix, appName, eventTypeCombined, publishRequest.PublishrequestV1.EventTypeVersion) event.SetSource(t.bebNamespace) event.SetType(eventType) event.SetExtension(eventTypeVersionExtensionKey, publishRequest.PublishrequestV1.EventTypeVersion) event.SetDataContentType(ContentTypeApplicationJSON) return &event, nil } + +// combineEventTypeSegments returns an event-type with exactly two segments separated by "." if the given event-type +// has more than two segments separated by "." (e.g. "Account.Order.Created" becomes "AccountOrder.Created") +func combineEventTypeSegments(eventType string) string { + parts := strings.Split(eventType, ".") + if len(parts) > 2 { + businessObject := strings.Join(parts[0:len(parts)-1], "") + operation := parts[len(parts)-1] + eventType = fmt.Sprintf("%s.%s", businessObject, operation) + } + return eventType +} diff --git a/pkg/legacy-events/legacy_test.go b/pkg/legacy-events/legacy_test.go index 871fabd..802c06c 100644 --- a/pkg/legacy-events/legacy_test.go +++ b/pkg/legacy-events/legacy_test.go @@ -8,23 +8,27 @@ import ( . "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) +const ( + eventTypeMultiSegment = "Segment1.Segment2.Segment3.Segment4.Segment5" + eventTypeMultiSegmentCombined = "Segment1Segment2Segment3Segment4.Segment5" +) + func TestConvertPublishRequestToCloudEvent(t *testing.T) { bebNs := MessagingNamespace eventTypePrefix := MessagingEventTypePrefix legacyTransformer := NewTransformer(bebNs, eventTypePrefix, nil) eventID := EventID appName := ApplicationName - legacyEventType := LegacyEventType legacyEventVersion := LegacyEventTypeVersion data := LegacyEventData timeNow := time.Now() - expectedEventType := formatEventType4BEB(eventTypePrefix, appName, legacyEventType, legacyEventVersion) + expectedEventType := formatEventType4BEB(eventTypePrefix, appName, eventTypeMultiSegmentCombined, legacyEventVersion) timeNowStr := timeNow.Format(time.RFC3339) timeNowFormatted, _ := time.Parse(time.RFC3339, timeNowStr) publishReqParams := &legacyapi.PublishEventParametersV1{ PublishrequestV1: legacyapi.PublishRequestV1{ EventID: eventID, - EventType: legacyEventType, + EventType: eventTypeMultiSegment, EventTime: timeNowStr, EventTypeVersion: legacyEventVersion, Data: data, @@ -63,3 +67,30 @@ func TestConvertPublishRequestToCloudEvent(t *testing.T) { t.Errorf("incorrect eventtype extension, want: %s, got: %s", legacyEventVersion, gotExtension) } } + +func TestCombineEventTypeSegments(t *testing.T) { + testCases := []struct { + name string + givenEventType string + wantEventType string + }{ + { + name: "event-type with two segments", + givenEventType: LegacyEventType, + wantEventType: LegacyEventType, + }, + { + name: "event-type with more than two segments", + givenEventType: eventTypeMultiSegment, + wantEventType: eventTypeMultiSegmentCombined, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + if gotEventType := combineEventTypeSegments(tc.givenEventType); tc.wantEventType != gotEventType { + t.Fatalf("invalid event-type want: %s, got: %s", tc.wantEventType, gotEventType) + } + }) + } +} From fa96adfa88f1dd62dd35e33a3aee28f72b07f54a Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Fri, 9 Apr 2021 10:56:56 +0200 Subject: [PATCH 019/194] Add latency metrics for Event publishers (#11058) --- cmd/event-publisher-nats/main.go | 18 ++++--- cmd/event-publisher-proxy/main.go | 12 +++-- pkg/handler/http/handler.go | 10 +++- pkg/handler/http/handler_test.go | 47 ++++++++++++++---- pkg/handler/nats/handler.go | 10 +++- pkg/handler/nats/handler_test.go | 17 ++++++- pkg/metrics/collector.go | 66 ++++++++++++++++++++++++++ pkg/metrics/metricstest/metricstest.go | 25 ++++++++++ pkg/metrics/{metrics.go => server.go} | 0 testing/utils.go | 4 ++ 10 files changed, 188 insertions(+), 21 deletions(-) create mode 100644 pkg/metrics/collector.go create mode 100644 pkg/metrics/metricstest/metricstest.go rename pkg/metrics/{metrics.go => server.go} (100%) diff --git a/cmd/event-publisher-nats/main.go b/cmd/event-publisher-nats/main.go index 38625e1..36906e2 100644 --- a/cmd/event-publisher-nats/main.go +++ b/cmd/event-publisher-nats/main.go @@ -1,19 +1,20 @@ package main import ( - "github.com/kelseyhightower/envconfig" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" - "github.com/sirupsen/logrus" - "k8s.io/client-go/dynamic" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "sigs.k8s.io/controller-runtime/pkg/client/config" + "github.com/kelseyhightower/envconfig" + "github.com/prometheus/client_golang/prometheus" + "github.com/sirupsen/logrus" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" @@ -37,13 +38,17 @@ func main() { // assure uniqueness ctx := signals.NewContext() - // metrics + // metrics server metricsServer := metrics.NewServer(logger) defer metricsServer.Stop() if err := metricsServer.Start(opts.MetricsAddress); err != nil { logger.Infof("Metrics server failed to start with error: %v", err) } + // metrics collector + metricsCollector := metrics.NewCollector() + prometheus.MustRegister(metricsCollector) + // connect to nats connection, err := pkgnats.ConnectToNats(cfgNats.URL, cfgNats.RetryOnFailedConnect, cfgNats.MaxReconnects, cfgNats.ReconnectWait) if err != nil { @@ -83,7 +88,8 @@ func main() { logger.Info("Informers are synced successfully") // start handler which blocks until it receives a shutdown signal - if err := nats.NewHandler(messageReceiver, messageSenderToNats, cfgNats.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logger).Start(ctx); err != nil { + if err := nats.NewHandler(messageReceiver, messageSenderToNats, cfgNats.RequestTimeout, legacyTransformer, opts, + subscribedProcessor, logger, metricsCollector).Start(ctx); err != nil { logger.Fatalf("Start handler failed with error: %s", err) } diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index 39f2baa..581dc1b 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -1,12 +1,12 @@ package main import ( - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "k8s.io/client-go/dynamic" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" "sigs.k8s.io/controller-runtime/pkg/client/config" "github.com/kelseyhightower/envconfig" + "github.com/prometheus/client_golang/prometheus" "github.com/sirupsen/logrus" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" @@ -14,6 +14,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/http" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" @@ -37,13 +38,17 @@ func main() { client := oauth.NewClient(ctx, cfg) defer client.CloseIdleConnections() - // metrics + // metrics server metricsServer := metrics.NewServer(logger) defer metricsServer.Stop() if err := metricsServer.Start(opts.MetricsAddress); err != nil { logger.Infof("Metrics server failed to start with error: %v", err) } + // metrics collector + metricsCollector := metrics.NewCollector() + prometheus.MustRegister(metricsCollector) + // configure message sender messageSender := sender.NewHttpMessageSender(cfg.EmsPublishURL, client) @@ -75,7 +80,8 @@ func main() { logger.Info("Informers are synced successfully") // start handler which blocks until it receives a shutdown signal - if err := http.NewHandler(messageReceiver, messageSender, cfg.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logger).Start(ctx); err != nil { + if err := http.NewHandler(messageReceiver, messageSender, cfg.RequestTimeout, legacyTransformer, opts, + subscribedProcessor, logger, metricsCollector).Start(ctx); err != nil { logger.Fatalf("Start handler failed with error: %s", err) } logger.Info("Shutdown the Event Publisher Proxy") diff --git a/pkg/handler/http/handler.go b/pkg/handler/http/handler.go index 3f110fa..cd14093 100644 --- a/pkg/handler/http/handler.go +++ b/pkg/handler/http/handler.go @@ -18,6 +18,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" @@ -57,10 +58,14 @@ type Handler struct { Logger *logrus.Logger // Options configures HTTP server Options *options.Options + // collector collects metrics + collector *metrics.Collector } // NewHandler returns a new HTTP Handler instance. -func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.HttpMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logrus.Logger) *Handler { +func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.HttpMessageSender, requestTimeout time.Duration, + legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, + logger *logrus.Logger, collector *metrics.Collector) *Handler { return &Handler{ Receiver: receiver, Sender: sender, @@ -69,6 +74,7 @@ func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.HttpMessa SubscribedProcessor: subscribedProcessor, Logger: logger, Options: opts, + collector: collector, } } @@ -224,9 +230,11 @@ func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.D resp, dispatchTime, err := h.sendAndRecordDispatchTime(request) if err != nil { h.Logger.Errorf("failed to send event and record dispatch time with error: %s", err) + h.collector.RecordError() return http.StatusInternalServerError, dispatchTime, []byte{} } defer func() { _ = resp.Body.Close() }() + h.collector.RecordLatency(dispatchTime) body, err := ioutil.ReadAll(resp.Body) if err != nil { diff --git a/pkg/handler/http/handler_test.go b/pkg/handler/http/handler_test.go index 3e857f5..ba3ed05 100644 --- a/pkg/handler/http/handler_test.go +++ b/pkg/handler/http/handler_test.go @@ -30,6 +30,8 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" @@ -66,7 +68,9 @@ func TestHandlerForCloudEvents(t *testing.T) { publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) ) - cancel, mockServer := setupTestResources(t, port, requestSize, applicationName, expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) + cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, + expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, + requestTimeout, serverResponseTime) defer cancel() defer mockServer.Close() @@ -81,6 +85,9 @@ func TestHandlerForCloudEvents(t *testing.T) { if testCase.WantStatusCode != resp.StatusCode { tt.Fatalf("Test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) } + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, collector) + } }) } } @@ -106,7 +113,9 @@ func TestHandlerForLegacyEvents(t *testing.T) { publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/%s/v1/events", port, applicationName) ) - cancel, mockServer := setupTestResources(t, port, requestSize, applicationName, expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) + cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, + expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, + requestTimeout, serverResponseTime) defer cancel() defer mockServer.Close() @@ -128,6 +137,10 @@ func TestHandlerForLegacyEvents(t *testing.T) { } else { handlertest.ValidateErrorResponse(t, *resp, &testCase.WantResponse) } + + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, collector) + } }) } } @@ -154,7 +167,8 @@ func TestHandlerForBEBFailures(t *testing.T) { publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/%s/v1/events", port, applicationName) ) - cancel, mockServer := setupTestResources(t, port, requestSize, applicationName, applicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) + cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, applicationName, + healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) defer cancel() defer mockServer.Close() @@ -205,6 +219,10 @@ func TestHandlerForBEBFailures(t *testing.T) { if testCase.endPoint == publishLegacyEndpoint { handlertest.ValidateErrorResponse(t, *resp, &testCase.wantResponse) } + + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, collector) + } }) } } @@ -225,7 +243,8 @@ func TestHandlerForHugeRequests(t *testing.T) { publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/%s/v1/events", port, applicationName) ) - cancel, mockServer := setupTestResources(t, port, requestSize, applicationName, applicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) + cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, applicationName, + healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) defer cancel() defer mockServer.Close() @@ -266,6 +285,10 @@ func TestHandlerForHugeRequests(t *testing.T) { if testCase.wantStatusCode != resp.StatusCode { t.Fatalf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) } + + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, collector) + } }) } } @@ -286,7 +309,8 @@ func TestHandlerForSubscribedEndpoint(t *testing.T) { subscribedEndpointFormat = "http://localhost:%d/%s/v1/events/subscribed" ) - cancel, mockServer := setupTestResources(t, port, requestSize, applicationName, applicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) + cancel, mockServer, _ := setupTestResources(t, port, requestSize, applicationName, applicationName, healthEndpoint, + bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) defer cancel() defer mockServer.Close() @@ -334,7 +358,8 @@ func TestHandlerTimeout(t *testing.T) { publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) ) - cancel, mockServer := setupTestResources(t, port, requestSize, applicationName, applicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) + cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, applicationName, + healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) defer cancel() defer mockServer.Close() @@ -347,6 +372,7 @@ func TestHandlerTimeout(t *testing.T) { if http.StatusInternalServerError != resp.StatusCode { t.Fatalf("Test failed, want status code:%d but got:%d", http.StatusInternalServerError, resp.StatusCode) } + metricstest.EnsureMetricErrors(t, collector) } func TestIsARequestWithLegacyEvent(t *testing.T) { @@ -380,7 +406,9 @@ func TestIsARequestWithLegacyEvent(t *testing.T) { } } -func setupTestResources(t *testing.T, port, maxRequestSize int, applicationName, expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint string, requestTimeout, serverResponseTime time.Duration) (context.CancelFunc, *testingutils.MockServer) { +func setupTestResources(t *testing.T, port, maxRequestSize int, applicationName, expectedApplicationName, + healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint string, requestTimeout, + serverResponseTime time.Duration) (context.CancelFunc, *testingutils.MockServer, *metrics.Collector) { validator := validateApplicationName(expectedApplicationName) mockServer := testingutils.NewMockServer(testingutils.WithResponseTime(serverResponseTime), testingutils.WithValidator(validator)) mockServer.Start(t, defaultTokenEndpoint, defaultEventsEndpoint, defaultEventsHTTP400Endpoint) @@ -450,7 +478,8 @@ func setupTestResources(t *testing.T, port, maxRequestSize int, applicationName, Logger: logrus.New(), } - msgHandler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logrus.New()) + collector := metrics.NewCollector() + msgHandler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logrus.New(), collector) go func() { if err := msgHandler.Start(ctx); err != nil { t.Errorf("failed to start handler with error: %v", err) @@ -458,7 +487,7 @@ func setupTestResources(t *testing.T, port, maxRequestSize int, applicationName, }() testingutils.WaitForHandlerToStart(t, healthEndpoint) - return cancel, mockServer + return cancel, mockServer, collector } func validateApplicationName(appName string) testingutils.Validator { diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index 6798e24..b3d8312 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -15,6 +15,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" @@ -40,10 +41,14 @@ type Handler struct { Logger *logrus.Logger // Options configures HTTP server Options *options.Options + // collector collects metrics + collector *metrics.Collector } // NewHandler returns a new NATS Handler instance. -func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.NatsMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logrus.Logger) *Handler { +func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.NatsMessageSender, requestTimeout time.Duration, + legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, + logger *logrus.Logger, collector *metrics.Collector) *Handler { return &Handler{ Receiver: receiver, Sender: sender, @@ -52,6 +57,7 @@ func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.NatsMessa SubscribedProcessor: subscribedProcessor, Logger: logger, Options: opts, + collector: collector, } } @@ -192,7 +198,9 @@ func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.D resp, err := h.Sender.Send(ctx, event) dispatchTime := time.Since(start) if err != nil { + h.collector.RecordError() return resp, dispatchTime, []byte(err.Error()) } + h.collector.RecordLatency(dispatchTime) return resp, dispatchTime, []byte{} } diff --git a/pkg/handler/nats/handler_test.go b/pkg/handler/nats/handler_test.go index 312c698..97647a0 100644 --- a/pkg/handler/nats/handler_test.go +++ b/pkg/handler/nats/handler_test.go @@ -27,6 +27,8 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" @@ -40,6 +42,7 @@ type Test struct { logger *logrus.Logger natsConfig *env.NatsConfig natsServer *server.Server + collector *metrics.Collector natsUrl string healthEndpoint string } @@ -51,6 +54,7 @@ func (test *Test) init() { test.logger = logrus.New() test.natsConfig = newEnvConfig(port, natsPort) test.natsServer = testingutils.StartNatsServer() + test.collector = metrics.NewCollector() test.natsUrl = test.natsServer.ClientURL() test.healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) } @@ -121,7 +125,7 @@ func (test *Test) setupResources(t *testing.T, subscription *eventingv1alpha1.Su // start handler which blocks until it receives a shutdown signal opts := &options.Options{MaxRequestSize: 65536} - natsHandler := NewHandler(messageReceiver, msgSender, test.natsConfig.RequestTimeout, legacyTransformer, opts, subscribedProcessor, test.logger) + natsHandler := NewHandler(messageReceiver, msgSender, test.natsConfig.RequestTimeout, legacyTransformer, opts, subscribedProcessor, test.logger, test.collector) assert.NotNil(t, natsHandler) go func() { if err := natsHandler.Start(ctx); err != nil { @@ -184,6 +188,9 @@ func TestNatsHandlerForCloudEvents(t *testing.T) { if testCase.WantStatusCode != resp.StatusCode { t.Errorf("Test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) } + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, test.collector) + } }) } } @@ -235,6 +242,10 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { } else { handlertest.ValidateErrorResponse(t, *resp, &testCase.WantResponse) } + + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, test.collector) + } }) } } @@ -278,6 +289,10 @@ func TestNatsHandlerForSubscribedEndpoint(t *testing.T) { if !reflect.DeepEqual(testCase.WantResponse, gotEventsResponse) { t.Errorf("incorrect response, wanted: %v, got: %v", testCase.WantResponse, gotEventsResponse) } + + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, test.collector) + } }) } } diff --git a/pkg/metrics/collector.go b/pkg/metrics/collector.go new file mode 100644 index 0000000..01e9c96 --- /dev/null +++ b/pkg/metrics/collector.go @@ -0,0 +1,66 @@ +package metrics + +import ( + "time" + + "github.com/prometheus/client_golang/prometheus" +) + +const ( + // Errors name of the errors metric + Errors = "event_publish_to_messaging_server_errors_total" + // Latency name of the latency metric + Latency = "event_publish_to_messaging_server_latency" + // errorsHelp help for the errors metric + errorsHelp = "The total number of errors while sending Events to the messaging server" + // latencyHelp help for the latency metric + latencyHelp = "The duration of sending Events to the messaging server" +) + +// Collector implements the prometheus.Collector interface +type Collector struct { + errors *prometheus.CounterVec + latency *prometheus.HistogramVec +} + +// NewCollector a new instance of Collector +func NewCollector() *Collector { + return &Collector{ + errors: prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: Errors, + Help: errorsHelp, + }, + []string{}, + ), + latency: prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: Latency, + Help: latencyHelp, + }, + []string{}, + ), + } +} + +// Describe implements the prometheus.Collector interface Describe method +func (c *Collector) Describe(ch chan<- *prometheus.Desc) { + c.errors.Describe(ch) + c.latency.Describe(ch) +} + +// Collect implements the prometheus.Collector interface Collect method +func (c *Collector) Collect(ch chan<- prometheus.Metric) { + c.errors.Collect(ch) + c.latency.Collect(ch) +} + +// RecordError records an error metric +func (c *Collector) RecordError() { + c.errors.WithLabelValues().Inc() +} + +// RecordLatency records a latency metric +func (c *Collector) RecordLatency(duration time.Duration) { + c.latency.WithLabelValues().Observe(duration.Seconds()) +} diff --git a/pkg/metrics/metricstest/metricstest.go b/pkg/metrics/metricstest/metricstest.go new file mode 100644 index 0000000..4f12527 --- /dev/null +++ b/pkg/metrics/metricstest/metricstest.go @@ -0,0 +1,25 @@ +// Package metricstest provides utilities for metrics testing. +package metricstest + +import ( + "testing" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/prometheus/client_golang/prometheus/testutil" +) + +// EnsureMetricErrors ensures metric errors exists +func EnsureMetricErrors(t *testing.T, collector *metrics.Collector) { + ensureMetricCount(t, collector, metrics.Errors, 1) +} + +// EnsureMetricLatency ensures metric latency exists +func EnsureMetricLatency(t *testing.T, collector *metrics.Collector) { + ensureMetricCount(t, collector, metrics.Latency, 1) +} + +func ensureMetricCount(t *testing.T, collector *metrics.Collector, metric string, expectedCount int) { + if count := testutil.CollectAndCount(collector, metric); count != expectedCount { + t.Fatalf("invalid count for metric:%s, want:%d, got:%d", metric, expectedCount, count) + } +} diff --git a/pkg/metrics/metrics.go b/pkg/metrics/server.go similarity index 100% rename from pkg/metrics/metrics.go rename to pkg/metrics/server.go diff --git a/testing/utils.go b/testing/utils.go index d624a77..de8b917 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -195,3 +195,7 @@ func generatePort() (int, error) { } var table = [...]byte{'1', '2', '3', '4', '5', '6', '7', '8', '9'} + +func Is2XX(statusCode int) bool { + return statusCode/100 == 2 +} From 5ddad44f26ab2f810eed9e941a5d61ca144abbc7 Mon Sep 17 00:00:00 2001 From: Karolina Zydek Date: Wed, 14 Apr 2021 13:19:49 +0200 Subject: [PATCH 020/194] Rename insensitive terms - leftovers (#11110) --- pkg/legacy-events/helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/legacy-events/helpers.go b/pkg/legacy-events/helpers.go index 583804a..c8fd12b 100644 --- a/pkg/legacy-events/helpers.go +++ b/pkg/legacy-events/helpers.go @@ -14,7 +14,7 @@ import ( // ParseApplicationNameFromPath returns application name from the URL. // The format of the URL is: /:application-name/v1/... func ParseApplicationNameFromPath(path string) string { - // Assumption: Clients(application validator which has a flag for the path(https://github.com/kyma-project/kyma/blob/master/components/application-connectivity-validator/cmd/applicationconnectivityvalidator/applicationconnectivityvalidator.go#L49) using this endpoint must be sending request to path /:application/v1/events + // Assumption: Clients(application validator which has a flag for the path (https://github.com/kyma-project/kyma/blob/main/components/application-connectivity-validator/cmd/applicationconnectivityvalidator/applicationconnectivityvalidator.go#L49) using this endpoint must be sending request to path /:application/v1/events // Hence it should be safe to return 0th index as the application name pathSegments := make([]string, 0) for _, segment := range strings.Split(path, "/") { From 22bc8bce3721ba0191795b186fc708743fd5fa5a Mon Sep 17 00:00:00 2001 From: Radu Fantaziu Date: Fri, 23 Apr 2021 10:48:00 +0200 Subject: [PATCH 021/194] Single binary event publisher (#11153) * initial commit * Add log messages * Update log messages * Add BACKEND env variable * Avoid fatal logging outside of main * Solve comments * Add BACKEND env variable for NATS deployment * Use the image event-publisher-proxy for nats too * Fix logs * Update KO deployments * Use PR images for verification * Update log messages * Enhance log messages at publisher starting * Fix beb-publisher deployment for beb-namespace missing / as a prefix * Fix KO build image and update comments Co-authored-by: Marco Bebway --- cmd/event-publisher-nats/Dockerfile | 20 ---- cmd/event-publisher-proxy/beb/beb.go | 102 ++++++++++++++++ cmd/event-publisher-proxy/main.go | 111 ++++++++---------- .../nats/nats.go} | 92 ++++++++------- .../event-publisher-nats/200-deployment.yaml | 7 +- config/event-publisher-proxy/100-secret.yaml | 8 +- .../event-publisher-proxy/300-deployment.yaml | 4 +- pkg/env/{config.go => beb_config.go} | 17 ++- .../{config_test.go => beb_config_test.go} | 2 +- pkg/env/nats_config.go | 21 +++- pkg/handler/http/handler.go | 4 +- pkg/handler/nats/handler.go | 4 +- pkg/oauth/client.go | 2 +- pkg/oauth/client_test.go | 2 +- pkg/oauth/config.go | 2 +- pkg/oauth/config_test.go | 2 +- pkg/sender/sender_test.go | 4 +- pkg/subscribed/processor.go | 2 +- testing/env_config.go | 18 +-- 19 files changed, 268 insertions(+), 156 deletions(-) delete mode 100644 cmd/event-publisher-nats/Dockerfile create mode 100644 cmd/event-publisher-proxy/beb/beb.go rename cmd/{event-publisher-nats/main.go => event-publisher-proxy/nats/nats.go} (54%) rename pkg/env/{config.go => beb_config.go} (66%) rename pkg/env/{config_test.go => beb_config_test.go} (87%) diff --git a/cmd/event-publisher-nats/Dockerfile b/cmd/event-publisher-nats/Dockerfile deleted file mode 100644 index 3ff9793..0000000 --- a/cmd/event-publisher-nats/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM golang:1.15-alpine as builder - -ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-nats - -WORKDIR $DOCK_PKG_DIR -COPY . $DOCK_PKG_DIR - -RUN GOOS=linux GO111MODULE=on go mod vendor && \ - CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -o event-publisher-nats ./cmd/event-publisher-nats - -FROM gcr.io/distroless/static:nonroot -LABEL source = git@github.com:kyma-project/kyma.git -USER nonroot:nonroot - -WORKDIR / -COPY --from=builder /go/src/github.com/kyma-project/kyma/components/event-publisher-nats/event-publisher-nats . - -COPY licenses/ /licenses/ - -ENTRYPOINT ["/event-publisher-nats"] diff --git a/cmd/event-publisher-proxy/beb/beb.go b/cmd/event-publisher-proxy/beb/beb.go new file mode 100644 index 0000000..cc851c0 --- /dev/null +++ b/cmd/event-publisher-proxy/beb/beb.go @@ -0,0 +1,102 @@ +package beb + +import ( + "github.com/kelseyhightower/envconfig" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/http" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + "github.com/sirupsen/logrus" + "k8s.io/client-go/dynamic" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" + "sigs.k8s.io/controller-runtime/pkg/client/config" +) + +// Commander implements the Commander interface. +type Commander struct { + envCfg *env.BebConfig + logger *logrus.Logger + metricsCollector *metrics.Collector + opts *options.Options +} + +// NewCommander creates the Commander for publisher to BEB. +func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, logger *logrus.Logger) *Commander { + return &Commander{ + metricsCollector: metricsCollector, + logger: logger, + envCfg: new(env.BebConfig), + opts: opts, + } +} + +// Init implements the Commander interface and initializes the publisher to BEB. +func (c *Commander) Init() error { + if err := envconfig.Process("", c.envCfg); err != nil { + c.logger.Errorf("Read BEB configuration failed with error: %s", err) + return err + } + return nil +} + +// Start implements the Commander interface and starts the publisher. +func (c *Commander) Start() error { + c.logger.Infof("Starting Event Publisher to BEB, envCfg: %v; opts: %#v", c.envCfg.String(), c.opts) + + // configure message receiver + messageReceiver := receiver.NewHttpMessageReceiver(c.envCfg.Port) + + // assure uniqueness + ctx := signals.NewContext() + + // configure auth client + client := oauth.NewClient(ctx, c.envCfg) + defer client.CloseIdleConnections() + + // configure message sender + messageSender := sender.NewHttpMessageSender(c.envCfg.EmsPublishURL, client) + + // cluster config + k8sConfig := config.GetConfigOrDie() + + // setup application lister + dynamicClient := dynamic.NewForConfigOrDie(k8sConfig) + applicationLister := application.NewLister(ctx, dynamicClient) + + // configure legacyTransformer + legacyTransformer := legacy.NewTransformer( + c.envCfg.BEBNamespace, + c.envCfg.EventTypePrefix, + applicationLister, + ) + + // Configure Subscription Lister + subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig) + subLister := subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() + subscribedProcessor := &subscribed.Processor{ + SubscriptionLister: &subLister, + Config: c.envCfg, + Logger: c.logger, + } + // Sync informer cache or die + c.logger.Info("Waiting for informers caches to sync") + informers.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory) + c.logger.Info("Informers are synced successfully") + + // start handler which blocks until it receives a shutdown signal + if err := http.NewHandler(messageReceiver, messageSender, c.envCfg.RequestTimeout, legacyTransformer, c.opts, + subscribedProcessor, c.logger, c.metricsCollector).Start(ctx); err != nil { + c.logger.Errorf("Start handler failed with error: %s", err) + return err + } + c.logger.Info("Shutdown the Event Publisher Proxy") + return nil +} diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index 581dc1b..bfe5509 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -1,88 +1,77 @@ package main import ( - "k8s.io/client-go/dynamic" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" - "sigs.k8s.io/controller-runtime/pkg/client/config" - "github.com/kelseyhightower/envconfig" + "github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy/beb" + "github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy/nats" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/prometheus/client_golang/prometheus" "github.com/sirupsen/logrus" +) - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/http" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" +const ( + backendBEB = "beb" + backendNATS = "nats" ) +type Config struct { + // Backend used for Eventing. It could be "nats" or "beb" + Backend string `envconfig:"BACKEND" required:"true"` +} + +// Commander defines the interface of different implementations +type Commander interface { + // Init allows main() to pass flag values to the commander instance. + Init() error + + // Start runs the initialized commander instance. + Start() error +} + func main() { logger := logrus.New() opts := options.ParseArgs() - cfg := new(env.Config) - if err := envconfig.Process("", cfg); err != nil { - logger.Fatalf("Start handler failed with error: %s", err) - } - // configure message receiver - messageReceiver := receiver.NewHttpMessageReceiver(cfg.Port) - - // configure auth client - ctx := signals.NewContext() - client := oauth.NewClient(ctx, cfg) - defer client.CloseIdleConnections() - // metrics server - metricsServer := metrics.NewServer(logger) - defer metricsServer.Stop() - if err := metricsServer.Start(opts.MetricsAddress); err != nil { - logger.Infof("Metrics server failed to start with error: %v", err) + // parse the config for main: + cfg := new(Config) + if err := envconfig.Process("", cfg); err != nil { + logger.Fatalf("Read configuration failed with error: %s", err) } // metrics collector metricsCollector := metrics.NewCollector() prometheus.MustRegister(metricsCollector) - // configure message sender - messageSender := sender.NewHttpMessageSender(cfg.EmsPublishURL, client) + // Instantiate configured commander. + var commander Commander + switch cfg.Backend { + case backendBEB: + commander = beb.NewCommander(opts, metricsCollector, logger) + case backendNATS: + commander = nats.NewCommander(opts, metricsCollector, logger) + default: + logger.Fatalf("Invalid publisher backend: %v", cfg.Backend) + } - // cluster config - k8sConfig := config.GetConfigOrDie() + // Init the commander. + if err := commander.Init(); err != nil { + logger.Fatalf("Initialization failed: %s", err) + } - // setup application lister - dynamicClient := dynamic.NewForConfigOrDie(k8sConfig) - applicationLister := application.NewLister(ctx, dynamicClient) + // Start the metrics server. + metricsServer := metrics.NewServer(logger) + defer metricsServer.Stop() + if err := metricsServer.Start(opts.MetricsAddress); err != nil { + logger.Infof("Metrics server failed to start with error: %v", err) + } - // configure legacyTransformer - legacyTransformer := legacy.NewTransformer( - cfg.BEBNamespace, - cfg.EventTypePrefix, - applicationLister, - ) + logger.Infof("Starting publisher to: %v", cfg.Backend) - // Configure Subscription Lister - subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig) - subLister := subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() - subscribedProcessor := &subscribed.Processor{ - SubscriptionLister: &subLister, - Config: cfg, - Logger: logger, + // Start the commander. + if err := commander.Start(); err != nil { + logger.Fatalf("Unable to start publisher: %s", err) } - // Sync informer cache or die - logger.Info("Waiting for informers caches to sync") - informers.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory) - logger.Info("Informers are synced successfully") - // start handler which blocks until it receives a shutdown signal - if err := http.NewHandler(messageReceiver, messageSender, cfg.RequestTimeout, legacyTransformer, opts, - subscribedProcessor, logger, metricsCollector).Start(ctx); err != nil { - logger.Fatalf("Start handler failed with error: %s", err) - } logger.Info("Shutdown the Event Publisher Proxy") } diff --git a/cmd/event-publisher-nats/main.go b/cmd/event-publisher-proxy/nats/nats.go similarity index 54% rename from cmd/event-publisher-nats/main.go rename to cmd/event-publisher-proxy/nats/nats.go index 36906e2..87b8135 100644 --- a/cmd/event-publisher-nats/main.go +++ b/cmd/event-publisher-proxy/nats/nats.go @@ -1,14 +1,7 @@ -package main +package nats import ( - "k8s.io/client-go/dynamic" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" - "sigs.k8s.io/controller-runtime/pkg/client/config" - "github.com/kelseyhightower/envconfig" - "github.com/prometheus/client_golang/prometheus" - "github.com/sirupsen/logrus" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" @@ -21,43 +14,59 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + "github.com/sirupsen/logrus" + "k8s.io/client-go/dynamic" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" + "sigs.k8s.io/controller-runtime/pkg/client/config" ) -func main() { - logger := logrus.New() - logger.Info("Event Publisher NATS started") - opts := options.ParseArgs() - cfgNats := new(env.NatsConfig) - if err := envconfig.Process("", cfgNats); err != nil { - logger.Fatalf("Read NATS configuration failed with error: %s", err) +// Commander implements the Commander interface. +type Commander struct { + metricsCollector *metrics.Collector + logger *logrus.Logger + envCfg *env.NatsConfig + opts *options.Options +} + +// NewCommander creates the Commander for publisher to NATS. +func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, logger *logrus.Logger) *Commander { + return &Commander{ + envCfg: new(env.NatsConfig), + logger: logger, + metricsCollector: metricsCollector, + opts: opts, } +} - // configure message receiver - messageReceiver := receiver.NewHttpMessageReceiver(cfgNats.Port) +// Init implements the Commander interface and initializes the publisher to NATS. +func (c *Commander) Init() error { + if err := envconfig.Process("", c.envCfg); err != nil { + c.logger.Errorf("Read NATS configuration failed with error: %s", err) + return err + } + return nil +} + +// Start implements the Commander interface and starts the publisher. +func (c *Commander) Start() error { + c.logger.Infof("Starting Event Publisher to NATS, envCfg: %v; opts: %#v", c.envCfg.String(), c.opts) // assure uniqueness ctx := signals.NewContext() - // metrics server - metricsServer := metrics.NewServer(logger) - defer metricsServer.Stop() - if err := metricsServer.Start(opts.MetricsAddress); err != nil { - logger.Infof("Metrics server failed to start with error: %v", err) - } - - // metrics collector - metricsCollector := metrics.NewCollector() - prometheus.MustRegister(metricsCollector) + // configure message receiver + messageReceiver := receiver.NewHttpMessageReceiver(c.envCfg.Port) // connect to nats - connection, err := pkgnats.ConnectToNats(cfgNats.URL, cfgNats.RetryOnFailedConnect, cfgNats.MaxReconnects, cfgNats.ReconnectWait) + connection, err := pkgnats.ConnectToNats(c.envCfg.URL, c.envCfg.RetryOnFailedConnect, c.envCfg.MaxReconnects, c.envCfg.ReconnectWait) if err != nil { - logger.Fatalf("Failed to connect to NATS server with error: %s", err) + c.logger.Errorf("Failed to connect to NATS server with error: %s", err) + return err } defer connection.Close() // configure message sender - messageSenderToNats := sender.NewNatsMessageSender(ctx, connection, logger) + messageSenderToNats := sender.NewNatsMessageSender(ctx, connection, c.logger) // cluster config k8sConfig := config.GetConfigOrDie() @@ -68,8 +77,8 @@ func main() { // configure legacyTransformer legacyTransformer := legacy.NewTransformer( - cfgNats.ToConfig().BEBNamespace, - cfgNats.ToConfig().EventTypePrefix, + c.envCfg.ToConfig().BEBNamespace, + c.envCfg.ToConfig().EventTypePrefix, applicationLister, ) @@ -78,20 +87,23 @@ func main() { subLister := subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() subscribedProcessor := &subscribed.Processor{ SubscriptionLister: &subLister, - Config: cfgNats.ToConfig(), - Logger: logger, + Config: c.envCfg.ToConfig(), + Logger: c.logger, } // sync informer cache or die - logger.Info("Waiting for informers caches to sync") + c.logger.Info("Waiting for informers caches to sync") informers.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory) - logger.Info("Informers are synced successfully") + c.logger.Info("Informers are synced successfully") // start handler which blocks until it receives a shutdown signal - if err := nats.NewHandler(messageReceiver, messageSenderToNats, cfgNats.RequestTimeout, legacyTransformer, opts, - subscribedProcessor, logger, metricsCollector).Start(ctx); err != nil { - logger.Fatalf("Start handler failed with error: %s", err) + if err := nats.NewHandler(messageReceiver, messageSenderToNats, c.envCfg.RequestTimeout, legacyTransformer, c.opts, + subscribedProcessor, c.logger, c.metricsCollector).Start(ctx); err != nil { + c.logger.Errorf("Start handler failed with error: %s", err) + return err } - logger.Info("Event Publisher NATS shutdown") + c.logger.Info("Event Publisher NATS shutdown") + + return nil } diff --git a/config/event-publisher-nats/200-deployment.yaml b/config/event-publisher-nats/200-deployment.yaml index 9a97d7c..692b7e6 100644 --- a/config/event-publisher-nats/200-deployment.yaml +++ b/config/event-publisher-nats/200-deployment.yaml @@ -17,7 +17,12 @@ spec: app: event-publisher-nats spec: containers: - - image: github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-nats + - env: + - name: BACKEND + value: "nats" + - name: NATS_URL + value: eventing-nats.kyma-system.svc.cluster.local + image: ko://github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy imagePullPolicy: IfNotPresent name: event-publisher-nats ports: diff --git a/config/event-publisher-proxy/100-secret.yaml b/config/event-publisher-proxy/100-secret.yaml index 31b016f..e9c88ea 100644 --- a/config/event-publisher-proxy/100-secret.yaml +++ b/config/event-publisher-proxy/100-secret.yaml @@ -1,9 +1,9 @@ apiVersion: v1 data: - client-id: fake-id - client-secret: fake-secret - token-endpoint: fake-token-ep - ems-publish-url: fake-ems-publish-url + client-id: ZmFrZS1pZA== + client-secret: ZmFrZS1zZWNyZXQ= + token-endpoint: ZmFrZS10b2tlbi1lcA== + ems-publish-url: ZmFrZS1lbXMtcHVibGlzaC11cmw= kind: Secret metadata: labels: diff --git a/config/event-publisher-proxy/300-deployment.yaml b/config/event-publisher-proxy/300-deployment.yaml index 45ac20e..9c34fe6 100644 --- a/config/event-publisher-proxy/300-deployment.yaml +++ b/config/event-publisher-proxy/300-deployment.yaml @@ -18,6 +18,8 @@ spec: spec: containers: - env: + - name: BACKEND + value: "beb" - name: CLIENT_ID valueFrom: secretKeyRef: @@ -38,7 +40,7 @@ spec: secretKeyRef: name: event-publisher-proxy key: ems-publish-url - image: github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy + image: ko://github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy imagePullPolicy: IfNotPresent name: event-publisher-proxy ports: diff --git a/pkg/env/config.go b/pkg/env/beb_config.go similarity index 66% rename from pkg/env/config.go rename to pkg/env/beb_config.go index 494adf5..0cdbf1f 100644 --- a/pkg/env/config.go +++ b/pkg/env/beb_config.go @@ -1,12 +1,16 @@ package env import ( + "fmt" "net/http" "time" ) -// Config represents the environment config for the Event Publisher Proxy. -type Config struct { +// compile time check +var _ fmt.Stringer = &BebConfig{} + +// BebConfig represents the environment config for the Event Publisher to BEB. +type BebConfig struct { Port int `envconfig:"INGRESS_PORT" default:"8080"` ClientID string `envconfig:"CLIENT_ID" required:"true"` ClientSecret string `envconfig:"CLIENT_SECRET" required:"true"` @@ -23,7 +27,14 @@ type Config struct { } // ConfigureTransport receives an HTTP transport and configure its max idle connection properties. -func (c *Config) ConfigureTransport(transport *http.Transport) { +func (c *BebConfig) ConfigureTransport(transport *http.Transport) { transport.MaxIdleConns = c.MaxIdleConns transport.MaxIdleConnsPerHost = c.MaxIdleConnsPerHost } + +// String implements the fmt.Stringer interface +func (c *BebConfig) String() string { + return fmt.Sprintf("BebConfig{ Port: %v; TokenEndPoint: %v; EmsPublishURL: %v; "+ + "MaxIdleConns: %v; MaxIdleConnsPerHost: %v; RequestTimeout: %v; BEBNamespace: %v; EventTypePrefix: %v }", + c.Port, c.TokenEndpoint, c.EmsPublishURL, c.MaxIdleConns, c.MaxIdleConnsPerHost, c.RequestTimeout, c.BEBNamespace, c.EventTypePrefix) +} diff --git a/pkg/env/config_test.go b/pkg/env/beb_config_test.go similarity index 87% rename from pkg/env/config_test.go rename to pkg/env/beb_config_test.go index 97cdb67..72deed5 100644 --- a/pkg/env/config_test.go +++ b/pkg/env/beb_config_test.go @@ -14,7 +14,7 @@ func TestConfigureTransport(t *testing.T) { ) transport := &http.Transport{} - cfg := Config{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost} + cfg := BebConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost} cfg.ConfigureTransport(transport) if transport.MaxIdleConns != maxIdleConns { diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go index be86881..fb1720b 100644 --- a/pkg/env/nats_config.go +++ b/pkg/env/nats_config.go @@ -1,8 +1,14 @@ package env -import "time" +import ( + "fmt" + "time" +) -// Config represents the environment config for the Event Publisher NATS. +// compile time check +var _ fmt.Stringer = &NatsConfig{} + +// NatsConfig represents the environment config for the Event Publisher to NATS. type NatsConfig struct { Port int `envconfig:"INGRESS_PORT" default:"8080"` URL string `envconfig:"NATS_URL" default:"nats.nats.svc.cluster.local"` @@ -18,11 +24,16 @@ type NatsConfig struct { LegacyEventTypePrefix string `envconfig:"LEGACY_EVENT_TYPE_PREFIX" default:"kyma"` } -// Convert to a default BEB Config -func (c *NatsConfig) ToConfig() *Config { - cfg := &Config{ +// ToConfig converts to a default BEB BebConfig +func (c *NatsConfig) ToConfig() *BebConfig { + cfg := &BebConfig{ BEBNamespace: c.LegacyNamespace, EventTypePrefix: c.LegacyEventTypePrefix, } return cfg } + +// String implements the fmt.Stringer interface +func (c *NatsConfig) String() string { + return fmt.Sprintf("%#v", c) +} diff --git a/pkg/handler/http/handler.go b/pkg/handler/http/handler.go index cd14093..878400a 100644 --- a/pkg/handler/http/handler.go +++ b/pkg/handler/http/handler.go @@ -143,7 +143,7 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h "type": event.Type(), "statusCode": statusCode, "duration": dispatchTime, - "responseBody": respBody, + "responseBody": string(respBody), }).Info("Event dispatched") } @@ -184,7 +184,7 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R "type": event.Type(), "statusCode": statusCode, "duration": dispatchTime, - "responseBody": respBody, + "responseBody": string(respBody), }).Info("Event dispatched") } diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index b3d8312..fdca45e 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -125,7 +125,7 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h "type": event.Type(), "statusCode": statusCode, "duration": dispatchTime, - "responseBody": respBody, + "responseBody": string(respBody), }).Info("Event dispatched") } @@ -166,7 +166,7 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R "type": event.Type(), "statusCode": statusCode, "duration": dispatchTime, - "responseBody": respBody, + "responseBody": string(respBody), }).Info("Event dispatched") } diff --git a/pkg/oauth/client.go b/pkg/oauth/client.go index ceba289..ce06880 100644 --- a/pkg/oauth/client.go +++ b/pkg/oauth/client.go @@ -12,7 +12,7 @@ import ( ) // NewClient returns a new HTTP client which have nested transports for handling oauth2 security, HTTP connection pooling, and tracing. -func NewClient(ctx context.Context, cfg *env.Config) *http.Client { +func NewClient(ctx context.Context, cfg *env.BebConfig) *http.Client { // configure auth client config := Config(cfg) client := config.Client(ctx) diff --git a/pkg/oauth/client_test.go b/pkg/oauth/client_test.go index f174c94..21f7d00 100644 --- a/pkg/oauth/client_test.go +++ b/pkg/oauth/client_test.go @@ -22,7 +22,7 @@ func TestNewClient(t *testing.T) { maxIdleConnsPerHost = 200 ) - client := NewClient(context.Background(), &env.Config{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) + client := NewClient(context.Background(), &env.BebConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) defer client.CloseIdleConnections() ocTransport, ok := client.Transport.(*ochttp.Transport) diff --git a/pkg/oauth/config.go b/pkg/oauth/config.go index 4d2b1bc..55445ff 100644 --- a/pkg/oauth/config.go +++ b/pkg/oauth/config.go @@ -7,7 +7,7 @@ import ( ) // Config returns a new oauth2 client credentials config instance. -func Config(cfg *env.Config) clientcredentials.Config { +func Config(cfg *env.BebConfig) clientcredentials.Config { return clientcredentials.Config{ ClientID: cfg.ClientID, ClientSecret: cfg.ClientSecret, diff --git a/pkg/oauth/config_test.go b/pkg/oauth/config_test.go index f0eef2d..e417abf 100644 --- a/pkg/oauth/config_test.go +++ b/pkg/oauth/config_test.go @@ -9,7 +9,7 @@ import ( func TestConfig(t *testing.T) { t.Parallel() - cfg := &env.Config{ClientID: "someID", ClientSecret: "someSecret", TokenEndpoint: "someEndpoint"} + cfg := &env.BebConfig{ClientID: "someID", ClientSecret: "someSecret", TokenEndpoint: "someEndpoint"} conf := Config(cfg) if cfg.ClientID != conf.ClientID { diff --git a/pkg/sender/sender_test.go b/pkg/sender/sender_test.go index a13c6d0..6713c0a 100644 --- a/pkg/sender/sender_test.go +++ b/pkg/sender/sender_test.go @@ -25,7 +25,7 @@ const ( func TestNewHttpMessageSender(t *testing.T) { t.Parallel() - client := oauth.NewClient(context.Background(), &env.Config{}) + client := oauth.NewClient(context.Background(), &env.BebConfig{}) defer client.CloseIdleConnections() msgSender := NewHttpMessageSender(eventsEndpoint, client) @@ -40,7 +40,7 @@ func TestNewHttpMessageSender(t *testing.T) { func TestNewRequestWithTarget(t *testing.T) { t.Parallel() - client := oauth.NewClient(context.Background(), &env.Config{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) + client := oauth.NewClient(context.Background(), &env.BebConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) defer client.CloseIdleConnections() msgSender := NewHttpMessageSender(eventsEndpoint, client) diff --git a/pkg/subscribed/processor.go b/pkg/subscribed/processor.go index a757dca..bee6bd2 100644 --- a/pkg/subscribed/processor.go +++ b/pkg/subscribed/processor.go @@ -12,7 +12,7 @@ import ( type Processor struct { SubscriptionLister *cache.GenericLister - Config *env.Config + Config *env.BebConfig Logger *logrus.Logger } diff --git a/testing/env_config.go b/testing/env_config.go index 6e32662..f67f3c0 100644 --- a/testing/env_config.go +++ b/testing/env_config.go @@ -6,48 +6,48 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" ) -func NewEnvConfig(emsCEURL, authURL string, opts ...EnvConfigOption) *env.Config { - envConfig := &env.Config{Port: 8080, EmsPublishURL: emsCEURL, TokenEndpoint: authURL, RequestTimeout: time.Minute} +func NewEnvConfig(emsCEURL, authURL string, opts ...EnvConfigOption) *env.BebConfig { + envConfig := &env.BebConfig{Port: 8080, EmsPublishURL: emsCEURL, TokenEndpoint: authURL, RequestTimeout: time.Minute} for _, opt := range opts { opt(envConfig) } return envConfig } -type EnvConfigOption func(e *env.Config) +type EnvConfigOption func(e *env.BebConfig) func WithPort(port int) EnvConfigOption { - return func(e *env.Config) { + return func(e *env.BebConfig) { e.Port = port } } func WithMaxIdleConns(maxIdleConns int) EnvConfigOption { - return func(e *env.Config) { + return func(e *env.BebConfig) { e.MaxIdleConns = maxIdleConns } } func WithMaxIdleConnsPerHost(maxIdleConnsPerHost int) EnvConfigOption { - return func(e *env.Config) { + return func(e *env.BebConfig) { e.MaxIdleConnsPerHost = maxIdleConnsPerHost } } func WithRequestTimeout(requestTimeout time.Duration) EnvConfigOption { - return func(e *env.Config) { + return func(e *env.BebConfig) { e.RequestTimeout = requestTimeout } } func WithBEBNamespace(bebNs string) EnvConfigOption { - return func(e *env.Config) { + return func(e *env.BebConfig) { e.BEBNamespace = bebNs } } func WithEventTypePrefix(eventTypePrefix string) EnvConfigOption { - return func(e *env.Config) { + return func(e *env.BebConfig) { e.EventTypePrefix = eventTypePrefix } } From 819dab33838a72c28f770ae53fb76755e80c72be Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Fri, 23 Apr 2021 13:34:16 +0200 Subject: [PATCH 022/194] Fix random port generator for Event publisher tests (#11176) --- testing/utils.go | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/testing/utils.go b/testing/utils.go index de8b917..55a958a 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -6,6 +6,7 @@ import ( "fmt" "io" "log" + "net" "net/http" "strconv" "testing" @@ -163,11 +164,33 @@ func WaitForHandlerToStart(t *testing.T, healthEndpoint string) { // GeneratePortOrDie generates a random 5 digit port or fail func GeneratePortOrDie() int { - port, err := generatePort() - if err != nil { - log.Fatalf("Failed to generate port with error: %v", err) + tick := time.NewTicker(time.Second / 2) + defer tick.Stop() + + timeout := time.NewTimer(time.Minute) + defer timeout.Stop() + + for { + select { + case <-tick.C: + { + port, err := generatePort() + if err != nil { + break + } + + if !isPortAvailable(port) { + break + } + + return port + } + case <-timeout.C: + { + log.Fatal("Failed to generate port") + } + } } - return port } func generatePort() (int, error) { @@ -199,3 +222,18 @@ var table = [...]byte{'1', '2', '3', '4', '5', '6', '7', '8', '9'} func Is2XX(statusCode int) bool { return statusCode/100 == 2 } + +// isPortAvailable returns true if the port is available for use, otherwise returns false +func isPortAvailable(port int) bool { + address := fmt.Sprintf(":%d", port) + listener, err := net.Listen("tcp", address) + if err != nil { + return false + } + + if err := listener.Close(); err != nil { + return false + } + + return true +} From 420c4c164638e7997c4a0733f5f321184ee72050 Mon Sep 17 00:00:00 2001 From: Radu Fantaziu Date: Thu, 29 Apr 2021 17:53:27 +0200 Subject: [PATCH 023/194] Fix KO for eventing-publisher-nats (#11189) * Fix KO for eventing-publisher-nats * Update nats publisher dev config * Add a note on the ClusterRoleBinding subject namespace Co-authored-by: Marco Bebway --- config/event-publisher-nats/100-service.yaml | 36 ++++++++++++++++--- .../event-publisher-nats/110-clusterrole.yaml | 23 ++++++++++++ .../115-clusterrolebinding.yaml | 14 ++++++++ .../120-peerauthentication.yaml | 13 +++++++ .../125-serviceaccount.yaml | 6 ++++ .../event-publisher-nats/200-deployment.yaml | 29 ++++++++++++--- 6 files changed, 112 insertions(+), 9 deletions(-) create mode 100644 config/event-publisher-nats/110-clusterrole.yaml create mode 100644 config/event-publisher-nats/115-clusterrolebinding.yaml create mode 100644 config/event-publisher-nats/120-peerauthentication.yaml create mode 100644 config/event-publisher-nats/125-serviceaccount.yaml diff --git a/config/event-publisher-nats/100-service.yaml b/config/event-publisher-nats/100-service.yaml index d118bc2..58a7aad 100644 --- a/config/event-publisher-nats/100-service.yaml +++ b/config/event-publisher-nats/100-service.yaml @@ -1,12 +1,40 @@ apiVersion: v1 kind: Service metadata: - name: event-publisher-nats + name: eventing-event-publisher-proxy + labels: + app.kubernetes.io/instance: eventing + app.kubernetes.io/name: event-publisher-nats + kyma-project.io/dashboard: eventing spec: type: ClusterIP selector: - app: event-publisher-nats + app.kubernetes.io/instance: eventing + app.kubernetes.io/name: event-publisher-nats + kyma-project.io/dashboard: eventing ports: - - protocol: TCP + - name: http port: 80 - targetPort: 8080 + protocol: TCP + targetPort: http +--- +apiVersion: v1 +kind: Service +metadata: + name: eventing-event-publisher-proxy-metrics + labels: + app.kubernetes.io/instance: eventing + app.kubernetes.io/name: event-publisher-nats + kyma-project.io/dashboard: eventing +spec: + type: ClusterIP + selector: + app.kubernetes.io/instance: eventing + app.kubernetes.io/name: event-publisher-nats + kyma-project.io/dashboard: eventing + ports: + - name: http-metrics + port: 80 + protocol: TCP + targetPort: http-metrics +--- diff --git a/config/event-publisher-nats/110-clusterrole.yaml b/config/event-publisher-nats/110-clusterrole.yaml new file mode 100644 index 0000000..78755d5 --- /dev/null +++ b/config/event-publisher-nats/110-clusterrole.yaml @@ -0,0 +1,23 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: eventing-event-publisher-nats + labels: + app.kubernetes.io/instance: eventing +rules: + - apiGroups: + - eventing.kyma-project.io + resources: + - subscriptions + verbs: + - get + - list + - watch + - apiGroups: + - applicationconnector.kyma-project.io + resources: + - applications + verbs: + - get + - list + - watch diff --git a/config/event-publisher-nats/115-clusterrolebinding.yaml b/config/event-publisher-nats/115-clusterrolebinding.yaml new file mode 100644 index 0000000..fbedd53 --- /dev/null +++ b/config/event-publisher-nats/115-clusterrolebinding.yaml @@ -0,0 +1,14 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: eventing-event-publisher-nats + labels: + app.kubernetes.io/instance: eventing +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: eventing-event-publisher-nats +subjects: + - kind: ServiceAccount + name: eventing-event-publisher-nats + namespace: kyma-system # Note: use the same namespace used by ko apply diff --git a/config/event-publisher-nats/120-peerauthentication.yaml b/config/event-publisher-nats/120-peerauthentication.yaml new file mode 100644 index 0000000..c05720f --- /dev/null +++ b/config/event-publisher-nats/120-peerauthentication.yaml @@ -0,0 +1,13 @@ +apiVersion: security.istio.io/v1beta1 +kind: PeerAuthentication +metadata: + name: eventing-event-publisher-nats + labels: + app.kubernetes.io/instance: eventing +spec: + selector: + matchLabels: + app.kubernetes.io/instance: eventing + mtls: + mode: "PERMISSIVE" +--- diff --git a/config/event-publisher-nats/125-serviceaccount.yaml b/config/event-publisher-nats/125-serviceaccount.yaml new file mode 100644 index 0000000..7d328b5 --- /dev/null +++ b/config/event-publisher-nats/125-serviceaccount.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: eventing-event-publisher-nats + labels: + app.kubernetes.io/instance: eventing diff --git a/config/event-publisher-nats/200-deployment.yaml b/config/event-publisher-nats/200-deployment.yaml index 692b7e6..29b5c92 100644 --- a/config/event-publisher-nats/200-deployment.yaml +++ b/config/event-publisher-nats/200-deployment.yaml @@ -1,34 +1,52 @@ apiVersion: apps/v1 kind: Deployment metadata: + name: eventing-event-publisher-nats labels: - app: event-publisher-nats - name: event-publisher-nats + app.kubernetes.io/instance: eventing + app.kubernetes.io/name: event-publisher-nats + kyma-project.io/dashboard: eventing spec: replicas: 1 selector: matchLabels: - app: event-publisher-nats + app.kubernetes.io/instance: eventing + app.kubernetes.io/name: event-publisher-nats + kyma-project.io/dashboard: eventing strategy: type: RollingUpdate template: metadata: labels: - app: event-publisher-nats + app.kubernetes.io/instance: eventing + app.kubernetes.io/name: event-publisher-nats + kyma-project.io/dashboard: eventing spec: + serviceAccountName: eventing-event-publisher-nats containers: - env: - name: BACKEND value: "nats" + - name: PORT + value: "8080" - name: NATS_URL value: eventing-nats.kyma-system.svc.cluster.local + - name: REQUEST_TIMEOUT + value: 5s + - name: LEGACY_NAMESPACE + value: kyma + - name: LEGACY_EVENT_TYPE_PREFIX + value: sap.kyma.custom image: ko://github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy imagePullPolicy: IfNotPresent - name: event-publisher-nats + name: event-publisher-proxy ports: - containerPort: 8080 name: http protocol: TCP + - containerPort: 9090 + name: http-metrics + protocol: TCP livenessProbe: failureThreshold: 3 httpGet: @@ -45,3 +63,4 @@ spec: path: /readyz port: 8080 scheme: HTTP +--- From daa43f7cf96da40557d791c70b6639c2aa3ec170 Mon Sep 17 00:00:00 2001 From: Radu Fantaziu Date: Tue, 11 May 2021 12:18:38 +0200 Subject: [PATCH 024/194] Refactor publisher, preparing it for switching the eventing backend (#11211) * Initial commit * Add Stop() method in Commander interface * Add a new reusable context whihc supports multiple instances --- cmd/event-publisher-proxy/beb/beb.go | 18 +++++++++++---- cmd/event-publisher-proxy/main.go | 3 +++ cmd/event-publisher-proxy/nats/nats.go | 12 +++++++++- pkg/handler/{http => beb}/handler.go | 6 ++--- pkg/handler/{http => beb}/handler_test.go | 4 ++-- pkg/sender/beb.go | 27 ++++++++++++++++++++++ pkg/sender/{sender_test.go => beb_test.go} | 6 ++--- pkg/sender/nats.go | 2 +- pkg/sender/sender.go | 27 ---------------------- pkg/signals/signals.go | 14 +++++++++-- 10 files changed, 76 insertions(+), 43 deletions(-) rename pkg/handler/{http => beb}/handler.go (98%) rename pkg/handler/{http => beb}/handler_test.go (99%) create mode 100644 pkg/sender/beb.go rename pkg/sender/{sender_test.go => beb_test.go} (95%) delete mode 100644 pkg/sender/sender.go diff --git a/cmd/event-publisher-proxy/beb/beb.go b/cmd/event-publisher-proxy/beb/beb.go index cc851c0..4426f9e 100644 --- a/cmd/event-publisher-proxy/beb/beb.go +++ b/cmd/event-publisher-proxy/beb/beb.go @@ -1,10 +1,12 @@ package beb import ( + "context" + "github.com/kelseyhightower/envconfig" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/http" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/beb" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" @@ -22,6 +24,7 @@ import ( // Commander implements the Commander interface. type Commander struct { + cancel context.CancelFunc envCfg *env.BebConfig logger *logrus.Logger metricsCollector *metrics.Collector @@ -55,14 +58,15 @@ func (c *Commander) Start() error { messageReceiver := receiver.NewHttpMessageReceiver(c.envCfg.Port) // assure uniqueness - ctx := signals.NewContext() + var ctx context.Context + ctx, c.cancel = context.WithCancel(signals.NewContext()) // configure auth client client := oauth.NewClient(ctx, c.envCfg) defer client.CloseIdleConnections() // configure message sender - messageSender := sender.NewHttpMessageSender(c.envCfg.EmsPublishURL, client) + messageSender := sender.NewBebMessageSender(c.envCfg.EmsPublishURL, client) // cluster config k8sConfig := config.GetConfigOrDie() @@ -92,7 +96,7 @@ func (c *Commander) Start() error { c.logger.Info("Informers are synced successfully") // start handler which blocks until it receives a shutdown signal - if err := http.NewHandler(messageReceiver, messageSender, c.envCfg.RequestTimeout, legacyTransformer, c.opts, + if err := beb.NewHandler(messageReceiver, messageSender, c.envCfg.RequestTimeout, legacyTransformer, c.opts, subscribedProcessor, c.logger, c.metricsCollector).Start(ctx); err != nil { c.logger.Errorf("Start handler failed with error: %s", err) return err @@ -100,3 +104,9 @@ func (c *Commander) Start() error { c.logger.Info("Shutdown the Event Publisher Proxy") return nil } + +// Stop implements the Commander interface and stops the publisher. +func (c *Commander) Stop() error { + c.cancel() + return nil +} diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index bfe5509..969d17e 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -27,6 +27,9 @@ type Commander interface { // Start runs the initialized commander instance. Start() error + + // Stop stops the commander instance. + Stop() error } func main() { diff --git a/cmd/event-publisher-proxy/nats/nats.go b/cmd/event-publisher-proxy/nats/nats.go index 87b8135..decc382 100644 --- a/cmd/event-publisher-proxy/nats/nats.go +++ b/cmd/event-publisher-proxy/nats/nats.go @@ -1,6 +1,8 @@ package nats import ( + "context" + "github.com/kelseyhightower/envconfig" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" @@ -22,6 +24,7 @@ import ( // Commander implements the Commander interface. type Commander struct { + cancel context.CancelFunc metricsCollector *metrics.Collector logger *logrus.Logger envCfg *env.NatsConfig @@ -52,7 +55,8 @@ func (c *Commander) Start() error { c.logger.Infof("Starting Event Publisher to NATS, envCfg: %v; opts: %#v", c.envCfg.String(), c.opts) // assure uniqueness - ctx := signals.NewContext() + var ctx context.Context + ctx, c.cancel = context.WithCancel(signals.NewContext()) // configure message receiver messageReceiver := receiver.NewHttpMessageReceiver(c.envCfg.Port) @@ -107,3 +111,9 @@ func (c *Commander) Start() error { return nil } + +// Stop implements the Commander interface and stops the publisher. +func (c *Commander) Stop() error { + c.cancel() + return nil +} diff --git a/pkg/handler/http/handler.go b/pkg/handler/beb/handler.go similarity index 98% rename from pkg/handler/http/handler.go rename to pkg/handler/beb/handler.go index 878400a..cab45ae 100644 --- a/pkg/handler/http/handler.go +++ b/pkg/handler/beb/handler.go @@ -1,4 +1,4 @@ -package http +package beb import ( "context" @@ -45,7 +45,7 @@ type Handler struct { // Receiver receives incoming HTTP requests Receiver *receiver.HttpMessageReceiver // Sender sends requests to the broker - Sender *sender.HttpMessageSender + Sender *sender.BebMessageSender // Defaulter sets default values to incoming events Defaulter cev2client.EventDefaulter // LegacyTransformer handles transformations needed to handle legacy events @@ -63,7 +63,7 @@ type Handler struct { } // NewHandler returns a new HTTP Handler instance. -func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.HttpMessageSender, requestTimeout time.Duration, +func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.BebMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logrus.Logger, collector *metrics.Collector) *Handler { return &Handler{ diff --git a/pkg/handler/http/handler_test.go b/pkg/handler/beb/handler_test.go similarity index 99% rename from pkg/handler/http/handler_test.go rename to pkg/handler/beb/handler_test.go index ba3ed05..201500e 100644 --- a/pkg/handler/http/handler_test.go +++ b/pkg/handler/beb/handler_test.go @@ -1,4 +1,4 @@ -package http +package beb import ( "context" @@ -428,7 +428,7 @@ func setupTestResources(t *testing.T, port, maxRequestSize int, applicationName, client := oauth.NewClient(ctx, cfg) defer client.CloseIdleConnections() - msgSender := sender.NewHttpMessageSender(emsCEURL, client) + msgSender := sender.NewBebMessageSender(emsCEURL, client) msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) opts := &options.Options{MaxRequestSize: int64(maxRequestSize)} appLister := handlertest.NewApplicationListerOrDie(ctx, applicationName) diff --git a/pkg/sender/beb.go b/pkg/sender/beb.go new file mode 100644 index 0000000..3528322 --- /dev/null +++ b/pkg/sender/beb.go @@ -0,0 +1,27 @@ +package sender + +import ( + "context" + "net/http" +) + +// BebMessageSender is responsible for sending messages over HTTP. +type BebMessageSender struct { + Client *http.Client + Target string +} + +// NewBebMessageSender returns a new BebMessageSender instance with the given target and client. +func NewBebMessageSender(target string, client *http.Client) *BebMessageSender { + return &BebMessageSender{Client: client, Target: target} +} + +// NewRequestWithTarget returns a new HTTP POST request with the given context and target. +func (s *BebMessageSender) NewRequestWithTarget(ctx context.Context, target string) (*http.Request, error) { + return http.NewRequestWithContext(ctx, http.MethodPost, target, nil) +} + +// Send sends the given HTTP request and returns the HTTP response back. +func (s *BebMessageSender) Send(req *http.Request) (*http.Response, error) { + return s.Client.Do(req) +} diff --git a/pkg/sender/sender_test.go b/pkg/sender/beb_test.go similarity index 95% rename from pkg/sender/sender_test.go rename to pkg/sender/beb_test.go index 6713c0a..eeb93a8 100644 --- a/pkg/sender/sender_test.go +++ b/pkg/sender/beb_test.go @@ -28,7 +28,7 @@ func TestNewHttpMessageSender(t *testing.T) { client := oauth.NewClient(context.Background(), &env.BebConfig{}) defer client.CloseIdleConnections() - msgSender := NewHttpMessageSender(eventsEndpoint, client) + msgSender := NewBebMessageSender(eventsEndpoint, client) if msgSender.Target != eventsEndpoint { t.Errorf("Message sender target is misconfigured want: %s but got: %s", eventsEndpoint, msgSender.Target) } @@ -43,7 +43,7 @@ func TestNewRequestWithTarget(t *testing.T) { client := oauth.NewClient(context.Background(), &env.BebConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) defer client.CloseIdleConnections() - msgSender := NewHttpMessageSender(eventsEndpoint, client) + msgSender := NewBebMessageSender(eventsEndpoint, client) const ctxKey, ctxValue = "testKey", "testValue" ctx := context.WithValue(context.Background(), ctxKey, ctxValue) @@ -89,7 +89,7 @@ func TestSend(t *testing.T) { client := oauth.NewClient(ctx, cfg) defer client.CloseIdleConnections() - msgSender := NewHttpMessageSender(emsCEURL, client) + msgSender := NewBebMessageSender(emsCEURL, client) request, err := msgSender.NewRequestWithTarget(ctx, msgSender.Target) if err != nil { diff --git a/pkg/sender/nats.go b/pkg/sender/nats.go index 00369cc..1f41d58 100644 --- a/pkg/sender/nats.go +++ b/pkg/sender/nats.go @@ -18,7 +18,7 @@ type GenericSender interface { Send(context.Context, *cev2event.Event) (int, error) } -// HttpMessageSender is responsible for sending messages over HTTP. +// BebMessageSender is responsible for sending messages over HTTP. type NatsMessageSender struct { ctx context.Context logger *logrus.Logger diff --git a/pkg/sender/sender.go b/pkg/sender/sender.go deleted file mode 100644 index 3dd9e45..0000000 --- a/pkg/sender/sender.go +++ /dev/null @@ -1,27 +0,0 @@ -package sender - -import ( - "context" - "net/http" -) - -// HttpMessageSender is responsible for sending messages over HTTP. -type HttpMessageSender struct { - Client *http.Client - Target string -} - -// NewHttpMessageSender returns a new HttpMessageSender instance with the given target and client. -func NewHttpMessageSender(target string, client *http.Client) *HttpMessageSender { - return &HttpMessageSender{Client: client, Target: target} -} - -// NewRequestWithTarget returns a new HTTP POST request with the given context and target. -func (s *HttpMessageSender) NewRequestWithTarget(ctx context.Context, target string) (*http.Request, error) { - return http.NewRequestWithContext(ctx, http.MethodPost, target, nil) -} - -// Send sends the given HTTP request and returns the HTTP response back. -func (s *HttpMessageSender) Send(req *http.Request) (*http.Response, error) { - return s.Client.Do(req) -} diff --git a/pkg/signals/signals.go b/pkg/signals/signals.go index 4adccc1..745db17 100644 --- a/pkg/signals/signals.go +++ b/pkg/signals/signals.go @@ -23,6 +23,10 @@ var ( func SetupSignalHandler() (stopCh <-chan struct{}) { close(onlyOneSignalHandler) // panics when called twice + return setupStopChannel() +} + +func setupStopChannel() (stopCh <-chan struct{}) { stop := make(chan struct{}) osSignal := make(chan os.Signal, 2) signal.Notify(osSignal, shutdownSignals...) @@ -41,12 +45,18 @@ type signalContext struct { stopCh <-chan struct{} } -// NewContext creates a new context with SetupSignalHandler() -// as our Done() channel. +// NewContext creates a new singleton context with SetupSignalHandler() +// as our Done() channel. This method can be called only once. func NewContext() context.Context { return &signalContext{stopCh: SetupSignalHandler()} } +// NewReusableContext creates a new context with setupStopChannel() as our Done() channel. +// This method can be called multiple times, returning new contexts. +func NewReusableContext() context.Context { + return &signalContext{stopCh: setupStopChannel()} +} + // Deadline implements context.Context. func (scc *signalContext) Deadline() (deadline time.Time, ok bool) { return From 173a1068cfb390bef2834f332d9bf6768aeca91a Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Fri, 21 May 2021 09:11:51 +0200 Subject: [PATCH 025/194] update nats dependencies (#11333) * update nats dependencies * bump image * update kyma dependencies --- go.mod | 42 ++--- go.sum | 513 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 470 insertions(+), 85 deletions(-) diff --git a/go.mod b/go.mod index b2d04a9..0bde4d3 100644 --- a/go.mod +++ b/go.mod @@ -5,31 +5,33 @@ go 1.15 require ( github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 github.com/cloudevents/sdk-go/v2 v2.3.1 - github.com/go-logr/logr v0.3.0 // indirect - github.com/go-logr/zapr v0.1.1 // indirect - github.com/google/uuid v1.1.1 + github.com/google/uuid v1.1.2 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma v0.5.1-0.20200609051543-f5997d4a36d6 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20210520105418-ddc3a476c40a github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316 - github.com/nats-io/nats-server/v2 v2.1.9 - github.com/nats-io/nats.go v1.10.1-0.20201204000952-090c71e95cd0 + github.com/nats-io/nats-server/v2 v2.2.4 + github.com/nats-io/nats.go v1.11.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.9.0 - github.com/sirupsen/logrus v1.6.0 - github.com/stretchr/testify v1.6.1 + github.com/sirupsen/logrus v1.7.0 + github.com/stretchr/testify v1.7.0 go.opencensus.io v0.22.4 - go.uber.org/multierr v1.5.0 // indirect - go.uber.org/zap v1.14.0 // indirect - golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d - golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect - golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4 // indirect - gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect - k8s.io/api v0.19.8 - k8s.io/apimachinery v0.19.8 - k8s.io/client-go v0.19.8 - k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect - sigs.k8s.io/controller-runtime v0.6.0 + golang.org/x/tools v0.1.1 // indirect + k8s.io/api v0.20.2 + k8s.io/apimachinery v0.20.2 + k8s.io/client-go v0.20.2 + sigs.k8s.io/controller-runtime v0.8.3 ) -replace github.com/dgrijalva/jwt-go => github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 // fix CVE-2020-26160 +replace ( + github.com/containerd/containerd => github.com/containerd/containerd v1.4.4 + github.com/dgrijalva/jwt-go => github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 // fix CVE-2020-26160 + github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d + github.com/docker/docker => github.com/docker/docker v20.10.3+incompatible + github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.0-rc93 + + k8s.io/api => k8s.io/api v0.19.8 + k8s.io/apimachinery => k8s.io/apimachinery v0.19.8 + k8s.io/client-go => k8s.io/client-go v0.19.8 +) diff --git a/go.sum b/go.sum index 7e35480..d9a6b75 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -6,17 +7,41 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.51.0 h1:PvKAVQWCtlGUSlZkGW3QLelKaWq7KYv/MW1EboG8bfM= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= contrib.go.opencensus.io/exporter/prometheus v0.1.0/go.mod h1:cGFniUXGZlKRjzOyuZJ6mgB+PgBcCIa79kEKR8YCW+A= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.2.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= @@ -36,13 +61,25 @@ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbt github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Masterminds/squirrel v1.5.0/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= +github.com/Masterminds/vcs v1.13.1/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA= +github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= @@ -64,27 +101,42 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/avast/retry-go v2.4.1+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= +github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= +github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= +github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= +github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= +github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= +github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= +github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudevents/sdk-go v1.2.0 h1:2AxI14EJUw1PclJ5gZJtzbxnHIfNMdi76Qq3P3G1BRU= @@ -97,27 +149,56 @@ github.com/cloudevents/sdk-go/v2 v2.3.1/go.mod h1:4fO2UjPMYYR1/7KPJQCwTPb0lFA8zY github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= +github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= +github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= +github.com/containerd/containerd v1.4.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= +github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= +github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= +github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= +github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= +github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= +github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= +github.com/deislabs/oras v0.10.0/go.mod h1:N1UzE7rBa9qLyN4l8IlBTxc2PkrRcKgWQ3HTJvRnJRE= +github.com/denisenkom/go-mssqldb v0.0.0-20191001013358-cfbb681360f0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= +github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= -github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= +github.com/docker/cli v20.10.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/distribution v0.0.0-20191216044856-a8371794149d/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= +github.com/docker/docker v20.10.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -126,10 +207,10 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.6+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -139,6 +220,8 @@ github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= +github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= @@ -146,11 +229,16 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= +github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= @@ -162,8 +250,8 @@ github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTg github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs= github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= -github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= +github.com/go-logr/zapr v0.2.0 h1:v6Ji8yBW77pva6NkJKQdHLAJKrIJKRHz0RXwPqCHSR4= +github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= @@ -208,7 +296,17 @@ github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+ github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= +github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= +github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= +github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godror/godror v0.13.3/go.mod h1:2ouUT4kdhUBk7TAkHWD4SN0CdI0pgEQbo8FVHhbSKWg= +github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -217,20 +315,27 @@ github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5 github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 h1:5ZkaAPbicIKTF2I64qf5Fh8Aa83Q/dnOafMYV0OMwjA= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -242,46 +347,66 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho= +github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995/go.mod h1:lJgMEyOkYFkPcDKwRXegd+iM6E7matEszMG5HhwytU8= +github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= +github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= +github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -308,18 +433,24 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -335,8 +466,10 @@ github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.11.12 h1:famVnQVu7QwryBN4jNseQdUKES71ZAOnB6UQQJPZvqk= +github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 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= @@ -346,49 +479,79 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20190909175253-906fa5f9c249/go.mod h1:s8wBC55/DEkNa3YMY1WLgpT33Ghpmw7v+waIxh15dYI= +github.com/kubernetes-sigs/service-catalog v0.3.0/go.mod h1:zRfgMd1T9HuXR24Qj4GOu/TGWABVGw62MGlyHVcpWnU= github.com/kyma-incubator/api-gateway v0.0.0-20200930072023-5d3f2107a1ef/go.mod h1:DGeKJ2GUH1cOAxUKVbUUl55DuIX6w2DXgZjlg8UTwrU= -github.com/kyma-project/kyma v0.5.1-0.20200609051543-f5997d4a36d6 h1:P3R3c4pewIa+IjzNldO9WRFA58s0r3WVqRxLK6feYc8= -github.com/kyma-project/kyma v0.5.1-0.20200609051543-f5997d4a36d6/go.mod h1:cfj5AQwIOmmoXLZUhW3bIiaB66Z6vgjCYu7TRK3+1lc= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20210520105418-ddc3a476c40a h1:kvb1Se/nAghcx+n+zLqaEn1YAC8m7/xoHsM5ICodxkU= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20210520105418-ddc3a476c40a/go.mod h1:XVGpxflxaa96HWcgvETiMIddt0TmIFivruGCij3rPRM= github.com/kyma-project/kyma/components/event-publisher-proxy v0.0.0-20201014135541-82b304ab245a/go.mod h1:SzxIlsqx8zJXNhqyUabWs8NzYcfEv1SleJ1U0+Gp6Ms= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316 h1:wZ2BvFuElkG6K3pOFxLiT/oXeH07N/wfJqj1LlL76rY= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316/go.mod h1:ZBfptvrdh3YUmdJac/1IFm2pgyk+YAfyLET05ztKTlI= +github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= +github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= +github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac h1:+2b6iGRJe3hvV/yVXrd41yVEjxuFHxasJqDhkIjS4gk= github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac/go.mod h1:Frd2bnT3w5FB5q49ENTfVlztJES+1k/7lyWX2+9gq/M= +github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 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/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-oci8 v0.0.7/go.mod h1:wjDx6Xm9q7dFtHJvIlrI99JytznLw5wQ4R+9mNXJwGI= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= +github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.12.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= +github.com/minio/highwayhash v1.0.1 h1:dZ6IIu8Z14VlC0VpfKofAhCy74wu/Qb5gcn52yWoz/0= +github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= +github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= +github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -397,48 +560,58 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/jwt v0.3.3-0.20200519195258-f2bf5ce574c7/go.mod h1:n3cvmLfBfnpV4JJRN7lRYCyZnw48ksGsbThGXEk4w9M= -github.com/nats-io/jwt v1.1.0 h1:+vOlgtM0ZsF46GbmUoadq0/2rChNS45gtxHEa3H1gqM= github.com/nats-io/jwt v1.1.0/go.mod h1:n3cvmLfBfnpV4JJRN7lRYCyZnw48ksGsbThGXEk4w9M= +github.com/nats-io/jwt v1.2.2 h1:w3GMTO969dFg+UOKTmmyuu7IGdusK+7Ytlt//OYH/uU= +github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= github.com/nats-io/jwt/v2 v2.0.0-20200916203241-1f8ce17dff02/go.mod h1:vs+ZEjP+XKy8szkBmQwCB7RjYdIlMaPsFPs4VdS4bTQ= github.com/nats-io/jwt/v2 v2.0.0-20201015190852-e11ce317263c/go.mod h1:vs+ZEjP+XKy8szkBmQwCB7RjYdIlMaPsFPs4VdS4bTQ= +github.com/nats-io/jwt/v2 v2.0.2 h1:ejVCLO8gu6/4bOKIHQpmB5UhhUJfAQw55yvLWpfmKjI= +github.com/nats-io/jwt/v2 v2.0.2/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.1.7/go.mod h1:rbRrRE/Iv93O/rUvZ9dh4NfT0Cm9HWjW/BqOWLGgYiE= github.com/nats-io/nats-server/v2 v2.1.8-0.20200524125952-51ebd92a9093/go.mod h1:rQnBf2Rv4P9adtAs/Ti6LfFmVtFG6HLhl/H7cVshcJU= github.com/nats-io/nats-server/v2 v2.1.8-0.20200601203034-f8d6dd992b71/go.mod h1:Nan/1L5Sa1JRW+Thm4HNYcIDcVRFc5zK9OpSZeI2kk4= github.com/nats-io/nats-server/v2 v2.1.8-0.20200929001935-7f44d075f7ad/go.mod h1:TkHpUIDETmTI7mrHN40D1pzxfzHZuGmtMbtb83TGVQw= github.com/nats-io/nats-server/v2 v2.1.8-0.20201129161730-ebe63db3e3ed/go.mod h1:XD0zHR/jTXdZvWaQfS5mQgsXj6x12kMjKLyAk/cOGgY= -github.com/nats-io/nats-server/v2 v2.1.9 h1:Sxr2zpaapgpBT9ElTxTVe62W+qjnhPcKY/8W5cnA/Qk= github.com/nats-io/nats-server/v2 v2.1.9/go.mod h1:9qVyoewoYXzG1ME9ox0HwkkzyYvnlBDugfR4Gg/8uHU= +github.com/nats-io/nats-server/v2 v2.2.4 h1:yonz5m/M4C4uqDbOCMuSintpvILI0UjdBZ7SuhKhCns= +github.com/nats-io/nats-server/v2 v2.2.4/go.mod h1:sEnFaxqe09cDmfMgACxZbziXnhQFhwk+aKkZjBBRYrI= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nats.go v1.10.0/go.mod h1:AjGArbfyR50+afOUotNX2Xs5SYHf+CoOa5HH1eEl2HE= github.com/nats-io/nats.go v1.10.1-0.20200531124210-96f2130e4d55/go.mod h1:ARiFsjW9DVxk48WJbO3OSZ2DG8fjkMi7ecLmXoY/n9I= github.com/nats-io/nats.go v1.10.1-0.20200606002146-fc6fed82929a/go.mod h1:8eAIv96Mo9QW6Or40jUHejS7e4VwZ3VRYD6Sf0BTDp4= github.com/nats-io/nats.go v1.10.1-0.20201021145452-94be476ad6e0/go.mod h1:VU2zERjp8xmF+Lw2NH4u2t5qWZxwc7jB3+7HVMWQXPI= -github.com/nats-io/nats.go v1.10.1-0.20201204000952-090c71e95cd0 h1:wyJhRLDJBRwl4OR0Q/nhdt/0rYPw3jbHgLklpyxGj/w= github.com/nats-io/nats.go v1.10.1-0.20201204000952-090c71e95cd0/go.mod h1:Sa3kLIonafChP5IF0b55i9uvGR10I3hPETFbi4+9kOI= +github.com/nats-io/nats.go v1.11.0 h1:L263PZkrmkRJRJT2YHU8GwWWvEvmr9/LUKuJTXsF32k= +github.com/nats-io/nats.go v1.11.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.4/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= -github.com/nats-io/nkeys v0.2.0 h1:WXKF7diOaPU9cJdLD7nuzwasQy9vT1tBqzXZZf3AMJM= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= +github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= +github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4= +github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -448,6 +621,15 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= +github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -464,6 +646,8 @@ github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/9 github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/peterbourgon/mergemap v0.0.0-20130613134717-e21c03b7a721/go.mod h1:jQyRpOpE/KbvPc0VKXjAqctYglwUO5W6zAcGcFfbvlo= +github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -472,19 +656,21 @@ github.com/pkg/errors v0.9.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= +github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= +github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= +github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -492,79 +678,123 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 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.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rubenv/sql-migrate v0.0.0-20200616145509-8d140a17f351/go.mod h1:DCgfY80j8GYL7MLEfvcpSFvjD0L5yZq/aZUJmhZklyg= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= +github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= +github.com/vrischmann/envconfig v1.1.0/go.mod h1:c5DuUlkzfsnspy1g7qiqryPCsW+NjsrLsYq4zhwsoHo= +github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= +github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= +github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= +github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= +github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= +github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= +github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= +go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= @@ -573,6 +803,7 @@ go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -580,42 +811,55 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.14.0 h1:/pduUoebOeeJzTDFuoMgC6nRkiasr1sBCIEorly7m4o= -go.uber.org/zap v1.14.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= +go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= +go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b h1:wSOdpTq0/eI46Ez/LkDwIsAKA71YP2SRKBODiRWM0as= +golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -626,6 +870,7 @@ golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= @@ -633,8 +878,11 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -654,18 +902,33 @@ golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -678,7 +941,10 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -690,7 +956,6 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -698,36 +963,69 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -755,43 +1053,85 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4 h1:v8Jgq9X6Es9K9otVr9jxENEJigepKMZgA9OmrIZDtFA= -golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= +gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -801,8 +1141,29 @@ google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dT google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -816,7 +1177,12 @@ google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -825,10 +1191,12 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= @@ -837,8 +1205,10 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= +gopkg.in/gorp.v1 v1.7.2/go.mod h1:Wo3h+DBQZIxATwftsglhdD/62zRFPhGhTiu5jUJmCaw= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -859,70 +1229,79 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= +helm.sh/helm/v3 v3.5.2/go.mod h1:7+CqT745B1Sy/4dzhzbbY9U08pGnJfrJXBkoEEFj18c= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= istio.io/api v0.0.0-20200812202721-24be265d41c3/go.mod h1:88HN3o1fSD1jo+Z1WTLlJfMm9biopur6Ct9BFKjiB64= istio.io/client-go v0.0.0-20200916161914-94f0e83444ca/go.mod h1:SO65MWt7I45dvUwuDowoiB0SVcGpfWZfUTlopvYpbZc= istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a/go.mod h1:OzpAts7jljZceG4Vqi5/zXy/pOg1b209T3jb7Nv5wIs= -k8s.io/api v0.17.8/go.mod h1:N++Llhs8kCixMUoCaXXAyMMPbo8dDVnh+IQ36xZV2/0= -k8s.io/api v0.18.1/go.mod h1:3My4jorQWzSs5a+l7Ge6JBbIxChLnY8HnuT58ZWolss= -k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= -k8s.io/api v0.18.12/go.mod h1:3sS78jmUoGHwERyMbEhxP6owcQ77UxGo+Yy+dKNWrh0= k8s.io/api v0.19.8 h1:U50vBUCb5kc2J483mnITLKfdyoITaC7PnaOJwT7oRRM= k8s.io/api v0.19.8/go.mod h1:9TMGoKoidvicOK0LSqj+Mj98pugQycbViPKyZHqutBc= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.18.12/go.mod h1:nihADkPed1L37Vxpz2/BrtxO9mCtINH23aNtUe/CRLo= -k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= -k8s.io/apimachinery v0.17.8/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= -k8s.io/apimachinery v0.18.1/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= -k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= -k8s.io/apimachinery v0.18.12/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk= +k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= +k8s.io/apiextensions-apiserver v0.20.2/go.mod h1:F6TXp389Xntt+LUq3vw6HFOLttPa0V8821ogLGwb6Zs= k8s.io/apimachinery v0.19.8 h1:MaehcNcx8brsgvMsqspcI0bi22E1np/DACnjf2mhJ5A= k8s.io/apimachinery v0.19.8/go.mod h1:6sRbGRAVY5DOCuZwB5XkqguBqpqLU6q/kOaOdk29z6Q= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.18.12/go.mod h1:uFOeW4LlxS6KDgLWy3n3gh0DhC6m41QIFgL33ouk+4w= -k8s.io/client-go v0.17.8/go.mod h1:SJsDS64AAtt9VZyeaQMb4Ck5etCitZ/FwajWdzua5eY= -k8s.io/client-go v0.18.1/go.mod h1:iCikYRiXOj/yRRFE/aWqrpPtDt4P2JVWhtHkmESTcfY= -k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= -k8s.io/client-go v0.18.12/go.mod h1:0aC8XkA09dX/goYqHQJ/kVv0zL1t+weOZt3pmz9LpxA= +k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= +k8s.io/apiserver v0.20.2/go.mod h1:2nKd93WyMhZx4Hp3RfgH2K5PhwyTrprrkWYnI7id7jA= +k8s.io/cli-runtime v0.18.2/go.mod h1:yfFR2sQQzDsV0VEKGZtrJwEy4hLZ2oj4ZIfodgxAHWQ= +k8s.io/cli-runtime v0.20.1/go.mod h1:6wkMM16ZXTi7Ow3JLYPe10bS+XBnIkL6V9dmEz0mbuY= +k8s.io/cli-runtime v0.20.2/go.mod h1:FjH6uIZZZP3XmwrXWeeYCbgxcrD6YXxoAykBaWH0VdM= k8s.io/client-go v0.19.8 h1:rcb2BrXb1HUBiBCoP3m/9Q2VZIMWhZUAmH49EmAyRUA= k8s.io/client-go v0.19.8/go.mod h1:5Op2bSbK+COBz8mwH62rrRgqhA9wOcORkWZ03+GL0Ow= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.12/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= +k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= +k8s.io/code-generator v0.20.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= k8s.io/component-base v0.17.8/go.mod h1:xfNNdTAMsYzdiAa8vXnqDhRVSEgkfza0iMt0FrZDY7s= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/component-base v0.18.12/go.mod h1:pRGKXsx2KWfsJqlDi4sbCc1jpaB87rXIIqupjhr5wj0= +k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= +k8s.io/component-base v0.20.2/go.mod h1:pzFtCiwe/ASD0iV7ySMu8SYVJjCapNM9bjvk7ptpKh0= +k8s.io/component-helpers v0.20.1/go.mod h1:Q8trCj1zyLNdeur6pD2QvsF8d/nWVfK71YjN5+qVXy4= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= +k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ= +k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 h1:+WnxoVtG8TMiudHBSEtrVL1egv36TkkJm+bA8AxicmQ= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= +k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd h1:sOHNzJIkytDF6qadMNKhhDRpc6ODik8lVC6nOur7B2c= +k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= +k8s.io/kubectl v0.20.1/go.mod h1:2bE0JLYTRDVKDiTREFsjLAx4R2GvUtL/mGYFXfFFMzY= +k8s.io/metrics v0.20.1/go.mod h1:JhpBE/fad3yRGsgEpiZz5FQQM5wJ18OTLkD7Tv40c0s= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 h1:0T5IaWHO3sJTEmCP6mUlBvMukxPKUQWqiI/YuiBNMiQ= +k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= @@ -930,18 +1309,22 @@ modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= pack.ag/amqp v0.11.0/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+aqSv/M3njpmo= -sigs.k8s.io/controller-runtime v0.6.0 h1:Fzna3DY7c4BIP6KwfSlrfnj20DJ+SeMBK8HSFvOk9NM= sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= +sigs.k8s.io/controller-runtime v0.8.3 h1:GMHvzjTmaWHQB8HadW+dIvBoJuLvZObYJ5YoZruPRao= +sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= sigs.k8s.io/kind v0.7.0/go.mod h1:An/AbWHT6pA/Lm0Og8j3ukGhfJP3RiVN/IBU6Lo3zl8= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7mRH6DGaRcixXEJXTsE= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= +sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From 1b8d33b8cc62fbba34a7e9791ec97feac96990d9 Mon Sep 17 00:00:00 2001 From: Radu Fantaziu Date: Tue, 8 Jun 2021 22:20:04 +0200 Subject: [PATCH 026/194] Upgrade go client to v0.20.7 for eventing publisher proxy (#11430) * Upgrade go client to v0.20.7 * Bump publisher-proxy image to PR-11430 * Fix event-publisher-proxy image tag --- go.mod | 10 ++---- go.sum | 59 ++++++++++++++++++++++++++++++++ pkg/application/fake/lister.go | 6 +--- pkg/handler/beb/handler_test.go | 19 +--------- pkg/handler/nats/handler_test.go | 19 +--------- 5 files changed, 65 insertions(+), 48 deletions(-) diff --git a/go.mod b/go.mod index 0bde4d3..dfda8ae 100644 --- a/go.mod +++ b/go.mod @@ -18,9 +18,9 @@ require ( go.opencensus.io v0.22.4 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/tools v0.1.1 // indirect - k8s.io/api v0.20.2 - k8s.io/apimachinery v0.20.2 - k8s.io/client-go v0.20.2 + k8s.io/api v0.20.7 + k8s.io/apimachinery v0.20.7 + k8s.io/client-go v0.20.7 sigs.k8s.io/controller-runtime v0.8.3 ) @@ -30,8 +30,4 @@ replace ( github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d github.com/docker/docker => github.com/docker/docker v20.10.3+incompatible github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.0-rc93 - - k8s.io/api => k8s.io/api v0.19.8 - k8s.io/apimachinery => k8s.io/apimachinery v0.19.8 - k8s.io/client-go => k8s.io/client-go v0.19.8 ) diff --git a/go.sum b/go.sum index d9a6b75..131efdc 100644 --- a/go.sum +++ b/go.sum @@ -42,22 +42,31 @@ github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9mo github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.2.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= +github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= +github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= +github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -180,6 +189,7 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= +github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -207,6 +217,7 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= @@ -223,6 +234,7 @@ github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= @@ -315,6 +327,8 @@ github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5 github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -361,6 +375,7 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -386,6 +401,7 @@ github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1a github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= +github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= @@ -451,6 +467,7 @@ github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhB github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -465,6 +482,7 @@ github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dv github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.12 h1:famVnQVu7QwryBN4jNseQdUKES71ZAOnB6UQQJPZvqk= github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= @@ -547,6 +565,7 @@ github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXy github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= @@ -606,6 +625,7 @@ github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2f github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -656,6 +676,7 @@ github.com/pkg/errors v0.9.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -754,6 +775,7 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -785,6 +807,7 @@ github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1: github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= @@ -826,6 +849,7 @@ go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -924,6 +948,7 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= @@ -943,6 +968,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -956,6 +982,7 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1089,9 +1116,11 @@ golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1244,15 +1273,32 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 istio.io/api v0.0.0-20200812202721-24be265d41c3/go.mod h1:88HN3o1fSD1jo+Z1WTLlJfMm9biopur6Ct9BFKjiB64= istio.io/client-go v0.0.0-20200916161914-94f0e83444ca/go.mod h1:SO65MWt7I45dvUwuDowoiB0SVcGpfWZfUTlopvYpbZc= istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a/go.mod h1:OzpAts7jljZceG4Vqi5/zXy/pOg1b209T3jb7Nv5wIs= +k8s.io/api v0.17.8/go.mod h1:N++Llhs8kCixMUoCaXXAyMMPbo8dDVnh+IQ36xZV2/0= +k8s.io/api v0.18.1/go.mod h1:3My4jorQWzSs5a+l7Ge6JBbIxChLnY8HnuT58ZWolss= +k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= +k8s.io/api v0.18.12/go.mod h1:3sS78jmUoGHwERyMbEhxP6owcQ77UxGo+Yy+dKNWrh0= k8s.io/api v0.19.8 h1:U50vBUCb5kc2J483mnITLKfdyoITaC7PnaOJwT7oRRM= k8s.io/api v0.19.8/go.mod h1:9TMGoKoidvicOK0LSqj+Mj98pugQycbViPKyZHqutBc= +k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= +k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= +k8s.io/api v0.20.7 h1:wOEPJ3NoimUfR9v9sAO2JosPiEP9IGFNplf7zZvYzPU= +k8s.io/api v0.20.7/go.mod h1:4x0yErUkcEWYG+O0S4QdrYa2+PLEeY2M7aeQe++2nmk= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.18.12/go.mod h1:nihADkPed1L37Vxpz2/BrtxO9mCtINH23aNtUe/CRLo= k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= k8s.io/apiextensions-apiserver v0.20.2/go.mod h1:F6TXp389Xntt+LUq3vw6HFOLttPa0V8821ogLGwb6Zs= +k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= +k8s.io/apimachinery v0.17.8/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= +k8s.io/apimachinery v0.18.1/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= +k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= +k8s.io/apimachinery v0.18.12/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk= k8s.io/apimachinery v0.19.8 h1:MaehcNcx8brsgvMsqspcI0bi22E1np/DACnjf2mhJ5A= k8s.io/apimachinery v0.19.8/go.mod h1:6sRbGRAVY5DOCuZwB5XkqguBqpqLU6q/kOaOdk29z6Q= +k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= +k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= +k8s.io/apimachinery v0.20.7 h1:tBfhql7OggSCahvASeEpLRzvxc7FK77wNivi1uXCQWM= +k8s.io/apimachinery v0.20.7/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.18.12/go.mod h1:uFOeW4LlxS6KDgLWy3n3gh0DhC6m41QIFgL33ouk+4w= @@ -1261,8 +1307,16 @@ k8s.io/apiserver v0.20.2/go.mod h1:2nKd93WyMhZx4Hp3RfgH2K5PhwyTrprrkWYnI7id7jA= k8s.io/cli-runtime v0.18.2/go.mod h1:yfFR2sQQzDsV0VEKGZtrJwEy4hLZ2oj4ZIfodgxAHWQ= k8s.io/cli-runtime v0.20.1/go.mod h1:6wkMM16ZXTi7Ow3JLYPe10bS+XBnIkL6V9dmEz0mbuY= k8s.io/cli-runtime v0.20.2/go.mod h1:FjH6uIZZZP3XmwrXWeeYCbgxcrD6YXxoAykBaWH0VdM= +k8s.io/client-go v0.17.8/go.mod h1:SJsDS64AAtt9VZyeaQMb4Ck5etCitZ/FwajWdzua5eY= +k8s.io/client-go v0.18.1/go.mod h1:iCikYRiXOj/yRRFE/aWqrpPtDt4P2JVWhtHkmESTcfY= +k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= +k8s.io/client-go v0.18.12/go.mod h1:0aC8XkA09dX/goYqHQJ/kVv0zL1t+weOZt3pmz9LpxA= k8s.io/client-go v0.19.8 h1:rcb2BrXb1HUBiBCoP3m/9Q2VZIMWhZUAmH49EmAyRUA= k8s.io/client-go v0.19.8/go.mod h1:5Op2bSbK+COBz8mwH62rrRgqhA9wOcORkWZ03+GL0Ow= +k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= +k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= +k8s.io/client-go v0.20.7 h1:Ot22456XfYAWrCWddw/quevMrFHqP7s1qT499FoumVU= +k8s.io/client-go v0.20.7/go.mod h1:uGl3qh/Jy3cTF1nDoIKBqUZlRWnj/EM+/leAXETKRuA= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.12/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= @@ -1287,6 +1341,7 @@ k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= @@ -1319,12 +1374,16 @@ sigs.k8s.io/controller-runtime v0.8.3 h1:GMHvzjTmaWHQB8HadW+dIvBoJuLvZObYJ5YoZru sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= sigs.k8s.io/kind v0.7.0/go.mod h1:An/AbWHT6pA/Lm0Og8j3ukGhfJP3RiVN/IBU6Lo3zl8= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7mRH6DGaRcixXEJXTsE= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.0.3 h1:4oyYo8NREp49LBBhKxEqCulFjg26rawYKrnCmg+Sr6c= +sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/pkg/application/fake/lister.go b/pkg/application/fake/lister.go index a267380..b22d4d5 100644 --- a/pkg/application/fake/lister.go +++ b/pkg/application/fake/lister.go @@ -5,7 +5,6 @@ import ( "log" corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" dynamicfake "k8s.io/client-go/dynamic/fake" @@ -15,10 +14,7 @@ import ( func NewListerOrDie(ctx context.Context, app *applicationv1alpha1.Application) *application.Lister { scheme := setupSchemeOrDie() - unstructuredMap := mapToUnstructuredOrDie(app) - appUnstructured := &unstructured.Unstructured{Object: unstructuredMap} - appUnstructured.SetGroupVersionKind(application.GroupVersionKind()) - dynamicClient := dynamicfake.NewSimpleDynamicClient(scheme, appUnstructured) + dynamicClient := dynamicfake.NewSimpleDynamicClient(scheme, app) return application.NewLister(ctx, dynamicClient) } diff --git a/pkg/handler/beb/handler_test.go b/pkg/handler/beb/handler_test.go index 201500e..13a0580 100644 --- a/pkg/handler/beb/handler_test.go +++ b/pkg/handler/beb/handler_test.go @@ -17,9 +17,7 @@ import ( cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic/dynamicinformer" dynamicfake "k8s.io/client-go/dynamic/fake" @@ -444,23 +442,8 @@ func setupTestResources(t *testing.T, port, maxRequestSize int, applicationName, } subscription := testingutils.NewSubscription() - subUnstructuredMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(subscription) - if err != nil { - t.Fatalf("failed to convert subscription to unstructured obj: %v", err) - } - // Creating unstructured subscriptions - subUnstructured := &unstructured.Unstructured{ - Object: subUnstructuredMap, - } - // Setting Kind information in unstructured subscription - subscriptionGVK := schema.GroupVersionKind{ - Group: subscribed.GVR.Group, - Version: subscribed.GVR.Version, - Kind: "Subscription", - } - subUnstructured.SetGroupVersionKind(subscriptionGVK) // Configuring fake dynamic client - dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subUnstructured) + dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, 10*time.Second, diff --git a/pkg/handler/nats/handler_test.go b/pkg/handler/nats/handler_test.go index 97647a0..94000a1 100644 --- a/pkg/handler/nats/handler_test.go +++ b/pkg/handler/nats/handler_test.go @@ -13,9 +13,7 @@ import ( corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic/dynamicinformer" dynamicfake "k8s.io/client-go/dynamic/fake" @@ -93,23 +91,8 @@ func (test *Test) setupResources(t *testing.T, subscription *eventingv1alpha1.Su t.Fatalf("failed to add eventing v1alpha1 to scheme: %v", err) } - subUnstructuredMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(subscription) - if err != nil { - t.Fatalf("failed to convert subscription to unstructured obj: %v", err) - } - // Creating unstructured subscriptions - subUnstructured := &unstructured.Unstructured{ - Object: subUnstructuredMap, - } - // Setting Kind information in unstructured subscription - subscriptionGVK := schema.GroupVersionKind{ - Group: subscribed.GVR.Group, - Version: subscribed.GVR.Version, - Kind: "Subscription", - } - subUnstructured.SetGroupVersionKind(subscriptionGVK) // Configuring fake dynamic client - dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subUnstructured) + dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, 10*time.Second, v1.NamespaceAll, nil) genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) From 069510f863c473e4f02d1e18dfe6f54d9649002c Mon Sep 17 00:00:00 2001 From: Radu Fantaziu Date: Mon, 14 Jun 2021 13:46:07 +0200 Subject: [PATCH 027/194] Reconnect to Nats in publisher-proxy (#11467) * Reconnect to Nats in publisher * Solve comments --- cmd/event-publisher-proxy/nats/nats.go | 8 ++-- pkg/handler/nats/handler_test.go | 21 +++++---- pkg/nats/connect.go | 43 ++++++++++++++--- pkg/nats/connect_test.go | 20 +++++--- pkg/sender/nats.go | 20 +++++--- pkg/sender/nats_test.go | 64 ++++++++++++++++++++++++-- 6 files changed, 140 insertions(+), 36 deletions(-) diff --git a/cmd/event-publisher-proxy/nats/nats.go b/cmd/event-publisher-proxy/nats/nats.go index decc382..29b7fd9 100644 --- a/cmd/event-publisher-proxy/nats/nats.go +++ b/cmd/event-publisher-proxy/nats/nats.go @@ -62,15 +62,15 @@ func (c *Commander) Start() error { messageReceiver := receiver.NewHttpMessageReceiver(c.envCfg.Port) // connect to nats - connection, err := pkgnats.ConnectToNats(c.envCfg.URL, c.envCfg.RetryOnFailedConnect, c.envCfg.MaxReconnects, c.envCfg.ReconnectWait) - if err != nil { + bc := pkgnats.NewBackendConnection(c.envCfg.URL, c.envCfg.RetryOnFailedConnect, c.envCfg.MaxReconnects, c.envCfg.ReconnectWait) + if err := bc.Connect(); err != nil { c.logger.Errorf("Failed to connect to NATS server with error: %s", err) return err } - defer connection.Close() + defer bc.Connection.Close() // configure message sender - messageSenderToNats := sender.NewNatsMessageSender(ctx, connection, c.logger) + messageSenderToNats := sender.NewNatsMessageSender(ctx, bc, c.logger) // cluster config k8sConfig := config.GetConfigOrDie() diff --git a/pkg/handler/nats/handler_test.go b/pkg/handler/nats/handler_test.go index 94000a1..e897bfe 100644 --- a/pkg/handler/nats/handler_test.go +++ b/pkg/handler/nats/handler_test.go @@ -66,12 +66,13 @@ func (test *Test) setupResources(t *testing.T, subscription *eventingv1alpha1.Su assert.NotNil(t, messageReceiver) // connect to nats - connection, err := pkgnats.ConnectToNats(test.natsUrl, true, 3, time.Second) + bc := pkgnats.NewBackendConnection(test.natsUrl, true, 3, time.Second) + err := bc.Connect() assert.Nil(t, err) - assert.NotNil(t, connection) + assert.NotNil(t, bc.Connection) // create a Nats sender - msgSender := sender.NewNatsMessageSender(ctx, connection, test.logger) + msgSender := sender.NewNatsMessageSender(ctx, bc, test.logger) assert.NotNil(t, msgSender) // configure legacyTransformer @@ -151,13 +152,14 @@ func TestNatsHandlerForCloudEvents(t *testing.T) { eventType := subscription.Spec.Filter.Filters[0].EventType.Value // connect to nats - connection, err := pkgnats.ConnectToNats(test.natsUrl, true, 3, time.Second) + bc := pkgnats.NewBackendConnection(test.natsUrl, true, 3, time.Second) + err := bc.Connect() assert.Nil(t, err) - assert.NotNil(t, connection) + assert.NotNil(t, bc.Connection) // publish a message to NATS and validate it validator := testingutils.ValidateNatsSubjectOrFail(t, expectedNatsSubject) - testingutils.SubscribeToEventOrFail(t, connection, eventType, validator) + testingutils.SubscribeToEventOrFail(t, bc.Connection, eventType, validator) // run the tests for publishing cloudevents for _, testCase := range handlertest.TestCasesForCloudEvents { @@ -199,13 +201,14 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { eventType := subscription.Spec.Filter.Filters[0].EventType.Value // connect to nats - connection, err := pkgnats.ConnectToNats(test.natsUrl, true, 3, time.Second) + bc := pkgnats.NewBackendConnection(test.natsUrl, true, 3, time.Second) + err := bc.Connect() assert.Nil(t, err) - assert.NotNil(t, connection) + assert.NotNil(t, bc.Connection) // publish a message to NATS and validate it validator := testingutils.ValidateNatsSubjectOrFail(t, expectedNatsSubject) - testingutils.SubscribeToEventOrFail(t, connection, eventType, validator) + testingutils.SubscribeToEventOrFail(t, bc.Connection, eventType, validator) // run the tests for publishing legacy events for _, testCase := range handlertest.TestCasesForLegacyEvents { diff --git a/pkg/nats/connect.go b/pkg/nats/connect.go index f685d4b..db02a07 100644 --- a/pkg/nats/connect.go +++ b/pkg/nats/connect.go @@ -7,14 +7,45 @@ import ( "github.com/nats-io/nats.go" ) -// ConnectToNats returns a nats connection that is ready for use, or error if connection to the nats server failed -func ConnectToNats(url string, retry bool, reconnects int, wait time.Duration) (*nats.Conn, error) { - connection, err := nats.Connect(url, nats.RetryOnFailedConnect(retry), nats.MaxReconnects(reconnects), nats.ReconnectWait(wait)) +type connectionData struct { + url string + retry bool + reconnects int + wait time.Duration +} + +type BackendConnection struct { + connectionData connectionData + Connection *nats.Conn +} + +// NewBackendConnection returns a new NewNatsConnection instance with the given NATS connection data. +func NewBackendConnection(url string, retry bool, reconnects int, wait time.Duration) *BackendConnection { + return &BackendConnection{ + connectionData: connectionData{ + url: url, + retry: retry, + reconnects: reconnects, + wait: wait, + }, + } +} + +// Connect returns a nats connection that is ready for use, or error if connection to the nats server failed +func (bc *BackendConnection) Connect() error { + connection, err := nats.Connect(bc.connectionData.url, nats.RetryOnFailedConnect(bc.connectionData.retry), + nats.MaxReconnects(bc.connectionData.reconnects), nats.ReconnectWait(bc.connectionData.wait)) if err != nil { - return nil, err + return err } if status := connection.Status(); status != nats.CONNECTED { - return nil, fmt.Errorf("connection status not connected: %v", status) + return fmt.Errorf("connection status not connected: %v", status) } - return connection, nil + // OK + bc.Connection = connection + return nil +} + +func (bc *BackendConnection) Reconnect() error { + return bc.Connect() } diff --git a/pkg/nats/connect_test.go b/pkg/nats/connect_test.go index 310d216..4a06467 100644 --- a/pkg/nats/connect_test.go +++ b/pkg/nats/connect_test.go @@ -3,10 +3,9 @@ package nats import ( "testing" + publishertesting "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" "github.com/nats-io/nats.go" "github.com/stretchr/testify/assert" - - publishertesting "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) func TestConnectToNats(t *testing.T) { @@ -15,9 +14,18 @@ func TestConnectToNats(t *testing.T) { assert.NotEmpty(t, natsServer.ClientURL()) defer natsServer.Shutdown() - connection, err := ConnectToNats(natsServer.ClientURL(), true, 1, 3) + bc := NewBackendConnection(natsServer.ClientURL(), true, 1, 3) + err := bc.Connect() assert.Nil(t, err) - assert.NotNil(t, connection) - assert.Equal(t, connection.Status(), nats.CONNECTED) - defer connection.Close() + assert.NotNil(t, bc.Connection) + assert.Equal(t, bc.Connection.Status(), nats.CONNECTED) + + bc.Connection.Close() + + err = bc.Reconnect() + assert.Nil(t, err) + assert.NotNil(t, bc.Connection) + assert.Equal(t, bc.Connection.Status(), nats.CONNECTED) + + defer bc.Connection.Close() } diff --git a/pkg/sender/nats.go b/pkg/sender/nats.go index 1f41d58..2dd024c 100644 --- a/pkg/sender/nats.go +++ b/pkg/sender/nats.go @@ -7,7 +7,7 @@ import ( cenats "github.com/cloudevents/sdk-go/protocol/nats/v2" cev2 "github.com/cloudevents/sdk-go/v2" cev2event "github.com/cloudevents/sdk-go/v2/event" - "github.com/nats-io/nats.go" + pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" "github.com/sirupsen/logrus" ) @@ -20,14 +20,14 @@ type GenericSender interface { // BebMessageSender is responsible for sending messages over HTTP. type NatsMessageSender struct { - ctx context.Context - logger *logrus.Logger - connection *nats.Conn + ctx context.Context + logger *logrus.Logger + backendConnection *pkgnats.BackendConnection } // NewNatsMessageSender returns a new NewNatsMessageSender instance with the given nats connection. -func NewNatsMessageSender(ctx context.Context, connection *nats.Conn, logger *logrus.Logger) *NatsMessageSender { - return &NatsMessageSender{ctx: ctx, connection: connection, logger: logger} +func NewNatsMessageSender(ctx context.Context, bc *pkgnats.BackendConnection, logger *logrus.Logger) *NatsMessageSender { + return &NatsMessageSender{ctx: ctx, backendConnection: bc, logger: logger} } // Send dispatches the given Cloud Event to NATS and returns the response details and dispatch time. @@ -36,7 +36,7 @@ func (h *NatsMessageSender) Send(ctx context.Context, event *cev2event.Event) (i // The same Nats subject used by Nats subscription subject := event.Type() - sender, err := cenats.NewSenderFromConn(h.connection, subject) + sender, err := cenats.NewSenderFromConn(h.backendConnection.Connection, subject) if err != nil { h.logger.Errorf("Failed to create nats protocol, %s", err.Error()) return http.StatusInternalServerError, err @@ -51,6 +51,12 @@ func (h *NatsMessageSender) Send(ctx context.Context, event *cev2event.Event) (i err = client.Send(ctx, *event) if cev2.IsUndelivered(err) { h.logger.Errorf("Failed to send: %s", err.Error()) + if h.backendConnection.Connection.IsClosed() { + h.logger.Info("Reconnect...") + if err := h.backendConnection.Reconnect(); err != nil { + h.logger.Errorf("Failed to reconnect: %s", err.Error()) + } + } return http.StatusBadGateway, err } diff --git a/pkg/sender/nats_test.go b/pkg/sender/nats_test.go index d628dd8..c0563bb 100644 --- a/pkg/sender/nats_test.go +++ b/pkg/sender/nats_test.go @@ -26,18 +26,19 @@ func TestSendCloudEvent(t *testing.T) { defer natsServer.Shutdown() // connect to nats - connection, err := pkgnats.ConnectToNats(natsServer.ClientURL(), true, 1, time.Second) + bc := pkgnats.NewBackendConnection(natsServer.ClientURL(), true, 1, time.Second) + err := bc.Connect() assert.Nil(t, err) - assert.NotNil(t, connection) + assert.NotNil(t, bc.Connection) // create message sender ctx := context.Background() - sender := NewNatsMessageSender(ctx, connection, logger) + sender := NewNatsMessageSender(ctx, bc, logger) // subscribe to subject done := make(chan bool, 1) validator := testingutils.ValidateNatsMessageDataOrFail(t, fmt.Sprintf(`"%s"`, testingutils.CloudEventData), done) - testingutils.SubscribeToEventOrFail(t, connection, testingutils.CloudEventType, validator) + testingutils.SubscribeToEventOrFail(t, bc.Connection, testingutils.CloudEventType, validator) // create cloudevent ce := testingutils.StructuredCloudEventPayloadWithCleanEventType @@ -56,3 +57,58 @@ func TestSendCloudEvent(t *testing.T) { t.Fatalf("Subscriber did not receive the message with error: %v", err) } } + +func TestSendCloudEventWithReconnect(t *testing.T) { + logger := logrus.New() + logger.Info("TestNatsSender started") + + // Start Nats server + natsServer := testingutils.StartNatsServer() + assert.NotNil(t, natsServer) + defer natsServer.Shutdown() + + // connect to nats + bc := pkgnats.NewBackendConnection(natsServer.ClientURL(), true, 10, time.Second) + err := bc.Connect() + assert.Nil(t, err) + assert.NotNil(t, bc.Connection) + + // create message sender + ctx := context.Background() + sender := NewNatsMessageSender(ctx, bc, logger) + + // subscribe to subject + done := make(chan bool, 1) + validator := testingutils.ValidateNatsMessageDataOrFail(t, fmt.Sprintf(`"%s"`, testingutils.CloudEventData), done) + testingutils.SubscribeToEventOrFail(t, bc.Connection, testingutils.CloudEventType, validator) + + // create cloudevent + ce := testingutils.StructuredCloudEventPayloadWithCleanEventType + event := cloudevents.NewEvent() + event.SetType(testingutils.CloudEventType) + err = json.Unmarshal([]byte(ce), &event) + assert.Nil(t, err) + + // send cloudevent + status, err := sender.Send(ctx, &event) + assert.Nil(t, err) + assert.Equal(t, status, http.StatusNoContent) + + // wait for subscriber to receive the messages + if err := testingutils.WaitForChannelOrTimeout(done, time.Second*3); err != nil { + t.Fatalf("Subscriber did not receive the message with error: %v", err) + } + + // close connection + bc.Connection.Close() + + // send the cloudevent again, the message is not delivered cause the connection was closed + status, err = sender.Send(ctx, &event) + assert.NotNil(t, err) + assert.Equal(t, status, http.StatusBadGateway) + + // send the cloudevent again, the reconnection should work + status, err = sender.Send(ctx, &event) + assert.Nil(t, err) + assert.Equal(t, status, http.StatusNoContent) +} From c91ae2208f9623c1a00195ba1a31f6d1931c2771 Mon Sep 17 00:00:00 2001 From: Frank Mueller Date: Fri, 9 Jul 2021 14:31:37 +0200 Subject: [PATCH 028/194] Optimze HTTP header access in test (#11634) * Optimze HTTP header access in test * Add debugging test output * Fix after tests * Change header access to Get() * Set event-publisher PR version --- pkg/handler/beb/handler_test.go | 20 +++++++++----------- testing/utils.go | 8 ++++---- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/pkg/handler/beb/handler_test.go b/pkg/handler/beb/handler_test.go index 13a0580..2fd9a55 100644 --- a/pkg/handler/beb/handler_test.go +++ b/pkg/handler/beb/handler_test.go @@ -487,18 +487,16 @@ func validateApplicationName(appName string) testingutils.Validator { if strings.Contains(event.Type(), appName) { return nil } - return errors.New(fmt.Sprintf("expected the event-type [%s] to contain the application name [%s] for structured mode", event.Type(), appName)) + return fmt.Errorf("expected the event-type [%s] to contain the application name [%s] for structured mode", event.Type(), appName) } - // default CE binary mode - for k, v := range r.Header { - if strings.ToLower(k) != strings.ToLower(testingutils.CeTypeHeader) { - continue - } - if strings.Contains(v[0], appName) { - return nil - } - return errors.New(fmt.Sprintf("expected the event-type [%s] to contain the application name [%s] for binary mode", v[0], appName)) + // Default CE binary mode + value := r.Header.Get(testingutils.CeTypeHeader) + if len(value) == 0 { + return errors.New("event-type header is not found or empty") + } + if !strings.Contains(value, appName) { + return fmt.Errorf("expected the event-type [%s] to contain the application name [%s] for binary mode", value, appName) } - return errors.New("event-type header is not found") + return nil } } diff --git a/testing/utils.go b/testing/utils.go index 55a958a..610c173 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -21,10 +21,10 @@ import ( const ( // binary cloudevent headers - CeIDHeader = "CE-ID" - CeTypeHeader = "CE-Type" - CeSourceHeader = "CE-Source" - CeSpecVersionHeader = "CE-SpecVersion" + CeIDHeader = "ce-id" + CeTypeHeader = "ce-type" + CeSourceHeader = "ce-source" + CeSpecVersionHeader = "ce-specversion" ) func QuerySubscribedEndpoint(endpoint string) (*http.Response, error) { From b9136d2b4aa081a51e62d2030755c5d3c56a6d65 Mon Sep 17 00:00:00 2001 From: Sayan Hazra Date: Wed, 14 Jul 2021 13:05:39 +0200 Subject: [PATCH 029/194] Fix tracing for publisher and controller (#11649) * Add tracing context from publisher to controller * Bump image * Fine tune test * Add tracing for /publish endpoint * Cleanup * Cleanup * Cleanup --- go.mod | 4 +- go.sum | 28 +++-------- pkg/handler/handlertest/handlertest.go | 1 - pkg/handler/nats/handler.go | 8 +++- pkg/legacy-events/legacy.go | 5 ++ pkg/tracing/helpers.go | 59 +++++++++++++++++++++++ pkg/tracing/helpers_test.go | 66 ++++++++++++++++++++++++++ 7 files changed, 147 insertions(+), 24 deletions(-) create mode 100644 pkg/tracing/helpers.go create mode 100644 pkg/tracing/helpers_test.go diff --git a/go.mod b/go.mod index dfda8ae..6b6ffd1 100644 --- a/go.mod +++ b/go.mod @@ -4,13 +4,15 @@ go 1.15 require ( github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 - github.com/cloudevents/sdk-go/v2 v2.3.1 + github.com/cloudevents/sdk-go/v2 v2.4.1 github.com/google/uuid v1.1.2 github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20210520105418-ddc3a476c40a github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316 github.com/nats-io/nats-server/v2 v2.2.4 github.com/nats-io/nats.go v1.11.0 + github.com/onsi/ginkgo v1.14.2 // indirect + github.com/onsi/gomega v1.10.4 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.9.0 github.com/sirupsen/logrus v1.7.0 diff --git a/go.sum b/go.sum index 131efdc..304c8da 100644 --- a/go.sum +++ b/go.sum @@ -8,7 +8,6 @@ cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxK cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= @@ -45,19 +44,15 @@ github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSW github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.2.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= @@ -153,8 +148,9 @@ github.com/cloudevents/sdk-go v1.2.0/go.mod h1:ss+jWJ88wypiewnPEzChSBzTYXGpdcILo github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 h1:LY5dKsBPIcY6NQajjgGyQO2hlfSD96FnMpoISZ2lxJo= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1/go.mod h1:xEjXKvch0fuLkmYyNlznjNpwgtMVhELY6aeyruXKXjQ= github.com/cloudevents/sdk-go/v2 v2.2.0/go.mod h1:3CTrpB4+u7Iaj6fd7E2Xvm5IxMdRoaAhqaRVnOr2rCU= -github.com/cloudevents/sdk-go/v2 v2.3.1 h1:QRTu0yRA4FbznjRSds0/4Hy6cVYpWV2wInlNJSHWAtw= github.com/cloudevents/sdk-go/v2 v2.3.1/go.mod h1:4fO2UjPMYYR1/7KPJQCwTPb0lFA8zYuitkUpAZFSY1Q= +github.com/cloudevents/sdk-go/v2 v2.4.1 h1:rZJoz9QVLbWQmnvLPDFEmv17Czu+CfSPwMO6lhJ72xQ= +github.com/cloudevents/sdk-go/v2 v2.4.1/go.mod h1:MZiMwmAh5tGj+fPFvtHv9hKurKqXtdB9haJYMJ/7GJY= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= @@ -325,7 +321,6 @@ github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -513,7 +508,6 @@ github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac h1:+2b6iGRJe3hvV/yVXrd41yVEjxuFHxasJqDhkIjS4gk= github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac/go.mod h1:Frd2bnT3w5FB5q49ENTfVlztJES+1k/7lyWX2+9gq/M= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -630,16 +624,18 @@ github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4= github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= +github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.4 h1:NiTx7EEvBzu9sFOD1zORteLSt3o8gnlvZZwSE9TnY9U= +github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -860,7 +856,6 @@ golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -950,6 +945,7 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0= @@ -1277,8 +1273,6 @@ k8s.io/api v0.17.8/go.mod h1:N++Llhs8kCixMUoCaXXAyMMPbo8dDVnh+IQ36xZV2/0= k8s.io/api v0.18.1/go.mod h1:3My4jorQWzSs5a+l7Ge6JBbIxChLnY8HnuT58ZWolss= k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= k8s.io/api v0.18.12/go.mod h1:3sS78jmUoGHwERyMbEhxP6owcQ77UxGo+Yy+dKNWrh0= -k8s.io/api v0.19.8 h1:U50vBUCb5kc2J483mnITLKfdyoITaC7PnaOJwT7oRRM= -k8s.io/api v0.19.8/go.mod h1:9TMGoKoidvicOK0LSqj+Mj98pugQycbViPKyZHqutBc= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= k8s.io/api v0.20.7 h1:wOEPJ3NoimUfR9v9sAO2JosPiEP9IGFNplf7zZvYzPU= @@ -1293,8 +1287,6 @@ k8s.io/apimachinery v0.17.8/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbb k8s.io/apimachinery v0.18.1/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= k8s.io/apimachinery v0.18.12/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk= -k8s.io/apimachinery v0.19.8 h1:MaehcNcx8brsgvMsqspcI0bi22E1np/DACnjf2mhJ5A= -k8s.io/apimachinery v0.19.8/go.mod h1:6sRbGRAVY5DOCuZwB5XkqguBqpqLU6q/kOaOdk29z6Q= k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.7 h1:tBfhql7OggSCahvASeEpLRzvxc7FK77wNivi1uXCQWM= @@ -1311,8 +1303,6 @@ k8s.io/client-go v0.17.8/go.mod h1:SJsDS64AAtt9VZyeaQMb4Ck5etCitZ/FwajWdzua5eY= k8s.io/client-go v0.18.1/go.mod h1:iCikYRiXOj/yRRFE/aWqrpPtDt4P2JVWhtHkmESTcfY= k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= k8s.io/client-go v0.18.12/go.mod h1:0aC8XkA09dX/goYqHQJ/kVv0zL1t+weOZt3pmz9LpxA= -k8s.io/client-go v0.19.8 h1:rcb2BrXb1HUBiBCoP3m/9Q2VZIMWhZUAmH49EmAyRUA= -k8s.io/client-go v0.19.8/go.mod h1:5Op2bSbK+COBz8mwH62rrRgqhA9wOcORkWZ03+GL0Ow= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= k8s.io/client-go v0.20.7 h1:Ot22456XfYAWrCWddw/quevMrFHqP7s1qT499FoumVU= @@ -1345,7 +1335,6 @@ k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKf k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd h1:sOHNzJIkytDF6qadMNKhhDRpc6ODik8lVC6nOur7B2c= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kubectl v0.20.1/go.mod h1:2bE0JLYTRDVKDiTREFsjLAx4R2GvUtL/mGYFXfFFMzY= @@ -1353,7 +1342,6 @@ k8s.io/metrics v0.20.1/go.mod h1:JhpBE/fad3yRGsgEpiZz5FQQM5wJ18OTLkD7Tv40c0s= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20200729134348-d5654de09c73/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 h1:0T5IaWHO3sJTEmCP6mUlBvMukxPKUQWqiI/YuiBNMiQ= k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= @@ -1379,8 +1367,6 @@ sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:w sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7mRH6DGaRcixXEJXTsE= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.3 h1:4oyYo8NREp49LBBhKxEqCulFjg26rawYKrnCmg+Sr6c= sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= diff --git a/pkg/handler/handlertest/handlertest.go b/pkg/handler/handlertest/handlertest.go index 4b7af8c..c2e359c 100644 --- a/pkg/handler/handlertest/handlertest.go +++ b/pkg/handler/handlertest/handlertest.go @@ -51,7 +51,6 @@ func ValidateOkResponse(t *testing.T, resp http.Response, tcWantResponse *legacy if err != nil { t.Fatalf("failed to read response body: %v", err) } - fmt.Println(string(bodyBytes)) if err = json.Unmarshal(bodyBytes, &legacyOkResponse); err != nil { t.Fatalf("failed to unmarshal response body: %v", err) } diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index fdca45e..7d1b832 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -5,11 +5,12 @@ import ( "net/http" "time" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing" + "github.com/cloudevents/sdk-go/v2/binding" cev2client "github.com/cloudevents/sdk-go/v2/client" cev2event "github.com/cloudevents/sdk-go/v2/event" cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" - "github.com/sirupsen/logrus" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" @@ -115,6 +116,7 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h defer cancel() h.receive(ctx, event) statusCode, dispatchTime, respBody := h.send(ctx, event) + // Change response as per old error codes h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, statusCode, event, string(respBody)) @@ -156,6 +158,10 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R } h.receive(ctx, event) + + // Add tracing context to cloud events + tracing.AddTracingContextToCEExtensions(request.Header, event) + statusCode, dispatchTime, respBody := h.send(ctx, event) h.writeResponse(writer, statusCode, respBody) diff --git a/pkg/legacy-events/legacy.go b/pkg/legacy-events/legacy.go index c2ccfcc..07a9dc8 100644 --- a/pkg/legacy-events/legacy.go +++ b/pkg/legacy-events/legacy.go @@ -8,6 +8,8 @@ import ( "strings" "time" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing" + cev2event "github.com/cloudevents/sdk-go/v2/event" "github.com/google/uuid" "github.com/pkg/errors" @@ -123,6 +125,9 @@ func (t Transformer) TransformLegacyRequestsToCE(writer http.ResponseWriter, req return nil } + // Add tracing context to cloud events + tracing.AddTracingContextToCEExtensions(request.Header, event) + return event } diff --git a/pkg/tracing/helpers.go b/pkg/tracing/helpers.go new file mode 100644 index 0000000..2b38f6a --- /dev/null +++ b/pkg/tracing/helpers.go @@ -0,0 +1,59 @@ +package tracing + +import ( + "fmt" + "net/http" + + cev2 "github.com/cloudevents/sdk-go/v2/event" + "github.com/cloudevents/sdk-go/v2/extensions" +) + +const ( + traceParentKey = "traceparent" + b3TraceIDKey = "X-B3-TraceId" + b3ParentSpanIDKey = "X-B3-ParentSpanId" + b3SpanIDKey = "X-B3-SpanId" + b3SampledKey = "X-B3-Sampled" + b3FlagsKey = "X-B3-Flags" + + b3TraceIDCEExtensionsKey = "b3traceid" + b3ParentSpanIDCEExtensionsKey = "b3parentspanid" + b3SpanIDCEExtensionsKey = "b3spanid" + b3SampledCEExtensionsKey = "b3sampled" + b3FlagsCEExtensionsKey = "b3flags" +) + +func AddTracingContextToCEExtensions(reqHeaders http.Header, event *cev2.Event) { + traceParent := reqHeaders.Get(traceParentKey) + if len(traceParent) > 0 { + st := extensions.DistributedTracingExtension{ + TraceParent: fmt.Sprintf("%v", traceParent), + } + st.AddTracingAttributes(event) + } + + b3TraceID := reqHeaders.Get(b3TraceIDKey) + if len(b3TraceID) > 0 { + event.SetExtension(b3TraceIDCEExtensionsKey, b3TraceID) + } + + b3ParentSpanID := reqHeaders.Get(b3ParentSpanIDKey) + if len(b3ParentSpanID) > 0 { + event.SetExtension(b3ParentSpanIDCEExtensionsKey, b3ParentSpanID) + } + + b3SpanID := reqHeaders.Get(b3SpanIDKey) + if len(b3SpanID) > 0 { + event.SetExtension(b3SpanIDCEExtensionsKey, b3SpanID) + } + + b3Sampled := reqHeaders.Get(b3SampledKey) + if len(b3Sampled) > 0 { + event.SetExtension(b3SampledCEExtensionsKey, b3Sampled) + } + + b3Flags := reqHeaders.Get(b3FlagsKey) + if len(b3Flags) > 0 { + event.SetExtension(b3FlagsCEExtensionsKey, b3Flags) + } +} diff --git a/pkg/tracing/helpers_test.go b/pkg/tracing/helpers_test.go new file mode 100644 index 0000000..7f0b733 --- /dev/null +++ b/pkg/tracing/helpers_test.go @@ -0,0 +1,66 @@ +package tracing + +import ( + "net/http" + "testing" + + cev2event "github.com/cloudevents/sdk-go/v2/event" + + . "github.com/onsi/gomega" +) + +func TestAddTracingContextToCEExtensions(t *testing.T) { + g := NewGomegaWithT(t) + testCases := []struct { + name string + headers http.Header + expectedExtensions map[string]interface{} + }{ + { + name: "headers with w3c tracing headers", + headers: func() http.Header { + headers := http.Header{} + headers.Add(traceParentKey, "traceparent") + return headers + }(), + expectedExtensions: map[string]interface{}{ + traceParentKey: "traceparent", + }, + }, { + name: "headers with b3 tracing headers", + headers: func() http.Header { + headers := http.Header{} + headers.Add(b3TraceIDKey, "traceID") + headers.Add(b3ParentSpanIDKey, "parentspanID") + headers.Add(b3SpanIDKey, "spanID") + headers.Add(b3SampledKey, "1") + headers.Add(b3FlagsKey, "1") + + return headers + }(), + expectedExtensions: map[string]interface{}{ + b3TraceIDCEExtensionsKey: "traceID", + b3ParentSpanIDCEExtensionsKey: "parentspanID", + b3SpanIDCEExtensionsKey: "spanID", + b3SampledCEExtensionsKey: "1", + b3FlagsCEExtensionsKey: "1", + }, + }, { + name: "headers without tracing headers", + headers: func() http.Header { + headers := http.Header{} + headers.Add("foo", "bar") + return headers + }(), + expectedExtensions: nil, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + event := cev2event.New() + AddTracingContextToCEExtensions(tc.headers, &event) + g.Expect(event.Extensions()).To(Equal(tc.expectedExtensions)) + }) + } +} From a68c29d70b00ae312fd2c9610ba2df99a2c8cae9 Mon Sep 17 00:00:00 2001 From: Radu Fantaziu Date: Thu, 9 Sep 2021 15:57:50 +0200 Subject: [PATCH 030/194] Add "check-code" for local publisher-proxy development (#12063) * Add check-code target * Update RESDME.md --- Makefile | 5 ++++- README.md | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b6a8b25..bf82d33 100644 --- a/Makefile +++ b/Makefile @@ -26,8 +26,11 @@ dep-status-local: mod-verify-local: GO111MODULE=on go mod verify +# Use it before commit +check-code: check-imports fmt-local vet-local lint + test-local: - GO111MODULE=on go test ./... + GO111MODULE=on go test ./... -coverprofile cover.out $(eval $(call buildpack-cp-ro,resolve)) $(eval $(call buildpack-mount,mod-verify)) diff --git a/README.md b/README.md index 950e360..6b403b2 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,17 @@ The Event Publisher Proxy receives legacy and Cloud Event publishing requests fr - Go modules - [ko](https://github.com/google/ko) +- lint + - Install lint on the local environment: +```bash +curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin +``` ## Development +- check code quality before a commit: +```bash +$ make code-check +``` ### Build From 4063047caf0b41f532a8614b7ea4c584d5c3160b Mon Sep 17 00:00:00 2001 From: Jeremy Harisch <48282931+jeremyharisch@users.noreply.github.com> Date: Fri, 17 Sep 2021 16:16:47 +0200 Subject: [PATCH 031/194] Enable Prometheus scraping using mTLS (#11994) * Initial setup istio example * Mount istio secret * General setup; connection reset by peer * add tls for fluent-bit and prometheus-istio * Fix kube state metrics * activate servicemonitor grafana * Fix application connector * activate tls for kube-state-metrics * Fix application connector, eventing, operator * add tls for service-catalog * Fix operator now for real * add tls for grafana * Added tls to Tracing * Fix for Prometheus endpoint * Fix Loki * Removed all PeerAuthentication policies which are stict (default) * REvert tracing changes for testing purposes * Revert tracing changes for testing purposes * Add changes to Tracing * Fix indentation * Small fixes * TLS config for dex * TLS config for dex; typo fix * TLS config SIMPLE * Setting peerauthentication * Setting peerauthentication * typo * Disabled second SM for grafana-monitoring * Added policies * Added policies app connect * Add PAs for testing purposes * Edited policies * Added FluentBit PA * MTLS for kialia for testing * Removed mtls for kiali * Removed mtls for grafana * Fix alertmanager * Remove mtls for app registry * FIx for loki * Added small unit about mtls * wrong branch * Grafan auf mtls umstellen * Disable sidecar PrometheusOperator * Disable sidecar PrometheusOperator * Disable sidecar PrometheusIstio incl no mtls * Renaming of interval, due helm render issues * PromOperator; deactivate https * Changed grafana ploicy * Removed schema from unsued sm * Deleted unnecessary ploicies * Deleted unnecessary ploicies * No MTLS for Grafana * Reset Grafana * Fix application connector * Fixxed small tupos * Removed peerAuthentication from kialia and grafana * Removed peerAuthentication from tracing * Add tls config * Add tls config for grafana * Removed Sidecar from kube-state-metrics * Removed istio cert from prom-istio-server * Adapted eventpublisher, ory, and prometheus * Remove unused cert * Applied changes requested by review Co-authored-by: Adrian Stobbe --- .../120-peerauthentication.yaml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 config/event-publisher-nats/120-peerauthentication.yaml diff --git a/config/event-publisher-nats/120-peerauthentication.yaml b/config/event-publisher-nats/120-peerauthentication.yaml deleted file mode 100644 index c05720f..0000000 --- a/config/event-publisher-nats/120-peerauthentication.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: security.istio.io/v1beta1 -kind: PeerAuthentication -metadata: - name: eventing-event-publisher-nats - labels: - app.kubernetes.io/instance: eventing -spec: - selector: - matchLabels: - app.kubernetes.io/instance: eventing - mtls: - mode: "PERMISSIVE" ---- From a052ba0bf0d88b332263b4c2cdb93ab1b5e36493 Mon Sep 17 00:00:00 2001 From: Radu Fantaziu Date: Mon, 11 Oct 2021 16:32:30 +0200 Subject: [PATCH 032/194] Upgrade CE-SDK to 2.5.0 (#12318) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6b6ffd1..9b853c2 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.15 require ( github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 - github.com/cloudevents/sdk-go/v2 v2.4.1 + github.com/cloudevents/sdk-go/v2 v2.5.0 github.com/google/uuid v1.1.2 github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20210520105418-ddc3a476c40a diff --git a/go.sum b/go.sum index 304c8da..51dbc71 100644 --- a/go.sum +++ b/go.sum @@ -149,8 +149,8 @@ github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 h1:LY5dKsBPIcY6NQajjgGyQO2 github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1/go.mod h1:xEjXKvch0fuLkmYyNlznjNpwgtMVhELY6aeyruXKXjQ= github.com/cloudevents/sdk-go/v2 v2.2.0/go.mod h1:3CTrpB4+u7Iaj6fd7E2Xvm5IxMdRoaAhqaRVnOr2rCU= github.com/cloudevents/sdk-go/v2 v2.3.1/go.mod h1:4fO2UjPMYYR1/7KPJQCwTPb0lFA8zYuitkUpAZFSY1Q= -github.com/cloudevents/sdk-go/v2 v2.4.1 h1:rZJoz9QVLbWQmnvLPDFEmv17Czu+CfSPwMO6lhJ72xQ= -github.com/cloudevents/sdk-go/v2 v2.4.1/go.mod h1:MZiMwmAh5tGj+fPFvtHv9hKurKqXtdB9haJYMJ/7GJY= +github.com/cloudevents/sdk-go/v2 v2.5.0 h1:Ts6aLHbBUJfcNcZ4ouAfJ4+Np7SE1Yf2w4ADKRCd7Fo= +github.com/cloudevents/sdk-go/v2 v2.5.0/go.mod h1:nlXhgFkf0uTopxmRXalyMwS2LG70cRGPrxzmjJgSG0U= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= From e71e6a1661636d62794547c946b87e83d19aad3a Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Wed, 13 Oct 2021 18:36:30 +0200 Subject: [PATCH 033/194] Read eventTypePrefix from ConfigMap (#12189) --- pkg/handler/beb/handler_test.go | 408 ++++++++++++++++-------------- pkg/handler/nats/handler_test.go | 112 ++++---- pkg/legacy-events/helpers.go | 16 +- pkg/legacy-events/helpers_test.go | 7 + pkg/legacy-events/legacy.go | 4 - pkg/subscribed/helpers.go | 12 +- testing/fixtures.go | 33 +-- 7 files changed, 321 insertions(+), 271 deletions(-) diff --git a/pkg/handler/beb/handler_test.go b/pkg/handler/beb/handler_test.go index 2fd9a55..7b1e5f5 100644 --- a/pkg/handler/beb/handler_test.go +++ b/pkg/handler/beb/handler_test.go @@ -53,13 +53,12 @@ const ( func TestHandlerForCloudEvents(t *testing.T) { t.Parallel() - exec := func(t *testing.T, applicationName, expectedApplicationName string) { + exec := func(t *testing.T, applicationName, expectedApplicationName, eventTypePrefix, eventType string) { var ( port = testingutils.GeneratePortOrDie() requestSize = bigRequestSize healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) bebNs = testingutils.MessagingNamespace - eventTypePrefix = testingutils.MessagingEventTypePrefix eventsEndpoint = defaultEventsEndpoint requestTimeout = time.Second serverResponseTime = time.Nanosecond @@ -67,7 +66,7 @@ func TestHandlerForCloudEvents(t *testing.T) { ) cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, - expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, + expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint, requestTimeout, serverResponseTime) defer cancel() defer mockServer.Close() @@ -90,21 +89,22 @@ func TestHandlerForCloudEvents(t *testing.T) { } } - // make sure not to change the cloudevent, even if its event-type contains none-alphanumeric characters - exec(t, testingutils.ApplicationName, testingutils.ApplicationNameNotClean) - exec(t, testingutils.ApplicationNameNotClean, testingutils.ApplicationNameNotClean) + // make sure not to change the cloudevent, even if its event-type contains none-alphanumeric characters or the event-type-prefix is empty + exec(t, testingutils.ApplicationName, testingutils.ApplicationNameNotClean, testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) + exec(t, testingutils.ApplicationName, testingutils.ApplicationNameNotClean, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) + exec(t, testingutils.ApplicationNameNotClean, testingutils.ApplicationNameNotClean, testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) + exec(t, testingutils.ApplicationNameNotClean, testingutils.ApplicationNameNotClean, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) } func TestHandlerForLegacyEvents(t *testing.T) { t.Parallel() - exec := func(t *testing.T, applicationName, expectedApplicationName string) { + exec := func(t *testing.T, applicationName, expectedApplicationName, eventTypePrefix, eventType string) { var ( port = testingutils.GeneratePortOrDie() requestSize = bigRequestSize healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) bebNs = testingutils.MessagingNamespace - eventTypePrefix = testingutils.MessagingEventTypePrefix eventsEndpoint = defaultEventsEndpoint requestTimeout = time.Second serverResponseTime = time.Nanosecond @@ -112,7 +112,7 @@ func TestHandlerForLegacyEvents(t *testing.T) { ) cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, - expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, + expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint, requestTimeout, serverResponseTime) defer cancel() defer mockServer.Close() @@ -144,233 +144,251 @@ func TestHandlerForLegacyEvents(t *testing.T) { } // make sure to clean the legacy event, so that its event-type is free from none-alphanumeric characters - exec(t, testingutils.ApplicationName, testingutils.ApplicationName) - exec(t, testingutils.ApplicationNameNotClean, testingutils.ApplicationName) + exec(t, testingutils.ApplicationName, testingutils.ApplicationName, testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) + exec(t, testingutils.ApplicationName, testingutils.ApplicationName, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) + exec(t, testingutils.ApplicationNameNotClean, testingutils.ApplicationName, testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) + exec(t, testingutils.ApplicationNameNotClean, testingutils.ApplicationName, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) } func TestHandlerForBEBFailures(t *testing.T) { t.Parallel() - var ( - port = testingutils.GeneratePortOrDie() - requestSize = bigRequestSize - applicationName = testingutils.ApplicationName - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - bebNs = testingutils.MessagingNamespace - eventTypePrefix = testingutils.MessagingEventTypePrefix - eventsEndpoint = defaultEventsHTTP400Endpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) - publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/%s/v1/events", port, applicationName) - ) + exec := func(eventTypePrefix, eventType string) { + var ( + port = testingutils.GeneratePortOrDie() + requestSize = bigRequestSize + applicationName = testingutils.ApplicationName + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + bebNs = testingutils.MessagingNamespace + eventsEndpoint = defaultEventsHTTP400Endpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) + publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/%s/v1/events", port, applicationName) + ) - cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, applicationName, - healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) - defer cancel() - defer mockServer.Close() + cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, applicationName, + healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint, requestTimeout, serverResponseTime) + defer cancel() + defer mockServer.Close() - testCases := []struct { - name string - targetEndpoint string - provideMessage func() (string, http.Header) - endPoint string - wantStatusCode int - wantResponse legacyapi.PublishEventResponses - }{ - { - name: "Send a legacy event with event-id", - provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() - }, - endPoint: publishLegacyEndpoint, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: &legacyapi.Error{ - Status: 400, - Message: "invalid request"}, + testCases := []struct { + name string + targetEndpoint string + provideMessage func() (string, http.Header) + endPoint string + wantStatusCode int + wantResponse legacyapi.PublishEventResponses + }{ + { + name: "Send a legacy event with event-id", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() + }, + endPoint: publishLegacyEndpoint, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: &legacyapi.Error{ + Status: 400, + Message: "invalid request"}, + }, }, - }, - { - name: "Binary CloudEvent is valid with required headers", - provideMessage: func() (string, http.Header) { - return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), testingutils.GetBinaryMessageHeaders() + { + name: "Binary CloudEvent is valid with required headers", + provideMessage: func() (string, http.Header) { + return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), testingutils.GetBinaryMessageHeaders() + }, + endPoint: publishEndpoint, + wantStatusCode: http.StatusBadRequest, }, - endPoint: publishEndpoint, - wantStatusCode: http.StatusBadRequest, - }, - } + } - for _, testCase := range testCases { - t.Run(testCase.name, func(t *testing.T) { - body, headers := testCase.provideMessage() - _ = legacyapi.PublishEventResponses{} - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - if err != nil { - t.Fatalf("failed to send event with error: %v", err) - } + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + body, headers := testCase.provideMessage() + _ = legacyapi.PublishEventResponses{} + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + if err != nil { + t.Fatalf("failed to send event with error: %v", err) + } - if testCase.wantStatusCode != resp.StatusCode { - t.Fatalf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) - } + if testCase.wantStatusCode != resp.StatusCode { + t.Fatalf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) + } - if testCase.endPoint == publishLegacyEndpoint { - handlertest.ValidateErrorResponse(t, *resp, &testCase.wantResponse) - } + if testCase.endPoint == publishLegacyEndpoint { + handlertest.ValidateErrorResponse(t, *resp, &testCase.wantResponse) + } - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, collector) - } - }) + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, collector) + } + }) + } } + + exec(testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) + exec(testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) } func TestHandlerForHugeRequests(t *testing.T) { t.Parallel() - var ( - port = testingutils.GeneratePortOrDie() - requestSize = smallRequestSize - applicationName = testingutils.ApplicationName - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - bebNs = testingutils.MessagingNamespace - eventTypePrefix = testingutils.MessagingEventTypePrefix - eventsEndpoint = defaultEventsHTTP400Endpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/%s/v1/events", port, applicationName) - ) + exec := func(eventTypePrefix, eventType string) { + var ( + port = testingutils.GeneratePortOrDie() + requestSize = smallRequestSize + applicationName = testingutils.ApplicationName + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + bebNs = testingutils.MessagingNamespace + eventsEndpoint = defaultEventsHTTP400Endpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/%s/v1/events", port, applicationName) + ) - cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, applicationName, - healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) - defer cancel() - defer mockServer.Close() + cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, applicationName, + healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint, requestTimeout, serverResponseTime) + defer cancel() + defer mockServer.Close() - testCases := []struct { - name string - targetEndpoint string - provideMessage func() (string, http.Header) - endPoint string - wantStatusCode int - }{ - { - name: "Should fail with HTTP 413 with a request which is larger than 2 Bytes as the maximum accepted size is 2 Bytes", - provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() + testCases := []struct { + name string + targetEndpoint string + provideMessage func() (string, http.Header) + endPoint string + wantStatusCode int + }{ + { + name: "Should fail with HTTP 413 with a request which is larger than 2 Bytes as the maximum accepted size is 2 Bytes", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() + }, + endPoint: publishLegacyEndpoint, + wantStatusCode: http.StatusRequestEntityTooLarge, }, - endPoint: publishLegacyEndpoint, - wantStatusCode: http.StatusRequestEntityTooLarge, - }, - { - name: "Should accept a request which is lesser than 2 Bytes as the maximum accepted size is 2 Bytes", - provideMessage: func() (string, http.Header) { - return "{}", testingutils.GetBinaryMessageHeaders() + { + name: "Should accept a request which is lesser than 2 Bytes as the maximum accepted size is 2 Bytes", + provideMessage: func() (string, http.Header) { + return "{}", testingutils.GetBinaryMessageHeaders() + }, + endPoint: handler.PublishEndpoint, + wantStatusCode: http.StatusBadRequest, }, - endPoint: handler.PublishEndpoint, - wantStatusCode: http.StatusBadRequest, - }, - } + } - for _, testCase := range testCases { - t.Run(testCase.name, func(t *testing.T) { - body, headers := testCase.provideMessage() - _ = legacyapi.PublishEventResponses{} - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - if err != nil { - t.Fatalf("failed to send event with error: %v", err) - } + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + body, headers := testCase.provideMessage() + _ = legacyapi.PublishEventResponses{} + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + if err != nil { + t.Fatalf("failed to send event with error: %v", err) + } - if testCase.wantStatusCode != resp.StatusCode { - t.Fatalf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) - } + if testCase.wantStatusCode != resp.StatusCode { + t.Fatalf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) + } - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, collector) - } - }) + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, collector) + } + }) + } } + + exec(testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) + exec(testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) } func TestHandlerForSubscribedEndpoint(t *testing.T) { t.Parallel() - var ( - port = testingutils.GeneratePortOrDie() - requestSize = smallRequestSize - applicationName = testingutils.ApplicationName - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - bebNs = testingutils.MessagingNamespace - eventTypePrefix = testingutils.MessagingEventTypePrefix - eventsEndpoint = defaultEventsHTTP400Endpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - subscribedEndpointFormat = "http://localhost:%d/%s/v1/events/subscribed" - ) + exec := func(eventTypePrefix, eventType string) { + var ( + port = testingutils.GeneratePortOrDie() + requestSize = smallRequestSize + applicationName = testingutils.ApplicationName + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + bebNs = testingutils.MessagingNamespace + eventsEndpoint = defaultEventsHTTP400Endpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + subscribedEndpointFormat = "http://localhost:%d/%s/v1/events/subscribed" + ) - cancel, mockServer, _ := setupTestResources(t, port, requestSize, applicationName, applicationName, healthEndpoint, - bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) - defer cancel() - defer mockServer.Close() - - for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { - t.Run(testCase.Name, func(t *testing.T) { - subscribedURL := fmt.Sprintf(subscribedEndpointFormat, port, testCase.AppName) - resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) - if err != nil { - t.Fatalf("failed to send event with error: %v", err) - } + cancel, mockServer, _ := setupTestResources(t, port, requestSize, applicationName, applicationName, healthEndpoint, + bebNs, eventTypePrefix, eventType, eventsEndpoint, requestTimeout, serverResponseTime) + defer cancel() + defer mockServer.Close() - if testCase.WantStatusCode != resp.StatusCode { - t.Fatalf("test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) - } - defer func() { _ = resp.Body.Close() }() - respBodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatalf("failed to convert body to bytes: %v", err) - } - gotEventsResponse := subscribed.Events{} - err = json.Unmarshal(respBodyBytes, &gotEventsResponse) - if err != nil { - t.Fatalf("failed to unmarshal body bytes to events response: %v", err) - } - if !reflect.DeepEqual(testCase.WantResponse, gotEventsResponse) { - t.Fatalf("incorrect response, wanted: %v, got: %v", testCase.WantResponse, gotEventsResponse) - } - }) + for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { + t.Run(testCase.Name, func(t *testing.T) { + subscribedURL := fmt.Sprintf(subscribedEndpointFormat, port, testCase.AppName) + resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) + if err != nil { + t.Fatalf("failed to send event with error: %v", err) + } + + if testCase.WantStatusCode != resp.StatusCode { + t.Fatalf("test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) + } + defer func() { _ = resp.Body.Close() }() + respBodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Fatalf("failed to convert body to bytes: %v", err) + } + gotEventsResponse := subscribed.Events{} + err = json.Unmarshal(respBodyBytes, &gotEventsResponse) + if err != nil { + t.Fatalf("failed to unmarshal body bytes to events response: %v", err) + } + if !reflect.DeepEqual(testCase.WantResponse, gotEventsResponse) { + t.Fatalf("incorrect response, wanted: %v, got: %v", testCase.WantResponse, gotEventsResponse) + } + }) + } } + + exec(testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) + exec(testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) } func TestHandlerTimeout(t *testing.T) { t.Parallel() - var ( - port = testingutils.GeneratePortOrDie() - requestSize = bigRequestSize - applicationName = testingutils.ApplicationName - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - bebNs = testingutils.MessagingNamespace - eventTypePrefix = testingutils.MessagingEventTypePrefix - eventsEndpoint = defaultEventsHTTP400Endpoint - requestTimeout = time.Nanosecond // short request timeout - serverResponseTime = time.Millisecond // long server response time - publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) - ) + exec := func(eventTypePrefix, eventType string) { + var ( + port = testingutils.GeneratePortOrDie() + requestSize = bigRequestSize + applicationName = testingutils.ApplicationName + healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) + bebNs = testingutils.MessagingNamespace + eventsEndpoint = defaultEventsHTTP400Endpoint + requestTimeout = time.Nanosecond // short request timeout + serverResponseTime = time.Millisecond // long server response time + publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) + ) - cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, applicationName, - healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) - defer cancel() - defer mockServer.Close() + cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, applicationName, + healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint, requestTimeout, serverResponseTime) + defer cancel() + defer mockServer.Close() - body, headers := testingutils.StructuredCloudEventPayload, testingutils.GetStructuredMessageHeaders() - resp, err := testingutils.SendEvent(publishEndpoint, body, headers) - if err != nil { - t.Fatalf("Failed to send event with error: %v", err) - } - _ = resp.Body.Close() - if http.StatusInternalServerError != resp.StatusCode { - t.Fatalf("Test failed, want status code:%d but got:%d", http.StatusInternalServerError, resp.StatusCode) + body, headers := testingutils.StructuredCloudEventPayload, testingutils.GetStructuredMessageHeaders() + resp, err := testingutils.SendEvent(publishEndpoint, body, headers) + if err != nil { + t.Fatalf("Failed to send event with error: %v", err) + } + _ = resp.Body.Close() + if http.StatusInternalServerError != resp.StatusCode { + t.Fatalf("Test failed, want status code:%d but got:%d", http.StatusInternalServerError, resp.StatusCode) + } + metricstest.EnsureMetricErrors(t, collector) } - metricstest.EnsureMetricErrors(t, collector) + + exec(testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) + exec(testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) } func TestIsARequestWithLegacyEvent(t *testing.T) { @@ -405,7 +423,7 @@ func TestIsARequestWithLegacyEvent(t *testing.T) { } func setupTestResources(t *testing.T, port, maxRequestSize int, applicationName, expectedApplicationName, - healthEndpoint, bebNs, eventTypePrefix, eventsEndpoint string, requestTimeout, + healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint string, requestTimeout, serverResponseTime time.Duration) (context.CancelFunc, *testingutils.MockServer, *metrics.Collector) { validator := validateApplicationName(expectedApplicationName) mockServer := testingutils.NewMockServer(testingutils.WithResponseTime(serverResponseTime), testingutils.WithValidator(validator)) @@ -440,7 +458,7 @@ func setupTestResources(t *testing.T, port, maxRequestSize int, applicationName, if err := eventingv1alpha1.AddToScheme(scheme); err != nil { t.Fatalf("failed to add eventing v1alpha1 to scheme: %v", err) } - subscription := testingutils.NewSubscription() + subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, eventType)) // Configuring fake dynamic client dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) diff --git a/pkg/handler/nats/handler_test.go b/pkg/handler/nats/handler_test.go index e897bfe..394c558 100644 --- a/pkg/handler/nats/handler_test.go +++ b/pkg/handler/nats/handler_test.go @@ -57,7 +57,10 @@ func (test *Test) init() { test.healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) } -func (test *Test) setupResources(t *testing.T, subscription *eventingv1alpha1.Subscription, applicationName string) context.CancelFunc { +func (test *Test) setupResources(t *testing.T, subscription *eventingv1alpha1.Subscription, applicationName, eventTypePrefix string) context.CancelFunc { + // set eventTypePrefix + test.natsConfig.LegacyEventTypePrefix = eventTypePrefix + // a cancelable context to be used ctx, cancel := context.WithCancel(context.Background()) @@ -137,19 +140,19 @@ func TestMain(m *testing.M) { } func TestNatsHandlerForCloudEvents(t *testing.T) { - exec := func(t *testing.T, applicationName, expectedNatsSubject string) { + exec := func(t *testing.T, applicationName, expectedNatsSubject, eventTypePrefix, eventType string) { test.logger.Info("TestNatsHandlerForCloudEvents started") // setup test environment publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", test.natsConfig.Port) - subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, testingutils.CloudEventTypeNotClean)) - cancel := test.setupResources(t, subscription, applicationName) + subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, eventType)) + cancel := test.setupResources(t, subscription, applicationName, eventTypePrefix) defer cancel() // prepare event type from subscription assert.NotNil(t, subscription.Spec.Filter) assert.NotEmpty(t, subscription.Spec.Filter.Filters) - eventType := subscription.Spec.Filter.Filters[0].EventType.Value + eventTypeToSubscribe := subscription.Spec.Filter.Filters[0].EventType.Value // connect to nats bc := pkgnats.NewBackendConnection(test.natsUrl, true, 3, time.Second) @@ -159,7 +162,7 @@ func TestNatsHandlerForCloudEvents(t *testing.T) { // publish a message to NATS and validate it validator := testingutils.ValidateNatsSubjectOrFail(t, expectedNatsSubject) - testingutils.SubscribeToEventOrFail(t, bc.Connection, eventType, validator) + testingutils.SubscribeToEventOrFail(t, bc.Connection, eventTypeToSubscribe, validator) // run the tests for publishing cloudevents for _, testCase := range handlertest.TestCasesForCloudEvents { @@ -180,25 +183,27 @@ func TestNatsHandlerForCloudEvents(t *testing.T) { } } - // make sure not to change the cloudevent, even if its event-type contains none-alphanumeric characters - exec(t, testingutils.ApplicationName, testingutils.CloudEventTypeNotClean) - exec(t, testingutils.ApplicationNameNotClean, testingutils.CloudEventTypeNotClean) + // make sure not to change the cloudevent, even if its event-type contains none-alphanumeric characters or the event-type-prefix is empty + exec(t, testingutils.ApplicationName, testingutils.CloudEventTypeNotClean, testingutils.MessagingEventTypePrefix, testingutils.CloudEventTypeNotClean) + exec(t, testingutils.ApplicationName, testingutils.CloudEventTypeNotClean, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypeNotCleanPrefixEmpty) + exec(t, testingutils.ApplicationNameNotClean, testingutils.CloudEventTypeNotClean, testingutils.MessagingEventTypePrefix, testingutils.CloudEventTypeNotClean) + exec(t, testingutils.ApplicationNameNotClean, testingutils.CloudEventTypeNotClean, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypeNotCleanPrefixEmpty) } func TestNatsHandlerForLegacyEvents(t *testing.T) { - exec := func(t *testing.T, applicationName string, expectedNatsSubject string) { + exec := func(t *testing.T, applicationName string, expectedNatsSubject, eventTypePrefix, eventType string) { test.logger.Info("TestNatsHandlerForLegacyEvents started") // setup test environment publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/%s/v1/events", test.natsConfig.Port, applicationName) - subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, testingutils.CloudEventTypeNotClean)) - cancel := test.setupResources(t, subscription, applicationName) + subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, eventType)) + cancel := test.setupResources(t, subscription, applicationName, eventTypePrefix) defer cancel() // prepare event type from subscription assert.NotNil(t, subscription.Spec.Filter) assert.NotEmpty(t, subscription.Spec.Filter.Filters) - eventType := subscription.Spec.Filter.Filters[0].EventType.Value + eventTypeToSubscribe := subscription.Spec.Filter.Filters[0].EventType.Value // connect to nats bc := pkgnats.NewBackendConnection(test.natsUrl, true, 3, time.Second) @@ -208,7 +213,7 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { // publish a message to NATS and validate it validator := testingutils.ValidateNatsSubjectOrFail(t, expectedNatsSubject) - testingutils.SubscribeToEventOrFail(t, bc.Connection, eventType, validator) + testingutils.SubscribeToEventOrFail(t, bc.Connection, eventTypeToSubscribe, validator) // run the tests for publishing legacy events for _, testCase := range handlertest.TestCasesForLegacyEvents { @@ -237,50 +242,53 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { } // make sure to clean the legacy event, so that its event-type is free from none-alphanumeric characters - exec(t, testingutils.ApplicationName, testingutils.CloudEventType) - exec(t, testingutils.ApplicationNameNotClean, testingutils.CloudEventType) + exec(t, testingutils.ApplicationName, testingutils.CloudEventType, testingutils.MessagingEventTypePrefix, testingutils.CloudEventTypeNotClean) + exec(t, testingutils.ApplicationName, testingutils.CloudEventType, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypeNotCleanPrefixEmpty) + exec(t, testingutils.ApplicationNameNotClean, testingutils.CloudEventType, testingutils.MessagingEventTypePrefix, testingutils.CloudEventTypeNotClean) + exec(t, testingutils.ApplicationNameNotClean, testingutils.CloudEventType, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypeNotCleanPrefixEmpty) } func TestNatsHandlerForSubscribedEndpoint(t *testing.T) { test.logger.Info("TestNatsHandlerForSubscribedEndpoint started") - // setup test environment - subscribedEndpointFormat := "http://localhost:%d/%s/v1/events/subscribed" - subscription := testingutils.NewSubscription() - cancel := test.setupResources(t, subscription, testingutils.ApplicationName) - defer cancel() - - // run the tests for subscribed endpoint - for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { - t.Run(testCase.Name, func(t *testing.T) { - subscribedURL := fmt.Sprintf(subscribedEndpointFormat, test.natsConfig.Port, testCase.AppName) - resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) - if err != nil { - t.Fatalf("failed to send event with error: %v", err) - } - - if testCase.WantStatusCode != resp.StatusCode { - t.Fatalf("test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) - } - defer func() { _ = resp.Body.Close() }() - respBodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Errorf("failed to convert body to bytes: %v", err) - } - gotEventsResponse := subscribed.Events{} - err = json.Unmarshal(respBodyBytes, &gotEventsResponse) - if err != nil { - t.Errorf("failed to unmarshal body bytes to events response: %v", err) - } - if !reflect.DeepEqual(testCase.WantResponse, gotEventsResponse) { - t.Errorf("incorrect response, wanted: %v, got: %v", testCase.WantResponse, gotEventsResponse) - } - - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, test.collector) - } - }) + exec := func(eventTypePrefix, eventType string) { + // setup test environment + subscribedEndpointFormat := "http://localhost:%d/%s/v1/events/subscribed" + subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, eventType)) + cancel := test.setupResources(t, subscription, testingutils.ApplicationName, eventTypePrefix) + defer cancel() + + // run the tests for subscribed endpoint + for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { + t.Run(testCase.Name, func(t *testing.T) { + subscribedURL := fmt.Sprintf(subscribedEndpointFormat, test.natsConfig.Port, testCase.AppName) + resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) + if err != nil { + t.Fatalf("failed to send event with error: %v", err) + } + + if testCase.WantStatusCode != resp.StatusCode { + t.Fatalf("test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) + } + defer func() { _ = resp.Body.Close() }() + respBodyBytes, err := ioutil.ReadAll(resp.Body) + if err != nil { + t.Errorf("failed to convert body to bytes: %v", err) + } + gotEventsResponse := subscribed.Events{} + err = json.Unmarshal(respBodyBytes, &gotEventsResponse) + if err != nil { + t.Errorf("failed to unmarshal body bytes to events response: %v", err) + } + if !reflect.DeepEqual(testCase.WantResponse, gotEventsResponse) { + t.Errorf("incorrect response, wanted: %v, got: %v", testCase.WantResponse, gotEventsResponse) + } + }) + } } + + exec(testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) + exec(testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) } func newEnvConfig(port, natsPort int) *env.NatsConfig { diff --git a/pkg/legacy-events/helpers.go b/pkg/legacy-events/helpers.go index c8fd12b..a8a66b8 100644 --- a/pkg/legacy-events/helpers.go +++ b/pkg/legacy-events/helpers.go @@ -11,6 +11,17 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" ) +const ( + // eventTypeFormat is driven by BEB specification. + // An EventType must have at least 4 segments separated by dots in the form of: + // ... + eventTypeFormat = "%s.%s.%s.%s" + + // eventTypeFormatWithoutPrefix must have at least 3 segments separated by dots in the form of: + // .. + eventTypeFormatWithoutPrefix = "%s.%s.%s" +) + // ParseApplicationNameFromPath returns application name from the URL. // The format of the URL is: /:application-name/v1/... func ParseApplicationNameFromPath(path string) string { @@ -51,5 +62,8 @@ func writeJSONResponse(w http.ResponseWriter, resp *api.PublishEventResponses) { // formatEventType4BEB format eventType as per BEB spec func formatEventType4BEB(eventTypePrefix, app, eventType, version string) string { - return fmt.Sprintf(eventTypePrefixFormat, eventTypePrefix, app, eventType, version) + if len(strings.TrimSpace(eventTypePrefix)) == 0 { + return fmt.Sprintf(eventTypeFormatWithoutPrefix, app, eventType, version) + } + return fmt.Sprintf(eventTypeFormat, eventTypePrefix, app, eventType, version) } diff --git a/pkg/legacy-events/helpers_test.go b/pkg/legacy-events/helpers_test.go index 9def2c1..9bce0e3 100644 --- a/pkg/legacy-events/helpers_test.go +++ b/pkg/legacy-events/helpers_test.go @@ -52,6 +52,13 @@ func TestFormatEventType4BEB(t *testing.T) { version: "v1", wantedEventType: "prefix.app.order-foo.v1", }, + { + eventTypePrefix: "", + app: "app", + eventType: "order-foo", + version: "v1", + wantedEventType: "app.order-foo.v1", + }, } for _, tc := range testCases { diff --git a/pkg/legacy-events/legacy.go b/pkg/legacy-events/legacy.go index 07a9dc8..0403d34 100644 --- a/pkg/legacy-events/legacy.go +++ b/pkg/legacy-events/legacy.go @@ -21,10 +21,6 @@ import ( var ( isValidEventTypeVersion = regexp.MustCompile(AllowedEventTypeVersionChars).MatchString isValidEventID = regexp.MustCompile(AllowedEventIDChars).MatchString - // eventTypePrefixFormat is driven by BEB specification. - // An EventType must have at least 4 segments separated by dots in the form of: - // ... - eventTypePrefixFormat = "%s.%s.%s.%s" ) const ( diff --git a/pkg/subscribed/helpers.go b/pkg/subscribed/helpers.go index 2dfc81a..b42e59a 100644 --- a/pkg/subscribed/helpers.go +++ b/pkg/subscribed/helpers.go @@ -83,7 +83,13 @@ func FilterEventTypeVersions(eventTypePrefix, bebNs, appName string, filters *ev if filter == nil { continue } - searchingForEventPrefix := strings.ToLower(fmt.Sprintf("%s.%s.", eventTypePrefix, appName)) + + var prefix string + if len(strings.TrimSpace(eventTypePrefix)) == 0 { + prefix = strings.ToLower(fmt.Sprintf("%s.", appName)) + } else { + prefix = strings.ToLower(fmt.Sprintf("%s.%s.", eventTypePrefix, appName)) + } if filter.EventSource != nil && filter.EventType != nil { // TODO revisit the filtration logic as part of https://github.com/kyma-project/kyma/issues/10761 @@ -93,8 +99,8 @@ func FilterEventTypeVersions(eventTypePrefix, bebNs, appName string, filters *ev continue } - if strings.HasPrefix(filter.EventType.Value, searchingForEventPrefix) { - eventTypeVersion := strings.ReplaceAll(filter.EventType.Value, searchingForEventPrefix, "") + if strings.HasPrefix(filter.EventType.Value, prefix) { + eventTypeVersion := strings.ReplaceAll(filter.EventType.Value, prefix, "") eventTypeVersionArr := strings.Split(eventTypeVersion, ".") version := eventTypeVersionArr[len(eventTypeVersionArr)-1] eventType := "" diff --git a/testing/fixtures.go b/testing/fixtures.go index 47e45a8..d30c85a 100644 --- a/testing/fixtures.go +++ b/testing/fixtures.go @@ -4,22 +4,23 @@ const ( ApplicationName = "testapp1023" ApplicationNameNotClean = "test.app_1-0+2=3" - // messaging system properties - MessagingNamespace = "/messaging.namespace" - MessagingEventTypePrefix = "sap.kyma" - - // event properties - EventID = "8945ec08-256b-11eb-9928-acde48001122" - CloudEventType = MessagingEventTypePrefix + "." + ApplicationName + ".order.created.v1" - CloudEventTypeNotClean = MessagingEventTypePrefix + "." + ApplicationNameNotClean + ".order.created.v1" - CloudEventSource = "/default/sap.kyma/id" - CloudEventSpecVersion = "1.0" - CloudEventData = `{\"key\":\"value\"}` - CloudEventDataContentType = "application/json" - LegacyEventType = "order.created" - LegacyEventTypeVersion = "v1" - LegacyEventTime = "2020-04-02T21:37:00Z" - LegacyEventData = `{"key": "value"}` + MessagingNamespace = "/messaging.namespace" + MessagingEventTypePrefix = "prefix" + MessagingEventTypePrefixEmpty = "" + + EventID = "8945ec08-256b-11eb-9928-acde48001122" + CloudEventType = MessagingEventTypePrefix + "." + ApplicationName + ".order.created.v1" + CloudEventTypePrefixEmpty = ApplicationName + ".order.created.v1" + CloudEventTypeNotClean = MessagingEventTypePrefix + "." + ApplicationNameNotClean + ".order.created.v1" + CloudEventTypeNotCleanPrefixEmpty = ApplicationNameNotClean + ".order.created.v1" + CloudEventSource = "/default/sap.kyma/id" + CloudEventSpecVersion = "1.0" + CloudEventData = `{\"key\":\"value\"}` + CloudEventDataContentType = "application/json" + LegacyEventType = "order.created" + LegacyEventTypeVersion = "v1" + LegacyEventTime = "2020-04-02T21:37:00Z" + LegacyEventData = `{"key": "value"}` StructuredCloudEventPayloadWithoutID = `{ "type":"` + CloudEventTypeNotClean + `", From 173ba684cbd04fa219041147862dde8bf0a08bf6 Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Thu, 21 Oct 2021 12:17:30 +0200 Subject: [PATCH 034/194] Fix CVE-2021-25741 for Eventing components (#12420) * Fix CVE-2021-25741 for Eventing components * Update images --- go.mod | 6 +++--- go.sum | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 9b853c2..2424929 100644 --- a/go.mod +++ b/go.mod @@ -20,9 +20,9 @@ require ( go.opencensus.io v0.22.4 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/tools v0.1.1 // indirect - k8s.io/api v0.20.7 - k8s.io/apimachinery v0.20.7 - k8s.io/client-go v0.20.7 + k8s.io/api v0.20.11 + k8s.io/apimachinery v0.20.11 + k8s.io/client-go v0.20.11 sigs.k8s.io/controller-runtime v0.8.3 ) diff --git a/go.sum b/go.sum index 51dbc71..71bd9ee 100644 --- a/go.sum +++ b/go.sum @@ -1275,8 +1275,8 @@ k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= k8s.io/api v0.18.12/go.mod h1:3sS78jmUoGHwERyMbEhxP6owcQ77UxGo+Yy+dKNWrh0= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= -k8s.io/api v0.20.7 h1:wOEPJ3NoimUfR9v9sAO2JosPiEP9IGFNplf7zZvYzPU= -k8s.io/api v0.20.7/go.mod h1:4x0yErUkcEWYG+O0S4QdrYa2+PLEeY2M7aeQe++2nmk= +k8s.io/api v0.20.11 h1:WSo9PRI0czf0DgevfMuCeMpzCxZxB8VRtYtXhWd1OlA= +k8s.io/api v0.20.11/go.mod h1:1VzSMyoGOEYcUvzlUBsV4wEbOb8x74yr8eCVBgi16BY= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.18.12/go.mod h1:nihADkPed1L37Vxpz2/BrtxO9mCtINH23aNtUe/CRLo= @@ -1289,8 +1289,8 @@ k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftc k8s.io/apimachinery v0.18.12/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk= k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.7 h1:tBfhql7OggSCahvASeEpLRzvxc7FK77wNivi1uXCQWM= -k8s.io/apimachinery v0.20.7/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= +k8s.io/apimachinery v0.20.11 h1:cAy7iHzAMEuNGZTNHbkaGtova6X/42NF7kJoEZHYoKo= +k8s.io/apimachinery v0.20.11/go.mod h1:kQa//VOAwyVwJ2+L9kOREbsnryfsGSkSM1przND4+mw= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.18.12/go.mod h1:uFOeW4LlxS6KDgLWy3n3gh0DhC6m41QIFgL33ouk+4w= @@ -1305,8 +1305,8 @@ k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= k8s.io/client-go v0.18.12/go.mod h1:0aC8XkA09dX/goYqHQJ/kVv0zL1t+weOZt3pmz9LpxA= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= -k8s.io/client-go v0.20.7 h1:Ot22456XfYAWrCWddw/quevMrFHqP7s1qT499FoumVU= -k8s.io/client-go v0.20.7/go.mod h1:uGl3qh/Jy3cTF1nDoIKBqUZlRWnj/EM+/leAXETKRuA= +k8s.io/client-go v0.20.11 h1:WIyJ++rzbT25QAXDvTLmNQC/M9jbrnIKmxsR3qPI4nI= +k8s.io/client-go v0.20.11/go.mod h1:C2UZgvcII+PH5s9Y66nV4wXphIxRukI2d8yiOxoPo5s= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.12/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= @@ -1368,8 +1368,8 @@ sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7m sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3 h1:4oyYo8NREp49LBBhKxEqCulFjg26rawYKrnCmg+Sr6c= -sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= +sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From 769deac5c4c8d0956cf4900b2e0d91adcbcd0d9d Mon Sep 17 00:00:00 2001 From: Pooya Salehi Date: Fri, 22 Oct 2021 14:43:30 +0200 Subject: [PATCH 035/194] Update event publisher proxy dependencies (#12434) * update github.com/prometheus/client_golang * update github.com/sirupsen/logrus * update go.opencensus.io * update github.com/google/uuid * update github.com/onsi/gomega * bump image tag * use go 1.16 --- go.mod | 13 ++++++------ go.sum | 67 ++++++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 50 insertions(+), 30 deletions(-) diff --git a/go.mod b/go.mod index 2424929..23404ec 100644 --- a/go.mod +++ b/go.mod @@ -1,23 +1,22 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy -go 1.15 +go 1.16 require ( github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 github.com/cloudevents/sdk-go/v2 v2.5.0 - github.com/google/uuid v1.1.2 + github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20210520105418-ddc3a476c40a github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316 github.com/nats-io/nats-server/v2 v2.2.4 github.com/nats-io/nats.go v1.11.0 - github.com/onsi/ginkgo v1.14.2 // indirect - github.com/onsi/gomega v1.10.4 + github.com/onsi/gomega v1.16.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.9.0 - github.com/sirupsen/logrus v1.7.0 + github.com/prometheus/client_golang v1.11.0 + github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.0 - go.opencensus.io v0.22.4 + go.opencensus.io v0.23.0 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/tools v0.1.1 // indirect k8s.io/api v0.20.11 diff --git a/go.sum b/go.sum index 71bd9ee..e218547 100644 --- a/go.sum +++ b/go.sum @@ -250,6 +250,7 @@ github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3I github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 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= @@ -306,6 +307,7 @@ github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85n github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= @@ -353,8 +355,10 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho= github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995/go.mod h1:lJgMEyOkYFkPcDKwRXegd+iM6E7matEszMG5HhwytU8= @@ -368,8 +372,11 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -386,8 +393,9 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +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/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= @@ -466,8 +474,9 @@ github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBv github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -608,8 +617,9 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -625,8 +635,8 @@ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= -github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -634,8 +644,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.4 h1:NiTx7EEvBzu9sFOD1zORteLSt3o8gnlvZZwSE9TnY9U= -github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= +github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= +github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -685,8 +695,8 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= -github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= +github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -703,8 +713,8 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= -github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= +github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -714,8 +724,9 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= @@ -739,8 +750,9 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= @@ -823,8 +835,9 @@ go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -945,11 +958,11 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 h1:DzZ89McO9/gWPsQXS/FVKAlG02ZjaQ6AlZRBimEYOd0= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1033,11 +1046,13 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1047,8 +1062,9 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1116,6 +1132,7 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -1208,6 +1225,7 @@ google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1217,8 +1235,10 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1247,8 +1267,9 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +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-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= From 830fe574894d4bdad6fe527cc623b86c24bc6e04 Mon Sep 17 00:00:00 2001 From: Piotr Halama Date: Tue, 2 Nov 2021 10:31:35 +0100 Subject: [PATCH 036/194] Improve event-publisher-proxy build performance (#10839) * Improve event-publisher-proxy build performance * build locally, duh * go mod vendor should be executed already * one vendor * bump * cleanup --- Makefile | 36 ++++------------------------ cmd/event-publisher-proxy/Dockerfile | 5 ++-- 2 files changed, 6 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index bf82d33..3c219d2 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ APP_NAME = event-publisher-proxy APP_PATH = components/$(APP_NAME) -BUILDPACK = eu.gcr.io/kyma-project/test-infra/buildpack-golang-toolbox:v20200117-d3885041 SCRIPTS_DIR = $(realpath $(shell pwd)/../..)/common/makefiles override ENTRYPOINT = cmd/main.go @@ -9,32 +8,8 @@ include $(SCRIPTS_DIR)/generic-make-go.mk VERIFY_IGNORE := /vendor\|/mocks -verify:: mod-verify - -resolve-local: - GO111MODULE=on go mod vendor -v - -ensure-local: - @echo "Go modules present in component - omitting." - -dep-status: - @echo "Go modules present in component - omitting." - -dep-status-local: - @echo "Go modules present in component - omitting." - -mod-verify-local: - GO111MODULE=on go mod verify - -# Use it before commit -check-code: check-imports fmt-local vet-local lint - -test-local: - GO111MODULE=on go test ./... -coverprofile cover.out - -$(eval $(call buildpack-cp-ro,resolve)) -$(eval $(call buildpack-mount,mod-verify)) -$(eval $(call buildpack-mount,test)) +release: + $(MAKE) gomod-release-local path-to-referenced-charts: @echo "resources/event-publisher-proxy" @@ -47,9 +22,6 @@ cmds_clean = $(foreach cmd,$(cmds),$(cmd).clean) # produce goals to push images for each cmd program ("bin1.image.push bin2.image.push ...") cmds_images_push = $(foreach img,$(cmds_images),$(img).push) -MOUNT_TARGETS = $(cmds) -$(foreach t,$(MOUNT_TARGETS),$(eval $(call buildpack-mount,$(t)))) - .PHONY: clean clean: $(cmds_clean) resolve_clean licenses_clean @@ -74,7 +46,7 @@ push-image: $(cmds_images_push) ; # make event-publisher-proxy GOBUILD_FLAGS := -v PKG := github.com/kyma-project/kyma/components/event-publisher-proxy -$(cmds): %: resolve-local +$(cmds): %: @echo "+ Building $*" @CGO_ENABLED=0 go build -o $* \ $(GOBUILD_FLAGS) \ @@ -82,7 +54,7 @@ $(cmds): %: resolve-local # Example: # make event-publisher-proxy.image -$(cmds_images): %.image: build pull-licenses +$(cmds_images): %.image: build-local pull-licenses $(eval $@_img_name := $*) @echo "+ Building container image $($@_img_name)" docker image build -f cmd/$*/Dockerfile -t $($@_img_name) . diff --git a/cmd/event-publisher-proxy/Dockerfile b/cmd/event-publisher-proxy/Dockerfile index 36f85c8..a27be88 100644 --- a/cmd/event-publisher-proxy/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -1,12 +1,11 @@ -FROM golang:1.15-alpine as builder +FROM eu.gcr.io/kyma-project/external/golang:1.16.4-alpine as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy WORKDIR $DOCK_PKG_DIR COPY . $DOCK_PKG_DIR -RUN GOOS=linux GO111MODULE=on go mod vendor && \ - CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -o event-publisher-proxy ./cmd/event-publisher-proxy +RUN CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -o event-publisher-proxy ./cmd/event-publisher-proxy FROM gcr.io/distroless/static:nonroot LABEL source = git@github.com:kyma-project/kyma.git From 6caca8612aa74ea6b87b57c86c91cf9f9a6c6fc8 Mon Sep 17 00:00:00 2001 From: Pooya Salehi Date: Tue, 16 Nov 2021 14:08:49 +0100 Subject: [PATCH 037/194] bump go version (#12616) * bump go version * bump image tag * bump docker image tag --- cmd/event-publisher-proxy/Dockerfile | 2 +- go.mod | 54 ++++++++++++++++++++++++++-- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/cmd/event-publisher-proxy/Dockerfile b/cmd/event-publisher-proxy/Dockerfile index a27be88..94d374f 100644 --- a/cmd/event-publisher-proxy/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.16.4-alpine as builder +FROM eu.gcr.io/kyma-project/test-infra/buildpack-golang:v20211110-ab51bd20 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy diff --git a/go.mod b/go.mod index 23404ec..cf3e816 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy -go 1.16 +go 1.17 require ( github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 @@ -18,13 +18,63 @@ require ( github.com/stretchr/testify v1.7.0 go.opencensus.io v0.23.0 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d - golang.org/x/tools v0.1.1 // indirect k8s.io/api v0.20.11 k8s.io/apimachinery v0.20.11 k8s.io/client-go v0.20.11 sigs.k8s.io/controller-runtime v0.8.3 ) +require ( + cloud.google.com/go v0.65.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/evanphx/json-patch v4.9.0+incompatible // indirect + github.com/go-logr/logr v0.3.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/google/go-cmp v0.5.5 // indirect + github.com/google/gofuzz v1.1.0 // indirect + github.com/googleapis/gnostic v0.5.1 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/imdario/mergo v0.3.11 // indirect + github.com/json-iterator/go v1.1.11 // indirect + github.com/klauspost/compress v1.11.12 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/minio/highwayhash v1.0.1 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/nats-io/jwt/v2 v2.0.2 // indirect + github.com/nats-io/nkeys v0.3.0 // indirect + github.com/nats-io/nuid v1.0.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.26.0 // indirect + github.com/prometheus/procfs v0.6.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + go.uber.org/atomic v1.6.0 // indirect + go.uber.org/multierr v1.5.0 // indirect + go.uber.org/zap v1.15.0 // indirect + golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b // indirect + golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 // indirect + golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 // indirect + golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect + golang.org/x/text v0.3.6 // indirect + golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect + golang.org/x/tools v0.1.1 // indirect + google.golang.org/appengine v1.6.6 // indirect + google.golang.org/protobuf v1.26.0 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect + k8s.io/klog/v2 v2.4.0 // indirect + k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd // indirect + k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect + sigs.k8s.io/yaml v1.2.0 // indirect +) + replace ( github.com/containerd/containerd => github.com/containerd/containerd v1.4.4 github.com/dgrijalva/jwt-go => github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 // fix CVE-2020-26160 From 336417419bf0f9bbe789893fa1895064dd22e62b Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Fri, 26 Nov 2021 13:20:54 +0100 Subject: [PATCH 038/194] update eventing-controller dependency in event-publisher-proxy (#12677) * bump eventing controller dependency * bump epp image --- go.mod | 60 +++---- go.sum | 305 ++++++++++++++++++++------------- pkg/subscribed/helpers.go | 5 +- pkg/subscribed/helpers_test.go | 28 +-- testing/utils.go | 8 +- 5 files changed, 233 insertions(+), 173 deletions(-) diff --git a/go.mod b/go.mod index cf3e816..2bec291 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,14 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy go 1.17 require ( - github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 + github.com/cloudevents/sdk-go/protocol/nats/v2 v2.5.0 github.com/cloudevents/sdk-go/v2 v2.5.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20210520105418-ddc3a476c40a - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316 - github.com/nats-io/nats-server/v2 v2.2.4 - github.com/nats-io/nats.go v1.11.0 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20211006112227-6d16a34ea468 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20211123105853-ceeb73d8a841 + github.com/nats-io/nats-server/v2 v2.6.1 + github.com/nats-io/nats.go v1.12.3 github.com/onsi/gomega v1.16.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 @@ -18,10 +18,10 @@ require ( github.com/stretchr/testify v1.7.0 go.opencensus.io v0.23.0 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d - k8s.io/api v0.20.11 - k8s.io/apimachinery v0.20.11 - k8s.io/client-go v0.20.11 - sigs.k8s.io/controller-runtime v0.8.3 + k8s.io/api v0.22.0 + k8s.io/apimachinery v0.22.0 + k8s.io/client-go v0.22.0 + sigs.k8s.io/controller-runtime v0.9.6 ) require ( @@ -29,23 +29,23 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/evanphx/json-patch v4.9.0+incompatible // indirect - github.com/go-logr/logr v0.3.0 // indirect + github.com/evanphx/json-patch v4.11.0+incompatible // indirect + github.com/go-logr/logr v0.4.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-cmp v0.5.5 // indirect github.com/google/gofuzz v1.1.0 // indirect - github.com/googleapis/gnostic v0.5.1 // indirect - github.com/hashicorp/golang-lru v0.5.4 // indirect - github.com/imdario/mergo v0.3.11 // indirect + github.com/googleapis/gnostic v0.5.5 // indirect + github.com/imdario/mergo v0.3.12 // indirect github.com/json-iterator/go v1.1.11 // indirect - github.com/klauspost/compress v1.11.12 // indirect + github.com/klauspost/compress v1.13.4 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/minio/highwayhash v1.0.1 // indirect + github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.1 // indirect - github.com/nats-io/jwt/v2 v2.0.2 // indirect + github.com/nats-io/jwt/v2 v2.0.3 // indirect github.com/nats-io/nkeys v0.3.0 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -53,24 +53,24 @@ require ( github.com/prometheus/common v0.26.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - go.uber.org/atomic v1.6.0 // indirect - go.uber.org/multierr v1.5.0 // indirect - go.uber.org/zap v1.15.0 // indirect - golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b // indirect - golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 // indirect - golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 // indirect - golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect + go.uber.org/atomic v1.7.0 // indirect + go.uber.org/multierr v1.6.0 // indirect + go.uber.org/zap v1.18.1 // indirect + golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect + golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 // indirect + golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect + golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect golang.org/x/text v0.3.6 // indirect - golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect + golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect golang.org/x/tools v0.1.1 // indirect - google.golang.org/appengine v1.6.6 // indirect + google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.26.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect - k8s.io/klog/v2 v2.4.0 // indirect - k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd // indirect - k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + k8s.io/klog/v2 v2.9.0 // indirect + k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e // indirect + k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect sigs.k8s.io/yaml v1.2.0 // indirect ) diff --git a/go.sum b/go.sum index e218547..573788d 100644 --- a/go.sum +++ b/go.sum @@ -2,7 +2,6 @@ bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxo cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.40.0/go.mod h1:Tk58MuI9rbLMKlAjeO/bDnteAx7tX2gJIXw4T5Jwlro= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= @@ -34,35 +33,30 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= -contrib.go.opencensus.io/exporter/prometheus v0.1.0/go.mod h1:cGFniUXGZlKRjzOyuZJ6mgB+PgBcCIa79kEKR8YCW+A= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.2.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= +github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= +github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= +github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= -github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= +github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= @@ -77,6 +71,7 @@ github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -107,10 +102,13 @@ github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:l github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/avast/retry-go v2.4.1+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= +github.com/avast/retry-go/v3 v3.1.1/go.mod h1:6cXRK369RpzFL3UQGqIUp9Q7GDrams+KsYWrfNA1/nQ= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -128,7 +126,6 @@ github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0Bsq github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= -github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -143,15 +140,12 @@ github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmE github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go v1.2.0 h1:2AxI14EJUw1PclJ5gZJtzbxnHIfNMdi76Qq3P3G1BRU= -github.com/cloudevents/sdk-go v1.2.0/go.mod h1:ss+jWJ88wypiewnPEzChSBzTYXGpdcILoN9YHk8uhTQ= -github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1 h1:LY5dKsBPIcY6NQajjgGyQO2hlfSD96FnMpoISZ2lxJo= -github.com/cloudevents/sdk-go/protocol/nats/v2 v2.3.1/go.mod h1:xEjXKvch0fuLkmYyNlznjNpwgtMVhELY6aeyruXKXjQ= -github.com/cloudevents/sdk-go/v2 v2.2.0/go.mod h1:3CTrpB4+u7Iaj6fd7E2Xvm5IxMdRoaAhqaRVnOr2rCU= -github.com/cloudevents/sdk-go/v2 v2.3.1/go.mod h1:4fO2UjPMYYR1/7KPJQCwTPb0lFA8zYuitkUpAZFSY1Q= +github.com/cloudevents/sdk-go/protocol/nats/v2 v2.5.0 h1:BRCZBiIow5Hj9GsQX0InaaJorKo+/3GsOzU4xIc9UwU= +github.com/cloudevents/sdk-go/protocol/nats/v2 v2.5.0/go.mod h1:69I3AikdiNccEO/188fSiEVFphftrxJ5fgLdG40PAKk= github.com/cloudevents/sdk-go/v2 v2.5.0 h1:Ts6aLHbBUJfcNcZ4ouAfJ4+Np7SE1Yf2w4ADKRCd7Fo= github.com/cloudevents/sdk-go/v2 v2.5.0/go.mod h1:nlXhgFkf0uTopxmRXalyMwS2LG70cRGPrxzmjJgSG0U= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= @@ -190,13 +184,13 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= -github.com/deislabs/oras v0.10.0/go.mod h1:N1UzE7rBa9qLyN4l8IlBTxc2PkrRcKgWQ3HTJvRnJRE= +github.com/deislabs/oras v0.11.1/go.mod h1:39lCtf8Q6WDC7ul9cnyWXONNzKvabEKk+AX+L0ImnQk= github.com/denisenkom/go-mssqldb v0.0.0-20191001013358-cfbb681360f0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/cli v20.10.3+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v20.10.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v0.0.0-20191216044856-a8371794149d/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= github.com/docker/docker v20.10.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= @@ -217,21 +211,24 @@ github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkg github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.6+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= +github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= +github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -243,6 +240,7 @@ github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2H github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -256,11 +254,13 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.3.0 h1:q4c+kbcR0d5rSurhBR8dIgieOaYpXtsdTYfx22Cu6rs= github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= +github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v0.2.0 h1:v6Ji8yBW77pva6NkJKQdHLAJKrIJKRHz0RXwPqCHSR4= github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= +github.com/go-logr/zapr v0.4.0 h1:uc1uML3hRYL9/ZZPdgHS/n8Nzo+eaYL/Efxkkamf7OM= +github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= @@ -274,11 +274,13 @@ github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwds github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= @@ -292,24 +294,31 @@ github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsd github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= +github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= +github.com/gobuffalo/flect v0.2.2/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= +github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= @@ -332,8 +341,9 @@ github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -360,11 +370,12 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho= -github.com/golangplus/fmt v0.0.0-20150411045040-2a5d6d7d2995/go.mod h1:lJgMEyOkYFkPcDKwRXegd+iM6E7matEszMG5HhwytU8= +github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -391,6 +402,7 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -402,8 +414,9 @@ github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsC github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/googleapis/gnostic v0.5.1 h1:A8Yhf6EtqTv9RMsU6MQTyrtV1TjWlR6xU9BsZIwuTCM= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= +github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= +github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -420,7 +433,6 @@ github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:Fecb github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= @@ -429,11 +441,9 @@ github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= @@ -443,8 +453,6 @@ github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -459,16 +467,19 @@ github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +github.com/jmoiron/sqlx v1.3.1/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -488,8 +499,9 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.11.12 h1:famVnQVu7QwryBN4jNseQdUKES71ZAOnB6UQQJPZvqk= github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/klauspost/compress v1.13.4 h1:0zhec2I8zGnjWcKyLl6i3gPqKANCCn5e9xmviEEeX6s= +github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -501,23 +513,21 @@ github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20190909175253-906fa5f9c249/go.mod h1:s8wBC55/DEkNa3YMY1WLgpT33Ghpmw7v+waIxh15dYI= -github.com/kubernetes-sigs/service-catalog v0.3.0/go.mod h1:zRfgMd1T9HuXR24Qj4GOu/TGWABVGw62MGlyHVcpWnU= -github.com/kyma-incubator/api-gateway v0.0.0-20200930072023-5d3f2107a1ef/go.mod h1:DGeKJ2GUH1cOAxUKVbUUl55DuIX6w2DXgZjlg8UTwrU= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20210520105418-ddc3a476c40a h1:kvb1Se/nAghcx+n+zLqaEn1YAC8m7/xoHsM5ICodxkU= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20210520105418-ddc3a476c40a/go.mod h1:XVGpxflxaa96HWcgvETiMIddt0TmIFivruGCij3rPRM= -github.com/kyma-project/kyma/components/event-publisher-proxy v0.0.0-20201014135541-82b304ab245a/go.mod h1:SzxIlsqx8zJXNhqyUabWs8NzYcfEv1SleJ1U0+Gp6Ms= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316 h1:wZ2BvFuElkG6K3pOFxLiT/oXeH07N/wfJqj1LlL76rY= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20210112215829-419ae45b5316/go.mod h1:ZBfptvrdh3YUmdJac/1IFm2pgyk+YAfyLET05ztKTlI= +github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= +github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= +github.com/kyma-incubator/api-gateway v0.0.0-20210909101151-ac45e9ce3553/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= +github.com/kyma-project/kyma/common/logging v0.0.0-20211006112227-6d16a34ea468/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20211006112227-6d16a34ea468 h1:0SPnmY0G+KntNdcVkzDnkCiWlmcKZxhrDVId1evT+jc= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20211006112227-6d16a34ea468/go.mod h1:tHyxTctgL2M0a0Rn25goIO6SVp1Hvo7eoZcrnDCIXxA= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20211123105853-ceeb73d8a841 h1:Jka8zBprgoUfutZH76EysIqqLLr61JEh6v0aXagZrl8= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20211123105853-ceeb73d8a841/go.mod h1:GQPUb9xnwDxDecH/lxZhswnH9vyvtkqTzkmbDtvMZts= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lightstep/tracecontext.go v0.0.0-20181129014701-1757c391b1ac/go.mod h1:Frd2bnT3w5FB5q49ENTfVlztJES+1k/7lyWX2+9gq/M= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -528,40 +538,48 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN 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/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-oci8 v0.0.7/go.mod h1:wjDx6Xm9q7dFtHJvIlrI99JytznLw5wQ4R+9mNXJwGI= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-shellwords v1.0.11/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mattn/go-sqlite3 v1.12.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= github.com/minio/highwayhash v1.0.1 h1:dZ6IIu8Z14VlC0VpfKofAhCy74wu/Qb5gcn52yWoz/0= github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.1.1/go.mod h1:EBArHfARyrSWO/+Wyr9zwEkc6XMFB9XyNgFNmRkZZU4= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= +github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= +github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= @@ -572,6 +590,7 @@ github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lN github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -581,34 +600,20 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/jwt v0.3.3-0.20200519195258-f2bf5ce574c7/go.mod h1:n3cvmLfBfnpV4JJRN7lRYCyZnw48ksGsbThGXEk4w9M= -github.com/nats-io/jwt v1.1.0/go.mod h1:n3cvmLfBfnpV4JJRN7lRYCyZnw48ksGsbThGXEk4w9M= github.com/nats-io/jwt v1.2.2 h1:w3GMTO969dFg+UOKTmmyuu7IGdusK+7Ytlt//OYH/uU= github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= -github.com/nats-io/jwt/v2 v2.0.0-20200916203241-1f8ce17dff02/go.mod h1:vs+ZEjP+XKy8szkBmQwCB7RjYdIlMaPsFPs4VdS4bTQ= -github.com/nats-io/jwt/v2 v2.0.0-20201015190852-e11ce317263c/go.mod h1:vs+ZEjP+XKy8szkBmQwCB7RjYdIlMaPsFPs4VdS4bTQ= -github.com/nats-io/jwt/v2 v2.0.2 h1:ejVCLO8gu6/4bOKIHQpmB5UhhUJfAQw55yvLWpfmKjI= -github.com/nats-io/jwt/v2 v2.0.2/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= +github.com/nats-io/jwt/v2 v2.0.3 h1:i/O6cmIsjpcQyWDYNcq2JyZ3/VTF8SJ4JWluI5OhpvI= +github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats-server/v2 v2.1.7/go.mod h1:rbRrRE/Iv93O/rUvZ9dh4NfT0Cm9HWjW/BqOWLGgYiE= -github.com/nats-io/nats-server/v2 v2.1.8-0.20200524125952-51ebd92a9093/go.mod h1:rQnBf2Rv4P9adtAs/Ti6LfFmVtFG6HLhl/H7cVshcJU= -github.com/nats-io/nats-server/v2 v2.1.8-0.20200601203034-f8d6dd992b71/go.mod h1:Nan/1L5Sa1JRW+Thm4HNYcIDcVRFc5zK9OpSZeI2kk4= -github.com/nats-io/nats-server/v2 v2.1.8-0.20200929001935-7f44d075f7ad/go.mod h1:TkHpUIDETmTI7mrHN40D1pzxfzHZuGmtMbtb83TGVQw= -github.com/nats-io/nats-server/v2 v2.1.8-0.20201129161730-ebe63db3e3ed/go.mod h1:XD0zHR/jTXdZvWaQfS5mQgsXj6x12kMjKLyAk/cOGgY= -github.com/nats-io/nats-server/v2 v2.1.9/go.mod h1:9qVyoewoYXzG1ME9ox0HwkkzyYvnlBDugfR4Gg/8uHU= -github.com/nats-io/nats-server/v2 v2.2.4 h1:yonz5m/M4C4uqDbOCMuSintpvILI0UjdBZ7SuhKhCns= -github.com/nats-io/nats-server/v2 v2.2.4/go.mod h1:sEnFaxqe09cDmfMgACxZbziXnhQFhwk+aKkZjBBRYrI= +github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= +github.com/nats-io/nats-server/v2 v2.6.1 h1:cJy+ia7/4EaJL+ZYDmIy2rD1mDWTfckhtPBU0GYo8xM= +github.com/nats-io/nats-server/v2 v2.6.1/go.mod h1:Az91TbZiV7K4a6k/4v6YYdOKEoxCXj+iqhHVf/MlrKo= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nats.go v1.10.0/go.mod h1:AjGArbfyR50+afOUotNX2Xs5SYHf+CoOa5HH1eEl2HE= -github.com/nats-io/nats.go v1.10.1-0.20200531124210-96f2130e4d55/go.mod h1:ARiFsjW9DVxk48WJbO3OSZ2DG8fjkMi7ecLmXoY/n9I= -github.com/nats-io/nats.go v1.10.1-0.20200606002146-fc6fed82929a/go.mod h1:8eAIv96Mo9QW6Or40jUHejS7e4VwZ3VRYD6Sf0BTDp4= -github.com/nats-io/nats.go v1.10.1-0.20201021145452-94be476ad6e0/go.mod h1:VU2zERjp8xmF+Lw2NH4u2t5qWZxwc7jB3+7HVMWQXPI= -github.com/nats-io/nats.go v1.10.1-0.20201204000952-090c71e95cd0/go.mod h1:Sa3kLIonafChP5IF0b55i9uvGR10I3hPETFbi4+9kOI= -github.com/nats-io/nats.go v1.11.0 h1:L263PZkrmkRJRJT2YHU8GwWWvEvmr9/LUKuJTXsF32k= -github.com/nats-io/nats.go v1.11.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats.go v1.12.3 h1:te0GLbRsjtejEkZKKiuk46tbfIn6FfCSv3WWSo1+51E= +github.com/nats-io/nats.go v1.12.3/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.4/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= @@ -626,11 +631,11 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= +github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= @@ -644,6 +649,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg= +github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= @@ -689,7 +696,6 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -707,7 +713,6 @@ github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2 github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -717,7 +722,6 @@ github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzz github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= @@ -744,6 +748,7 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -766,7 +771,9 @@ github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -775,6 +782,7 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -796,6 +804,7 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= @@ -806,11 +815,13 @@ github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vrischmann/envconfig v1.1.0/go.mod h1:c5DuUlkzfsnspy1g7qiqryPCsW+NjsrLsYq4zhwsoHo= +github.com/vrischmann/envconfig v1.3.0/go.mod h1:bbvxFYJdRSpXrhS63mBFtKJzkDiNkyArOLXtY6q0kuI= github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -838,23 +849,28 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= +go.uber.org/zap v1.18.1 h1:CSUJ2mjFszzEWt4CdKISEuChVIXGBn3lAPwkRGyVrc4= +go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -869,17 +885,17 @@ golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b h1:wSOdpTq0/eI46Ez/LkDwIsAKA71YP2SRKBODiRWM0as= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e h1:gsTQYXdTw2Gq7RBsWvlQ91b+aEQ6bXFUngBGuR8sPpI= +golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -913,7 +929,7 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= +golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -932,6 +948,7 @@ golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -958,11 +975,14 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 h1:DzZ89McO9/gWPsQXS/FVKAlG02ZjaQ6AlZRBimEYOd0= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 h1:ADo5wSpq2gqaCGQWzk7S5vd//0iyyLeAratkEoG5dLE= +golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -993,6 +1013,7 @@ golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1010,6 +1031,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1047,15 +1069,22 @@ golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= +golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1070,8 +1099,10 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= +golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1134,6 +1165,7 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1143,13 +1175,13 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1N golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= +gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1171,8 +1203,9 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +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/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1204,11 +1237,11 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1226,6 +1259,7 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1272,12 +1306,13 @@ 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-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -helm.sh/helm/v3 v3.5.2/go.mod h1:7+CqT745B1Sy/4dzhzbbY9U08pGnJfrJXBkoEEFj18c= +helm.sh/helm/v3 v3.6.3/go.mod h1:mIIus8EOqj+obtycw3sidsR4ORr2aFDmXMSI3k+oeVY= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1285,110 +1320,134 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -istio.io/api v0.0.0-20200812202721-24be265d41c3/go.mod h1:88HN3o1fSD1jo+Z1WTLlJfMm9biopur6Ct9BFKjiB64= -istio.io/client-go v0.0.0-20200916161914-94f0e83444ca/go.mod h1:SO65MWt7I45dvUwuDowoiB0SVcGpfWZfUTlopvYpbZc= +istio.io/api v0.0.0-20210318170531-e6e017e575c5/go.mod h1:88HN3o1fSD1jo+Z1WTLlJfMm9biopur6Ct9BFKjiB64= +istio.io/api v0.0.0-20210416170358-17514f58eeeb/go.mod h1:nsSFw1LIMmGL7r/+6fJI6FxeG/UGlLxRK8bkojIvBVs= +istio.io/client-go v1.9.2/go.mod h1:BfOsn8V/wjBKFqEheQqLqx1r3pjDeYPsQnTU5yWjb1Y= istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a/go.mod h1:OzpAts7jljZceG4Vqi5/zXy/pOg1b209T3jb7Nv5wIs= +istio.io/gogo-genproto v0.0.0-20210113155706-4daf5697332f/go.mod h1:6BwTZRNbWS570wHX/uR1Wqk5e0157TofTAUMzT7N4+s= k8s.io/api v0.17.8/go.mod h1:N++Llhs8kCixMUoCaXXAyMMPbo8dDVnh+IQ36xZV2/0= -k8s.io/api v0.18.1/go.mod h1:3My4jorQWzSs5a+l7Ge6JBbIxChLnY8HnuT58ZWolss= k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= -k8s.io/api v0.18.12/go.mod h1:3sS78jmUoGHwERyMbEhxP6owcQ77UxGo+Yy+dKNWrh0= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= -k8s.io/api v0.20.11 h1:WSo9PRI0czf0DgevfMuCeMpzCxZxB8VRtYtXhWd1OlA= -k8s.io/api v0.20.11/go.mod h1:1VzSMyoGOEYcUvzlUBsV4wEbOb8x74yr8eCVBgi16BY= +k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= +k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= +k8s.io/api v0.22.0 h1:elCpMZ9UE8dLdYxr55E06TmSeji9I3KH494qH70/y+c= +k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= -k8s.io/apiextensions-apiserver v0.18.12/go.mod h1:nihADkPed1L37Vxpz2/BrtxO9mCtINH23aNtUe/CRLo= k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= k8s.io/apiextensions-apiserver v0.20.2/go.mod h1:F6TXp389Xntt+LUq3vw6HFOLttPa0V8821ogLGwb6Zs= +k8s.io/apiextensions-apiserver v0.21.0/go.mod h1:gsQGNtGkc/YoDG9loKI0V+oLZM4ljRPjc/sql5tmvzc= +k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= k8s.io/apimachinery v0.17.8/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= k8s.io/apimachinery v0.18.1/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= -k8s.io/apimachinery v0.18.12/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk= k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.11 h1:cAy7iHzAMEuNGZTNHbkaGtova6X/42NF7kJoEZHYoKo= -k8s.io/apimachinery v0.20.11/go.mod h1:kQa//VOAwyVwJ2+L9kOREbsnryfsGSkSM1przND4+mw= +k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= +k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= +k8s.io/apimachinery v0.22.0 h1:CqH/BdNAzZl+sr3tc0D3VsK3u6ARVSo3GWyLmfIjbP0= +k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= -k8s.io/apiserver v0.18.12/go.mod h1:uFOeW4LlxS6KDgLWy3n3gh0DhC6m41QIFgL33ouk+4w= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.2/go.mod h1:2nKd93WyMhZx4Hp3RfgH2K5PhwyTrprrkWYnI7id7jA= +k8s.io/apiserver v0.21.0/go.mod h1:w2YSn4/WIwYuxG5zJmcqtRdtqgW/J2JRgFAqps3bBpg= +k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU= k8s.io/cli-runtime v0.18.2/go.mod h1:yfFR2sQQzDsV0VEKGZtrJwEy4hLZ2oj4ZIfodgxAHWQ= -k8s.io/cli-runtime v0.20.1/go.mod h1:6wkMM16ZXTi7Ow3JLYPe10bS+XBnIkL6V9dmEz0mbuY= -k8s.io/cli-runtime v0.20.2/go.mod h1:FjH6uIZZZP3XmwrXWeeYCbgxcrD6YXxoAykBaWH0VdM= +k8s.io/cli-runtime v0.21.0/go.mod h1:XoaHP93mGPF37MkLbjGVYqg3S1MnsFdKtiA/RZzzxOo= +k8s.io/cli-runtime v0.22.0/go.mod h1:An6zELQ7udUI0GaXvkuMqyopPA14dIgNqpH8cZu1vig= k8s.io/client-go v0.17.8/go.mod h1:SJsDS64AAtt9VZyeaQMb4Ck5etCitZ/FwajWdzua5eY= -k8s.io/client-go v0.18.1/go.mod h1:iCikYRiXOj/yRRFE/aWqrpPtDt4P2JVWhtHkmESTcfY= k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= -k8s.io/client-go v0.18.12/go.mod h1:0aC8XkA09dX/goYqHQJ/kVv0zL1t+weOZt3pmz9LpxA= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= -k8s.io/client-go v0.20.11 h1:WIyJ++rzbT25QAXDvTLmNQC/M9jbrnIKmxsR3qPI4nI= -k8s.io/client-go v0.20.11/go.mod h1:C2UZgvcII+PH5s9Y66nV4wXphIxRukI2d8yiOxoPo5s= +k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= +k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= +k8s.io/client-go v0.22.0 h1:sD6o9O6tCwUKCENw8v+HFsuAbq2jCu8cWC61/ydwA50= +k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= -k8s.io/code-generator v0.18.12/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= k8s.io/code-generator v0.20.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= +k8s.io/code-generator v0.21.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= +k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo= k8s.io/component-base v0.17.8/go.mod h1:xfNNdTAMsYzdiAa8vXnqDhRVSEgkfza0iMt0FrZDY7s= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= -k8s.io/component-base v0.18.12/go.mod h1:pRGKXsx2KWfsJqlDi4sbCc1jpaB87rXIIqupjhr5wj0= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= k8s.io/component-base v0.20.2/go.mod h1:pzFtCiwe/ASD0iV7ySMu8SYVJjCapNM9bjvk7ptpKh0= -k8s.io/component-helpers v0.20.1/go.mod h1:Q8trCj1zyLNdeur6pD2QvsF8d/nWVfK71YjN5+qVXy4= +k8s.io/component-base v0.21.0/go.mod h1:qvtjz6X0USWXbgmbfXR+Agik4RZ3jv2Bgr5QnZzdPYw= +k8s.io/component-base v0.21.3/go.mod h1:kkuhtfEHeZM6LkX0saqSK8PbdO7A0HigUngmhhrwfGQ= +k8s.io/component-helpers v0.21.0/go.mod h1:tezqefP7lxfvJyR+0a+6QtVrkZ/wIkyMLK4WcQ3Cj8U= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= +k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd h1:sOHNzJIkytDF6qadMNKhhDRpc6ODik8lVC6nOur7B2c= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/kubectl v0.20.1/go.mod h1:2bE0JLYTRDVKDiTREFsjLAx4R2GvUtL/mGYFXfFFMzY= -k8s.io/metrics v0.20.1/go.mod h1:JhpBE/fad3yRGsgEpiZz5FQQM5wJ18OTLkD7Tv40c0s= +k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= +k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM= +k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= +k8s.io/kubectl v0.21.0/go.mod h1:EU37NukZRXn1TpAkMUoy8Z/B2u6wjHDS4aInsDzVvks= +k8s.io/metrics v0.21.0/go.mod h1:L3Ji9EGPP1YBbfm9sPfEXSpnj8i24bfQbAFAsW0NueQ= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210111153108-fddb29f9d009 h1:0T5IaWHO3sJTEmCP6mUlBvMukxPKUQWqiI/YuiBNMiQ= k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471 h1:DnzUXII7sVg1FJ/4JX6YDRJfLNAC7idRatPwe07suiI= +k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= -pack.ag/amqp v0.11.0/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+aqSv/M3njpmo= sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= -sigs.k8s.io/controller-runtime v0.8.3 h1:GMHvzjTmaWHQB8HadW+dIvBoJuLvZObYJ5YoZruPRao= sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= +sigs.k8s.io/controller-runtime v0.9.6 h1:EevVMlgUj4fC1NVM4+DB3iPkWkmGRNarA66neqv9Qew= +sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= +sigs.k8s.io/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I= sigs.k8s.io/kind v0.7.0/go.mod h1:An/AbWHT6pA/Lm0Og8j3ukGhfJP3RiVN/IBU6Lo3zl8= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= +sigs.k8s.io/kustomize/api v0.8.5/go.mod h1:M377apnKT5ZHJS++6H4rQoCHmWtt6qTpp3mbe7p6OLY= +sigs.k8s.io/kustomize/api v0.8.11/go.mod h1:a77Ls36JdfCWojpUqR6m60pdGY1AYFix4AH83nJtY1g= +sigs.k8s.io/kustomize/cmd/config v0.9.7/go.mod h1:MvXCpHs77cfyxRmCNUQjIqCmZyYsbn5PyQpWiq44nW0= +sigs.k8s.io/kustomize/kustomize/v4 v4.0.5/go.mod h1:C7rYla7sI8EnxHE/xEhRBSHMNfcL91fx0uKmUlUhrBk= +sigs.k8s.io/kustomize/kyaml v0.10.15/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg= +sigs.k8s.io/kustomize/kyaml v0.11.0/go.mod h1:GNMwjim4Ypgp/MueD3zXHLRJEjz7RvtPae0AwlvEMFM= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7mRH6DGaRcixXEJXTsE= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/pkg/subscribed/helpers.go b/pkg/subscribed/helpers.go index b42e59a..5cb00ae 100644 --- a/pkg/subscribed/helpers.go +++ b/pkg/subscribed/helpers.go @@ -12,8 +12,9 @@ import ( "k8s.io/client-go/dynamic/dynamicinformer" "k8s.io/client-go/rest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" ) var ( @@ -74,7 +75,7 @@ func AddUniqueEventsToResult(eventsSubSet []Event, uniqEvents map[Event]bool) ma // 1. if the eventType matches the format: .. // E.g. sap.kyma.custom.varkes.order.created.v0 // 2. if the eventSource matches BEBNamespace name -func FilterEventTypeVersions(eventTypePrefix, bebNs, appName string, filters *eventingv1alpha1.BebFilters) []Event { +func FilterEventTypeVersions(eventTypePrefix, bebNs, appName string, filters *eventingv1alpha1.BEBFilters) []Event { events := make([]Event, 0) if filters == nil { return events diff --git a/pkg/subscribed/helpers_test.go b/pkg/subscribed/helpers_test.go index 36b46cf..7374398 100644 --- a/pkg/subscribed/helpers_test.go +++ b/pkg/subscribed/helpers_test.go @@ -13,7 +13,7 @@ func TestFilterEventTypeVersions(t *testing.T) { appName string eventTypePrefix string bebNs string - filters *eventingv1alpha1.BebFilters + filters *eventingv1alpha1.BEBFilters expectedEvents []Event }{ { @@ -184,10 +184,10 @@ func TestAddUniqueEventsToResult(t *testing.T) { } } -type BEBFilterOption func(filter *eventingv1alpha1.BebFilters) +type BEBFilterOption func(filter *eventingv1alpha1.BEBFilters) -func NewBEBFilters(opts ...BEBFilterOption) *eventingv1alpha1.BebFilters { - newFilters := &eventingv1alpha1.BebFilters{} +func NewBEBFilters(opts ...BEBFilterOption) *eventingv1alpha1.BEBFilters { + newFilters := &eventingv1alpha1.BEBFilters{} for _, opt := range opts { opt(newFilters) } @@ -195,32 +195,32 @@ func NewBEBFilters(opts ...BEBFilterOption) *eventingv1alpha1.BebFilters { return newFilters } -func WithOneBEBFilter(bebFilters *eventingv1alpha1.BebFilters) { +func WithOneBEBFilter(bebFilters *eventingv1alpha1.BEBFilters) { evSource := "/default/foo.kyma/kt1" evType := "foo.prefix.custom.foovarkes.order.created.v1" - bebFilters.Filters = []*eventingv1alpha1.BebFilter{ + bebFilters.Filters = []*eventingv1alpha1.BEBFilter{ NewBEBFilter(evSource, evType), } } -func WithMultipleBEBFiltersFromSameSource(bebFilters *eventingv1alpha1.BebFilters) { +func WithMultipleBEBFiltersFromSameSource(bebFilters *eventingv1alpha1.BEBFilters) { evSource := "/default/foo.kyma/kt1" evType := "foo.prefix.custom.foovarkes.order.created.v1" - bebFilters.Filters = []*eventingv1alpha1.BebFilter{ + bebFilters.Filters = []*eventingv1alpha1.BEBFilter{ NewBEBFilter(evSource, evType), NewBEBFilter(evSource, evType), NewBEBFilter(evSource, evType), } } -func WithMultipleBEBFiltersFromDiffSource(bebFilters *eventingv1alpha1.BebFilters) { +func WithMultipleBEBFiltersFromDiffSource(bebFilters *eventingv1alpha1.BEBFilters) { evSource1 := "foo-match" evSource2 := "/default/foo.different/kt1" evSource3 := "/default/foo.different2/kt1" evSource4 := "" evType := "foo.prefix.custom.foovarkes.order.created.v1" - bebFilters.Filters = []*eventingv1alpha1.BebFilter{ + bebFilters.Filters = []*eventingv1alpha1.BEBFilter{ NewBEBFilter(evSource1, evType), NewBEBFilter(evSource2, evType), NewBEBFilter(evSource3, evType), @@ -228,19 +228,19 @@ func WithMultipleBEBFiltersFromDiffSource(bebFilters *eventingv1alpha1.BebFilter } } -func WithMultipleBEBFiltersFromDiffEventTypePrefix(bebFilters *eventingv1alpha1.BebFilters) { +func WithMultipleBEBFiltersFromDiffEventTypePrefix(bebFilters *eventingv1alpha1.BEBFilters) { evSource := "/default/foo.kyma/kt1" evType1 := "foo.prefix.custom.foovarkes.order.created.v1" evType2 := "foo.prefixdifferent.custom.foovarkes.order.created.v1" - bebFilters.Filters = []*eventingv1alpha1.BebFilter{ + bebFilters.Filters = []*eventingv1alpha1.BEBFilter{ NewBEBFilter(evSource, evType1), NewBEBFilter(evSource, evType2), NewBEBFilter(evSource, evType1), } } -func NewBEBFilter(evSource, evType string) *eventingv1alpha1.BebFilter { - return &eventingv1alpha1.BebFilter{ +func NewBEBFilter(evSource, evType string) *eventingv1alpha1.BEBFilter { + return &eventingv1alpha1.BEBFilter{ EventSource: &eventingv1alpha1.Filter{ Property: "source", Value: evSource, diff --git a/testing/utils.go b/testing/utils.go index 610c173..147a738 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -92,8 +92,8 @@ func NewSubscription(opts ...SubscriptionOpt) *eventingv1alpha1.Subscription { Protocol: "", ProtocolSettings: nil, Sink: "", - Filter: &eventingv1alpha1.BebFilters{ - Filters: []*eventingv1alpha1.BebFilter{ + Filter: &eventingv1alpha1.BEBFilters{ + Filters: []*eventingv1alpha1.BEBFilter{ { EventSource: &eventingv1alpha1.Filter{ Type: "exact", @@ -120,8 +120,8 @@ func NewSubscription(opts ...SubscriptionOpt) *eventingv1alpha1.Subscription { func SubscriptionWithFilter(eventSource, eventType string) SubscriptionOpt { return func(subscription *eventingv1alpha1.Subscription) { - subscription.Spec.Filter = &eventingv1alpha1.BebFilters{ - Filters: []*eventingv1alpha1.BebFilter{ + subscription.Spec.Filter = &eventingv1alpha1.BEBFilters{ + Filters: []*eventingv1alpha1.BEBFilter{ { EventSource: &eventingv1alpha1.Filter{ Type: "exact", From 6e6e3e249ca3f229302f53a045e91d8f37c93fb7 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Fri, 3 Dec 2021 12:43:23 +0100 Subject: [PATCH 039/194] fix issues found by various linters (#12753) * fix issues found by various linters * fix comments * bump image --- Makefile | 2 ++ cmd/event-publisher-proxy/beb/beb.go | 4 ++-- cmd/event-publisher-proxy/nats/nats.go | 4 ++-- pkg/application/clean.go | 2 +- pkg/application/fake/lister.go | 9 +-------- pkg/handler/beb/handler.go | 5 ++--- pkg/handler/beb/handler_test.go | 16 +++++++++++----- pkg/handler/common.go | 10 ++-------- pkg/handler/handlertest/handlertest.go | 6 +++--- pkg/handler/nats/handler.go | 5 ++--- pkg/handler/nats/handler_test.go | 18 +++++++++++------- pkg/legacy-events/legacy.go | 1 - pkg/metrics/server.go | 2 +- pkg/oauth/client_test.go | 1 + pkg/receiver/receiver.go | 12 ++++++------ pkg/receiver/receiver_test.go | 14 +++++++------- pkg/sender/beb_test.go | 10 ++++++---- pkg/subscribed/helpers.go | 2 +- pkg/subscribed/response.go | 21 +++++++++++++-------- testing/fixtures.go | 6 +++--- testing/utils.go | 12 +++++------- 21 files changed, 82 insertions(+), 80 deletions(-) diff --git a/Makefile b/Makefile index 3c219d2..db24832 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,8 @@ APP_NAME = event-publisher-proxy APP_PATH = components/$(APP_NAME) SCRIPTS_DIR = $(realpath $(shell pwd)/../..)/common/makefiles +# fail on lint issues +override IGNORE_LINTING_ISSUES = override ENTRYPOINT = cmd/main.go include $(SCRIPTS_DIR)/generic-make-go.mk diff --git a/cmd/event-publisher-proxy/beb/beb.go b/cmd/event-publisher-proxy/beb/beb.go index 4426f9e..833243f 100644 --- a/cmd/event-publisher-proxy/beb/beb.go +++ b/cmd/event-publisher-proxy/beb/beb.go @@ -18,7 +18,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" "github.com/sirupsen/logrus" "k8s.io/client-go/dynamic" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only used in a development setup "sigs.k8s.io/controller-runtime/pkg/client/config" ) @@ -55,7 +55,7 @@ func (c *Commander) Start() error { c.logger.Infof("Starting Event Publisher to BEB, envCfg: %v; opts: %#v", c.envCfg.String(), c.opts) // configure message receiver - messageReceiver := receiver.NewHttpMessageReceiver(c.envCfg.Port) + messageReceiver := receiver.NewHTTPMessageReceiver(c.envCfg.Port) // assure uniqueness var ctx context.Context diff --git a/cmd/event-publisher-proxy/nats/nats.go b/cmd/event-publisher-proxy/nats/nats.go index 29b7fd9..23bb291 100644 --- a/cmd/event-publisher-proxy/nats/nats.go +++ b/cmd/event-publisher-proxy/nats/nats.go @@ -18,7 +18,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" "github.com/sirupsen/logrus" "k8s.io/client-go/dynamic" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only required in a dev setup "sigs.k8s.io/controller-runtime/pkg/client/config" ) @@ -59,7 +59,7 @@ func (c *Commander) Start() error { ctx, c.cancel = context.WithCancel(signals.NewContext()) // configure message receiver - messageReceiver := receiver.NewHttpMessageReceiver(c.envCfg.Port) + messageReceiver := receiver.NewHTTPMessageReceiver(c.envCfg.Port) // connect to nats bc := pkgnats.NewBackendConnection(c.envCfg.URL, c.envCfg.RetryOnFailedConnect, c.envCfg.MaxReconnects, c.envCfg.ReconnectWait) diff --git a/pkg/application/clean.go b/pkg/application/clean.go index bc1ac51..e54e669 100644 --- a/pkg/application/clean.go +++ b/pkg/application/clean.go @@ -14,7 +14,7 @@ const ( var ( // invalidApplicationNameSegment used to match and replace none-alphanumeric characters in the application name - invalidApplicationNameSegment = regexp.MustCompile("\\W|_") + invalidApplicationNameSegment = regexp.MustCompile(`\W|_`) ) // GetCleanTypeOrName cleans the application name form none-alphanumeric characters and returns it diff --git a/pkg/application/fake/lister.go b/pkg/application/fake/lister.go index b22d4d5..4d159b8 100644 --- a/pkg/application/fake/lister.go +++ b/pkg/application/fake/lister.go @@ -9,6 +9,7 @@ import ( dynamicfake "k8s.io/client-go/dynamic/fake" applicationv1alpha1 "github.com/kyma-project/kyma/components/application-operator/pkg/apis/applicationconnector/v1alpha1" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" ) @@ -28,11 +29,3 @@ func setupSchemeOrDie() *runtime.Scheme { } return scheme } - -func mapToUnstructuredOrDie(app *applicationv1alpha1.Application) map[string]interface{} { - unstructuredMap, err := runtime.DefaultUnstructuredConverter.ToUnstructured(app) - if err != nil { - log.Fatalf("Failed to map application to unstruchtured object with error: %v", err) - } - return unstructuredMap -} diff --git a/pkg/handler/beb/handler.go b/pkg/handler/beb/handler.go index cab45ae..b0e2018 100644 --- a/pkg/handler/beb/handler.go +++ b/pkg/handler/beb/handler.go @@ -43,7 +43,7 @@ var ( // It also assures that the messages received are compliant with the Cloud Events spec. type Handler struct { // Receiver receives incoming HTTP requests - Receiver *receiver.HttpMessageReceiver + Receiver *receiver.HTTPMessageReceiver // Sender sends requests to the broker Sender *sender.BebMessageSender // Defaulter sets default values to incoming events @@ -63,7 +63,7 @@ type Handler struct { } // NewHandler returns a new HTTP Handler instance. -func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.BebMessageSender, requestTimeout time.Duration, +func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.BebMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logrus.Logger, collector *metrics.Collector) *Handler { return &Handler{ @@ -119,7 +119,6 @@ func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { } h.writeResponse(writer, http.StatusNotFound, nil) - return } func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { diff --git a/pkg/handler/beb/handler_test.go b/pkg/handler/beb/handler_test.go index 7b1e5f5..2c03f0e 100644 --- a/pkg/handler/beb/handler_test.go +++ b/pkg/handler/beb/handler_test.go @@ -23,6 +23,8 @@ import ( "github.com/sirupsen/logrus" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" @@ -36,7 +38,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) const ( @@ -71,6 +72,7 @@ func TestHandlerForCloudEvents(t *testing.T) { defer cancel() defer mockServer.Close() + // nolint:scopelint for _, testCase := range handlertest.TestCasesForCloudEvents { t.Run(testCase.Name, func(tt *testing.T) { body, headers := testCase.ProvideMessage() @@ -117,6 +119,7 @@ func TestHandlerForLegacyEvents(t *testing.T) { defer cancel() defer mockServer.Close() + // nolint:scopelint for _, testCase := range handlertest.TestCasesForLegacyEvents { t.Run(testCase.Name, func(t *testing.T) { body, headers := testCase.ProvideMessage() @@ -183,7 +186,7 @@ func TestHandlerForBEBFailures(t *testing.T) { { name: "Send a legacy event with event-id", provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() + return testingutils.ValidLegacyEventPayloadWithEventID, testingutils.GetApplicationJSONHeaders() }, endPoint: publishLegacyEndpoint, wantStatusCode: http.StatusBadRequest, @@ -203,6 +206,7 @@ func TestHandlerForBEBFailures(t *testing.T) { }, } + // nolint:scopelint for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { body, headers := testCase.provideMessage() @@ -262,7 +266,7 @@ func TestHandlerForHugeRequests(t *testing.T) { { name: "Should fail with HTTP 413 with a request which is larger than 2 Bytes as the maximum accepted size is 2 Bytes", provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() + return testingutils.ValidLegacyEventPayloadWithEventID, testingutils.GetApplicationJSONHeaders() }, endPoint: publishLegacyEndpoint, wantStatusCode: http.StatusRequestEntityTooLarge, @@ -277,6 +281,7 @@ func TestHandlerForHugeRequests(t *testing.T) { }, } + // nolint:scopelint for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { body, headers := testCase.provideMessage() @@ -322,6 +327,7 @@ func TestHandlerForSubscribedEndpoint(t *testing.T) { defer cancel() defer mockServer.Close() + // nolint:scopelint for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { t.Run(testCase.Name, func(t *testing.T) { subscribedURL := fmt.Sprintf(subscribedEndpointFormat, port, testCase.AppName) @@ -423,7 +429,7 @@ func TestIsARequestWithLegacyEvent(t *testing.T) { } func setupTestResources(t *testing.T, port, maxRequestSize int, applicationName, expectedApplicationName, - healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint string, requestTimeout, + healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint string, requestTimeout, // nolint:unparam serverResponseTime time.Duration) (context.CancelFunc, *testingutils.MockServer, *metrics.Collector) { validator := validateApplicationName(expectedApplicationName) mockServer := testingutils.NewMockServer(testingutils.WithResponseTime(serverResponseTime), testingutils.WithValidator(validator)) @@ -445,7 +451,7 @@ func setupTestResources(t *testing.T, port, maxRequestSize int, applicationName, defer client.CloseIdleConnections() msgSender := sender.NewBebMessageSender(emsCEURL, client) - msgReceiver := receiver.NewHttpMessageReceiver(cfg.Port) + msgReceiver := receiver.NewHTTPMessageReceiver(cfg.Port) opts := &options.Options{MaxRequestSize: int64(maxRequestSize)} appLister := handlertest.NewApplicationListerOrDie(ctx, applicationName) legacyTransformer := legacy.NewTransformer(cfg.BEBNamespace, cfg.EventTypePrefix, appLister) diff --git a/pkg/handler/common.go b/pkg/handler/common.go index f779e99..97908e6 100644 --- a/pkg/handler/common.go +++ b/pkg/handler/common.go @@ -23,16 +23,10 @@ func IsARequestWithLegacyEvent(uri string) bool { if len(uriPathSegments) != 3 { return false } - if !strings.HasSuffix(uri, LegacyEndpointSuffix) { - return false - } - return true + return strings.HasSuffix(uri, LegacyEndpointSuffix) } func IsARequestForSubscriptions(uri string) bool { // Assuming the path should be of the form /:application/v1/events/subscribed - if !strings.HasSuffix(uri, SubscribedEndpointSuffix) { - return false - } - return true + return strings.HasSuffix(uri, SubscribedEndpointSuffix) } diff --git a/pkg/handler/handlertest/handlertest.go b/pkg/handler/handlertest/handlertest.go index c2e359c..c1614ca 100644 --- a/pkg/handler/handlertest/handlertest.go +++ b/pkg/handler/handlertest/handlertest.go @@ -212,7 +212,7 @@ var ( { Name: "Send a legacy event successfully with event-id", ProvideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventId, testingutils.GetApplicationJSONHeaders() + return testingutils.ValidLegacyEventPayloadWithEventID, testingutils.GetApplicationJSONHeaders() }, WantStatusCode: http.StatusOK, WantResponse: legacyapi.PublishEventResponses{ @@ -226,7 +226,7 @@ var ( { Name: "Send a legacy event successfully without event-id", ProvideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithoutEventId, testingutils.GetApplicationJSONHeaders() + return testingutils.ValidLegacyEventPayloadWithoutEventID, testingutils.GetApplicationJSONHeaders() }, WantStatusCode: http.StatusOK, WantResponse: legacyapi.PublishEventResponses{ @@ -240,7 +240,7 @@ var ( { Name: "Send a legacy event with invalid event id", ProvideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithInvalidEventId, testingutils.GetApplicationJSONHeaders() + return testingutils.LegacyEventPayloadWithInvalidEventID, testingutils.GetApplicationJSONHeaders() }, WantStatusCode: http.StatusBadRequest, WantResponse: legacyapi.PublishEventResponses{ diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index 7d1b832..d0bca61 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -27,7 +27,7 @@ import ( // It also assures that the messages received are compliant with the Cloud Events spec. type Handler struct { // Receiver receives incoming HTTP requests - Receiver *receiver.HttpMessageReceiver + Receiver *receiver.HTTPMessageReceiver // Sender sends requests to the broker Sender *sender.NatsMessageSender // Defaulter sets default values to incoming events @@ -47,7 +47,7 @@ type Handler struct { } // NewHandler returns a new NATS Handler instance. -func NewHandler(receiver *receiver.HttpMessageReceiver, sender *sender.NatsMessageSender, requestTimeout time.Duration, +func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.NatsMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logrus.Logger, collector *metrics.Collector) *Handler { return &Handler{ @@ -103,7 +103,6 @@ func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { } h.writeResponse(writer, http.StatusNotFound, nil) - return } func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { diff --git a/pkg/handler/nats/handler_test.go b/pkg/handler/nats/handler_test.go index 394c558..6ab36e9 100644 --- a/pkg/handler/nats/handler_test.go +++ b/pkg/handler/nats/handler_test.go @@ -21,6 +21,8 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" @@ -33,7 +35,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) type Test struct { @@ -41,7 +42,7 @@ type Test struct { natsConfig *env.NatsConfig natsServer *server.Server collector *metrics.Collector - natsUrl string + natsURL string healthEndpoint string } @@ -53,7 +54,7 @@ func (test *Test) init() { test.natsConfig = newEnvConfig(port, natsPort) test.natsServer = testingutils.StartNatsServer() test.collector = metrics.NewCollector() - test.natsUrl = test.natsServer.ClientURL() + test.natsURL = test.natsServer.ClientURL() test.healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) } @@ -65,11 +66,11 @@ func (test *Test) setupResources(t *testing.T, subscription *eventingv1alpha1.Su ctx, cancel := context.WithCancel(context.Background()) // configure message receiver - messageReceiver := receiver.NewHttpMessageReceiver(test.natsConfig.Port) + messageReceiver := receiver.NewHTTPMessageReceiver(test.natsConfig.Port) assert.NotNil(t, messageReceiver) // connect to nats - bc := pkgnats.NewBackendConnection(test.natsUrl, true, 3, time.Second) + bc := pkgnats.NewBackendConnection(test.natsURL, true, 3, time.Second) err := bc.Connect() assert.Nil(t, err) assert.NotNil(t, bc.Connection) @@ -155,7 +156,7 @@ func TestNatsHandlerForCloudEvents(t *testing.T) { eventTypeToSubscribe := subscription.Spec.Filter.Filters[0].EventType.Value // connect to nats - bc := pkgnats.NewBackendConnection(test.natsUrl, true, 3, time.Second) + bc := pkgnats.NewBackendConnection(test.natsURL, true, 3, time.Second) err := bc.Connect() assert.Nil(t, err) assert.NotNil(t, bc.Connection) @@ -164,6 +165,7 @@ func TestNatsHandlerForCloudEvents(t *testing.T) { validator := testingutils.ValidateNatsSubjectOrFail(t, expectedNatsSubject) testingutils.SubscribeToEventOrFail(t, bc.Connection, eventTypeToSubscribe, validator) + // nolint:scopelint // run the tests for publishing cloudevents for _, testCase := range handlertest.TestCasesForCloudEvents { t.Run(testCase.Name, func(t *testing.T) { @@ -206,7 +208,7 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { eventTypeToSubscribe := subscription.Spec.Filter.Filters[0].EventType.Value // connect to nats - bc := pkgnats.NewBackendConnection(test.natsUrl, true, 3, time.Second) + bc := pkgnats.NewBackendConnection(test.natsURL, true, 3, time.Second) err := bc.Connect() assert.Nil(t, err) assert.NotNil(t, bc.Connection) @@ -215,6 +217,7 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { validator := testingutils.ValidateNatsSubjectOrFail(t, expectedNatsSubject) testingutils.SubscribeToEventOrFail(t, bc.Connection, eventTypeToSubscribe, validator) + // nolint:scopelint // run the tests for publishing legacy events for _, testCase := range handlertest.TestCasesForLegacyEvents { t.Run(testCase.Name, func(t *testing.T) { @@ -258,6 +261,7 @@ func TestNatsHandlerForSubscribedEndpoint(t *testing.T) { cancel := test.setupResources(t, subscription, testingutils.ApplicationName, eventTypePrefix) defer cancel() + // nolint:scopelint // run the tests for subscribed endpoint for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { t.Run(testCase.Name, func(t *testing.T) { diff --git a/pkg/legacy-events/legacy.go b/pkg/legacy-events/legacy.go index 0403d34..1641169 100644 --- a/pkg/legacy-events/legacy.go +++ b/pkg/legacy-events/legacy.go @@ -142,7 +142,6 @@ func (t Transformer) TransformsCEResponseToLegacyResponse(writer http.ResponseWr // Success response.Ok = &apiv1.PublishResponse{EventID: event.ID()} writeJSONResponse(writer, response) - return } // convertPublishRequestToCloudEvent converts the given publish request to a CloudEvent. diff --git a/pkg/metrics/server.go b/pkg/metrics/server.go index 92234ec..496f08a 100644 --- a/pkg/metrics/server.go +++ b/pkg/metrics/server.go @@ -29,7 +29,7 @@ func (s *Server) Start(address string) error { } s.logger.Infof("Metrics server started on %v", address) - go s.srv.Serve(listener) + go s.srv.Serve(listener) //nolint:errcheck } return nil diff --git a/pkg/oauth/client_test.go b/pkg/oauth/client_test.go index 21f7d00..7a523c6 100644 --- a/pkg/oauth/client_test.go +++ b/pkg/oauth/client_test.go @@ -80,6 +80,7 @@ func TestGetToken(t *testing.T) { }, } + // nolint:scopelint for _, test := range testCases { t.Run(test.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/receiver/receiver.go b/pkg/receiver/receiver.go index 3e4d97c..a00155d 100644 --- a/pkg/receiver/receiver.go +++ b/pkg/receiver/receiver.go @@ -17,21 +17,21 @@ const ( defaultShutdownTimeout = time.Minute * 1 ) -// HttpMessageReceiver is responsible for receiving messages over HTTP. -type HttpMessageReceiver struct { +// HTTPMessageReceiver is responsible for receiving messages over HTTP. +type HTTPMessageReceiver struct { port int handler http.Handler server *http.Server listener net.Listener } -// NewHttpMessageReceiver returns a new NewHttpMessageReceiver instance with the given port. -func NewHttpMessageReceiver(port int) *HttpMessageReceiver { - return &HttpMessageReceiver{port: port} +// NewHTTPMessageReceiver returns a new NewHTTPMessageReceiver instance with the given port. +func NewHTTPMessageReceiver(port int) *HTTPMessageReceiver { + return &HTTPMessageReceiver{port: port} } // StartListen starts the HTTP message receiver and blocks until it receives a shutdown signal. -func (recv *HttpMessageReceiver) StartListen(ctx context.Context, handler http.Handler) error { +func (recv *HTTPMessageReceiver) StartListen(ctx context.Context, handler http.Handler) error { var err error if recv.listener, err = net.Listen("tcp", fmt.Sprintf(":%d", recv.port)); err != nil { return err diff --git a/pkg/receiver/receiver_test.go b/pkg/receiver/receiver_test.go index 82d83b3..7d59a5f 100644 --- a/pkg/receiver/receiver_test.go +++ b/pkg/receiver/receiver_test.go @@ -19,9 +19,9 @@ var _ http.Handler = (*testHandler)(nil) func TestNewHttpMessageReceiver(t *testing.T) { port := testingutils.GeneratePortOrDie() - r := NewHttpMessageReceiver(port) + r := NewHTTPMessageReceiver(port) if r == nil { - t.Fatalf("Could not create HttpMessageReceiver") + t.Fatalf("Could not create HTTPMessageReceiver") } if r.port != port { t.Errorf("Port should be: %d is: %d", port, r.port) @@ -42,15 +42,15 @@ func TestStartListener(t *testing.T) { wg := sync.WaitGroup{} start := make(chan bool, 1) defer close(start) + wg.Add(1) go func(t *testing.T) { - wg.Add(1) + defer wg.Done() start <- true t.Log("starting receiver in goroutine") if err := r.StartListen(ctx, &testHandler{}); err != nil { - t.Fatalf("error while starting HTTPMessageReceiver: %v", err) + t.Errorf("error while starting HTTPMessageReceiver: %v", err) } t.Log("receiver goroutine ends here") - wg.Done() }(t) // wait for goroutine to start @@ -76,6 +76,6 @@ func TestStartListener(t *testing.T) { } } -func fixtureReceiver() *HttpMessageReceiver { - return NewHttpMessageReceiver(0) +func fixtureReceiver() *HTTPMessageReceiver { + return NewHTTPMessageReceiver(0) } diff --git a/pkg/sender/beb_test.go b/pkg/sender/beb_test.go index eeb93a8..46f9d6c 100644 --- a/pkg/sender/beb_test.go +++ b/pkg/sender/beb_test.go @@ -45,14 +45,16 @@ func TestNewRequestWithTarget(t *testing.T) { msgSender := NewBebMessageSender(eventsEndpoint, client) - const ctxKey, ctxValue = "testKey", "testValue" - ctx := context.WithValue(context.Background(), ctxKey, ctxValue) + type ctxKey struct{} + const ctxValue = "testValue" + ctx := context.WithValue(context.Background(), ctxKey{}, ctxValue) req, err := msgSender.NewRequestWithTarget(ctx, eventsEndpoint) if err != nil { t.Errorf("Failed to create a CloudEvent HTTP request with error: %v", err) } if req == nil { t.Error("Failed to create a CloudEvent HTTP request want new request but got nil") + return } if req.Method != http.MethodPost { t.Errorf("HTTP request has invalid method want: %s but got: %s", http.MethodPost, req.Method) @@ -72,8 +74,8 @@ func TestNewRequestWithTarget(t *testing.T) { if req.Context() != ctx { t.Errorf("HTTP request context does not match original context want: %#v, but got %#v", ctx, req.Context()) } - if got := req.Context().Value(ctxKey); got != ctxValue { - t.Errorf("HTTP request context key:value do not match mant: %v:%v but got %v:%v", ctxKey, ctxValue, ctxKey, got) + if got := req.Context().Value(ctxKey{}); got != ctxValue { + t.Errorf("HTTP request context key:value do not match mant: %v:%v but got %v:%v", ctxKey{}, ctxValue, ctxKey{}, got) } } diff --git a/pkg/subscribed/helpers.go b/pkg/subscribed/helpers.go index 5cb00ae..ad31c30 100644 --- a/pkg/subscribed/helpers.go +++ b/pkg/subscribed/helpers.go @@ -96,7 +96,7 @@ func FilterEventTypeVersions(eventTypePrefix, bebNs, appName string, filters *ev // TODO revisit the filtration logic as part of https://github.com/kyma-project/kyma/issues/10761 // filter by event-source if exists - if len(strings.TrimSpace(filter.EventSource.Value)) > 0 && strings.ToLower(filter.EventSource.Value) != strings.ToLower(bebNs) { + if len(strings.TrimSpace(filter.EventSource.Value)) > 0 && !strings.EqualFold(filter.EventSource.Value, bebNs) { continue } diff --git a/pkg/subscribed/response.go b/pkg/subscribed/response.go index 7eeab22..ad1bcbd 100644 --- a/pkg/subscribed/response.go +++ b/pkg/subscribed/response.go @@ -1,28 +1,33 @@ package subscribed import ( + "encoding/json" "net/http" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/sirupsen/logrus" - "encoding/json" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" ) -//RespondWithBody sends http response with json body +// RespondWithBody sends http response with json body func RespondWithBody(w http.ResponseWriter, events Events, httpCode int) { respond(w, httpCode) - json.NewEncoder(w).Encode(events) + if err := json.NewEncoder(w).Encode(events); err != nil { + logrus.Errorln(err) + } } -//RespondWithErrorAndLog logs error and sends http response with error json body +// RespondWithErrorAndLog logs error and sends http response with error json body func RespondWithErrorAndLog(e error, w http.ResponseWriter) { logrus.Errorln(e.Error()) respond(w, http.StatusInternalServerError) - json.NewEncoder(w).Encode(legacy.HTTPErrorResponse{ + err := json.NewEncoder(w).Encode(legacy.HTTPErrorResponse{ Code: http.StatusInternalServerError, Error: e.Error(), }) + if err != nil { + logrus.Errorln(err) + } } func respond(w http.ResponseWriter, httpCode int) { @@ -31,12 +36,12 @@ func respond(w http.ResponseWriter, httpCode int) { logrus.Infof("Response code from \"subscribed\" request: HTTP %d", httpCode) } -//Events represents collection of all events with subscriptions +// Events represents collection of all events with subscriptions type Events struct { EventsInfo []Event `json:"eventsInfo"` } -//Event represents basic information about event +// Event represents basic information about event type Event struct { Name string `json:"name"` Version string `json:"version"` diff --git a/testing/fixtures.go b/testing/fixtures.go index d30c85a..f4e2fd8 100644 --- a/testing/fixtures.go +++ b/testing/fixtures.go @@ -72,7 +72,7 @@ const ( "datacontenttype":"` + CloudEventDataContentType + `" }` - ValidLegacyEventPayloadWithEventId = `{ + ValidLegacyEventPayloadWithEventID = `{ "event-id": "` + EventID + `", "event-type":"` + LegacyEventType + `", "event-type-version":"` + LegacyEventTypeVersion + `", @@ -80,13 +80,13 @@ const ( "data": ` + LegacyEventData + ` }` - ValidLegacyEventPayloadWithoutEventId = `{ + ValidLegacyEventPayloadWithoutEventID = `{ "event-type":"` + LegacyEventType + `", "event-type-version":"` + LegacyEventTypeVersion + `", "event-time": "` + LegacyEventTime + `", "data": ` + LegacyEventData + ` }` - LegacyEventPayloadWithInvalidEventId = `{ + LegacyEventPayloadWithInvalidEventID = `{ "event-id":"foo-bar", "event-type":"` + LegacyEventType + `", "event-type-version":"` + LegacyEventTypeVersion + `", diff --git a/testing/utils.go b/testing/utils.go index 147a738..fb0f9d5 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -46,10 +46,8 @@ func SendEvent(endpoint, body string, headers http.Header) (*http.Response, erro return nil, err } - if headers != nil { - for k, v := range headers { - req.Header[k] = v - } + for k, v := range headers { + req.Header[k] = v } client := http.Client{} @@ -142,7 +140,7 @@ func SubscriptionWithFilter(eventSource, eventType string) SubscriptionOpt { // WaitForHandlerToStart is waits for the test handler to start before testing could start func WaitForHandlerToStart(t *testing.T, healthEndpoint string) { timeout := time.After(time.Second * 30) - tick := time.Tick(time.Second * 1) + ticker := time.NewTicker(time.Second * 1) for { select { @@ -150,9 +148,9 @@ func WaitForHandlerToStart(t *testing.T, healthEndpoint string) { { t.Fatal("Failed to start handler") } - case <-tick: + case <-ticker.C: { - if resp, err := http.Get(healthEndpoint); err != nil { + if resp, err := http.Get(healthEndpoint); err != nil { //nolint:gosec continue } else if resp.StatusCode == http.StatusOK { return From 79a0da77fafe962a5986a6f964e50358fe56224b Mon Sep 17 00:00:00 2001 From: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> Date: Mon, 17 Jan 2022 14:16:45 +0100 Subject: [PATCH 040/194] fix: broken legacy event cleanup (#13002) * write tests for reproduction of the issue add tests and improve code to pass the tests cleanup fix typos bump image unbump image fix imports fix typo rebump * bump the right component * refactoring according to review --- pkg/handler/beb/handler.go | 1 + pkg/legacy-events/helpers_test.go | 44 ++++---- pkg/legacy-events/legacy.go | 22 ++-- pkg/legacy-events/legacy_test.go | 176 +++++++++++++++++++++++++++++- 4 files changed, 207 insertions(+), 36 deletions(-) diff --git a/pkg/handler/beb/handler.go b/pkg/handler/beb/handler.go index b0e2018..5f2886f 100644 --- a/pkg/handler/beb/handler.go +++ b/pkg/handler/beb/handler.go @@ -132,6 +132,7 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h defer cancel() h.receive(ctx, event) statusCode, dispatchTime, respBody := h.send(ctx, event) + // Change response as per old error codes h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, statusCode, event, string(respBody)) diff --git a/pkg/legacy-events/helpers_test.go b/pkg/legacy-events/helpers_test.go index 9bce0e3..724f9b1 100644 --- a/pkg/legacy-events/helpers_test.go +++ b/pkg/legacy-events/helpers_test.go @@ -32,40 +32,40 @@ func TestParseApplicationNameFromPath(t *testing.T) { func TestFormatEventType4BEB(t *testing.T) { testCases := []struct { - eventTypePrefix string - app string - eventType string - version string - wantedEventType string + eventTypePrefix string + app string + eventType string + version string + expectedEventType string }{ { - eventTypePrefix: "prefix", - app: "app", - eventType: "order.foo", - version: "v1", - wantedEventType: "prefix.app.order.foo.v1", + eventTypePrefix: "prefix", + app: "app", + eventType: "order.foo", + version: "v1", + expectedEventType: "prefix.app.order.foo.v1", }, { - eventTypePrefix: "prefix", - app: "app", - eventType: "order-foo", - version: "v1", - wantedEventType: "prefix.app.order-foo.v1", + eventTypePrefix: "prefix", + app: "app", + eventType: "order-foo", + version: "v1", + expectedEventType: "prefix.app.order-foo.v1", }, { - eventTypePrefix: "", - app: "app", - eventType: "order-foo", - version: "v1", - wantedEventType: "app.order-foo.v1", + eventTypePrefix: "", + app: "app", + eventType: "order-foo", + version: "v1", + expectedEventType: "app.order-foo.v1", }, } for _, tc := range testCases { gotEventType := formatEventType4BEB(tc.eventTypePrefix, tc.app, tc.eventType, tc.version) - if tc.wantedEventType != gotEventType { + if tc.expectedEventType != gotEventType { t.Errorf("incorrect formatting of eventType: "+ - "%s, wanted: %s got: %s", tc.eventType, tc.wantedEventType, gotEventType) + "%s, wanted: %s got: %s", tc.eventType, tc.expectedEventType, gotEventType) } } } diff --git a/pkg/legacy-events/legacy.go b/pkg/legacy-events/legacy.go index 1641169..9160ca1 100644 --- a/pkg/legacy-events/legacy.go +++ b/pkg/legacy-events/legacy.go @@ -170,23 +170,29 @@ func (t Transformer) convertPublishRequestToCloudEvent(appName string, publishRe event.SetID(uuid.New().String()) } - eventTypeCombined := combineEventTypeSegments(publishRequest.PublishrequestV1.EventType) - eventType := formatEventType4BEB(t.eventTypePrefix, appName, eventTypeCombined, publishRequest.PublishrequestV1.EventTypeVersion) - event.SetSource(t.bebNamespace) + eventName := combineEventNameSegments(removeNonAlphanumeric(publishRequest.PublishrequestV1.EventType)) + prefix := removeNonAlphanumeric(t.eventTypePrefix) + eventType := formatEventType4BEB(prefix, appName, eventName, publishRequest.PublishrequestV1.EventTypeVersion) event.SetType(eventType) + event.SetSource(t.bebNamespace) event.SetExtension(eventTypeVersionExtensionKey, publishRequest.PublishrequestV1.EventTypeVersion) event.SetDataContentType(ContentTypeApplicationJSON) return &event, nil } -// combineEventTypeSegments returns an event-type with exactly two segments separated by "." if the given event-type +// combineEventNameSegments returns an eventName with exactly two segments separated by "." if the given event-type // has more than two segments separated by "." (e.g. "Account.Order.Created" becomes "AccountOrder.Created") -func combineEventTypeSegments(eventType string) string { - parts := strings.Split(eventType, ".") +func combineEventNameSegments(eventName string) string { + parts := strings.Split(eventName, ".") if len(parts) > 2 { businessObject := strings.Join(parts[0:len(parts)-1], "") operation := parts[len(parts)-1] - eventType = fmt.Sprintf("%s.%s", businessObject, operation) + eventName = fmt.Sprintf("%s.%s", businessObject, operation) } - return eventType + return eventName +} + +// removeNonAlphanumeric returns an eventName without any non-alphanumerical character besides dot (".") +func removeNonAlphanumeric(eventType string) string { + return regexp.MustCompile(("[^a-zA-Z0-9.]+")).ReplaceAllString(eventType, "") } diff --git a/pkg/legacy-events/legacy_test.go b/pkg/legacy-events/legacy_test.go index 802c06c..e44338a 100644 --- a/pkg/legacy-events/legacy_test.go +++ b/pkg/legacy-events/legacy_test.go @@ -1,9 +1,17 @@ package legacy import ( + "bytes" + "context" + "encoding/json" + "fmt" + "net/http" + "net/http/httptest" "testing" "time" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" . "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) @@ -13,6 +21,130 @@ const ( eventTypeMultiSegmentCombined = "Segment1Segment2Segment3Segment4.Segment5" ) +// TestTransformLegacyRequestsToCE ensures that TransformLegacyRequestsToCE transforms a http reuqest containing +// a legacy request to a valid cloud event by creating mock http requests +func TestTransformLegacyRequestsToCE(t *testing.T) { + testCases := []struct { + name string + // the event type has the strurcture + // ... + // or, more specific + // ...... + // e.g. "sap.kyma.custom.varkestest.ordertest.created.v1" + // where "sap.kyma.custom" is the (or ..), + // "varkestest" is the + // "ordertest.created" ts the (or .) + // and "v2" is the + // + // derrived from that a legacy event path (a.k.a. endpoint) has the structure + // http://:///events + // e.g. http://localhost:8081/varkestest/v1/events + prefix string + appName string + typeLabel string + eventName string + version string + expectedType string + }{ + { + name: "clean", + prefix: "pre1.pre2.pre3", + appName: "app", + typeLabel: "", + eventName: "object.do", + version: "v1", + expectedType: "pre1.pre2.pre3.app.object.do.v1", + }, + { + name: "unclean", + prefix: "p!r@e&1.p,r:e2.p|r+e3", + appName: "m(i_s+h*a}p", + typeLabel: "", + eventName: "o{b?j>e$c't.d;o", + version: "v1", + expectedType: "pre1.pre2.pre3.mishap.object.do.v1", + }, + { + name: "event name too many segments", + prefix: "pre1.pre2.pre3", + appName: "app", + typeLabel: "", + eventName: "too.many.dots.object.do", + version: "v1", + expectedType: "pre1.pre2.pre3.app.toomanydotsobject.do.v1", + }, + { + name: "with event type label", + prefix: "pre1.pre2.pre3", + appName: "app", + typeLabel: "different", + eventName: "object.do", + version: "v1", + expectedType: "pre1.pre2.pre3.different.object.do.v1", + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + app := applicationtest.NewApplication(tc.appName, applicationTypeLabel(tc.typeLabel)) + appLister := fake.NewListerOrDie(ctx, app) + + request, err := mockLegacyRequest(tc.version, tc.appName, tc.eventName) + if err != nil { + t.Errorf("error while creating mock legacy request in case %s:\n%s", tc.name, err.Error()) + } + + writer := httptest.NewRecorder() + + transformer := NewTransformer("test", tc.prefix, appLister) + actualEvent := transformer.TransformLegacyRequestsToCE(writer, request) + + errorString := func(caseName, subject, actual, expected string) string { + return fmt.Sprintf("Unexpected %s in case %s\nwas:\n\t%s\nexpected:\n\t%s", subject, caseName, actual, expected) + } + + //check eventType + if actual := actualEvent.Context.GetType(); tc.expectedType != actual { + t.Errorf(errorString(tc.name, "event type", actual, tc.expectedType)) + } + + // check extensions 'eventtypeversion' + if actual := actualEvent.Extensions()["eventtypeversion"].(string); actual != tc.version { + t.Errorf(errorString(tc.name, "event type", actual, tc.expectedType)) + } + + // check HTTP ContentType set properly + if actualContentType := actualEvent.Context.GetDataContentType(); actualContentType != ContentTypeApplicationJSON { + t.Errorf(errorString(tc.name, "HTTP Content Type", actualContentType, ContentTypeApplicationJSON)) + } + }) + } +} + +func applicationTypeLabel(label string) map[string]string { + if label != "" { + return map[string]string{"application-type": label} + } + return nil +} + +func mockLegacyRequest(version, appname, eventType string) (*http.Request, error) { + body, err := json.Marshal(map[string]string{ + "event-type": eventType, + "event-type-version": version, + "event-time": "2020-04-02T21:37:00Z", + "data": "{\"legacy\":\"event\"}", + }) + if err != nil { + return nil, err + } + + url := fmt.Sprintf("http://localhost:8080/%s/%s/events", appname, version) + return http.NewRequest(http.MethodPost, url, bytes.NewBuffer(body)) +} + func TestConvertPublishRequestToCloudEvent(t *testing.T) { bebNs := MessagingNamespace eventTypePrefix := MessagingEventTypePrefix @@ -42,23 +174,18 @@ func TestConvertPublishRequestToCloudEvent(t *testing.T) { if gotEvent.Context.GetID() != eventID { t.Errorf("incorrect id, want: %s, got: %s", eventID, gotEvent.Context.GetDataContentType()) } - if gotEvent.Context.GetType() != expectedEventType { t.Errorf("incorrect eventType, want: %s, got: %s", expectedEventType, gotEvent.Context.GetType()) } - if gotEvent.Context.GetTime() != timeNowFormatted { t.Errorf("incorrect eventTime, want: %s, got: %s", timeNowFormatted, gotEvent.Context.GetTime()) } - if gotEvent.Context.GetSource() != bebNs { t.Errorf("incorrect source want: %s, got: %s", bebNs, gotEvent.Context.GetDataContentType()) } - if gotEvent.Context.GetDataContentType() != ContentTypeApplicationJSON { t.Errorf("incorrect content-type, want: %s, got: %s", ContentTypeApplicationJSON, gotEvent.Context.GetDataContentType()) } - gotExtension, err := gotEvent.Context.GetExtension(eventTypeVersionExtensionKey) if err != nil { t.Errorf("eventtype extension is missing: %v", err) @@ -88,9 +215,46 @@ func TestCombineEventTypeSegments(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - if gotEventType := combineEventTypeSegments(tc.givenEventType); tc.wantEventType != gotEventType { + if gotEventType := combineEventNameSegments(tc.givenEventType); tc.wantEventType != gotEventType { t.Fatalf("invalid event-type want: %s, got: %s", tc.wantEventType, gotEventType) } }) } } + +func TestRemoveNonAlphanumeric(t *testing.T) { + testCases := []struct { + name string + givenEventType string + expectedEventType string + }{ + { + name: "unclean", + givenEventType: "1-2+3=4.t&h$i#s.t!h@a%t.t;o/m$f*o{o]lery", + expectedEventType: "1234.this.that.tomfoolery", + }, + { + name: "clean", + givenEventType: "1234.this.that", + expectedEventType: "1234.this.that", + }, + { + name: "single unclean segment", + givenEventType: "t_o_m_f_o_o_l_e_r_y", + expectedEventType: "tomfoolery", + }, + { + name: "empty", + givenEventType: "", + expectedEventType: "", + }, + } + for _, tc := range testCases { + t.Run(fmt.Sprintf("%s eventType", tc.name), func(t *testing.T) { + actual := removeNonAlphanumeric(tc.givenEventType) + if actual != tc.expectedEventType { + t.Errorf("invalid eventType; expected: %s, got %s", tc.expectedEventType, actual) + } + }) + } +} From 2a6cc3faf0ff9a7e51d9cb09373798d127d12a54 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Thu, 27 Jan 2022 16:29:55 +0100 Subject: [PATCH 041/194] bump build images (#13195) --- cmd/event-publisher-proxy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/event-publisher-proxy/Dockerfile b/cmd/event-publisher-proxy/Dockerfile index 94d374f..c479376 100644 --- a/cmd/event-publisher-proxy/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/test-infra/buildpack-golang:v20211110-ab51bd20 as builder +FROM eu.gcr.io/kyma-project/test-infra/buildpack-golang:v20211223-df98b255 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From e33be7e16a6d961958619ff957e81ddd9ad96ee2 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Wed, 2 Feb 2022 07:52:45 +0100 Subject: [PATCH 042/194] modify OWNERS for eventing (#13184) * modify OWNERS for eventing * remove outdated reviewers and approvers --- OWNERS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OWNERS b/OWNERS index e69de29..4fbde54 100644 --- a/OWNERS +++ b/OWNERS @@ -0,0 +1,4 @@ +reviewers: + - eventing-reviewers +approvers: + - eventing-approvers From 2ac0f036320f2e8738ad74034d05c1802230eb79 Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Tue, 22 Feb 2022 11:34:50 +0100 Subject: [PATCH 043/194] Change builder images in eventing-controller (#13449) * Change builder images in eventing-controller * Change builder images in eventing-publisher-proxy * image bump --- cmd/event-publisher-proxy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/event-publisher-proxy/Dockerfile b/cmd/event-publisher-proxy/Dockerfile index c479376..52f0df1 100644 --- a/cmd/event-publisher-proxy/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/test-infra/buildpack-golang:v20211223-df98b255 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.17.7-alpine3.15 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From a3316bdbd802adec01cc3fa95c1ac4403e3ad430 Mon Sep 17 00:00:00 2001 From: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> Date: Tue, 22 Feb 2022 13:09:26 +0100 Subject: [PATCH 044/194] Upgrade packages epp (#13469) * upgrade packages * upgrade packages * bump --- go.mod | 60 ++++++------- go.sum | 265 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 258 insertions(+), 67 deletions(-) diff --git a/go.mod b/go.mod index 2bec291..cab345d 100644 --- a/go.mod +++ b/go.mod @@ -3,34 +3,34 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy go 1.17 require ( - github.com/cloudevents/sdk-go/protocol/nats/v2 v2.5.0 - github.com/cloudevents/sdk-go/v2 v2.5.0 + github.com/cloudevents/sdk-go/protocol/nats/v2 v2.8.0 + github.com/cloudevents/sdk-go/v2 v2.8.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20211006112227-6d16a34ea468 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20211123105853-ceeb73d8a841 github.com/nats-io/nats-server/v2 v2.6.1 github.com/nats-io/nats.go v1.12.3 - github.com/onsi/gomega v1.16.0 + github.com/onsi/gomega v1.17.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.11.0 + github.com/prometheus/client_golang v1.12.1 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.0 go.opencensus.io v0.23.0 - golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d - k8s.io/api v0.22.0 - k8s.io/apimachinery v0.22.0 - k8s.io/client-go v0.22.0 - sigs.k8s.io/controller-runtime v0.9.6 + golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f + k8s.io/api v0.23.4 + k8s.io/apimachinery v0.23.4 + k8s.io/client-go v0.23.0 + sigs.k8s.io/controller-runtime v0.11.1 ) require ( - cloud.google.com/go v0.65.0 // indirect + cloud.google.com/go v0.81.0 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/evanphx/json-patch v4.11.0+incompatible // indirect - github.com/go-logr/logr v0.4.0 // indirect + github.com/evanphx/json-patch v4.12.0+incompatible // indirect + github.com/go-logr/logr v1.2.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect @@ -38,41 +38,41 @@ require ( github.com/google/gofuzz v1.1.0 // indirect github.com/googleapis/gnostic v0.5.5 // indirect github.com/imdario/mergo v0.3.12 // indirect - github.com/json-iterator/go v1.1.11 // indirect + github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.13.4 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/minio/highwayhash v1.0.1 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect github.com/nats-io/jwt/v2 v2.0.3 // indirect github.com/nats-io/nkeys v0.3.0 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.26.0 // indirect - github.com/prometheus/procfs v0.6.0 // indirect + github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect github.com/spf13/pflag v1.0.5 // indirect go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.18.1 // indirect - golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect - golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 // indirect - golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect - golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect - golang.org/x/text v0.3.6 // indirect + go.uber.org/zap v1.19.1 // indirect + golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect + golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect + golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect + golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect + golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect - golang.org/x/tools v0.1.1 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.26.0 // indirect + google.golang.org/protobuf v1.27.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect - k8s.io/klog/v2 v2.9.0 // indirect - k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e // indirect - k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect - sigs.k8s.io/yaml v1.2.0 // indirect + k8s.io/klog/v2 v2.30.0 // indirect + k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect + k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect + sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect ) replace ( diff --git a/go.sum b/go.sum index 573788d..c86401a 100644 --- a/go.sum +++ b/go.sum @@ -13,8 +13,13 @@ cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bP cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0 h1:at8Tk2zUz63cLPR0JPWm5vp77pEZmzxEQBEfRKn1VV8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -36,6 +41,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= @@ -91,6 +98,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053/go.mod h1:xW8sBma2LE3QxFSzCnH9qe6gAE2yO9GvQaWwX89HxbE= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -107,6 +116,7 @@ github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQ github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= +github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -117,6 +127,7 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= +github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= @@ -127,10 +138,13 @@ github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3k github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= +github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -140,13 +154,20 @@ github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmE github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/protocol/nats/v2 v2.5.0 h1:BRCZBiIow5Hj9GsQX0InaaJorKo+/3GsOzU4xIc9UwU= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.5.0/go.mod h1:69I3AikdiNccEO/188fSiEVFphftrxJ5fgLdG40PAKk= -github.com/cloudevents/sdk-go/v2 v2.5.0 h1:Ts6aLHbBUJfcNcZ4ouAfJ4+Np7SE1Yf2w4ADKRCd7Fo= +github.com/cloudevents/sdk-go/protocol/nats/v2 v2.8.0 h1:sn/ExiNFh1ooLGRVu/YvKF1WyaX65b4wGE99BMcvvKg= +github.com/cloudevents/sdk-go/protocol/nats/v2 v2.8.0/go.mod h1:YdfvPwlNoyTW6exGMoayTlHdb9R/ZbFk9ZT5S/aPD1Y= github.com/cloudevents/sdk-go/v2 v2.5.0/go.mod h1:nlXhgFkf0uTopxmRXalyMwS2LG70cRGPrxzmjJgSG0U= +github.com/cloudevents/sdk-go/v2 v2.8.0 h1:kmRaLbsafZmidZ0rZ6h7WOMqCkRMcVTLV5lxV/HKQ9Y= +github.com/cloudevents/sdk-go/v2 v2.8.0/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= +github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= +github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= @@ -169,6 +190,7 @@ github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7 github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= @@ -215,27 +237,35 @@ github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4s github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= +github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= +github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= @@ -255,12 +285,14 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= +github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= -github.com/go-logr/zapr v0.4.0 h1:uc1uML3hRYL9/ZZPdgHS/n8Nzo+eaYL/Efxkkamf7OM= github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= +github.com/go-logr/zapr v1.2.0 h1:n4JnPI1T3Qq1SFEi/F8rwLrZERp2bso19PJZDB9dayk= +github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= @@ -324,6 +356,7 @@ github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godror/godror v0.13.3/go.mod h1:2ouUT4kdhUBk7TAkHWD4SN0CdI0pgEQbo8FVHhbSKWg= github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -337,6 +370,7 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -351,6 +385,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -367,6 +402,7 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -376,6 +412,8 @@ github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA// github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/cel-go v0.9.0/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= +github.com/google/cel-spec v0.6.0/go.mod h1:Nwjgxy5CbjlPrtCWjeDjUyKMl8w41YBYGjsyDdqk0xA= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -394,6 +432,7 @@ github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -401,6 +440,10 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -432,9 +475,11 @@ github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16 github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -463,6 +508,7 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= @@ -479,6 +525,7 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht github.com/jmoiron/sqlx v1.3.1/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -486,8 +533,9 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -505,6 +553,7 @@ github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8 github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +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= @@ -532,6 +581,7 @@ github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -576,6 +626,7 @@ github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/z github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -583,13 +634,15 @@ github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0Gq github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= +github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= @@ -640,8 +693,9 @@ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -651,8 +705,8 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg= github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= -github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -677,6 +731,7 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= +github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterbourgon/mergemap v0.0.0-20130613134717-e21c03b7a721/go.mod h1:jQyRpOpE/KbvPc0VKXjAqctYglwUO5W6zAcGcFfbvlo= @@ -689,6 +744,7 @@ github.com/pkg/errors v0.9.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -701,8 +757,9 @@ github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDf github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +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_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= @@ -718,8 +775,10 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -729,12 +788,14 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -762,10 +823,12 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1 github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= +github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= @@ -774,7 +837,9 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= +github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -784,6 +849,7 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -804,6 +870,7 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= @@ -828,6 +895,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= @@ -835,8 +903,16 @@ github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wK go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= +go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= +go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= +go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= @@ -847,8 +923,21 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= +go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= +go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= +go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= +go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= +go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= +go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= +go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= +go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -856,8 +945,10 @@ go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= @@ -869,8 +960,11 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= -go.uber.org/zap v1.18.1 h1:CSUJ2mjFszzEWt4CdKISEuChVIXGBn3lAPwkRGyVrc4= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= +go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -884,6 +978,7 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -894,8 +989,9 @@ golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e h1:gsTQYXdTw2Gq7RBsWvlQ91b+aEQ6bXFUngBGuR8sPpI= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -919,8 +1015,9 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -930,6 +1027,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -974,21 +1073,38 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 h1:ADo5wSpq2gqaCGQWzk7S5vd//0iyyLeAratkEoG5dLE= golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= +golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -1062,29 +1178,42 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE= +golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1092,8 +1221,10 @@ golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1163,11 +1294,17 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1 h1:wGiQel/hW0NnEkJUk8lbzkX2gFJU6PFxf1v5OlCfuOs= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1197,6 +1334,12 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1229,16 +1372,31 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201102152239-715cce707fb0/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1258,8 +1416,16 @@ google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1271,8 +1437,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1288,6 +1455,7 @@ gopkg.in/gorp.v1 v1.7.2/go.mod h1:Wo3h+DBQZIxATwftsglhdD/62zRFPhGhTiu5jUJmCaw= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -1297,6 +1465,7 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1332,14 +1501,17 @@ k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= -k8s.io/api v0.22.0 h1:elCpMZ9UE8dLdYxr55E06TmSeji9I3KH494qH70/y+c= k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= +k8s.io/api v0.23.0/go.mod h1:8wmDdLBHBNxtOIytwLstXt5E9PddnZb0GaMcqsvDBpg= +k8s.io/api v0.23.4 h1:85gnfXQOWbJa1SiWGpE9EEtHs0UVvDyIsSMpEtl2D4E= +k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= k8s.io/apiextensions-apiserver v0.20.2/go.mod h1:F6TXp389Xntt+LUq3vw6HFOLttPa0V8821ogLGwb6Zs= k8s.io/apiextensions-apiserver v0.21.0/go.mod h1:gsQGNtGkc/YoDG9loKI0V+oLZM4ljRPjc/sql5tmvzc= k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE= +k8s.io/apiextensions-apiserver v0.23.0/go.mod h1:xIFAEEDlAZgpVBl/1VSjGDmLoXAWRG40+GsWhKhAxY4= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= k8s.io/apimachinery v0.17.8/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= k8s.io/apimachinery v0.18.1/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= @@ -1348,14 +1520,17 @@ k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRp k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= -k8s.io/apimachinery v0.22.0 h1:CqH/BdNAzZl+sr3tc0D3VsK3u6ARVSo3GWyLmfIjbP0= k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= +k8s.io/apimachinery v0.23.0/go.mod h1:fFCTTBKvKcwTPFzjlcxp91uPFZr+JA0FubU4fLzzFYc= +k8s.io/apimachinery v0.23.4 h1:fhnuMd/xUL3Cjfl64j5ULKZ1/J9n8NuQEgNL+WXWfdM= +k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.2/go.mod h1:2nKd93WyMhZx4Hp3RfgH2K5PhwyTrprrkWYnI7id7jA= k8s.io/apiserver v0.21.0/go.mod h1:w2YSn4/WIwYuxG5zJmcqtRdtqgW/J2JRgFAqps3bBpg= k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU= +k8s.io/apiserver v0.23.0/go.mod h1:Cec35u/9zAepDPPFyT+UMrgqOCjgJ5qtfVJDxjZYmt4= k8s.io/cli-runtime v0.18.2/go.mod h1:yfFR2sQQzDsV0VEKGZtrJwEy4hLZ2oj4ZIfodgxAHWQ= k8s.io/cli-runtime v0.21.0/go.mod h1:XoaHP93mGPF37MkLbjGVYqg3S1MnsFdKtiA/RZzzxOo= k8s.io/cli-runtime v0.22.0/go.mod h1:An6zELQ7udUI0GaXvkuMqyopPA14dIgNqpH8cZu1vig= @@ -1365,20 +1540,23 @@ k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= -k8s.io/client-go v0.22.0 h1:sD6o9O6tCwUKCENw8v+HFsuAbq2jCu8cWC61/ydwA50= k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= +k8s.io/client-go v0.23.0 h1:vcsOqyPq7XV3QmQRCBH/t9BICJM9Q1M18qahjv+rebY= +k8s.io/client-go v0.23.0/go.mod h1:hrDnpnK1mSr65lHHcUuIZIXDgEbzc7/683c6hyG4jTA= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= k8s.io/code-generator v0.20.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= k8s.io/code-generator v0.21.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo= +k8s.io/code-generator v0.23.0/go.mod h1:vQvOhDXhuzqiVfM/YHp+dmg10WDZCchJVObc9MvowsE= k8s.io/component-base v0.17.8/go.mod h1:xfNNdTAMsYzdiAa8vXnqDhRVSEgkfza0iMt0FrZDY7s= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= k8s.io/component-base v0.20.2/go.mod h1:pzFtCiwe/ASD0iV7ySMu8SYVJjCapNM9bjvk7ptpKh0= k8s.io/component-base v0.21.0/go.mod h1:qvtjz6X0USWXbgmbfXR+Agik4RZ3jv2Bgr5QnZzdPYw= k8s.io/component-base v0.21.3/go.mod h1:kkuhtfEHeZM6LkX0saqSK8PbdO7A0HigUngmhhrwfGQ= +k8s.io/component-base v0.23.0/go.mod h1:DHH5uiFvLC1edCpvcTDV++NKULdYYU6pR9Tt3HIKMKI= k8s.io/component-helpers v0.21.0/go.mod h1:tezqefP7lxfvJyR+0a+6QtVrkZ/wIkyMLK4WcQ3Cj8U= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -1386,6 +1564,7 @@ k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8 k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= @@ -1395,16 +1574,18 @@ k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= +k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= +k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= +k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= k8s.io/kubectl v0.21.0/go.mod h1:EU37NukZRXn1TpAkMUoy8Z/B2u6wjHDS4aInsDzVvks= k8s.io/metrics v0.21.0/go.mod h1:L3Ji9EGPP1YBbfm9sPfEXSpnj8i24bfQbAFAsW0NueQ= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= @@ -1413,8 +1594,11 @@ k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471 h1:DnzUXII7sVg1FJ/4JX6YDRJfLNAC7idRatPwe07suiI= k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= +k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= @@ -1427,12 +1611,16 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.25/go.mod h1:Mlj9PNLmG9bZ6BHFwFKDo5afkpWyUISkb9Me0GnK66I= sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+aqSv/M3njpmo= sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= -sigs.k8s.io/controller-runtime v0.9.6 h1:EevVMlgUj4fC1NVM4+DB3iPkWkmGRNarA66neqv9Qew= sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= +sigs.k8s.io/controller-runtime v0.11.1 h1:7YIHT2QnHJArj/dk9aUkYhfqfK5cIxPOX5gPECfdZLU= +sigs.k8s.io/controller-runtime v0.11.1/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA= sigs.k8s.io/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I= +sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= +sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= sigs.k8s.io/kind v0.7.0/go.mod h1:An/AbWHT6pA/Lm0Og8j3ukGhfJP3RiVN/IBU6Lo3zl8= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/kustomize/api v0.8.5/go.mod h1:M377apnKT5ZHJS++6H4rQoCHmWtt6qTpp3mbe7p6OLY= @@ -1448,9 +1636,12 @@ sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/structured-merge-diff/v4 v4.2.0/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +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.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= From bd220a89c61cda1608965d041f0bf46aca315cb1 Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Tue, 1 Mar 2022 13:22:59 +0100 Subject: [PATCH 045/194] Implement readiness probe for NATS publisher based on connection status of NATS server(s) (#13120) * Implement readiness probe for NATS publisher based on connection status of NATS server(s) * Update publisher image * Sort imports * Return error if connection is not open while publishing --- pkg/env/nats_config.go | 2 +- pkg/handler/beb/handler.go | 7 +- pkg/handler/health/health.go | 86 ++++++++++++++ pkg/handler/health/health_test.go | 126 ++++++++++++++++++++ pkg/handler/nats/handler.go | 12 +- pkg/handler/nats/handler_health_test.go | 45 ++++++++ pkg/handler/nats/health.go | 28 +++++ pkg/handler/nats/health_test.go | 67 +++++++++++ pkg/handler/nats/mock/mock.go | 111 ++++++++++++++++++ pkg/health/probes.go | 26 ----- pkg/health/probes_test.go | 49 -------- pkg/nats/connect.go | 24 ++-- pkg/nats/connect_test.go | 9 -- pkg/sender/nats.go | 42 ++++--- pkg/sender/nats_test.go | 147 +++++++++--------------- testing/nats.go | 4 +- testing/utils.go | 23 ++++ 17 files changed, 586 insertions(+), 222 deletions(-) create mode 100644 pkg/handler/health/health.go create mode 100644 pkg/handler/health/health_test.go create mode 100644 pkg/handler/nats/handler_health_test.go create mode 100644 pkg/handler/nats/health.go create mode 100644 pkg/handler/nats/health_test.go create mode 100644 pkg/handler/nats/mock/mock.go delete mode 100644 pkg/health/probes.go delete mode 100644 pkg/health/probes_test.go diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go index fb1720b..0cb4ef3 100644 --- a/pkg/env/nats_config.go +++ b/pkg/env/nats_config.go @@ -13,7 +13,7 @@ type NatsConfig struct { Port int `envconfig:"INGRESS_PORT" default:"8080"` URL string `envconfig:"NATS_URL" default:"nats.nats.svc.cluster.local"` RetryOnFailedConnect bool `envconfig:"RETRY_ON_FAILED_CONNECT" default:"true"` - MaxReconnects int `envconfig:"MAX_RECONNECTS" default:"10"` + MaxReconnects int `envconfig:"MAX_RECONNECTS" default:"-1"` // Negative means keep try reconnecting. ReconnectWait time.Duration `envconfig:"RECONNECT_WAIT" default:"5s"` RequestTimeout time.Duration `envconfig:"REQUEST_TIMEOUT" default:"5s"` diff --git a/pkg/handler/beb/handler.go b/pkg/handler/beb/handler.go index 5f2886f..e06b868 100644 --- a/pkg/handler/beb/handler.go +++ b/pkg/handler/beb/handler.go @@ -16,7 +16,7 @@ import ( cloudevents "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/ems" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/health" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" @@ -80,10 +80,11 @@ func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.BebMessag // Start starts the Handler with the given context. func (h *Handler) Start(ctx context.Context) error { - return h.Receiver.StartListen(ctx, health.CheckHealth(h)) + healthChecker := health.NewChecker() + return h.Receiver.StartListen(ctx, healthChecker.Check(h)) } -// ServeHTTP serves an HTTP request and returns back an HTTP response. +// ServeHTTP serves an HTTP request and returns an HTTP response. // It ensures that the incoming request is a valid Cloud Event, then dispatches it // to the EMS gateway and writes back the HTTP response. func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { diff --git a/pkg/handler/health/health.go b/pkg/handler/health/health.go new file mode 100644 index 0000000..93dbdd3 --- /dev/null +++ b/pkg/handler/health/health.go @@ -0,0 +1,86 @@ +package health + +import ( + "net/http" +) + +const ( + // LivenessURI is the endpoint URI used for liveness check. + LivenessURI = "/healthz" + + // ReadinessURI is the endpoint URI used for readiness check. + ReadinessURI = "/readyz" + + // StatusCodeHealthy is the status code which indicates a healthy state. + StatusCodeHealthy = http.StatusOK + + // StatusCodeNotHealthy is the status code which indicates a not healthy state. + StatusCodeNotHealthy = http.StatusInternalServerError +) + +// Checker represents a health checker. +type Checker struct { + livenessCheck http.HandlerFunc + readinessCheck http.HandlerFunc +} + +// CheckerOpt represents a health checker option. +type CheckerOpt func(*Checker) + +// NewChecker returns a new instance of Checker initialized with the default liveness and readiness checks. +func NewChecker(opts ...CheckerOpt) *Checker { + c := &Checker{ + livenessCheck: DefaultCheck, + readinessCheck: DefaultCheck, + } + + for _, opt := range opts { + opt(c) + } + + return c +} + +// Check does the necessary health checks (if applicable) before serving HTTP requests for the given http.Handler. +func (c *Checker) Check(h http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if c.livenessCheck != nil && r.RequestURI == LivenessURI { + c.livenessCheck(w, r) + return + } + + if c.readinessCheck != nil && r.RequestURI == ReadinessURI { + c.readinessCheck(w, r) + return + } + + h.ServeHTTP(w, r) + }) +} + +// DefaultCheck always writes a 2XX status code for the given http.ResponseWriter. +func DefaultCheck(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(StatusCodeHealthy) +} + +// WithLivenessCheck returns CheckerOpt which sets the liveness check for the given http.HandlerFunc. +func WithLivenessCheck(h http.HandlerFunc) CheckerOpt { + if h == nil { + panic("liveness handler is nil") + } + + return func(c *Checker) { + c.livenessCheck = h + } +} + +// WithReadinessCheck returns CheckerOpt which sets the readiness check for the given http.HandlerFunc. +func WithReadinessCheck(h http.HandlerFunc) CheckerOpt { + if h == nil { + panic("readiness handler is nil") + } + + return func(c *Checker) { + c.readinessCheck = h + } +} diff --git a/pkg/handler/health/health_test.go b/pkg/handler/health/health_test.go new file mode 100644 index 0000000..089f032 --- /dev/null +++ b/pkg/handler/health/health_test.go @@ -0,0 +1,126 @@ +package health + +import ( + "net/http" + "net/http/httptest" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestChecker(t *testing.T) { + testCases := []struct { + name string + useCustomLivenessCheck bool // use the givenCustomLivenessCheck instead of the default one + useCustomReadinessCheck bool // use the givenCustomReadinessCheck instead of the default one + givenCustomLivenessCheck http.HandlerFunc // custom liveness check (can be nil) + givenCustomReadinessCheck http.HandlerFunc // custom readiness check (can be nil) + givenNextHandler http.Handler // next handler + givenNextHandlerEndpoint string // next handler endpoint + wantPanicForNilHealthChecks bool // panic if provided health checks is nil + wantLivenessStatusCode int // expected liveness status code + wantReadinessStatusCode int // expected readiness status code + wantNextHandlerStatusCode int // expected next handler status code + }{ + { + name: "should report default health checks status-codes", + useCustomLivenessCheck: false, + useCustomReadinessCheck: false, + wantLivenessStatusCode: StatusCodeHealthy, + wantReadinessStatusCode: StatusCodeHealthy, + }, + { + name: "should report default health checks and next handler status-codes", + useCustomLivenessCheck: false, + useCustomReadinessCheck: false, + givenNextHandler: handlerWithStatusCode(http.StatusNoContent), + givenNextHandlerEndpoint: "/endpoint", + wantLivenessStatusCode: StatusCodeHealthy, + wantReadinessStatusCode: StatusCodeHealthy, + wantNextHandlerStatusCode: http.StatusNoContent, + }, + { + name: "should panic if provided liveness check is nil", + useCustomLivenessCheck: true, + useCustomReadinessCheck: false, + givenCustomLivenessCheck: nil, + wantPanicForNilHealthChecks: true, + }, + { + name: "should panic if provided readiness check is nil", + useCustomLivenessCheck: false, + useCustomReadinessCheck: true, + givenCustomReadinessCheck: nil, + wantPanicForNilHealthChecks: true, + }, + { + name: "should report custom health checks and next handler status-codes", + useCustomLivenessCheck: true, + useCustomReadinessCheck: true, + givenCustomLivenessCheck: handlerFuncWithStatusCode(http.StatusOK), + givenCustomReadinessCheck: handlerFuncWithStatusCode(http.StatusAccepted), + givenNextHandler: handlerWithStatusCode(http.StatusNoContent), + givenNextHandlerEndpoint: "/endpoint", + wantPanicForNilHealthChecks: false, + wantLivenessStatusCode: http.StatusOK, + wantReadinessStatusCode: http.StatusAccepted, + wantNextHandlerStatusCode: http.StatusNoContent, + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer func() { + r := recover() + + if !assert.Equal(t, tc.wantPanicForNilHealthChecks, r != nil) { + t.Log(r) + } + }() + + var opts []CheckerOpt + if tc.useCustomLivenessCheck { + opts = append(opts, WithLivenessCheck(tc.givenCustomLivenessCheck)) + } + if tc.useCustomReadinessCheck { + opts = append(opts, WithReadinessCheck(tc.givenCustomReadinessCheck)) + } + checker := NewChecker(opts...) + + if tc.useCustomLivenessCheck { + assertResponseStatusCode(t, LivenessURI, checker, tc.givenCustomLivenessCheck, tc.wantLivenessStatusCode) + } else { + assertResponseStatusCode(t, LivenessURI, checker, http.HandlerFunc(DefaultCheck), StatusCodeHealthy) + } + + if tc.useCustomReadinessCheck { + assertResponseStatusCode(t, ReadinessURI, checker, tc.givenCustomReadinessCheck, tc.wantReadinessStatusCode) + } else { + assertResponseStatusCode(t, ReadinessURI, checker, http.HandlerFunc(DefaultCheck), StatusCodeHealthy) + } + + if tc.givenNextHandler != nil { + assertResponseStatusCode(t, tc.givenNextHandlerEndpoint, checker, tc.givenNextHandler, tc.wantNextHandlerStatusCode) + } + }) + } +} + +func assertResponseStatusCode(t *testing.T, endpoint string, checker *Checker, handler http.Handler, statusCode int) { + writer := httptest.NewRecorder() + request := httptest.NewRequest(http.MethodGet, endpoint, nil) + + checker.Check(handler).ServeHTTP(writer, request) + + require.Equal(t, statusCode, writer.Result().StatusCode) +} + +func handlerFuncWithStatusCode(statusCode int) http.HandlerFunc { + return func(writer http.ResponseWriter, request *http.Request) { + writer.WriteHeader(statusCode) + } +} + +func handlerWithStatusCode(statusCode int) http.Handler { + return handlerFuncWithStatusCode(statusCode) +} diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index d0bca61..78baa05 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -5,8 +5,6 @@ import ( "net/http" "time" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing" - "github.com/cloudevents/sdk-go/v2/binding" cev2client "github.com/cloudevents/sdk-go/v2/client" cev2event "github.com/cloudevents/sdk-go/v2/event" @@ -14,13 +12,14 @@ import ( "github.com/sirupsen/logrus" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/health" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing" ) // Handler is responsible for receiving HTTP requests and dispatching them to NATS. @@ -64,10 +63,13 @@ func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.NatsMessa // Start starts the Handler with the given context. func (h *Handler) Start(ctx context.Context) error { - return h.Receiver.StartListen(ctx, health.CheckHealth(h)) + healthChecker := health.NewChecker( + health.WithReadinessCheck(ReadinessCheck(h)), + ) + return h.Receiver.StartListen(ctx, healthChecker.Check(h)) } -// ServeHTTP serves an HTTP request and returns back an HTTP response. +// ServeHTTP serves an HTTP request and returns an HTTP response. // It ensures that the incoming request is a valid Cloud Event, then dispatches it // to NATS and writes back the HTTP response. func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { diff --git a/pkg/handler/nats/handler_health_test.go b/pkg/handler/nats/handler_health_test.go new file mode 100644 index 0000000..4af2277 --- /dev/null +++ b/pkg/handler/nats/handler_health_test.go @@ -0,0 +1,45 @@ +package nats_test + +import ( + "context" + "testing" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats/mock" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" +) + +func TestHandlerHealth(t *testing.T) { + testCases := []struct { + name string + givenNatsServerShutdown bool + wantLivenessStatusCode int + wantReadinessStatusCode int + }{ + { + name: "NATS handler is healthy", + givenNatsServerShutdown: false, + wantLivenessStatusCode: health.StatusCodeHealthy, + wantReadinessStatusCode: health.StatusCodeHealthy, + }, + { + name: "NATS handler is unhealthy", + givenNatsServerShutdown: true, + wantLivenessStatusCode: health.StatusCodeHealthy, + wantReadinessStatusCode: health.StatusCodeNotHealthy, + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + handlerMock := mock.StartOrDie(context.TODO(), t) + defer handlerMock.ShutdownNatsServer() + + if tc.givenNatsServerShutdown { + handlerMock.ShutdownNatsServer() + } + + testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetLivenessEndpoint(), tc.wantLivenessStatusCode) + testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetReadinessEndpoint(), tc.wantReadinessStatusCode) + }) + } +} diff --git a/pkg/handler/nats/health.go b/pkg/handler/nats/health.go new file mode 100644 index 0000000..ba170c5 --- /dev/null +++ b/pkg/handler/nats/health.go @@ -0,0 +1,28 @@ +package nats + +import ( + "net/http" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" + + "github.com/nats-io/nats.go" +) + +// ReadinessCheck returns an instance of http.HandlerFunc that checks the readiness of the given NATS Handler. +// It checks the NATS server connection status and reports 2XX if connected, otherwise reports 5XX. +// It panics if the given NATS Handler is nil. +func ReadinessCheck(h *Handler) http.HandlerFunc { + if h == nil { + panic("readiness handler is nil") + } + + return func(w http.ResponseWriter, _ *http.Request) { + if status := h.Sender.ConnectionStatus(); status != nats.CONNECTED { + h.Logger.WithField("connection-status", status).Info("Disconnected from NATS server") + w.WriteHeader(health.StatusCodeNotHealthy) + return + } + + w.WriteHeader(health.StatusCodeHealthy) + } +} diff --git a/pkg/handler/nats/health_test.go b/pkg/handler/nats/health_test.go new file mode 100644 index 0000000..5b946e4 --- /dev/null +++ b/pkg/handler/nats/health_test.go @@ -0,0 +1,67 @@ +package nats_test + +import ( + "context" + "net/http" + "net/http/httptest" + "testing" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" + "github.com/stretchr/testify/assert" + + "github.com/stretchr/testify/require" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats/mock" +) + +func TestReadinessCheck(t *testing.T) { + testCases := []struct { + name string + givenHandlerEndpoint string + wantPanicForNilHandler bool + wantHandlerStatusCode int + }{ + { + name: "should panic if provided handler is nil", + wantPanicForNilHandler: true, + }, + { + name: "should report handler status-code", + givenHandlerEndpoint: "/endpoint", + wantPanicForNilHandler: false, + wantHandlerStatusCode: health.StatusCodeHealthy, + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + defer func() { + r := recover() + if !assert.Equal(t, tc.wantPanicForNilHandler, r != nil) { + t.Log(r) + } + }() + + handlerMock := mock.StartOrDie(context.TODO(), t) + defer handlerMock.ShutdownNatsServer() + + var handler http.HandlerFunc + if tc.wantPanicForNilHandler { + handler = nats.ReadinessCheck(nil) + } else { + handler = nats.ReadinessCheck(handlerMock.GetHandler()) + } + + assertResponseStatusCode(t, tc.givenHandlerEndpoint, handler, tc.wantHandlerStatusCode) + }) + } +} + +func assertResponseStatusCode(t *testing.T, endpoint string, handler http.HandlerFunc, statusCode int) { + writer := httptest.NewRecorder() + request := httptest.NewRequest(http.MethodGet, endpoint, nil) + + handler.ServeHTTP(writer, request) + + require.Equal(t, statusCode, writer.Result().StatusCode) +} diff --git a/pkg/handler/nats/mock/mock.go b/pkg/handler/nats/mock/mock.go new file mode 100644 index 0000000..6a7893e --- /dev/null +++ b/pkg/handler/nats/mock/mock.go @@ -0,0 +1,111 @@ +package mock + +import ( + "context" + "fmt" + "testing" + "time" + + "github.com/nats-io/nats-server/v2/server" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" +) + +// NatsHandlerMock represents a mock for the nats.Handler. +type NatsHandlerMock struct { + ctx context.Context + handler *nats.Handler + livenessEndpoint string + readinessEndpoint string + logger *logrus.Logger + natsServer *server.Server + natsConfig *env.NatsConfig + collector *metrics.Collector + legacyTransformer *legacy.Transformer + subscribedProcessor *subscribed.Processor +} + +// NatsHandlerMockOpt represents a NatsHandlerMock option. +type NatsHandlerMockOpt func(*NatsHandlerMock) + +// StartOrDie starts a new NatsHandlerMock instance or die if a precondition fails. +// Preconditions: 1) NATS connection and 2) nats.Handler started without errors. +func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) *NatsHandlerMock { + port := testingutils.GeneratePortOrDie() + mock := &NatsHandlerMock{ + ctx: ctx, + livenessEndpoint: fmt.Sprintf("http://localhost:%d%s", port, health.LivenessURI), + readinessEndpoint: fmt.Sprintf("http://localhost:%d%s", port, health.ReadinessURI), + logger: logrus.New(), + natsServer: testingutils.StartNatsServer(), + natsConfig: &env.NatsConfig{Port: port}, + collector: metrics.NewCollector(), + legacyTransformer: &legacy.Transformer{}, + subscribedProcessor: &subscribed.Processor{}, + } + + for _, opt := range opts { + opt(mock) + } + + msgReceiver := receiver.NewHTTPMessageReceiver(mock.natsConfig.Port) + + backendConnection := pkgnats.NewBackendConnection(mock.GetNatsURL(), true, 3, time.Second) + err := backendConnection.Connect() + require.NoError(t, err) + + msgSender := sender.NewNatsMessageSender(ctx, backendConnection, mock.logger) + + mock.handler = nats.NewHandler( + msgReceiver, + msgSender, + mock.natsConfig.RequestTimeout, + mock.legacyTransformer, + &options.Options{MaxRequestSize: 65536}, + mock.subscribedProcessor, + mock.logger, + mock.collector, + ) + + go func() { require.NoError(t, mock.handler.Start(ctx)) }() + testingutils.WaitForEndpointStatusCodeOrFail(mock.livenessEndpoint, health.StatusCodeHealthy) + + return mock +} + +// ShutdownNatsServer shuts down the NATS server used by the NatsHandlerMock. +func (m *NatsHandlerMock) ShutdownNatsServer() { + m.natsServer.Shutdown() +} + +// GetNatsURL returns the NATS server URL used by the NatsHandlerMock. +func (m *NatsHandlerMock) GetNatsURL() string { + return m.natsServer.ClientURL() +} + +// GetLivenessEndpoint returns the liveness endpoint used by the NatsHandlerMock. +func (m *NatsHandlerMock) GetLivenessEndpoint() string { + return m.livenessEndpoint +} + +// GetReadinessEndpoint returns the readiness endpoint used by the NatsHandlerMock. +func (m *NatsHandlerMock) GetReadinessEndpoint() string { + return m.readinessEndpoint +} + +// GetHandler returns the nats.Handler used by the NatsHandlerMock. +func (m *NatsHandlerMock) GetHandler() *nats.Handler { + return m.handler +} diff --git a/pkg/health/probes.go b/pkg/health/probes.go deleted file mode 100644 index 83b3db9..0000000 --- a/pkg/health/probes.go +++ /dev/null @@ -1,26 +0,0 @@ -package health - -import ( - "net/http" -) - -const ( - livenessURI = "/healthz" - readinessURI = "/readyz" -) - -// CheckHealth does the health checks for the readiness and liveness probes, otherwise it will let the next -// handler take care of the incoming HTTP requests. -func CheckHealth(next http.Handler) http.Handler { - return http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { - if request.RequestURI == livenessURI { - writer.WriteHeader(http.StatusOK) - return - } - if request.RequestURI == readinessURI { - writer.WriteHeader(http.StatusOK) - return - } - next.ServeHTTP(writer, request) - }) -} diff --git a/pkg/health/probes_test.go b/pkg/health/probes_test.go deleted file mode 100644 index d148c17..0000000 --- a/pkg/health/probes_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package health - -import ( - "net/http" - "net/http/httptest" - "testing" -) - -func TestCheckHealthSuccess(t *testing.T) { - writer := httptest.NewRecorder() - checkHealthHandler := CheckHealth(failHandler(http.StatusInternalServerError)) - - requestLiveness := httptest.NewRequest(http.MethodGet, livenessURI, nil) - checkHealthHandler.ServeHTTP(writer, requestLiveness) - if got := writer.Result().StatusCode; got != http.StatusOK { - t.Errorf("Handler must respond with status code %d to %s requests to path: '%s' but got code %d", - http.StatusOK, http.MethodGet, livenessURI, got) - } - - requestReadiness := httptest.NewRequest(http.MethodGet, readinessURI, nil) - checkHealthHandler.ServeHTTP(writer, requestReadiness) - if got := writer.Result().StatusCode; got != http.StatusOK { - t.Errorf("Handler must respond with status code %d to %s requests to path: '%s' but got code %d", - http.StatusOK, http.MethodGet, readinessURI, got) - } -} - -func TestCheckHealthFail(t *testing.T) { - const ( - endpoint = "/someEndpoint" - statusCode = http.StatusInternalServerError - ) - - writer := httptest.NewRecorder() - checkHealthHandler := CheckHealth(failHandler(statusCode)) - - requestLiveness := httptest.NewRequest(http.MethodGet, endpoint, nil) - checkHealthHandler.ServeHTTP(writer, requestLiveness) - if got := writer.Result().StatusCode; got != statusCode { - t.Errorf("Handler must respond with status code %d to %s requests to path: '%s' but got code %d", - statusCode, http.MethodGet, endpoint, got) - } -} - -func failHandler(statusCode int) http.Handler { - return http.HandlerFunc(func(writer http.ResponseWriter, request *http.Request) { - writer.WriteHeader(statusCode) - }) -} diff --git a/pkg/nats/connect.go b/pkg/nats/connect.go index db02a07..3903289 100644 --- a/pkg/nats/connect.go +++ b/pkg/nats/connect.go @@ -31,21 +31,21 @@ func NewBackendConnection(url string, retry bool, reconnects int, wait time.Dura } } -// Connect returns a nats connection that is ready for use, or error if connection to the nats server failed -func (bc *BackendConnection) Connect() error { - connection, err := nats.Connect(bc.connectionData.url, nats.RetryOnFailedConnect(bc.connectionData.retry), - nats.MaxReconnects(bc.connectionData.reconnects), nats.ReconnectWait(bc.connectionData.wait)) +// Connect returns a NATS connection that is ready for use, or an error if connection to the NATS server failed. +// It uses the nats.Connect function which is thread-safe. +func (bc *BackendConnection) Connect() (err error) { + bc.Connection, err = nats.Connect(bc.connectionData.url, + nats.RetryOnFailedConnect(bc.connectionData.retry), + nats.MaxReconnects(bc.connectionData.reconnects), + nats.ReconnectWait(bc.connectionData.wait), + ) if err != nil { return err } - if status := connection.Status(); status != nats.CONNECTED { - return fmt.Errorf("connection status not connected: %v", status) + + if status := bc.Connection.Status(); status != nats.CONNECTED { + return fmt.Errorf("cannot connect to NATS server, status: %v", status) } - // OK - bc.Connection = connection - return nil -} -func (bc *BackendConnection) Reconnect() error { - return bc.Connect() + return nil } diff --git a/pkg/nats/connect_test.go b/pkg/nats/connect_test.go index 4a06467..d925cf8 100644 --- a/pkg/nats/connect_test.go +++ b/pkg/nats/connect_test.go @@ -19,13 +19,4 @@ func TestConnectToNats(t *testing.T) { assert.Nil(t, err) assert.NotNil(t, bc.Connection) assert.Equal(t, bc.Connection.Status(), nats.CONNECTED) - - bc.Connection.Close() - - err = bc.Reconnect() - assert.Nil(t, err) - assert.NotNil(t, bc.Connection) - assert.Equal(t, bc.Connection.Status(), nats.CONNECTED) - - defer bc.Connection.Close() } diff --git a/pkg/sender/nats.go b/pkg/sender/nats.go index 2dd024c..4ec0cd2 100644 --- a/pkg/sender/nats.go +++ b/pkg/sender/nats.go @@ -2,23 +2,26 @@ package sender import ( "context" + "errors" "net/http" cenats "github.com/cloudevents/sdk-go/protocol/nats/v2" cev2 "github.com/cloudevents/sdk-go/v2" - cev2event "github.com/cloudevents/sdk-go/v2/event" - pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" + "github.com/cloudevents/sdk-go/v2/event" + "github.com/nats-io/nats.go" "github.com/sirupsen/logrus" + + pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" ) // compile time check var _ GenericSender = &NatsMessageSender{} type GenericSender interface { - Send(context.Context, *cev2event.Event) (int, error) + Send(context.Context, *event.Event) (int, error) } -// BebMessageSender is responsible for sending messages over HTTP. +// NatsMessageSender is responsible for sending messages over HTTP. type NatsMessageSender struct { ctx context.Context logger *logrus.Logger @@ -30,36 +33,31 @@ func NewNatsMessageSender(ctx context.Context, bc *pkgnats.BackendConnection, lo return &NatsMessageSender{ctx: ctx, backendConnection: bc, logger: logger} } -// Send dispatches the given Cloud Event to NATS and returns the response details and dispatch time. -func (h *NatsMessageSender) Send(ctx context.Context, event *cev2event.Event) (int, error) { - h.logger.Infof("Sending event to NATS, id:[%s]", event.ID()) - // The same Nats subject used by Nats subscription - subject := event.Type() +// ConnectionStatus returns nats.Status for the NATS connection used by the NatsMessageSender. +func (s *NatsMessageSender) ConnectionStatus() nats.Status { + return s.backendConnection.Connection.Status() +} + +// Send dispatches the event.Event to NATS server. +// If the NATS connection is not open, it returns an error. +func (s *NatsMessageSender) Send(ctx context.Context, event *event.Event) (int, error) { + if s.ConnectionStatus() != nats.CONNECTED { + return http.StatusBadGateway, errors.New("connection status: no connection to NATS server") + } - sender, err := cenats.NewSenderFromConn(h.backendConnection.Connection, subject) + sender, err := cenats.NewSenderFromConn(s.backendConnection.Connection, event.Type()) if err != nil { - h.logger.Errorf("Failed to create nats protocol, %s", err.Error()) return http.StatusInternalServerError, err } client, err := cev2.NewClient(sender) if err != nil { - h.logger.Errorf("Failed to create client, %s", err.Error()) return http.StatusInternalServerError, err } - err = client.Send(ctx, *event) - if cev2.IsUndelivered(err) { - h.logger.Errorf("Failed to send: %s", err.Error()) - if h.backendConnection.Connection.IsClosed() { - h.logger.Info("Reconnect...") - if err := h.backendConnection.Reconnect(); err != nil { - h.logger.Errorf("Failed to reconnect: %s", err.Error()) - } - } + if err := client.Send(ctx, *event); cev2.IsUndelivered(err) { return http.StatusBadGateway, err } - h.logger.Infof("sent id:[%s], accepted: %t", event.ID(), cev2.IsACK(err)) return http.StatusNoContent, nil } diff --git a/pkg/sender/nats_test.go b/pkg/sender/nats_test.go index c0563bb..f66ddbb 100644 --- a/pkg/sender/nats_test.go +++ b/pkg/sender/nats_test.go @@ -16,99 +16,60 @@ import ( testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) -func TestSendCloudEvent(t *testing.T) { - logger := logrus.New() - logger.Info("TestNatsSender started") - - // Start Nats server - natsServer := testingutils.StartNatsServer() - assert.NotNil(t, natsServer) - defer natsServer.Shutdown() - - // connect to nats - bc := pkgnats.NewBackendConnection(natsServer.ClientURL(), true, 1, time.Second) - err := bc.Connect() - assert.Nil(t, err) - assert.NotNil(t, bc.Connection) - - // create message sender - ctx := context.Background() - sender := NewNatsMessageSender(ctx, bc, logger) - - // subscribe to subject - done := make(chan bool, 1) - validator := testingutils.ValidateNatsMessageDataOrFail(t, fmt.Sprintf(`"%s"`, testingutils.CloudEventData), done) - testingutils.SubscribeToEventOrFail(t, bc.Connection, testingutils.CloudEventType, validator) - - // create cloudevent - ce := testingutils.StructuredCloudEventPayloadWithCleanEventType - event := cloudevents.NewEvent() - event.SetType(testingutils.CloudEventType) - err = json.Unmarshal([]byte(ce), &event) - assert.Nil(t, err) - - // send cloudevent - status, err := sender.Send(ctx, &event) - assert.Nil(t, err) - assert.Equal(t, status, http.StatusNoContent) - - // wait for subscriber to receive the messages - if err := testingutils.WaitForChannelOrTimeout(done, time.Second*3); err != nil { - t.Fatalf("Subscriber did not receive the message with error: %v", err) +func TestNatsMessageSender(t *testing.T) { + testCases := []struct { + name string + givenNatsServerShutdown bool + wantError bool + wantStatusCode int + }{ + { + name: "Send should succeed if NATS connection is open", + givenNatsServerShutdown: false, + wantError: false, + wantStatusCode: http.StatusNoContent, + }, + { + name: "Send should fail if NATS connection is not open", + givenNatsServerShutdown: true, + wantError: true, + wantStatusCode: http.StatusBadGateway, + }, } -} - -func TestSendCloudEventWithReconnect(t *testing.T) { - logger := logrus.New() - logger.Info("TestNatsSender started") - - // Start Nats server - natsServer := testingutils.StartNatsServer() - assert.NotNil(t, natsServer) - defer natsServer.Shutdown() - - // connect to nats - bc := pkgnats.NewBackendConnection(natsServer.ClientURL(), true, 10, time.Second) - err := bc.Connect() - assert.Nil(t, err) - assert.NotNil(t, bc.Connection) - - // create message sender - ctx := context.Background() - sender := NewNatsMessageSender(ctx, bc, logger) - - // subscribe to subject - done := make(chan bool, 1) - validator := testingutils.ValidateNatsMessageDataOrFail(t, fmt.Sprintf(`"%s"`, testingutils.CloudEventData), done) - testingutils.SubscribeToEventOrFail(t, bc.Connection, testingutils.CloudEventType, validator) - - // create cloudevent - ce := testingutils.StructuredCloudEventPayloadWithCleanEventType - event := cloudevents.NewEvent() - event.SetType(testingutils.CloudEventType) - err = json.Unmarshal([]byte(ce), &event) - assert.Nil(t, err) - - // send cloudevent - status, err := sender.Send(ctx, &event) - assert.Nil(t, err) - assert.Equal(t, status, http.StatusNoContent) - - // wait for subscriber to receive the messages - if err := testingutils.WaitForChannelOrTimeout(done, time.Second*3); err != nil { - t.Fatalf("Subscriber did not receive the message with error: %v", err) + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + natsServer := testingutils.StartNatsServer() + assert.NotNil(t, natsServer) + defer natsServer.Shutdown() + + bc := pkgnats.NewBackendConnection(natsServer.ClientURL(), true, 1, time.Second) + err := bc.Connect() + assert.NoError(t, err) + assert.NotNil(t, bc.Connection) + + if tc.givenNatsServerShutdown { + natsServer.Shutdown() + } + + receive := make(chan bool, 1) + validator := testingutils.ValidateNatsMessageDataOrFail(t, fmt.Sprintf(`"%s"`, testingutils.CloudEventData), receive) + testingutils.SubscribeToEventOrFail(t, bc.Connection, testingutils.CloudEventType, validator) + + ce := testingutils.StructuredCloudEventPayloadWithCleanEventType + event := cloudevents.NewEvent() + event.SetType(testingutils.CloudEventType) + err = json.Unmarshal([]byte(ce), &event) + assert.NoError(t, err) + + ctx := context.Background() + sender := NewNatsMessageSender(context.Background(), bc, logrus.New()) + + status, err := sender.Send(ctx, &event) + assert.Equal(t, tc.wantError, err != nil) + assert.Equal(t, status, tc.wantStatusCode) + + err = testingutils.WaitForChannelOrTimeout(receive, time.Second*3) + assert.Equal(t, tc.wantError, err != nil) + }) } - - // close connection - bc.Connection.Close() - - // send the cloudevent again, the message is not delivered cause the connection was closed - status, err = sender.Send(ctx, &event) - assert.NotNil(t, err) - assert.Equal(t, status, http.StatusBadGateway) - - // send the cloudevent again, the reconnection should work - status, err = sender.Send(ctx, &event) - assert.Nil(t, err) - assert.Equal(t, status, http.StatusNoContent) } diff --git a/testing/nats.go b/testing/nats.go index fd94ca3..2d66d44 100644 --- a/testing/nats.go +++ b/testing/nats.go @@ -52,12 +52,12 @@ func ValidateNatsMessageDataOrFail(t *testing.T, data string, notify ...chan boo } } -func WaitForChannelOrTimeout(done chan bool, timeout time.Duration) error { +func WaitForChannelOrTimeout(ch chan bool, timeout time.Duration) error { timer := time.NewTimer(timeout) defer timer.Stop() select { - case <-done: + case <-ch: return nil case <-timer.C: return fmt.Errorf("timeout is reached %v", timeout) diff --git a/testing/utils.go b/testing/utils.go index fb0f9d5..5cc7451 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -160,6 +160,29 @@ func WaitForHandlerToStart(t *testing.T, healthEndpoint string) { } } +// WaitForEndpointStatusCodeOrFail waits for endpoint status code or timeout. +func WaitForEndpointStatusCodeOrFail(endpoint string, statusCode int) { + timeout := time.After(time.Second * 30) + ticker := time.NewTicker(time.Second * 1) + + for { + select { + case <-timeout: + { + log.Fatalf("Endpoint:%s did not respond with the expected status-code:%d", endpoint, statusCode) + } + case <-ticker.C: + { + if resp, err := http.Get(endpoint); err != nil { //nolint:gosec + continue + } else if resp.StatusCode == statusCode { + return + } + } + } + } +} + // GeneratePortOrDie generates a random 5 digit port or fail func GeneratePortOrDie() int { tick := time.NewTicker(time.Second / 2) From 351c8dea2333d4f0c453271809b6c4eaf5f157be Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Thu, 3 Mar 2022 09:37:01 +0100 Subject: [PATCH 046/194] Refactor Event publisher NATS sender and connection (#13523) * Refactor NATS sender and connection * Update publisher image * Use assertions instead of error checking in the tests * Cleanup test resources after each test run * Remove test parallelism in favour of having stable tests * Use assertions instead of error checking --- cmd/event-publisher-proxy/nats/nats.go | 18 +- pkg/handler/health/health.go | 2 + pkg/handler/nats/handler_health_test.go | 4 +- pkg/handler/nats/handler_integration_test.go | 259 ++++++++++++++++ pkg/handler/nats/handler_test.go | 306 ------------------- pkg/handler/nats/health.go | 4 +- pkg/handler/nats/health_test.go | 5 +- pkg/handler/nats/mock/mock.go | 67 +++- pkg/nats/connect.go | 42 +-- pkg/nats/connect_test.go | 56 +++- pkg/sender/nats.go | 16 +- pkg/sender/nats_test.go | 49 +-- 12 files changed, 424 insertions(+), 404 deletions(-) create mode 100644 pkg/handler/nats/handler_integration_test.go delete mode 100644 pkg/handler/nats/handler_test.go diff --git a/cmd/event-publisher-proxy/nats/nats.go b/cmd/event-publisher-proxy/nats/nats.go index 23bb291..107bf39 100644 --- a/cmd/event-publisher-proxy/nats/nats.go +++ b/cmd/event-publisher-proxy/nats/nats.go @@ -3,7 +3,13 @@ package nats import ( "context" + "k8s.io/client-go/dynamic" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only required in a dev setup + "sigs.k8s.io/controller-runtime/pkg/client/config" + "github.com/kelseyhightower/envconfig" + "github.com/sirupsen/logrus" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" @@ -16,10 +22,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - "github.com/sirupsen/logrus" - "k8s.io/client-go/dynamic" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only required in a dev setup - "sigs.k8s.io/controller-runtime/pkg/client/config" ) // Commander implements the Commander interface. @@ -62,15 +64,15 @@ func (c *Commander) Start() error { messageReceiver := receiver.NewHTTPMessageReceiver(c.envCfg.Port) // connect to nats - bc := pkgnats.NewBackendConnection(c.envCfg.URL, c.envCfg.RetryOnFailedConnect, c.envCfg.MaxReconnects, c.envCfg.ReconnectWait) - if err := bc.Connect(); err != nil { + connection, err := pkgnats.Connect(c.envCfg.URL, c.envCfg.RetryOnFailedConnect, c.envCfg.MaxReconnects, c.envCfg.ReconnectWait) + if err != nil { c.logger.Errorf("Failed to connect to NATS server with error: %s", err) return err } - defer bc.Connection.Close() + defer connection.Close() // configure message sender - messageSenderToNats := sender.NewNatsMessageSender(ctx, bc, c.logger) + messageSenderToNats := sender.NewNatsMessageSender(ctx, connection, c.logger) // cluster config k8sConfig := config.GetConfigOrDie() diff --git a/pkg/handler/health/health.go b/pkg/handler/health/health.go index 93dbdd3..550f7f5 100644 --- a/pkg/handler/health/health.go +++ b/pkg/handler/health/health.go @@ -64,6 +64,7 @@ func DefaultCheck(w http.ResponseWriter, _ *http.Request) { } // WithLivenessCheck returns CheckerOpt which sets the liveness check for the given http.HandlerFunc. +// It panics if the given http.HandlerFunc is nil. func WithLivenessCheck(h http.HandlerFunc) CheckerOpt { if h == nil { panic("liveness handler is nil") @@ -75,6 +76,7 @@ func WithLivenessCheck(h http.HandlerFunc) CheckerOpt { } // WithReadinessCheck returns CheckerOpt which sets the readiness check for the given http.HandlerFunc. +// It panics if the given http.HandlerFunc is nil. func WithReadinessCheck(h http.HandlerFunc) CheckerOpt { if h == nil { panic("readiness handler is nil") diff --git a/pkg/handler/nats/handler_health_test.go b/pkg/handler/nats/handler_health_test.go index 4af2277..db70ad8 100644 --- a/pkg/handler/nats/handler_health_test.go +++ b/pkg/handler/nats/handler_health_test.go @@ -32,10 +32,10 @@ func TestHandlerHealth(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { handlerMock := mock.StartOrDie(context.TODO(), t) - defer handlerMock.ShutdownNatsServer() + defer handlerMock.ShutdownNatsServerAndWait() if tc.givenNatsServerShutdown { - handlerMock.ShutdownNatsServer() + handlerMock.ShutdownNatsServerAndWait() } testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetLivenessEndpoint(), tc.wantLivenessStatusCode) diff --git a/pkg/handler/nats/handler_integration_test.go b/pkg/handler/nats/handler_integration_test.go new file mode 100644 index 0000000..ac1ae9c --- /dev/null +++ b/pkg/handler/nats/handler_integration_test.go @@ -0,0 +1,259 @@ +package nats_test + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "testing" + "time" + + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats/mock" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" + pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" +) + +func TestNatsHandlerForCloudEvents(t *testing.T) { + testCases := []struct { + name string + givenEventTypePrefix string + givenApplicationName string + givenEventType string + wantNatsSubject string + }{ + { + name: "With prefix and clean application name and not-clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenApplicationName: testingutils.ApplicationName, + givenEventType: testingutils.CloudEventTypeNotClean, + wantNatsSubject: testingutils.CloudEventTypeNotClean, + }, + { + name: "With prefix and not-clean application name and not-clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenApplicationName: testingutils.ApplicationNameNotClean, + givenEventType: testingutils.CloudEventTypeNotClean, + wantNatsSubject: testingutils.CloudEventTypeNotClean, + }, + { + name: "With empty prefix and clean application name and not-clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenApplicationName: testingutils.ApplicationName, + givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, + wantNatsSubject: testingutils.CloudEventTypeNotClean, + }, + { + name: "With empty prefix and not-clean application name and not-clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenApplicationName: testingutils.ApplicationNameNotClean, + givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, + wantNatsSubject: testingutils.CloudEventTypeNotClean, + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + handlerMock := mock.StartOrDie(ctx, t, + mock.WithApplication(tc.givenApplicationName), + ) + defer handlerMock.ShutdownNatsServerAndWait() + + // setup test environment + publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", handlerMock.GetNatsConfig().Port) + subscription := testingutils.NewSubscription( + testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, tc.givenEventType), + ) + + // prepare event type from subscription + assert.NotNil(t, subscription.Spec.Filter) + assert.NotEmpty(t, subscription.Spec.Filter.Filters) + eventTypeToSubscribe := subscription.Spec.Filter.Filters[0].EventType.Value + + // connect to nats + connection, err := pkgnats.Connect(handlerMock.GetNatsURL(), true, 3, time.Second) + assert.Nil(t, err) + assert.NotNil(t, connection) + + // publish a message to NATS and validate it + validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantNatsSubject) + testingutils.SubscribeToEventOrFail(t, connection, eventTypeToSubscribe, validator) + + // nolint:scopelint + // run the tests for publishing cloudevents + for _, testCase := range handlertest.TestCasesForCloudEvents { + t.Run(testCase.Name, func(t *testing.T) { + body, headers := testCase.ProvideMessage() + resp, err := testingutils.SendEvent(publishEndpoint, body, headers) + assert.NoError(t, err) + _ = resp.Body.Close() + assert.Equal(t, testCase.WantStatusCode, resp.StatusCode) + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) + } + }) + } + }) + } +} + +func TestNatsHandlerForLegacyEvents(t *testing.T) { + testCases := []struct { + name string + givenEventTypePrefix string + givenApplicationName string + givenEventType string + wantNatsSubject string + }{ + { + name: "With prefix and clean application name and not-clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenApplicationName: testingutils.ApplicationName, + givenEventType: testingutils.CloudEventTypeNotClean, + wantNatsSubject: testingutils.CloudEventType, + }, + { + name: "With empty prefix and clean application name and not-clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenApplicationName: testingutils.ApplicationName, + givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, + wantNatsSubject: testingutils.CloudEventType, + }, + { + name: "With prefix and not-clean application name and not-clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenApplicationName: testingutils.ApplicationNameNotClean, + givenEventType: testingutils.CloudEventTypeNotClean, + wantNatsSubject: testingutils.CloudEventType, + }, + { + name: "With empty prefix and not-clean application name and not-clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenApplicationName: testingutils.ApplicationNameNotClean, + givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, + wantNatsSubject: testingutils.CloudEventType, + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + handlerMock := mock.StartOrDie(ctx, t, + mock.WithApplication(tc.givenApplicationName), + ) + defer handlerMock.ShutdownNatsServerAndWait() + + // setup test environment + publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/%s/v1/events", handlerMock.GetNatsConfig().Port, tc.givenApplicationName) + subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, tc.givenEventType)) + + // prepare event type from subscription + assert.NotNil(t, subscription.Spec.Filter) + assert.NotEmpty(t, subscription.Spec.Filter.Filters) + eventTypeToSubscribe := subscription.Spec.Filter.Filters[0].EventType.Value + + // connect to nats + connection, err := pkgnats.Connect(handlerMock.GetNatsURL(), true, 3, time.Second) + assert.Nil(t, err) + assert.NotNil(t, connection) + + // publish a message to NATS and validate it + validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantNatsSubject) + testingutils.SubscribeToEventOrFail(t, connection, eventTypeToSubscribe, validator) + + // nolint:scopelint + // run the tests for publishing legacy events + for _, testCase := range handlertest.TestCasesForLegacyEvents { + t.Run(testCase.Name, func(t *testing.T) { + body, headers := testCase.ProvideMessage() + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + require.NoError(t, err) + require.Equal(t, testCase.WantStatusCode, resp.StatusCode) + + if testCase.WantStatusCode == http.StatusOK { + handlertest.ValidateOkResponse(t, *resp, &testCase.WantResponse) + } else { + handlertest.ValidateErrorResponse(t, *resp, &testCase.WantResponse) + } + + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) + } + }) + } + }) + } +} + +func TestNatsHandlerForSubscribedEndpoint(t *testing.T) { + testCases := []struct { + name string + givenEventTypePrefix string + givenEventType string + }{ + { + name: "With prefix and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenEventType: testingutils.CloudEventType, + }, + { + name: "With empty prefix and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenEventType: testingutils.CloudEventTypePrefixEmpty, + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + // setup test environment + scheme := runtime.NewScheme() + require.NoError(t, corev1.AddToScheme(scheme)) + require.NoError(t, eventingv1alpha1.AddToScheme(scheme)) + + subscribedEndpointFormat := "http://localhost:%d/%s/v1/events/subscribed" + subscription := testingutils.NewSubscription( + testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, tc.givenEventType), + ) + handlerMock := mock.StartOrDie(ctx, t, + mock.WithSubscription(scheme, subscription, tc.givenEventTypePrefix), + mock.WithApplication(testingutils.ApplicationName), + ) + defer handlerMock.ShutdownNatsServerAndWait() + + // nolint:scopelint + // run the tests for subscribed endpoint + for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { + t.Run(testCase.Name, func(t *testing.T) { + subscribedURL := fmt.Sprintf(subscribedEndpointFormat, handlerMock.GetNatsConfig().Port, testCase.AppName) + resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) + require.NoError(t, err) + require.Equal(t, testCase.WantStatusCode, resp.StatusCode) + defer func() { _ = resp.Body.Close() }() + + respBodyBytes, err := ioutil.ReadAll(resp.Body) + require.NoError(t, err) + + gotEventsResponse := subscribed.Events{} + err = json.Unmarshal(respBodyBytes, &gotEventsResponse) + require.NoError(t, err) + require.Equal(t, testCase.WantResponse, gotEventsResponse) + }) + } + }) + } +} diff --git a/pkg/handler/nats/handler_test.go b/pkg/handler/nats/handler_test.go deleted file mode 100644 index 6ab36e9..0000000 --- a/pkg/handler/nats/handler_test.go +++ /dev/null @@ -1,306 +0,0 @@ -package nats - -import ( - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "os" - "reflect" - "testing" - "time" - - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/dynamic/dynamicinformer" - dynamicfake "k8s.io/client-go/dynamic/fake" - - "github.com/nats-io/nats-server/v2/server" - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/assert" - - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" - pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" -) - -type Test struct { - logger *logrus.Logger - natsConfig *env.NatsConfig - natsServer *server.Server - collector *metrics.Collector - natsURL string - healthEndpoint string -} - -func (test *Test) init() { - port := testingutils.GeneratePortOrDie() - natsPort := testingutils.GeneratePortOrDie() - - test.logger = logrus.New() - test.natsConfig = newEnvConfig(port, natsPort) - test.natsServer = testingutils.StartNatsServer() - test.collector = metrics.NewCollector() - test.natsURL = test.natsServer.ClientURL() - test.healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) -} - -func (test *Test) setupResources(t *testing.T, subscription *eventingv1alpha1.Subscription, applicationName, eventTypePrefix string) context.CancelFunc { - // set eventTypePrefix - test.natsConfig.LegacyEventTypePrefix = eventTypePrefix - - // a cancelable context to be used - ctx, cancel := context.WithCancel(context.Background()) - - // configure message receiver - messageReceiver := receiver.NewHTTPMessageReceiver(test.natsConfig.Port) - assert.NotNil(t, messageReceiver) - - // connect to nats - bc := pkgnats.NewBackendConnection(test.natsURL, true, 3, time.Second) - err := bc.Connect() - assert.Nil(t, err) - assert.NotNil(t, bc.Connection) - - // create a Nats sender - msgSender := sender.NewNatsMessageSender(ctx, bc, test.logger) - assert.NotNil(t, msgSender) - - // configure legacyTransformer - appLister := handlertest.NewApplicationListerOrDie(ctx, applicationName) - legacyTransformer := legacy.NewTransformer( - test.natsConfig.ToConfig().BEBNamespace, - test.natsConfig.ToConfig().EventTypePrefix, - appLister, - ) - - // Setting up fake informers - scheme := runtime.NewScheme() - if err := corev1.AddToScheme(scheme); err != nil { - t.Fatalf("failed to add corev1 to scheme: %v", err) - } - if err := eventingv1alpha1.AddToScheme(scheme); err != nil { - t.Fatalf("failed to add eventing v1alpha1 to scheme: %v", err) - } - - // Configuring fake dynamic client - dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) - - dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, 10*time.Second, v1.NamespaceAll, nil) - genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) - t.Logf("Waiting for cache to resync") - informers.WaitForCacheSyncOrDie(ctx, dFilteredSharedInfFactory) - t.Logf("Informers resynced successfully") - subLister := genericInf.Lister() - subscribedProcessor := &subscribed.Processor{ - SubscriptionLister: &subLister, - Config: test.natsConfig.ToConfig(), - Logger: logrus.New(), - } - - // start handler which blocks until it receives a shutdown signal - opts := &options.Options{MaxRequestSize: 65536} - natsHandler := NewHandler(messageReceiver, msgSender, test.natsConfig.RequestTimeout, legacyTransformer, opts, subscribedProcessor, test.logger, test.collector) - assert.NotNil(t, natsHandler) - go func() { - if err := natsHandler.Start(ctx); err != nil { - t.Errorf("Failed to start handler with error: %v", err) - } - }() - - // wait that the embedded servers are started - testingutils.WaitForHandlerToStart(t, test.healthEndpoint) - - return cancel -} - -func (test *Test) cleanup() { - test.natsServer.Shutdown() -} - -var test = Test{} - -func TestMain(m *testing.M) { - test.init() - code := m.Run() - test.cleanup() - os.Exit(code) -} - -func TestNatsHandlerForCloudEvents(t *testing.T) { - exec := func(t *testing.T, applicationName, expectedNatsSubject, eventTypePrefix, eventType string) { - test.logger.Info("TestNatsHandlerForCloudEvents started") - - // setup test environment - publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", test.natsConfig.Port) - subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, eventType)) - cancel := test.setupResources(t, subscription, applicationName, eventTypePrefix) - defer cancel() - - // prepare event type from subscription - assert.NotNil(t, subscription.Spec.Filter) - assert.NotEmpty(t, subscription.Spec.Filter.Filters) - eventTypeToSubscribe := subscription.Spec.Filter.Filters[0].EventType.Value - - // connect to nats - bc := pkgnats.NewBackendConnection(test.natsURL, true, 3, time.Second) - err := bc.Connect() - assert.Nil(t, err) - assert.NotNil(t, bc.Connection) - - // publish a message to NATS and validate it - validator := testingutils.ValidateNatsSubjectOrFail(t, expectedNatsSubject) - testingutils.SubscribeToEventOrFail(t, bc.Connection, eventTypeToSubscribe, validator) - - // nolint:scopelint - // run the tests for publishing cloudevents - for _, testCase := range handlertest.TestCasesForCloudEvents { - t.Run(testCase.Name, func(t *testing.T) { - body, headers := testCase.ProvideMessage() - resp, err := testingutils.SendEvent(publishEndpoint, body, headers) - if err != nil { - t.Errorf("Failed to send event with error: %v", err) - } - _ = resp.Body.Close() - if testCase.WantStatusCode != resp.StatusCode { - t.Errorf("Test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) - } - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, test.collector) - } - }) - } - } - - // make sure not to change the cloudevent, even if its event-type contains none-alphanumeric characters or the event-type-prefix is empty - exec(t, testingutils.ApplicationName, testingutils.CloudEventTypeNotClean, testingutils.MessagingEventTypePrefix, testingutils.CloudEventTypeNotClean) - exec(t, testingutils.ApplicationName, testingutils.CloudEventTypeNotClean, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypeNotCleanPrefixEmpty) - exec(t, testingutils.ApplicationNameNotClean, testingutils.CloudEventTypeNotClean, testingutils.MessagingEventTypePrefix, testingutils.CloudEventTypeNotClean) - exec(t, testingutils.ApplicationNameNotClean, testingutils.CloudEventTypeNotClean, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypeNotCleanPrefixEmpty) -} - -func TestNatsHandlerForLegacyEvents(t *testing.T) { - exec := func(t *testing.T, applicationName string, expectedNatsSubject, eventTypePrefix, eventType string) { - test.logger.Info("TestNatsHandlerForLegacyEvents started") - - // setup test environment - publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/%s/v1/events", test.natsConfig.Port, applicationName) - subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, eventType)) - cancel := test.setupResources(t, subscription, applicationName, eventTypePrefix) - defer cancel() - - // prepare event type from subscription - assert.NotNil(t, subscription.Spec.Filter) - assert.NotEmpty(t, subscription.Spec.Filter.Filters) - eventTypeToSubscribe := subscription.Spec.Filter.Filters[0].EventType.Value - - // connect to nats - bc := pkgnats.NewBackendConnection(test.natsURL, true, 3, time.Second) - err := bc.Connect() - assert.Nil(t, err) - assert.NotNil(t, bc.Connection) - - // publish a message to NATS and validate it - validator := testingutils.ValidateNatsSubjectOrFail(t, expectedNatsSubject) - testingutils.SubscribeToEventOrFail(t, bc.Connection, eventTypeToSubscribe, validator) - - // nolint:scopelint - // run the tests for publishing legacy events - for _, testCase := range handlertest.TestCasesForLegacyEvents { - t.Run(testCase.Name, func(t *testing.T) { - body, headers := testCase.ProvideMessage() - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - if err != nil { - t.Fatalf("Failed to send event with error: %v", err) - } - - if testCase.WantStatusCode != resp.StatusCode { - t.Fatalf("Test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) - } - - if testCase.WantStatusCode == http.StatusOK { - handlertest.ValidateOkResponse(t, *resp, &testCase.WantResponse) - } else { - handlertest.ValidateErrorResponse(t, *resp, &testCase.WantResponse) - } - - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, test.collector) - } - }) - } - } - - // make sure to clean the legacy event, so that its event-type is free from none-alphanumeric characters - exec(t, testingutils.ApplicationName, testingutils.CloudEventType, testingutils.MessagingEventTypePrefix, testingutils.CloudEventTypeNotClean) - exec(t, testingutils.ApplicationName, testingutils.CloudEventType, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypeNotCleanPrefixEmpty) - exec(t, testingutils.ApplicationNameNotClean, testingutils.CloudEventType, testingutils.MessagingEventTypePrefix, testingutils.CloudEventTypeNotClean) - exec(t, testingutils.ApplicationNameNotClean, testingutils.CloudEventType, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypeNotCleanPrefixEmpty) -} - -func TestNatsHandlerForSubscribedEndpoint(t *testing.T) { - test.logger.Info("TestNatsHandlerForSubscribedEndpoint started") - - exec := func(eventTypePrefix, eventType string) { - // setup test environment - subscribedEndpointFormat := "http://localhost:%d/%s/v1/events/subscribed" - subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, eventType)) - cancel := test.setupResources(t, subscription, testingutils.ApplicationName, eventTypePrefix) - defer cancel() - - // nolint:scopelint - // run the tests for subscribed endpoint - for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { - t.Run(testCase.Name, func(t *testing.T) { - subscribedURL := fmt.Sprintf(subscribedEndpointFormat, test.natsConfig.Port, testCase.AppName) - resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) - if err != nil { - t.Fatalf("failed to send event with error: %v", err) - } - - if testCase.WantStatusCode != resp.StatusCode { - t.Fatalf("test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) - } - defer func() { _ = resp.Body.Close() }() - respBodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Errorf("failed to convert body to bytes: %v", err) - } - gotEventsResponse := subscribed.Events{} - err = json.Unmarshal(respBodyBytes, &gotEventsResponse) - if err != nil { - t.Errorf("failed to unmarshal body bytes to events response: %v", err) - } - if !reflect.DeepEqual(testCase.WantResponse, gotEventsResponse) { - t.Errorf("incorrect response, wanted: %v, got: %v", testCase.WantResponse, gotEventsResponse) - } - }) - } - } - - exec(testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) - exec(testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) -} - -func newEnvConfig(port, natsPort int) *env.NatsConfig { - return &env.NatsConfig{ - Port: port, - URL: fmt.Sprintf("http://localhost:%d", natsPort), - RequestTimeout: 2 * time.Second, - LegacyNamespace: testingutils.MessagingNamespace, - LegacyEventTypePrefix: testingutils.MessagingEventTypePrefix, - } -} diff --git a/pkg/handler/nats/health.go b/pkg/handler/nats/health.go index ba170c5..b2b8bfa 100644 --- a/pkg/handler/nats/health.go +++ b/pkg/handler/nats/health.go @@ -3,9 +3,9 @@ package nats import ( "net/http" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" - "github.com/nats-io/nats.go" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" ) // ReadinessCheck returns an instance of http.HandlerFunc that checks the readiness of the given NATS Handler. diff --git a/pkg/handler/nats/health_test.go b/pkg/handler/nats/health_test.go index 5b946e4..c91b2a6 100644 --- a/pkg/handler/nats/health_test.go +++ b/pkg/handler/nats/health_test.go @@ -6,11 +6,10 @@ import ( "net/http/httptest" "testing" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats/mock" ) @@ -43,7 +42,7 @@ func TestReadinessCheck(t *testing.T) { }() handlerMock := mock.StartOrDie(context.TODO(), t) - defer handlerMock.ShutdownNatsServer() + defer handlerMock.ShutdownNatsServerAndWait() var handler http.HandlerFunc if tc.wantPanicForNilHandler { diff --git a/pkg/handler/nats/mock/mock.go b/pkg/handler/nats/mock/mock.go index 6a7893e..acd8d64 100644 --- a/pkg/handler/nats/mock/mock.go +++ b/pkg/handler/nats/mock/mock.go @@ -6,13 +6,20 @@ import ( "testing" "time" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/dynamic/dynamicinformer" + dynamicfake "k8s.io/client-go/dynamic/fake" + "github.com/nats-io/nats-server/v2/server" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" @@ -21,6 +28,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) // NatsHandlerMock represents a mock for the nats.Handler. @@ -50,7 +58,7 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) * readinessEndpoint: fmt.Sprintf("http://localhost:%d%s", port, health.ReadinessURI), logger: logrus.New(), natsServer: testingutils.StartNatsServer(), - natsConfig: &env.NatsConfig{Port: port}, + natsConfig: newNatsConfig(port), collector: metrics.NewCollector(), legacyTransformer: &legacy.Transformer{}, subscribedProcessor: &subscribed.Processor{}, @@ -62,11 +70,10 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) * msgReceiver := receiver.NewHTTPMessageReceiver(mock.natsConfig.Port) - backendConnection := pkgnats.NewBackendConnection(mock.GetNatsURL(), true, 3, time.Second) - err := backendConnection.Connect() + connection, err := pkgnats.Connect(mock.GetNatsURL(), true, 3, time.Second) require.NoError(t, err) - msgSender := sender.NewNatsMessageSender(ctx, backendConnection, mock.logger) + msgSender := sender.NewNatsMessageSender(ctx, connection, mock.logger) mock.handler = nats.NewHandler( msgReceiver, @@ -85,9 +92,10 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) * return mock } -// ShutdownNatsServer shuts down the NATS server used by the NatsHandlerMock. -func (m *NatsHandlerMock) ShutdownNatsServer() { +// ShutdownNatsServerAndWait shuts down the NATS server used by the NatsHandlerMock and waits for the shutdown. +func (m *NatsHandlerMock) ShutdownNatsServerAndWait() { m.natsServer.Shutdown() + m.natsServer.WaitForShutdown() } // GetNatsURL returns the NATS server URL used by the NatsHandlerMock. @@ -109,3 +117,50 @@ func (m *NatsHandlerMock) GetReadinessEndpoint() string { func (m *NatsHandlerMock) GetHandler() *nats.Handler { return m.handler } + +// GetMetricsCollector returns the metrics.Collector used by the NatsHandlerMock. +func (m *NatsHandlerMock) GetMetricsCollector() *metrics.Collector { + return m.collector +} + +// GetNatsConfig returns the env.NatsConfig used by the NatsHandlerMock. +func (m *NatsHandlerMock) GetNatsConfig() *env.NatsConfig { + return m.natsConfig +} + +// WithSubscription returns NatsHandlerMockOpt which sets the subscribed.Processor for the given NatsHandlerMock. +func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Subscription, eventTypePrefix string) NatsHandlerMockOpt { + return func(m *NatsHandlerMock) { + m.natsConfig.LegacyEventTypePrefix = eventTypePrefix + dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) + dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, 10*time.Second, v1.NamespaceAll, nil) + genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) + informers.WaitForCacheSyncOrDie(m.ctx, dFilteredSharedInfFactory) + subLister := genericInf.Lister() + m.subscribedProcessor = &subscribed.Processor{ + SubscriptionLister: &subLister, + Config: m.natsConfig.ToConfig(), + Logger: logrus.New(), + } + } +} + +// WithApplication returns NatsHandlerMockOpt which sets the legacy.Transformer for the given NatsHandlerMock. +func WithApplication(applicationName string) NatsHandlerMockOpt { + return func(m *NatsHandlerMock) { + appLister := handlertest.NewApplicationListerOrDie(m.ctx, applicationName) + m.legacyTransformer = legacy.NewTransformer( + m.natsConfig.ToConfig().BEBNamespace, + m.natsConfig.ToConfig().EventTypePrefix, + appLister, + ) + } +} + +func newNatsConfig(port int) *env.NatsConfig { + return &env.NatsConfig{ + Port: port, + LegacyNamespace: testingutils.MessagingNamespace, + LegacyEventTypePrefix: testingutils.MessagingEventTypePrefix, + } +} diff --git a/pkg/nats/connect.go b/pkg/nats/connect.go index 3903289..cbaa0c9 100644 --- a/pkg/nats/connect.go +++ b/pkg/nats/connect.go @@ -7,45 +7,21 @@ import ( "github.com/nats-io/nats.go" ) -type connectionData struct { - url string - retry bool - reconnects int - wait time.Duration -} - -type BackendConnection struct { - connectionData connectionData - Connection *nats.Conn -} - -// NewBackendConnection returns a new NewNatsConnection instance with the given NATS connection data. -func NewBackendConnection(url string, retry bool, reconnects int, wait time.Duration) *BackendConnection { - return &BackendConnection{ - connectionData: connectionData{ - url: url, - retry: retry, - reconnects: reconnects, - wait: wait, - }, - } -} - // Connect returns a NATS connection that is ready for use, or an error if connection to the NATS server failed. // It uses the nats.Connect function which is thread-safe. -func (bc *BackendConnection) Connect() (err error) { - bc.Connection, err = nats.Connect(bc.connectionData.url, - nats.RetryOnFailedConnect(bc.connectionData.retry), - nats.MaxReconnects(bc.connectionData.reconnects), - nats.ReconnectWait(bc.connectionData.wait), +func Connect(url string, retry bool, reconnects int, wait time.Duration) (*nats.Conn, error) { + connection, err := nats.Connect(url, + nats.RetryOnFailedConnect(retry), + nats.MaxReconnects(reconnects), + nats.ReconnectWait(wait), ) if err != nil { - return err + return nil, err } - if status := bc.Connection.Status(); status != nats.CONNECTED { - return fmt.Errorf("cannot connect to NATS server, status: %v", status) + if status := connection.Status(); status != nats.CONNECTED { + return nil, fmt.Errorf("NATS connection not connected with status:%v", status) } - return nil + return connection, err } diff --git a/pkg/nats/connect_test.go b/pkg/nats/connect_test.go index d925cf8..75af214 100644 --- a/pkg/nats/connect_test.go +++ b/pkg/nats/connect_test.go @@ -1,22 +1,54 @@ -package nats +package nats_test import ( "testing" + "time" - publishertesting "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" "github.com/nats-io/nats.go" "github.com/stretchr/testify/assert" + + pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" + publishertesting "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) -func TestConnectToNats(t *testing.T) { - natsServer := publishertesting.StartNatsServer() - assert.NotNil(t, natsServer) - assert.NotEmpty(t, natsServer.ClientURL()) - defer natsServer.Shutdown() +func TestConnect(t *testing.T) { + testCases := []struct { + name string + wantRetryOnFailedConnect bool + wantMaxReconnect int + wantReconnectWait time.Duration + }{ + { + name: "do not retry failed connections", + wantRetryOnFailedConnect: false, + wantMaxReconnect: 0, + wantReconnectWait: time.Millisecond, + }, + { + name: "keep retrying failed connections", + wantRetryOnFailedConnect: true, + wantMaxReconnect: -1, + wantReconnectWait: time.Millisecond, + }, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + natsServer := publishertesting.StartNatsServer() + assert.NotNil(t, natsServer) + defer natsServer.Shutdown() + + clientURL := natsServer.ClientURL() + assert.NotEmpty(t, clientURL) + + connection, err := pkgnats.Connect(clientURL, tc.wantRetryOnFailedConnect, tc.wantMaxReconnect, tc.wantReconnectWait) + assert.Nil(t, err) + assert.NotNil(t, connection) - bc := NewBackendConnection(natsServer.ClientURL(), true, 1, 3) - err := bc.Connect() - assert.Nil(t, err) - assert.NotNil(t, bc.Connection) - assert.Equal(t, bc.Connection.Status(), nats.CONNECTED) + assert.Equal(t, connection.Status(), nats.CONNECTED) + assert.Equal(t, clientURL, connection.Opts.Servers[0]) + assert.Equal(t, tc.wantRetryOnFailedConnect, connection.Opts.RetryOnFailedConnect) + assert.Equal(t, tc.wantMaxReconnect, connection.Opts.MaxReconnect) + assert.Equal(t, tc.wantReconnectWait, connection.Opts.ReconnectWait) + }) + } } diff --git a/pkg/sender/nats.go b/pkg/sender/nats.go index 4ec0cd2..f7ee5d0 100644 --- a/pkg/sender/nats.go +++ b/pkg/sender/nats.go @@ -10,8 +10,6 @@ import ( "github.com/cloudevents/sdk-go/v2/event" "github.com/nats-io/nats.go" "github.com/sirupsen/logrus" - - pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" ) // compile time check @@ -23,19 +21,19 @@ type GenericSender interface { // NatsMessageSender is responsible for sending messages over HTTP. type NatsMessageSender struct { - ctx context.Context - logger *logrus.Logger - backendConnection *pkgnats.BackendConnection + ctx context.Context + logger *logrus.Logger + connection *nats.Conn } // NewNatsMessageSender returns a new NewNatsMessageSender instance with the given nats connection. -func NewNatsMessageSender(ctx context.Context, bc *pkgnats.BackendConnection, logger *logrus.Logger) *NatsMessageSender { - return &NatsMessageSender{ctx: ctx, backendConnection: bc, logger: logger} +func NewNatsMessageSender(ctx context.Context, connection *nats.Conn, logger *logrus.Logger) *NatsMessageSender { + return &NatsMessageSender{ctx: ctx, connection: connection, logger: logger} } // ConnectionStatus returns nats.Status for the NATS connection used by the NatsMessageSender. func (s *NatsMessageSender) ConnectionStatus() nats.Status { - return s.backendConnection.Connection.Status() + return s.connection.Status() } // Send dispatches the event.Event to NATS server. @@ -45,7 +43,7 @@ func (s *NatsMessageSender) Send(ctx context.Context, event *event.Event) (int, return http.StatusBadGateway, errors.New("connection status: no connection to NATS server") } - sender, err := cenats.NewSenderFromConn(s.backendConnection.Connection, event.Type()) + sender, err := cenats.NewSenderFromConn(s.connection, event.Type()) if err != nil { return http.StatusInternalServerError, err } diff --git a/pkg/sender/nats_test.go b/pkg/sender/nats_test.go index f66ddbb..aa569e7 100644 --- a/pkg/sender/nats_test.go +++ b/pkg/sender/nats_test.go @@ -17,43 +17,42 @@ import ( ) func TestNatsMessageSender(t *testing.T) { + t.Parallel() + testCases := []struct { - name string - givenNatsServerShutdown bool - wantError bool - wantStatusCode int + name string + givenNatsConnectionClosed bool + wantError bool + wantStatusCode int }{ { - name: "Send should succeed if NATS connection is open", - givenNatsServerShutdown: false, - wantError: false, - wantStatusCode: http.StatusNoContent, + name: "send should succeed if NATS connection is open", + givenNatsConnectionClosed: false, + wantError: false, + wantStatusCode: http.StatusNoContent, }, { - name: "Send should fail if NATS connection is not open", - givenNatsServerShutdown: true, - wantError: true, - wantStatusCode: http.StatusBadGateway, + name: "send should fail if NATS connection is not open", + givenNatsConnectionClosed: true, + wantError: true, + wantStatusCode: http.StatusBadGateway, }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { + t.Parallel() + natsServer := testingutils.StartNatsServer() assert.NotNil(t, natsServer) defer natsServer.Shutdown() - bc := pkgnats.NewBackendConnection(natsServer.ClientURL(), true, 1, time.Second) - err := bc.Connect() + connection, err := pkgnats.Connect(natsServer.ClientURL(), true, 1, time.Second) assert.NoError(t, err) - assert.NotNil(t, bc.Connection) - - if tc.givenNatsServerShutdown { - natsServer.Shutdown() - } + assert.NotNil(t, connection) receive := make(chan bool, 1) validator := testingutils.ValidateNatsMessageDataOrFail(t, fmt.Sprintf(`"%s"`, testingutils.CloudEventData), receive) - testingutils.SubscribeToEventOrFail(t, bc.Connection, testingutils.CloudEventType, validator) + testingutils.SubscribeToEventOrFail(t, connection, testingutils.CloudEventType, validator) ce := testingutils.StructuredCloudEventPayloadWithCleanEventType event := cloudevents.NewEvent() @@ -62,13 +61,17 @@ func TestNatsMessageSender(t *testing.T) { assert.NoError(t, err) ctx := context.Background() - sender := NewNatsMessageSender(context.Background(), bc, logrus.New()) + sender := NewNatsMessageSender(context.Background(), connection, logrus.New()) + + if tc.givenNatsConnectionClosed { + connection.Close() + } status, err := sender.Send(ctx, &event) assert.Equal(t, tc.wantError, err != nil) - assert.Equal(t, status, tc.wantStatusCode) + assert.Equal(t, tc.wantStatusCode, status) - err = testingutils.WaitForChannelOrTimeout(receive, time.Second*3) + err = testingutils.WaitForChannelOrTimeout(receive, time.Millisecond*5) assert.Equal(t, tc.wantError, err != nil) }) } From 1c6ef166654db2254de44eb762fddf4a397586d3 Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Wed, 9 Mar 2022 16:34:17 +0100 Subject: [PATCH 047/194] Refactor Event publisher proxy tests (#13549) * Refactor BEB handler tests * Update publisher image * Fix test parallelism and remove not needed nolint annotations * Refactor ok and error response validators for legacy events * Move TestIsARequestWithLegacyEvent under its correct package --- pkg/handler/beb/handler_health_test.go | 42 ++ pkg/handler/beb/handler_integration_test.go | 446 ++++++++++++++++ pkg/handler/beb/handler_test.go | 526 ------------------- pkg/handler/beb/mock/mock.go | 189 +++++++ pkg/handler/common_test.go | 69 +++ pkg/handler/handlertest/handlertest.go | 68 +-- pkg/handler/health/health_test.go | 3 + pkg/handler/nats/handler_health_test.go | 3 + pkg/handler/nats/handler_integration_test.go | 19 +- pkg/handler/nats/health_test.go | 3 + pkg/legacy-events/helpers_test.go | 3 + pkg/legacy-events/legacy_test.go | 9 + pkg/nats/connect_test.go | 3 + pkg/oauth/client_test.go | 2 +- pkg/sender/nats_test.go | 1 + pkg/subscribed/helpers_test.go | 9 + pkg/tracing/helpers_test.go | 3 + testing/utils.go | 24 - 18 files changed, 819 insertions(+), 603 deletions(-) create mode 100644 pkg/handler/beb/handler_health_test.go create mode 100644 pkg/handler/beb/handler_integration_test.go delete mode 100644 pkg/handler/beb/handler_test.go create mode 100644 pkg/handler/beb/mock/mock.go create mode 100644 pkg/handler/common_test.go diff --git a/pkg/handler/beb/handler_health_test.go b/pkg/handler/beb/handler_health_test.go new file mode 100644 index 0000000..51d43d0 --- /dev/null +++ b/pkg/handler/beb/handler_health_test.go @@ -0,0 +1,42 @@ +package beb_test + +import ( + "context" + "testing" + "time" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/beb/mock" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" +) + +func TestHandlerHealth(t *testing.T) { + var ( + requestSize = bigRequestSize + eventsEndpoint = defaultEventsEndpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + ) + testCases := []struct { + name string + wantLivenessStatusCode int + wantReadinessStatusCode int + }{ + { + name: "beb handler is healthy", + wantLivenessStatusCode: health.StatusCodeHealthy, + wantReadinessStatusCode: health.StatusCodeHealthy, + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, testingutils.MessagingEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) + defer handlerMock.Close() + + testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetLivenessEndpoint(), tc.wantLivenessStatusCode) + testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetReadinessEndpoint(), tc.wantReadinessStatusCode) + }) + } +} diff --git a/pkg/handler/beb/handler_integration_test.go b/pkg/handler/beb/handler_integration_test.go new file mode 100644 index 0000000..73e37eb --- /dev/null +++ b/pkg/handler/beb/handler_integration_test.go @@ -0,0 +1,446 @@ +package beb_test + +import ( + "context" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "testing" + "time" + + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + + "github.com/stretchr/testify/require" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/beb/mock" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" + legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" +) + +const ( + // mock server endpoints + defaultEventsEndpoint = "/events" + defaultEventsHTTP400Endpoint = "/events400" + + // request size + smallRequestSize = 2 + bigRequestSize = 65536 + + publishEndpointFormat = "http://localhost:%d/publish" + publishLegacyEndpointFormat = "http://localhost:%d/%s/v1/events" + subscribedEndpointFormat = "http://localhost:%d/%s/v1/events/subscribed" +) + +func TestHandlerForCloudEvents(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + givenEventTypePrefix string + givenApplicationNameToCreate string + givenApplicationNameToValidate string + }{ + { + name: "With prefix and clean application name", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenApplicationNameToCreate: testingutils.ApplicationName, + givenApplicationNameToValidate: testingutils.ApplicationNameNotClean, + }, + { + name: "With empty prefix and clean application name", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenApplicationNameToCreate: testingutils.ApplicationName, + givenApplicationNameToValidate: testingutils.ApplicationNameNotClean, + }, + { + name: "With prefix and not-clean application name", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, + givenApplicationNameToValidate: testingutils.ApplicationNameNotClean, + }, + { + name: "With empty prefix and not-clean application name", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, + givenApplicationNameToValidate: testingutils.ApplicationNameNotClean, + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + var ( + requestSize = bigRequestSize + eventsEndpoint = defaultEventsEndpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + ) + + handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, + mock.WithApplication(tc.givenApplicationNameToCreate, tc.givenApplicationNameToValidate), + ) + defer handlerMock.Close() + publishEndpoint := fmt.Sprintf(publishEndpointFormat, handlerMock.GetPort()) + + for _, testCase := range handlertest.TestCasesForCloudEvents { + testCase := testCase + t.Run(testCase.Name, func(t *testing.T) { + body, headers := testCase.ProvideMessage() + resp, err := testingutils.SendEvent(publishEndpoint, body, headers) + require.NoError(t, err) + _ = resp.Body.Close() + require.Equal(t, testCase.WantStatusCode, resp.StatusCode) + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) + } + }) + } + }) + } +} + +func TestHandlerForLegacyEvents(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + givenEventTypePrefix string + givenApplicationNameToCreate string + givenApplicationNameToValidate string + }{ + { + name: "With prefix and clean application name", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenApplicationNameToCreate: testingutils.ApplicationName, + givenApplicationNameToValidate: testingutils.ApplicationName, + }, + { + name: "With empty prefix and clean application name", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenApplicationNameToCreate: testingutils.ApplicationName, + givenApplicationNameToValidate: testingutils.ApplicationName, + }, + { + name: "With prefix and not-clean application name", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, + givenApplicationNameToValidate: testingutils.ApplicationName, + }, + { + name: "With empty prefix and not-clean application name", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, + givenApplicationNameToValidate: testingutils.ApplicationName, + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + var ( + requestSize = bigRequestSize + eventsEndpoint = defaultEventsEndpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + ) + + handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, + mock.WithApplication(tc.givenApplicationNameToCreate, tc.givenApplicationNameToValidate), + ) + defer handlerMock.Close() + publishLegacyEndpoint := fmt.Sprintf(publishLegacyEndpointFormat, handlerMock.GetPort(), tc.givenApplicationNameToCreate) + + for _, testCase := range handlertest.TestCasesForLegacyEvents { + testCase := testCase + t.Run(testCase.Name, func(t *testing.T) { + body, headers := testCase.ProvideMessage() + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + require.NoError(t, err) + require.Equal(t, testCase.WantStatusCode, resp.StatusCode) + if testCase.WantStatusCode == http.StatusOK { + handlertest.ValidateLegacyOkResponse(t, *resp, &testCase.WantResponse) + } else { + handlertest.ValidateLegacyErrorResponse(t, *resp, &testCase.WantResponse) + } + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) + } + }) + } + }) + } +} + +func TestHandlerForBEBFailures(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + givenEventTypePrefix string + }{ + { + name: "With prefix", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + }, + { + name: "With empty prefix", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + var ( + requestSize = bigRequestSize + applicationName = testingutils.ApplicationName + eventsEndpoint = defaultEventsHTTP400Endpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + ) + + handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, + mock.WithApplication(applicationName, applicationName), + ) + defer handlerMock.Close() + publishEndpoint := fmt.Sprintf(publishEndpointFormat, handlerMock.GetPort()) + publishLegacyEndpoint := fmt.Sprintf(publishLegacyEndpointFormat, handlerMock.GetPort(), applicationName) + + innerTestCases := []struct { + name string + provideMessage func() (string, http.Header) + givenEndpoint string + wantStatusCode int + wantResponse legacyapi.PublishEventResponses + }{ + { + name: "Send a legacy event with event-id", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithEventID, testingutils.GetApplicationJSONHeaders() + }, + givenEndpoint: publishLegacyEndpoint, + wantStatusCode: http.StatusBadRequest, + wantResponse: legacyapi.PublishEventResponses{ + Error: &legacyapi.Error{ + Status: 400, + Message: "invalid request"}, + }, + }, + { + name: "Binary CloudEvent is valid with required headers", + provideMessage: func() (string, http.Header) { + return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), testingutils.GetBinaryMessageHeaders() + }, + givenEndpoint: publishEndpoint, + wantStatusCode: http.StatusBadRequest, + }, + } + for _, testCase := range innerTestCases { + testCase := testCase + t.Run(testCase.name, func(t *testing.T) { + body, headers := testCase.provideMessage() + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + require.NoError(t, err) + require.Equal(t, testCase.wantStatusCode, resp.StatusCode) + if testCase.givenEndpoint == publishLegacyEndpoint { + handlertest.ValidateLegacyErrorResponse(t, *resp, &testCase.wantResponse) + } + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) + } + }) + } + }) + } +} + +func TestHandlerForHugeRequests(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + givenEventTypePrefix string + }{ + { + name: "With prefix", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + }, + { + name: "With empty prefix", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + var ( + requestSize = smallRequestSize + applicationName = testingutils.ApplicationName + eventsEndpoint = defaultEventsHTTP400Endpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + ) + + handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, + mock.WithApplication(applicationName, applicationName), + ) + defer handlerMock.Close() + publishLegacyEndpoint := fmt.Sprintf(publishLegacyEndpointFormat, handlerMock.GetPort(), applicationName) + + innerTestCases := []struct { + name string + provideMessage func() (string, http.Header) + givenEndpoint string + wantStatusCode int + }{ + { + name: "Should fail with HTTP 413 with a request which is larger than 2 Bytes as the maximum accepted size is 2 Bytes", + provideMessage: func() (string, http.Header) { + return testingutils.ValidLegacyEventPayloadWithEventID, testingutils.GetApplicationJSONHeaders() + }, + givenEndpoint: publishLegacyEndpoint, + wantStatusCode: http.StatusRequestEntityTooLarge, + }, + { + name: "Should accept a request which is lesser than 2 Bytes as the maximum accepted size is 2 Bytes", + provideMessage: func() (string, http.Header) { + return "{}", testingutils.GetBinaryMessageHeaders() + }, + givenEndpoint: handler.PublishEndpoint, + wantStatusCode: http.StatusBadRequest, + }, + } + for _, testCase := range innerTestCases { + testCase := testCase + t.Run(testCase.name, func(t *testing.T) { + body, headers := testCase.provideMessage() + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + require.NoError(t, err) + require.Equal(t, testCase.wantStatusCode, resp.StatusCode) + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) + } + }) + } + }) + } +} + +func TestHandlerForSubscribedEndpoint(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + givenEventTypePrefix string + givenEventType string + }{ + { + name: "With prefix and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenEventType: testingutils.CloudEventType, + }, + { + name: "With empty prefix and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenEventType: testingutils.CloudEventTypePrefixEmpty, + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + var ( + requestSize = smallRequestSize + eventsEndpoint = defaultEventsHTTP400Endpoint + requestTimeout = time.Second + serverResponseTime = time.Nanosecond + subscribedEndpointFormat = subscribedEndpointFormat + ) + + scheme := runtime.NewScheme() + require.NoError(t, corev1.AddToScheme(scheme)) + require.NoError(t, eventingv1alpha1.AddToScheme(scheme)) + subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, tc.givenEventType)) + + handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, + mock.WithSubscription(scheme, subscription), + ) + defer handlerMock.Close() + + for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { + testCase := testCase + t.Run(testCase.Name, func(t *testing.T) { + subscribedURL := fmt.Sprintf(subscribedEndpointFormat, handlerMock.GetPort(), testCase.AppName) + resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) + require.NoError(t, err) + require.Equal(t, testCase.WantStatusCode, resp.StatusCode) + defer func() { _ = resp.Body.Close() }() + respBodyBytes, err := ioutil.ReadAll(resp.Body) + require.NoError(t, err) + gotEventsResponse := subscribed.Events{} + err = json.Unmarshal(respBodyBytes, &gotEventsResponse) + require.NoError(t, err) + require.Equal(t, testCase.WantResponse, gotEventsResponse) + }) + } + }) + } +} + +func TestHandlerTimeout(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + givenEventTypePrefix string + }{ + { + name: "With prefix", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + }, + { + name: "With empty prefix", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + var ( + requestSize = bigRequestSize + applicationName = testingutils.ApplicationName + eventsEndpoint = defaultEventsHTTP400Endpoint + requestTimeout = time.Nanosecond // short request timeout + serverResponseTime = time.Millisecond // long server response time + ) + + handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, + mock.WithApplication(applicationName, applicationName), + ) + defer handlerMock.Close() + publishEndpoint := fmt.Sprintf(publishEndpointFormat, handlerMock.GetPort()) + + body, headers := testingutils.StructuredCloudEventPayload, testingutils.GetStructuredMessageHeaders() + resp, err := testingutils.SendEvent(publishEndpoint, body, headers) + require.NoError(t, err) + _ = resp.Body.Close() + require.Equal(t, http.StatusInternalServerError, resp.StatusCode) + metricstest.EnsureMetricErrors(t, handlerMock.GetMetricsCollector()) + }) + } +} diff --git a/pkg/handler/beb/handler_test.go b/pkg/handler/beb/handler_test.go deleted file mode 100644 index 2c03f0e..0000000 --- a/pkg/handler/beb/handler_test.go +++ /dev/null @@ -1,526 +0,0 @@ -package beb - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "net/http" - "reflect" - "strings" - "testing" - "time" - - "github.com/cloudevents/sdk-go/v2/binding" - cev2event "github.com/cloudevents/sdk-go/v2/event" - cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/dynamic/dynamicinformer" - dynamicfake "k8s.io/client-go/dynamic/fake" - - "github.com/sirupsen/logrus" - - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" -) - -const ( - // mock server endpoints - defaultTokenEndpoint = "/token" - defaultEventsEndpoint = "/events" - defaultEventsHTTP400Endpoint = "/events400" - - // request size - smallRequestSize = 2 - bigRequestSize = 65536 -) - -func TestHandlerForCloudEvents(t *testing.T) { - t.Parallel() - - exec := func(t *testing.T, applicationName, expectedApplicationName, eventTypePrefix, eventType string) { - var ( - port = testingutils.GeneratePortOrDie() - requestSize = bigRequestSize - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - bebNs = testingutils.MessagingNamespace - eventsEndpoint = defaultEventsEndpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) - ) - - cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, - expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint, - requestTimeout, serverResponseTime) - defer cancel() - defer mockServer.Close() - - // nolint:scopelint - for _, testCase := range handlertest.TestCasesForCloudEvents { - t.Run(testCase.Name, func(tt *testing.T) { - body, headers := testCase.ProvideMessage() - resp, err := testingutils.SendEvent(publishEndpoint, body, headers) - if err != nil { - tt.Fatalf("failed to send event with error: %v", err) - } - _ = resp.Body.Close() - if testCase.WantStatusCode != resp.StatusCode { - tt.Fatalf("Test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) - } - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, collector) - } - }) - } - } - - // make sure not to change the cloudevent, even if its event-type contains none-alphanumeric characters or the event-type-prefix is empty - exec(t, testingutils.ApplicationName, testingutils.ApplicationNameNotClean, testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) - exec(t, testingutils.ApplicationName, testingutils.ApplicationNameNotClean, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) - exec(t, testingutils.ApplicationNameNotClean, testingutils.ApplicationNameNotClean, testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) - exec(t, testingutils.ApplicationNameNotClean, testingutils.ApplicationNameNotClean, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) -} - -func TestHandlerForLegacyEvents(t *testing.T) { - t.Parallel() - - exec := func(t *testing.T, applicationName, expectedApplicationName, eventTypePrefix, eventType string) { - var ( - port = testingutils.GeneratePortOrDie() - requestSize = bigRequestSize - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - bebNs = testingutils.MessagingNamespace - eventsEndpoint = defaultEventsEndpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/%s/v1/events", port, applicationName) - ) - - cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, - expectedApplicationName, healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint, - requestTimeout, serverResponseTime) - defer cancel() - defer mockServer.Close() - - // nolint:scopelint - for _, testCase := range handlertest.TestCasesForLegacyEvents { - t.Run(testCase.Name, func(t *testing.T) { - body, headers := testCase.ProvideMessage() - - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - if err != nil { - t.Fatalf("Failed to send event with error: %v", err) - } - - if testCase.WantStatusCode != resp.StatusCode { - t.Fatalf("Test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) - } - - if testCase.WantStatusCode == http.StatusOK { - handlertest.ValidateOkResponse(t, *resp, &testCase.WantResponse) - } else { - handlertest.ValidateErrorResponse(t, *resp, &testCase.WantResponse) - } - - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, collector) - } - }) - } - } - - // make sure to clean the legacy event, so that its event-type is free from none-alphanumeric characters - exec(t, testingutils.ApplicationName, testingutils.ApplicationName, testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) - exec(t, testingutils.ApplicationName, testingutils.ApplicationName, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) - exec(t, testingutils.ApplicationNameNotClean, testingutils.ApplicationName, testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) - exec(t, testingutils.ApplicationNameNotClean, testingutils.ApplicationName, testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) -} - -func TestHandlerForBEBFailures(t *testing.T) { - t.Parallel() - - exec := func(eventTypePrefix, eventType string) { - var ( - port = testingutils.GeneratePortOrDie() - requestSize = bigRequestSize - applicationName = testingutils.ApplicationName - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - bebNs = testingutils.MessagingNamespace - eventsEndpoint = defaultEventsHTTP400Endpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) - publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/%s/v1/events", port, applicationName) - ) - - cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, applicationName, - healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint, requestTimeout, serverResponseTime) - defer cancel() - defer mockServer.Close() - - testCases := []struct { - name string - targetEndpoint string - provideMessage func() (string, http.Header) - endPoint string - wantStatusCode int - wantResponse legacyapi.PublishEventResponses - }{ - { - name: "Send a legacy event with event-id", - provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventID, testingutils.GetApplicationJSONHeaders() - }, - endPoint: publishLegacyEndpoint, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: &legacyapi.Error{ - Status: 400, - Message: "invalid request"}, - }, - }, - { - name: "Binary CloudEvent is valid with required headers", - provideMessage: func() (string, http.Header) { - return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), testingutils.GetBinaryMessageHeaders() - }, - endPoint: publishEndpoint, - wantStatusCode: http.StatusBadRequest, - }, - } - - // nolint:scopelint - for _, testCase := range testCases { - t.Run(testCase.name, func(t *testing.T) { - body, headers := testCase.provideMessage() - _ = legacyapi.PublishEventResponses{} - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - if err != nil { - t.Fatalf("failed to send event with error: %v", err) - } - - if testCase.wantStatusCode != resp.StatusCode { - t.Fatalf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) - } - - if testCase.endPoint == publishLegacyEndpoint { - handlertest.ValidateErrorResponse(t, *resp, &testCase.wantResponse) - } - - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, collector) - } - }) - } - } - - exec(testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) - exec(testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) -} - -func TestHandlerForHugeRequests(t *testing.T) { - t.Parallel() - - exec := func(eventTypePrefix, eventType string) { - var ( - port = testingutils.GeneratePortOrDie() - requestSize = smallRequestSize - applicationName = testingutils.ApplicationName - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - bebNs = testingutils.MessagingNamespace - eventsEndpoint = defaultEventsHTTP400Endpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - publishLegacyEndpoint = fmt.Sprintf("http://localhost:%d/%s/v1/events", port, applicationName) - ) - - cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, applicationName, - healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint, requestTimeout, serverResponseTime) - defer cancel() - defer mockServer.Close() - - testCases := []struct { - name string - targetEndpoint string - provideMessage func() (string, http.Header) - endPoint string - wantStatusCode int - }{ - { - name: "Should fail with HTTP 413 with a request which is larger than 2 Bytes as the maximum accepted size is 2 Bytes", - provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventID, testingutils.GetApplicationJSONHeaders() - }, - endPoint: publishLegacyEndpoint, - wantStatusCode: http.StatusRequestEntityTooLarge, - }, - { - name: "Should accept a request which is lesser than 2 Bytes as the maximum accepted size is 2 Bytes", - provideMessage: func() (string, http.Header) { - return "{}", testingutils.GetBinaryMessageHeaders() - }, - endPoint: handler.PublishEndpoint, - wantStatusCode: http.StatusBadRequest, - }, - } - - // nolint:scopelint - for _, testCase := range testCases { - t.Run(testCase.name, func(t *testing.T) { - body, headers := testCase.provideMessage() - _ = legacyapi.PublishEventResponses{} - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - if err != nil { - t.Fatalf("failed to send event with error: %v", err) - } - - if testCase.wantStatusCode != resp.StatusCode { - t.Fatalf("test failed, want status code:%d but got:%d", testCase.wantStatusCode, resp.StatusCode) - } - - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, collector) - } - }) - } - } - - exec(testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) - exec(testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) -} - -func TestHandlerForSubscribedEndpoint(t *testing.T) { - t.Parallel() - - exec := func(eventTypePrefix, eventType string) { - var ( - port = testingutils.GeneratePortOrDie() - requestSize = smallRequestSize - applicationName = testingutils.ApplicationName - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - bebNs = testingutils.MessagingNamespace - eventsEndpoint = defaultEventsHTTP400Endpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - subscribedEndpointFormat = "http://localhost:%d/%s/v1/events/subscribed" - ) - - cancel, mockServer, _ := setupTestResources(t, port, requestSize, applicationName, applicationName, healthEndpoint, - bebNs, eventTypePrefix, eventType, eventsEndpoint, requestTimeout, serverResponseTime) - defer cancel() - defer mockServer.Close() - - // nolint:scopelint - for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { - t.Run(testCase.Name, func(t *testing.T) { - subscribedURL := fmt.Sprintf(subscribedEndpointFormat, port, testCase.AppName) - resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) - if err != nil { - t.Fatalf("failed to send event with error: %v", err) - } - - if testCase.WantStatusCode != resp.StatusCode { - t.Fatalf("test failed, want status code:%d but got:%d", testCase.WantStatusCode, resp.StatusCode) - } - defer func() { _ = resp.Body.Close() }() - respBodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatalf("failed to convert body to bytes: %v", err) - } - gotEventsResponse := subscribed.Events{} - err = json.Unmarshal(respBodyBytes, &gotEventsResponse) - if err != nil { - t.Fatalf("failed to unmarshal body bytes to events response: %v", err) - } - if !reflect.DeepEqual(testCase.WantResponse, gotEventsResponse) { - t.Fatalf("incorrect response, wanted: %v, got: %v", testCase.WantResponse, gotEventsResponse) - } - }) - } - } - - exec(testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) - exec(testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) -} - -func TestHandlerTimeout(t *testing.T) { - t.Parallel() - - exec := func(eventTypePrefix, eventType string) { - var ( - port = testingutils.GeneratePortOrDie() - requestSize = bigRequestSize - applicationName = testingutils.ApplicationName - healthEndpoint = fmt.Sprintf("http://localhost:%d/healthz", port) - bebNs = testingutils.MessagingNamespace - eventsEndpoint = defaultEventsHTTP400Endpoint - requestTimeout = time.Nanosecond // short request timeout - serverResponseTime = time.Millisecond // long server response time - publishEndpoint = fmt.Sprintf("http://localhost:%d/publish", port) - ) - - cancel, mockServer, collector := setupTestResources(t, port, requestSize, applicationName, applicationName, - healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint, requestTimeout, serverResponseTime) - defer cancel() - defer mockServer.Close() - - body, headers := testingutils.StructuredCloudEventPayload, testingutils.GetStructuredMessageHeaders() - resp, err := testingutils.SendEvent(publishEndpoint, body, headers) - if err != nil { - t.Fatalf("Failed to send event with error: %v", err) - } - _ = resp.Body.Close() - if http.StatusInternalServerError != resp.StatusCode { - t.Fatalf("Test failed, want status code:%d but got:%d", http.StatusInternalServerError, resp.StatusCode) - } - metricstest.EnsureMetricErrors(t, collector) - } - - exec(testingutils.MessagingEventTypePrefix, testingutils.CloudEventType) - exec(testingutils.MessagingEventTypePrefixEmpty, testingutils.CloudEventTypePrefixEmpty) -} - -func TestIsARequestWithLegacyEvent(t *testing.T) { - testCases := []struct { - inputURI string - wantedResult bool - }{ - { - inputURI: "/app/v1/events", - wantedResult: true, - }, - { - inputURI: "///app/v1/events", - wantedResult: true, - }, - { - inputURI: "///app/v1//events", - wantedResult: false, - }, - { - inputURI: "///app/v1/foo/events", - wantedResult: false, - }, - } - - for _, tc := range testCases { - got := handler.IsARequestWithLegacyEvent(tc.inputURI) - if tc.wantedResult != got { - t.Errorf("incorrect result with inputURI: %s, wanted: %v, got: %v", tc.inputURI, tc.wantedResult, got) - } - } -} - -func setupTestResources(t *testing.T, port, maxRequestSize int, applicationName, expectedApplicationName, - healthEndpoint, bebNs, eventTypePrefix, eventType, eventsEndpoint string, requestTimeout, // nolint:unparam - serverResponseTime time.Duration) (context.CancelFunc, *testingutils.MockServer, *metrics.Collector) { - validator := validateApplicationName(expectedApplicationName) - mockServer := testingutils.NewMockServer(testingutils.WithResponseTime(serverResponseTime), testingutils.WithValidator(validator)) - mockServer.Start(t, defaultTokenEndpoint, defaultEventsEndpoint, defaultEventsHTTP400Endpoint) - - ctx, cancel := context.WithCancel(context.Background()) - - emsCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) - authURL := fmt.Sprintf("%s%s", mockServer.URL(), defaultTokenEndpoint) - cfg := testingutils.NewEnvConfig( - emsCEURL, - authURL, - testingutils.WithPort(port), - testingutils.WithBEBNamespace(bebNs), - testingutils.WithRequestTimeout(requestTimeout), - testingutils.WithEventTypePrefix(eventTypePrefix), - ) - client := oauth.NewClient(ctx, cfg) - defer client.CloseIdleConnections() - - msgSender := sender.NewBebMessageSender(emsCEURL, client) - msgReceiver := receiver.NewHTTPMessageReceiver(cfg.Port) - opts := &options.Options{MaxRequestSize: int64(maxRequestSize)} - appLister := handlertest.NewApplicationListerOrDie(ctx, applicationName) - legacyTransformer := legacy.NewTransformer(cfg.BEBNamespace, cfg.EventTypePrefix, appLister) - - // Setting up fake informers - scheme := runtime.NewScheme() - if err := corev1.AddToScheme(scheme); err != nil { - t.Fatalf("failed to add corev1 to scheme: %v", err) - } - if err := eventingv1alpha1.AddToScheme(scheme); err != nil { - t.Fatalf("failed to add eventing v1alpha1 to scheme: %v", err) - } - subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, eventType)) - - // Configuring fake dynamic client - dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) - - dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, - 10*time.Second, - v1.NamespaceAll, - nil, - ) - genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) - t.Logf("Waiting for cache to resync") - informers.WaitForCacheSyncOrDie(ctx, dFilteredSharedInfFactory) - t.Logf("Informers resynced successfully") - subLister := genericInf.Lister() - subscribedProcessor := &subscribed.Processor{ - SubscriptionLister: &subLister, - Config: cfg, - Logger: logrus.New(), - } - - collector := metrics.NewCollector() - msgHandler := NewHandler(msgReceiver, msgSender, cfg.RequestTimeout, legacyTransformer, opts, subscribedProcessor, logrus.New(), collector) - go func() { - if err := msgHandler.Start(ctx); err != nil { - t.Errorf("failed to start handler with error: %v", err) - } - }() - testingutils.WaitForHandlerToStart(t, healthEndpoint) - - return cancel, mockServer, collector -} - -func validateApplicationName(appName string) testingutils.Validator { - return func(r *http.Request) error { - if r.Header.Get(cev2http.ContentType) == cev2event.ApplicationCloudEventsJSON { - // CE structured mode - message := cev2http.NewMessageFromHttpRequest(r) - defer func() { _ = message.Finish(nil) }() - var event *cev2event.Event - var err error - if event, err = binding.ToEvent(context.Background(), message); err != nil { - return err - } - if strings.Contains(event.Type(), appName) { - return nil - } - return fmt.Errorf("expected the event-type [%s] to contain the application name [%s] for structured mode", event.Type(), appName) - } - // Default CE binary mode - value := r.Header.Get(testingutils.CeTypeHeader) - if len(value) == 0 { - return errors.New("event-type header is not found or empty") - } - if !strings.Contains(value, appName) { - return fmt.Errorf("expected the event-type [%s] to contain the application name [%s] for binary mode", value, appName) - } - return nil - } -} diff --git a/pkg/handler/beb/mock/mock.go b/pkg/handler/beb/mock/mock.go new file mode 100644 index 0000000..385aebd --- /dev/null +++ b/pkg/handler/beb/mock/mock.go @@ -0,0 +1,189 @@ +package mock + +import ( + "context" + "errors" + "fmt" + "net/http" + "strings" + "testing" + "time" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/dynamic/dynamicinformer" + dynamicfake "k8s.io/client-go/dynamic/fake" + + "github.com/cloudevents/sdk-go/v2/binding" + cev2event "github.com/cloudevents/sdk-go/v2/event" + cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/beb" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" +) + +const ( + defaultTokenEndpoint = "/token" + defaultEventsEndpoint = "/events" + defaultEventsHTTP400Endpoint = "/events400" +) + +// BebHandlerMock represents a mock for the beb.Handler. +type BebHandlerMock struct { + ctx context.Context + cfg *env.BebConfig + logger *logrus.Logger + collector *metrics.Collector + livenessEndpoint string + readinessEndpoint string + legacyTransformer *legacy.Transformer + subscribedProcessor *subscribed.Processor + mockServer *testingutils.MockServer +} + +// BebHandlerMockOpt represents a BebHandlerMock option. +type BebHandlerMockOpt func(*BebHandlerMock) + +// GetPort returns the port used by the BebHandlerMock. +func (m *BebHandlerMock) GetPort() int { + return m.cfg.Port +} + +// GetMetricsCollector returns the metrics.Collector used by the BebHandlerMock. +func (m *BebHandlerMock) GetMetricsCollector() *metrics.Collector { + return m.collector +} + +// Close closes the testing.MockServer used by the BebHandlerMock. +func (m *BebHandlerMock) Close() { + m.mockServer.Close() +} + +// GetLivenessEndpoint returns the liveness endpoint used by the BebHandlerMock. +func (m *BebHandlerMock) GetLivenessEndpoint() string { + return m.livenessEndpoint +} + +// GetReadinessEndpoint returns the readiness endpoint used by the BebHandlerMock. +func (m *BebHandlerMock) GetReadinessEndpoint() string { + return m.readinessEndpoint +} + +// StartOrDie starts a new BebHandlerMock instance or die if a precondition fails. +// Preconditions: 1) beb.Handler started without errors. +func StartOrDie(ctx context.Context, t *testing.T, requestSize int, eventTypePrefix, eventsEndpoint string, + requestTimeout, serverResponseTime time.Duration, opts ...BebHandlerMockOpt) *BebHandlerMock { + mockServer := testingutils.NewMockServer(testingutils.WithResponseTime(serverResponseTime)) + mockServer.Start(t, defaultTokenEndpoint, defaultEventsEndpoint, defaultEventsHTTP400Endpoint) + + cfg := testingutils.NewEnvConfig( + fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint), + fmt.Sprintf("%s%s", mockServer.URL(), defaultTokenEndpoint), + testingutils.WithPort(testingutils.GeneratePortOrDie()), + testingutils.WithBEBNamespace(testingutils.MessagingNamespace), + testingutils.WithRequestTimeout(requestTimeout), + testingutils.WithEventTypePrefix(eventTypePrefix), + ) + + mock := &BebHandlerMock{ + ctx: ctx, + cfg: cfg, + logger: logrus.New(), + collector: metrics.NewCollector(), + livenessEndpoint: fmt.Sprintf("http://localhost:%d%s", cfg.Port, health.LivenessURI), + readinessEndpoint: fmt.Sprintf("http://localhost:%d%s", cfg.Port, health.ReadinessURI), + legacyTransformer: &legacy.Transformer{}, + subscribedProcessor: &subscribed.Processor{}, + mockServer: mockServer, + } + + for _, opt := range opts { + opt(mock) + } + + client := oauth.NewClient(ctx, mock.cfg) + defer client.CloseIdleConnections() + + msgReceiver := receiver.NewHTTPMessageReceiver(mock.cfg.Port) + msgSender := sender.NewBebMessageSender(mock.cfg.EmsPublishURL, client) + msgHandlerOpts := &options.Options{MaxRequestSize: int64(requestSize)} + msgHandler := beb.NewHandler(msgReceiver, msgSender, mock.cfg.RequestTimeout, mock.legacyTransformer, msgHandlerOpts, mock.subscribedProcessor, mock.logger, mock.collector) + + go func() { require.NoError(t, msgHandler.Start(ctx)) }() + testingutils.WaitForEndpointStatusCodeOrFail(mock.livenessEndpoint, health.StatusCodeHealthy) + + return mock +} + +// validateEventTypeContainsApplicationName extracts the cloud event type from the http.Request and validates that +// it contains the given application name. +func validateEventTypeContainsApplicationName(name string) testingutils.Validator { + return func(r *http.Request) error { + eventType, err := extractEventTypeFromRequest(r) + if err != nil { + return err + } + if !strings.Contains(eventType, name) { + return fmt.Errorf("event-type:%s does not contain application name:%s", eventType, name) + } + return nil + } +} + +// extractEventTypeFromRequest returns the cloud event type from the given http.Request. +func extractEventTypeFromRequest(r *http.Request) (string, error) { + // structured + if r.Header.Get(cev2http.ContentType) == cev2event.ApplicationCloudEventsJSON { + message := cev2http.NewMessageFromHttpRequest(r) + defer func() { _ = message.Finish(nil) }() + event, err := binding.ToEvent(context.Background(), message) + if err != nil { + return "", err + } + return event.Type(), nil + } + + // binary + eventType := r.Header.Get(testingutils.CeTypeHeader) + if strings.TrimSpace(eventType) == "" { + return "", errors.New("event-type header is not found or empty") + } + return eventType, nil +} + +// WithApplication returns BebHandlerMockOpt which sets the subscribed.Processor for the given BebHandlerMock. +func WithApplication(applicationNameToCreate, applicationNameToValidate string) BebHandlerMockOpt { + return func(m *BebHandlerMock) { + applicationLister := handlertest.NewApplicationListerOrDie(m.ctx, applicationNameToCreate) + m.legacyTransformer = legacy.NewTransformer(m.cfg.BEBNamespace, m.cfg.EventTypePrefix, applicationLister) + validator := validateEventTypeContainsApplicationName(applicationNameToValidate) + testingutils.WithValidator(validator)(m.mockServer) + } +} + +// WithSubscription returns BebHandlerMockOpt which sets the subscribed.Processor for the given BebHandlerMock. +func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Subscription) BebHandlerMockOpt { + return func(m *BebHandlerMock) { + dynamicClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) + informerFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicClient, time.Second, v1.NamespaceAll, nil) + genericInformer := informerFactory.ForResource(subscribed.GVR) + informers.WaitForCacheSyncOrDie(m.ctx, informerFactory) + subscriptionLister := genericInformer.Lister() + m.subscribedProcessor = &subscribed.Processor{SubscriptionLister: &subscriptionLister, Config: m.cfg, Logger: m.logger} + } +} diff --git a/pkg/handler/common_test.go b/pkg/handler/common_test.go new file mode 100644 index 0000000..12f38d3 --- /dev/null +++ b/pkg/handler/common_test.go @@ -0,0 +1,69 @@ +package handler + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestIsARequestWithLegacyEvent(t *testing.T) { + t.Parallel() + testCases := []struct { + name string + givenURI string + wantedResult bool + }{ + { + name: "is a legacy endpoint if application name, api version and events endpoint exist", + givenURI: "/app/v1/events", + wantedResult: true, + }, + { + name: "is not a legacy endpoint if application name, api version and events endpoint exist with multiple trailing slashes", + givenURI: "/app/v1/events//", + wantedResult: false, + }, + { + name: "is not a legacy endpoint if application name, api version and events endpoint exist after ", + givenURI: "/test/app/v1/events", + wantedResult: false, + }, + { + name: "is not a legacy endpoint if application name is missing", + givenURI: "/v1/events", + wantedResult: false, + }, + { + name: "is not a legacy endpoint if api version is missing", + givenURI: "/app/events", + wantedResult: false, + }, + { + name: "is not a legacy endpoint if events endpoint is missing", + givenURI: "/app/v1", + wantedResult: false, + }, + { + name: "is not a legacy endpoint if it ends with an endpoint other than events", + givenURI: "/app/v1/events/foo", + wantedResult: false, + }, + { + name: "is not a legacy endpoint if it contains multiple slashes in-between the api version and events endpoint", + givenURI: "/app/v1//events", + wantedResult: false, + }, + { + name: "is not a legacy endpoint if it contains any endpoint in-between the api version and events endpoint", + givenURI: "/app/v1/foo/events", + wantedResult: false, + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + assert.Equal(t, tc.wantedResult, IsARequestWithLegacyEvent(tc.givenURI)) + }) + } +} diff --git a/pkg/handler/handlertest/handlertest.go b/pkg/handler/handlertest/handlertest.go index c1614ca..38613f9 100644 --- a/pkg/handler/handlertest/handlertest.go +++ b/pkg/handler/handlertest/handlertest.go @@ -7,71 +7,45 @@ import ( "fmt" "io/ioutil" "net/http" - "reflect" - "regexp" "testing" + "github.com/stretchr/testify/require" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) -// isValidEventID checks whether EventID is valid or not -func isValidEventID(id string) bool { - return regexp.MustCompile(legacy.AllowedEventIDChars).MatchString(id) -} - -// validateErrorResponse validates Error Response -func ValidateErrorResponse(t *testing.T, resp http.Response, tcWantResponse *legacyapi.PublishEventResponses) { +// ValidateLegacyErrorResponse validates error responses for the legacy events endpoint. +func ValidateLegacyErrorResponse(t *testing.T, resp http.Response, wantResponse *legacyapi.PublishEventResponses) { legacyResponse := legacyapi.PublishEventResponses{} - legacyError := legacyapi.Error{} + legacyErrorResponse := legacyapi.Error{} bodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatalf("failed to read response body: %v", err) - } - if err = json.Unmarshal(bodyBytes, &legacyError); err != nil { - t.Fatalf("failed to unmarshal response body: %v", err) - } - legacyResponse.Error = &legacyError - if !reflect.DeepEqual(tcWantResponse.Error, legacyResponse.Error) { - t.Fatalf("Invalid error, want: %v, got: %v", tcWantResponse.Error, legacyResponse.Error) - } + require.NoError(t, err) + err = json.Unmarshal(bodyBytes, &legacyErrorResponse) + require.NoError(t, err) + legacyResponse.Error = &legacyErrorResponse + require.Equal(t, wantResponse.Error, legacyResponse.Error) + err = resp.Body.Close() + require.NoError(t, err) } -// validateOkResponse validates Ok Response -func ValidateOkResponse(t *testing.T, resp http.Response, tcWantResponse *legacyapi.PublishEventResponses) { - legacyOkResponse := legacyapi.PublishResponse{} +// ValidateLegacyOkResponse validates ok responses for the legacy events endpoint. +func ValidateLegacyOkResponse(t *testing.T, resp http.Response, wantResponse *legacyapi.PublishEventResponses) { legacyResponse := legacyapi.PublishEventResponses{} + legacyOkResponse := legacyapi.PublishResponse{} bodyBytes, err := ioutil.ReadAll(resp.Body) - if err != nil { - t.Fatalf("failed to read response body: %v", err) - } - if err = json.Unmarshal(bodyBytes, &legacyOkResponse); err != nil { - t.Fatalf("failed to unmarshal response body: %v", err) - } + require.NoError(t, err) + err = json.Unmarshal(bodyBytes, &legacyOkResponse) + require.NoError(t, err) legacyResponse.Ok = &legacyOkResponse - if err = resp.Body.Close(); err != nil { - t.Fatalf("failed to close body: %v", err) - } - - if tcWantResponse.Ok.EventID != "" && tcWantResponse.Ok.EventID != legacyResponse.Ok.EventID { - t.Errorf("invalid event-id, want: %v, got: %v", tcWantResponse.Ok.EventID, legacyResponse.Ok.EventID) - } - - if tcWantResponse.Ok.EventID == "" && !isValidEventID(legacyResponse.Ok.EventID) { - t.Errorf("should match regex: [%s] Not a valid event-id: %v ", legacy.AllowedEventIDChars, legacyResponse.Ok.EventID) - } - if tcWantResponse.Ok.Reason != legacyResponse.Ok.Reason { - t.Errorf("invalid reason, want: %v, got: %v", tcWantResponse.Ok.Reason, legacyResponse.Ok.Reason) - } - if tcWantResponse.Ok.Status != legacyResponse.Ok.Status { - t.Errorf("invalid status, want: %v, got: %v", tcWantResponse.Ok.Status, legacyResponse.Ok.Status) - } + require.Equal(t, wantResponse.Error, legacyResponse.Error) + err = resp.Body.Close() + require.NoError(t, err) } // getMissingFieldValidationError generates an Error message for a missing field diff --git a/pkg/handler/health/health_test.go b/pkg/handler/health/health_test.go index 089f032..afa00fe 100644 --- a/pkg/handler/health/health_test.go +++ b/pkg/handler/health/health_test.go @@ -69,7 +69,10 @@ func TestChecker(t *testing.T) { }, } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + defer func() { r := recover() diff --git a/pkg/handler/nats/handler_health_test.go b/pkg/handler/nats/handler_health_test.go index db70ad8..4d5f1fd 100644 --- a/pkg/handler/nats/handler_health_test.go +++ b/pkg/handler/nats/handler_health_test.go @@ -30,7 +30,10 @@ func TestHandlerHealth(t *testing.T) { }, } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + handlerMock := mock.StartOrDie(context.TODO(), t) defer handlerMock.ShutdownNatsServerAndWait() diff --git a/pkg/handler/nats/handler_integration_test.go b/pkg/handler/nats/handler_integration_test.go index ac1ae9c..3630bed 100644 --- a/pkg/handler/nats/handler_integration_test.go +++ b/pkg/handler/nats/handler_integration_test.go @@ -62,7 +62,10 @@ func TestNatsHandlerForCloudEvents(t *testing.T) { }, } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -91,9 +94,9 @@ func TestNatsHandlerForCloudEvents(t *testing.T) { validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantNatsSubject) testingutils.SubscribeToEventOrFail(t, connection, eventTypeToSubscribe, validator) - // nolint:scopelint // run the tests for publishing cloudevents for _, testCase := range handlertest.TestCasesForCloudEvents { + testCase := testCase t.Run(testCase.Name, func(t *testing.T) { body, headers := testCase.ProvideMessage() resp, err := testingutils.SendEvent(publishEndpoint, body, headers) @@ -147,7 +150,10 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { }, } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -174,9 +180,9 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantNatsSubject) testingutils.SubscribeToEventOrFail(t, connection, eventTypeToSubscribe, validator) - // nolint:scopelint // run the tests for publishing legacy events for _, testCase := range handlertest.TestCasesForLegacyEvents { + testCase := testCase t.Run(testCase.Name, func(t *testing.T) { body, headers := testCase.ProvideMessage() resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) @@ -184,9 +190,9 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { require.Equal(t, testCase.WantStatusCode, resp.StatusCode) if testCase.WantStatusCode == http.StatusOK { - handlertest.ValidateOkResponse(t, *resp, &testCase.WantResponse) + handlertest.ValidateLegacyOkResponse(t, *resp, &testCase.WantResponse) } else { - handlertest.ValidateErrorResponse(t, *resp, &testCase.WantResponse) + handlertest.ValidateLegacyErrorResponse(t, *resp, &testCase.WantResponse) } if testingutils.Is2XX(resp.StatusCode) { @@ -216,7 +222,10 @@ func TestNatsHandlerForSubscribedEndpoint(t *testing.T) { }, } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -235,9 +244,9 @@ func TestNatsHandlerForSubscribedEndpoint(t *testing.T) { ) defer handlerMock.ShutdownNatsServerAndWait() - // nolint:scopelint // run the tests for subscribed endpoint for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { + testCase := testCase t.Run(testCase.Name, func(t *testing.T) { subscribedURL := fmt.Sprintf(subscribedEndpointFormat, handlerMock.GetNatsConfig().Port, testCase.AppName) resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) diff --git a/pkg/handler/nats/health_test.go b/pkg/handler/nats/health_test.go index c91b2a6..85ad055 100644 --- a/pkg/handler/nats/health_test.go +++ b/pkg/handler/nats/health_test.go @@ -33,7 +33,10 @@ func TestReadinessCheck(t *testing.T) { }, } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + defer func() { r := recover() if !assert.Equal(t, tc.wantPanicForNilHandler, r != nil) { diff --git a/pkg/legacy-events/helpers_test.go b/pkg/legacy-events/helpers_test.go index 724f9b1..3d7cddb 100644 --- a/pkg/legacy-events/helpers_test.go +++ b/pkg/legacy-events/helpers_test.go @@ -21,7 +21,10 @@ func TestParseApplicationNameFromPath(t *testing.T) { }, } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + gotAppName := ParseApplicationNameFromPath(tc.inputPath) if tc.wantedAppName != gotAppName { t.Errorf("incorrect parsing, wanted: %s, got: %s", tc.wantedAppName, gotAppName) diff --git a/pkg/legacy-events/legacy_test.go b/pkg/legacy-events/legacy_test.go index e44338a..855276b 100644 --- a/pkg/legacy-events/legacy_test.go +++ b/pkg/legacy-events/legacy_test.go @@ -85,7 +85,10 @@ func TestTransformLegacyRequestsToCE(t *testing.T) { } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + ctx, cancel := context.WithCancel(context.Background()) defer cancel() app := applicationtest.NewApplication(tc.appName, applicationTypeLabel(tc.typeLabel)) @@ -214,7 +217,10 @@ func TestCombineEventTypeSegments(t *testing.T) { } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + if gotEventType := combineEventNameSegments(tc.givenEventType); tc.wantEventType != gotEventType { t.Fatalf("invalid event-type want: %s, got: %s", tc.wantEventType, gotEventType) } @@ -250,7 +256,10 @@ func TestRemoveNonAlphanumeric(t *testing.T) { }, } for _, tc := range testCases { + tc := tc t.Run(fmt.Sprintf("%s eventType", tc.name), func(t *testing.T) { + t.Parallel() + actual := removeNonAlphanumeric(tc.givenEventType) if actual != tc.expectedEventType { t.Errorf("invalid eventType; expected: %s, got %s", tc.expectedEventType, actual) diff --git a/pkg/nats/connect_test.go b/pkg/nats/connect_test.go index 75af214..eed7491 100644 --- a/pkg/nats/connect_test.go +++ b/pkg/nats/connect_test.go @@ -32,7 +32,10 @@ func TestConnect(t *testing.T) { }, } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + natsServer := publishertesting.StartNatsServer() assert.NotNil(t, natsServer) defer natsServer.Shutdown() diff --git a/pkg/oauth/client_test.go b/pkg/oauth/client_test.go index 7a523c6..52ac10f 100644 --- a/pkg/oauth/client_test.go +++ b/pkg/oauth/client_test.go @@ -80,8 +80,8 @@ func TestGetToken(t *testing.T) { }, } - // nolint:scopelint for _, test := range testCases { + test := test t.Run(test.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/sender/nats_test.go b/pkg/sender/nats_test.go index aa569e7..111ac4b 100644 --- a/pkg/sender/nats_test.go +++ b/pkg/sender/nats_test.go @@ -39,6 +39,7 @@ func TestNatsMessageSender(t *testing.T) { }, } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() diff --git a/pkg/subscribed/helpers_test.go b/pkg/subscribed/helpers_test.go index 7374398..f9c80af 100644 --- a/pkg/subscribed/helpers_test.go +++ b/pkg/subscribed/helpers_test.go @@ -74,7 +74,10 @@ func TestFilterEventTypeVersions(t *testing.T) { } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + gotEvents := FilterEventTypeVersions(tc.eventTypePrefix, tc.bebNs, tc.appName, tc.filters) if !reflect.DeepEqual(tc.expectedEvents, gotEvents) { t.Errorf("Received incorrect events, Wanted: %v, Got: %v", tc.expectedEvents, gotEvents) @@ -106,7 +109,10 @@ func TestConvertEventsMapToSlice(t *testing.T) { }, } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + gotEvents := ConvertEventsMapToSlice(tc.inputMap) for _, event := range gotEvents { found := false @@ -175,7 +181,10 @@ func TestAddUniqueEventsToResult(t *testing.T) { }, } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + gotUniqEvents := AddUniqueEventsToResult(tc.eventsSubSet, tc.givenUniqEventsAlready) if !reflect.DeepEqual(tc.wantedUniqEvents, gotUniqEvents) { t.Errorf("incorrect unique events, wanted: %v, got: %v", tc.wantedUniqEvents, gotUniqEvents) diff --git a/pkg/tracing/helpers_test.go b/pkg/tracing/helpers_test.go index 7f0b733..b7398ee 100644 --- a/pkg/tracing/helpers_test.go +++ b/pkg/tracing/helpers_test.go @@ -57,7 +57,10 @@ func TestAddTracingContextToCEExtensions(t *testing.T) { } for _, tc := range testCases { + tc := tc t.Run(tc.name, func(t *testing.T) { + t.Parallel() + event := cev2event.New() AddTracingContextToCEExtensions(tc.headers, &event) g.Expect(event.Extensions()).To(Equal(tc.expectedExtensions)) diff --git a/testing/utils.go b/testing/utils.go index 5cc7451..dfab470 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -9,7 +9,6 @@ import ( "net" "net/http" "strconv" - "testing" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -137,29 +136,6 @@ func SubscriptionWithFilter(eventSource, eventType string) SubscriptionOpt { } } -// WaitForHandlerToStart is waits for the test handler to start before testing could start -func WaitForHandlerToStart(t *testing.T, healthEndpoint string) { - timeout := time.After(time.Second * 30) - ticker := time.NewTicker(time.Second * 1) - - for { - select { - case <-timeout: - { - t.Fatal("Failed to start handler") - } - case <-ticker.C: - { - if resp, err := http.Get(healthEndpoint); err != nil { //nolint:gosec - continue - } else if resp.StatusCode == http.StatusOK { - return - } - } - } - } -} - // WaitForEndpointStatusCodeOrFail waits for endpoint status code or timeout. func WaitForEndpointStatusCodeOrFail(endpoint string, statusCode int) { timeout := time.After(time.Second * 30) From 94449d86cf259b3d8dfde43a9d5bf68930a8fc45 Mon Sep 17 00:00:00 2001 From: Nils Seip Date: Fri, 11 Mar 2022 11:58:50 +0100 Subject: [PATCH 048/194] Non-functional improvements in event-publisher-proxy (documentation, testing) (#13247) * Reconnect to NATS server before publishing events if the NATS connection is closed * Trying to reuse the test environment * Use option pattern in setupTestEnvironment * Use subscribeToSubject method * Use table test * Fix tests * More comments * Work together with Friedrich * Remove discussed todos * Use table test fields * Move cleanup to setupTestEnvironment * Rewrite assertion using testify * Use functional option pattern for pkgnats.NewBackendConnection * Rename func opts to reflect struct * Shorten func options * Make url non optional * Rename to Opt * Simplify naming * Small corrections * Use custom PR image * Update components/event-publisher-proxy/pkg/sender/nats_test.go Co-authored-by: Korbinian Stoemmer * Pass varargs correctly to pkgnats.NewConnection * Incorporate review comments from k15r: only send event once and close connection before if required * Shutdown connections * Rename bc/backendConnection to c/Connection * Make assertions visible * Fix linter * Make wants givens in TestConnect * Use GWT in TestConnect * Prevent common goroutine loop problem * Leverage nats.Options for nats wrapper * Use epp from PR * Remove obvious comment from nats tests Co-authored-by: Marco Bebway Co-authored-by: Korbinian Stoemmer --- cmd/event-publisher-proxy/nats/nats.go | 6 ++- pkg/handler/nats/handler_integration_test.go | 12 +++++- pkg/handler/nats/mock/mock.go | 6 ++- pkg/nats/connect.go | 15 +++++--- pkg/nats/connect_test.go | 40 +++++++++++--------- pkg/sender/nats_test.go | 6 ++- testing/nats.go | 5 +++ 7 files changed, 63 insertions(+), 27 deletions(-) diff --git a/cmd/event-publisher-proxy/nats/nats.go b/cmd/event-publisher-proxy/nats/nats.go index 107bf39..e63060a 100644 --- a/cmd/event-publisher-proxy/nats/nats.go +++ b/cmd/event-publisher-proxy/nats/nats.go @@ -64,7 +64,11 @@ func (c *Commander) Start() error { messageReceiver := receiver.NewHTTPMessageReceiver(c.envCfg.Port) // connect to nats - connection, err := pkgnats.Connect(c.envCfg.URL, c.envCfg.RetryOnFailedConnect, c.envCfg.MaxReconnects, c.envCfg.ReconnectWait) + connection, err := pkgnats.Connect(c.envCfg.URL, + pkgnats.WithRetryOnFailedConnect(c.envCfg.RetryOnFailedConnect), + pkgnats.WithMaxReconnects(c.envCfg.MaxReconnects), + pkgnats.WithReconnectWait(c.envCfg.ReconnectWait), + ) if err != nil { c.logger.Errorf("Failed to connect to NATS server with error: %s", err) return err diff --git a/pkg/handler/nats/handler_integration_test.go b/pkg/handler/nats/handler_integration_test.go index 3630bed..200a1e2 100644 --- a/pkg/handler/nats/handler_integration_test.go +++ b/pkg/handler/nats/handler_integration_test.go @@ -86,7 +86,11 @@ func TestNatsHandlerForCloudEvents(t *testing.T) { eventTypeToSubscribe := subscription.Spec.Filter.Filters[0].EventType.Value // connect to nats - connection, err := pkgnats.Connect(handlerMock.GetNatsURL(), true, 3, time.Second) + connection, err := pkgnats.Connect(handlerMock.GetNatsURL(), + pkgnats.WithRetryOnFailedConnect(true), + pkgnats.WithMaxReconnects(3), + pkgnats.WithReconnectWait(time.Second), + ) assert.Nil(t, err) assert.NotNil(t, connection) @@ -172,7 +176,11 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { eventTypeToSubscribe := subscription.Spec.Filter.Filters[0].EventType.Value // connect to nats - connection, err := pkgnats.Connect(handlerMock.GetNatsURL(), true, 3, time.Second) + connection, err := pkgnats.Connect(handlerMock.GetNatsURL(), + pkgnats.WithRetryOnFailedConnect(true), + pkgnats.WithMaxReconnects(3), + pkgnats.WithReconnectWait(time.Second), + ) assert.Nil(t, err) assert.NotNil(t, connection) diff --git a/pkg/handler/nats/mock/mock.go b/pkg/handler/nats/mock/mock.go index acd8d64..17a5845 100644 --- a/pkg/handler/nats/mock/mock.go +++ b/pkg/handler/nats/mock/mock.go @@ -70,7 +70,11 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) * msgReceiver := receiver.NewHTTPMessageReceiver(mock.natsConfig.Port) - connection, err := pkgnats.Connect(mock.GetNatsURL(), true, 3, time.Second) + connection, err := pkgnats.Connect(mock.GetNatsURL(), + pkgnats.WithRetryOnFailedConnect(true), + pkgnats.WithMaxReconnects(3), + pkgnats.WithReconnectWait(time.Second), + ) require.NoError(t, err) msgSender := sender.NewNatsMessageSender(ctx, connection, mock.logger) diff --git a/pkg/nats/connect.go b/pkg/nats/connect.go index cbaa0c9..66dab58 100644 --- a/pkg/nats/connect.go +++ b/pkg/nats/connect.go @@ -2,18 +2,23 @@ package nats import ( "fmt" - "time" "github.com/nats-io/nats.go" ) +type Opt = nats.Option + +var ( + WithRetryOnFailedConnect = nats.RetryOnFailedConnect + WithMaxReconnects = nats.MaxReconnects + WithReconnectWait = nats.ReconnectWait +) + // Connect returns a NATS connection that is ready for use, or an error if connection to the NATS server failed. // It uses the nats.Connect function which is thread-safe. -func Connect(url string, retry bool, reconnects int, wait time.Duration) (*nats.Conn, error) { +func Connect(url string, opts ...Opt) (*nats.Conn, error) { connection, err := nats.Connect(url, - nats.RetryOnFailedConnect(retry), - nats.MaxReconnects(reconnects), - nats.ReconnectWait(wait), + opts..., ) if err != nil { return nil, err diff --git a/pkg/nats/connect_test.go b/pkg/nats/connect_test.go index eed7491..3a2842c 100644 --- a/pkg/nats/connect_test.go +++ b/pkg/nats/connect_test.go @@ -13,29 +13,29 @@ import ( func TestConnect(t *testing.T) { testCases := []struct { - name string - wantRetryOnFailedConnect bool - wantMaxReconnect int - wantReconnectWait time.Duration + name string + givenRetryOnFailedConnect bool + givenMaxReconnect int + givenReconnectWait time.Duration }{ { - name: "do not retry failed connections", - wantRetryOnFailedConnect: false, - wantMaxReconnect: 0, - wantReconnectWait: time.Millisecond, + name: "do not retry failed connections", + givenRetryOnFailedConnect: false, + givenMaxReconnect: 0, + givenReconnectWait: time.Millisecond, }, { - name: "keep retrying failed connections", - wantRetryOnFailedConnect: true, - wantMaxReconnect: -1, - wantReconnectWait: time.Millisecond, + name: "keep retrying failed connections", + givenRetryOnFailedConnect: true, + givenMaxReconnect: -1, + givenReconnectWait: time.Millisecond, }, } for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { + // given t.Parallel() - natsServer := publishertesting.StartNatsServer() assert.NotNil(t, natsServer) defer natsServer.Shutdown() @@ -43,15 +43,21 @@ func TestConnect(t *testing.T) { clientURL := natsServer.ClientURL() assert.NotEmpty(t, clientURL) - connection, err := pkgnats.Connect(clientURL, tc.wantRetryOnFailedConnect, tc.wantMaxReconnect, tc.wantReconnectWait) + // when + connection, err := pkgnats.Connect(clientURL, + pkgnats.WithRetryOnFailedConnect(tc.givenRetryOnFailedConnect), + pkgnats.WithMaxReconnects(tc.givenMaxReconnect), + pkgnats.WithReconnectWait(tc.givenReconnectWait), + ) assert.Nil(t, err) assert.NotNil(t, connection) + // then assert.Equal(t, connection.Status(), nats.CONNECTED) assert.Equal(t, clientURL, connection.Opts.Servers[0]) - assert.Equal(t, tc.wantRetryOnFailedConnect, connection.Opts.RetryOnFailedConnect) - assert.Equal(t, tc.wantMaxReconnect, connection.Opts.MaxReconnect) - assert.Equal(t, tc.wantReconnectWait, connection.Opts.ReconnectWait) + assert.Equal(t, tc.givenRetryOnFailedConnect, connection.Opts.RetryOnFailedConnect) + assert.Equal(t, tc.givenMaxReconnect, connection.Opts.MaxReconnect) + assert.Equal(t, tc.givenReconnectWait, connection.Opts.ReconnectWait) }) } } diff --git a/pkg/sender/nats_test.go b/pkg/sender/nats_test.go index 111ac4b..4dec4af 100644 --- a/pkg/sender/nats_test.go +++ b/pkg/sender/nats_test.go @@ -47,7 +47,11 @@ func TestNatsMessageSender(t *testing.T) { assert.NotNil(t, natsServer) defer natsServer.Shutdown() - connection, err := pkgnats.Connect(natsServer.ClientURL(), true, 1, time.Second) + connection, err := pkgnats.Connect(natsServer.ClientURL(), + pkgnats.WithRetryOnFailedConnect(true), + pkgnats.WithMaxReconnects(1), + pkgnats.WithReconnectWait(time.Second), + ) assert.NoError(t, err) assert.NotNil(t, connection) diff --git a/testing/nats.go b/testing/nats.go index 2d66d44..2d247e9 100644 --- a/testing/nats.go +++ b/testing/nats.go @@ -18,6 +18,8 @@ func StartNatsServer() *server.Server { return test.RunServer(&opts) } +// SubscribeToEventOrFail subscribes to the given eventType using the given NATS connection. +// The received messages are then validated using the given validator. func SubscribeToEventOrFail(t *testing.T, connection *nats.Conn, eventType string, validator nats.MsgHandler) { if _, err := connection.Subscribe(eventType, validator); err != nil { t.Fatalf("Failed to subscribe to event with error: %v", err) @@ -35,6 +37,9 @@ func ValidateNatsSubjectOrFail(t *testing.T, subject string, notify ...chan bool } } +// ValidateNatsMessageDataOrFail returns a function which can be used to validate a nats.Msg. +// It reads the data from nats.Msg and unmarshalls it as a CloudEvent. +// The data section of the CloudEvent is then checked against the value provided in data. func ValidateNatsMessageDataOrFail(t *testing.T, data string, notify ...chan bool) nats.MsgHandler { return func(msg *nats.Msg) { for _, n := range notify { From 8c23cf6635dc50f7f3eec67e5681efce3e7af21a Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Wed, 16 Mar 2022 10:01:14 +0100 Subject: [PATCH 049/194] Support CloudEvents type cleanup while publishing (#13608) * Support Event type cleanup for CloudEvents while publishing * Update publisher and controller images * Update Event type cleanup tests * Simplify parsing Event types. * Refactor legacy events tests to be compliant with code quality guidelines --- cmd/event-publisher-proxy/beb/beb.go | 16 +- cmd/event-publisher-proxy/nats/nats.go | 6 +- internal/httpconsts.go | 8 + pkg/application/clean.go | 14 +- pkg/application/clean_test.go | 8 +- pkg/application/fake/lister.go | 2 +- pkg/application/lister.go | 8 - pkg/cloudevents/eventtype/build.go | 13 + pkg/cloudevents/eventtype/build_test.go | 35 ++ pkg/cloudevents/eventtype/clean.go | 79 +++++ pkg/cloudevents/eventtype/clean_test.go | 176 +++++++++++ .../eventtype/eventtypetest/eventtypetest.go | 12 + pkg/cloudevents/eventtype/parse.go | 38 +++ pkg/cloudevents/eventtype/parse_test.go | 73 +++++ pkg/cloudevents/utils_test.go | 6 +- pkg/handler/beb/handler.go | 31 +- pkg/handler/beb/handler_integration_test.go | 98 ++++-- pkg/handler/beb/mock/mock.go | 27 +- pkg/handler/handlertest/handlertest.go | 139 +++++--- pkg/handler/nats/handler.go | 27 +- pkg/handler/nats/handler_health_test.go | 2 +- pkg/handler/nats/handler_integration_test.go | 185 +++++++---- pkg/handler/nats/health_test.go | 2 +- pkg/handler/nats/mock/mock.go | 37 ++- pkg/legacy-events/constants.go | 6 - pkg/legacy-events/helpers.go | 14 +- pkg/legacy-events/helpers_test.go | 91 +++--- pkg/legacy-events/legacy.go | 38 ++- pkg/legacy-events/legacy_test.go | 227 ++++++------- pkg/nats/connect_test.go | 1 + pkg/sender/nats_test.go | 10 +- pkg/subscribed/response.go | 3 +- testing/fixtures.go | 299 +++++++++++------- testing/utils.go | 14 +- 34 files changed, 1235 insertions(+), 510 deletions(-) create mode 100644 internal/httpconsts.go create mode 100644 pkg/cloudevents/eventtype/build.go create mode 100644 pkg/cloudevents/eventtype/build_test.go create mode 100644 pkg/cloudevents/eventtype/clean.go create mode 100644 pkg/cloudevents/eventtype/clean_test.go create mode 100644 pkg/cloudevents/eventtype/eventtypetest/eventtypetest.go create mode 100644 pkg/cloudevents/eventtype/parse.go create mode 100644 pkg/cloudevents/eventtype/parse_test.go diff --git a/cmd/event-publisher-proxy/beb/beb.go b/cmd/event-publisher-proxy/beb/beb.go index 833243f..81f169d 100644 --- a/cmd/event-publisher-proxy/beb/beb.go +++ b/cmd/event-publisher-proxy/beb/beb.go @@ -3,8 +3,15 @@ package beb import ( "context" + "k8s.io/client-go/dynamic" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only used in a development setup + "sigs.k8s.io/controller-runtime/pkg/client/config" + "github.com/kelseyhightower/envconfig" + "github.com/sirupsen/logrus" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/beb" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" @@ -16,10 +23,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - "github.com/sirupsen/logrus" - "k8s.io/client-go/dynamic" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only used in a development setup - "sigs.k8s.io/controller-runtime/pkg/client/config" ) // Commander implements the Commander interface. @@ -95,9 +98,12 @@ func (c *Commander) Start() error { informers.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory) c.logger.Info("Informers are synced successfully") + // configure event type cleaner + eventTypeCleaner := eventtype.NewCleaner(c.envCfg.EventTypePrefix, applicationLister, c.logger) + // start handler which blocks until it receives a shutdown signal if err := beb.NewHandler(messageReceiver, messageSender, c.envCfg.RequestTimeout, legacyTransformer, c.opts, - subscribedProcessor, c.logger, c.metricsCollector).Start(ctx); err != nil { + subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleaner).Start(ctx); err != nil { c.logger.Errorf("Start handler failed with error: %s", err) return err } diff --git a/cmd/event-publisher-proxy/nats/nats.go b/cmd/event-publisher-proxy/nats/nats.go index e63060a..3357a29 100644 --- a/cmd/event-publisher-proxy/nats/nats.go +++ b/cmd/event-publisher-proxy/nats/nats.go @@ -11,6 +11,7 @@ import ( "github.com/sirupsen/logrus" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" @@ -106,9 +107,12 @@ func (c *Commander) Start() error { informers.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory) c.logger.Info("Informers are synced successfully") + // configure event type cleaner + eventTypeCleaner := eventtype.NewCleaner(c.envCfg.LegacyEventTypePrefix, applicationLister, c.logger) + // start handler which blocks until it receives a shutdown signal if err := nats.NewHandler(messageReceiver, messageSenderToNats, c.envCfg.RequestTimeout, legacyTransformer, c.opts, - subscribedProcessor, c.logger, c.metricsCollector).Start(ctx); err != nil { + subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleaner).Start(ctx); err != nil { c.logger.Errorf("Start handler failed with error: %s", err) return err } diff --git a/internal/httpconsts.go b/internal/httpconsts.go new file mode 100644 index 0000000..0d5db85 --- /dev/null +++ b/internal/httpconsts.go @@ -0,0 +1,8 @@ +package internal + +// HTTP ContentType constants +const ( + HeaderContentType = "Content-Type" + ContentTypeApplicationJSON = "application/json" + ContentTypeApplicationCloudEventsJSON = "application/cloudevents+json" +) diff --git a/pkg/application/clean.go b/pkg/application/clean.go index e54e669..93014e0 100644 --- a/pkg/application/clean.go +++ b/pkg/application/clean.go @@ -8,24 +8,24 @@ import ( ) const ( - // typeLabel is an optional label for the application to determine its type - typeLabel = "application-type" + // TypeLabel is an optional label for the application to determine its type. + TypeLabel = "application-type" ) var ( - // invalidApplicationNameSegment used to match and replace none-alphanumeric characters in the application name + // invalidApplicationNameSegment used to match and replace none-alphanumeric characters in the application name. invalidApplicationNameSegment = regexp.MustCompile(`\W|_`) ) // GetCleanTypeOrName cleans the application name form none-alphanumeric characters and returns it -// if the application type label exists, it will be cleaned and returned instead of the application name +// if the application type label exists, it will be cleaned and returned instead of the application name. func GetCleanTypeOrName(application *applicationv1alpha1.Application) string { if application == nil { return "" } applicationName := application.Name for k, v := range application.Labels { - if strings.ToLower(k) == typeLabel { + if strings.ToLower(k) == TypeLabel { applicationName = v break } @@ -33,12 +33,12 @@ func GetCleanTypeOrName(application *applicationv1alpha1.Application) string { return GetCleanName(applicationName) } -// GetCleanName cleans the name form none-alphanumeric characters and returns the clean name +// GetCleanName cleans the name form none-alphanumeric characters and returns the clean name. func GetCleanName(name string) string { return invalidApplicationNameSegment.ReplaceAllString(name, "") } -// IsCleanName returns true if the name contains alphanumeric characters only, otherwise returns false +// IsCleanName returns true if the name contains alphanumeric characters only, otherwise returns false. func IsCleanName(name string) bool { return !invalidApplicationNameSegment.MatchString(name) } diff --git a/pkg/application/clean_test.go b/pkg/application/clean_test.go index 606a9b1..bbe3f6e 100644 --- a/pkg/application/clean_test.go +++ b/pkg/application/clean_test.go @@ -31,19 +31,19 @@ func TestCleanName(t *testing.T) { }, // application type label is available, then use it instead of the application name { - givenApplication: applicationtest.NewApplication("alphanumeric0123", map[string]string{typeLabel: "apptype"}), + givenApplication: applicationtest.NewApplication("alphanumeric0123", map[string]string{TypeLabel: "apptype"}), wantName: "apptype", }, { - givenApplication: applicationtest.NewApplication("with.!@#none-$%^alphanumeric_&*-characters", map[string]string{typeLabel: "apptype"}), + givenApplication: applicationtest.NewApplication("with.!@#none-$%^alphanumeric_&*-characters", map[string]string{TypeLabel: "apptype"}), wantName: "apptype", }, { - givenApplication: applicationtest.NewApplication("alphanumeric0123", map[string]string{typeLabel: "apptype=with.!@#none-$%^alphanumeric_&*-characters"}), + givenApplication: applicationtest.NewApplication("alphanumeric0123", map[string]string{TypeLabel: "apptype=with.!@#none-$%^alphanumeric_&*-characters"}), wantName: "apptypewithnonealphanumericcharacters", }, { - givenApplication: applicationtest.NewApplication("with.!@#none-$%^alphanumeric_&*-characters", map[string]string{typeLabel: "apptype=with.!@#none-$%^alphanumeric_&*-characters"}), + givenApplication: applicationtest.NewApplication("with.!@#none-$%^alphanumeric_&*-characters", map[string]string{TypeLabel: "apptype=with.!@#none-$%^alphanumeric_&*-characters"}), wantName: "apptypewithnonealphanumericcharacters", }, } diff --git a/pkg/application/fake/lister.go b/pkg/application/fake/lister.go index 4d159b8..ed1de51 100644 --- a/pkg/application/fake/lister.go +++ b/pkg/application/fake/lister.go @@ -13,7 +13,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" ) -func NewListerOrDie(ctx context.Context, app *applicationv1alpha1.Application) *application.Lister { +func NewApplicationListerOrDie(ctx context.Context, app *applicationv1alpha1.Application) *application.Lister { scheme := setupSchemeOrDie() dynamicClient := dynamicfake.NewSimpleDynamicClient(scheme, app) return application.NewLister(ctx, dynamicClient) diff --git a/pkg/application/lister.go b/pkg/application/lister.go index fdce57b..22e2879 100644 --- a/pkg/application/lister.go +++ b/pkg/application/lister.go @@ -57,11 +57,3 @@ func GroupVersionResource() schema.GroupVersionResource { Resource: "applications", } } - -func GroupVersionKind() schema.GroupVersionKind { - return schema.GroupVersionKind{ - Group: applicationv1alpha1.SchemeGroupVersion.Group, - Version: applicationv1alpha1.SchemeGroupVersion.Version, - Kind: "Application", - } -} diff --git a/pkg/cloudevents/eventtype/build.go b/pkg/cloudevents/eventtype/build.go new file mode 100644 index 0000000..92352bd --- /dev/null +++ b/pkg/cloudevents/eventtype/build.go @@ -0,0 +1,13 @@ +package eventtype + +import ( + "fmt" + "strings" +) + +func build(prefix, applicationName, event, version string) string { + if len(strings.TrimSpace(prefix)) == 0 { + return fmt.Sprintf("%s.%s.%s", applicationName, event, version) + } + return fmt.Sprintf("%s.%s.%s.%s", prefix, applicationName, event, version) +} diff --git a/pkg/cloudevents/eventtype/build_test.go b/pkg/cloudevents/eventtype/build_test.go new file mode 100644 index 0000000..580e029 --- /dev/null +++ b/pkg/cloudevents/eventtype/build_test.go @@ -0,0 +1,35 @@ +package eventtype + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestBuilder(t *testing.T) { + t.Parallel() + testCases := []struct { + name string + givenPrefix, givenApplicationName, givenEvent, givenVersion string + wantEventType string + }{ + { + name: "prefix is empty", + givenPrefix: "", givenApplicationName: "test.app-1", givenEvent: "order.created", givenVersion: "v1", + wantEventType: "test.app-1.order.created.v1", + }, + { + name: "prefix is not empty", + givenPrefix: "prefix", givenApplicationName: "test.app-1", givenEvent: "order.created", givenVersion: "v1", + wantEventType: "prefix.test.app-1.order.created.v1", + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + eventType := build(tc.givenPrefix, tc.givenApplicationName, tc.givenEvent, tc.givenVersion) + assert.Equal(t, tc.wantEventType, eventType) + }) + } +} diff --git a/pkg/cloudevents/eventtype/clean.go b/pkg/cloudevents/eventtype/clean.go new file mode 100644 index 0000000..c7d9fd2 --- /dev/null +++ b/pkg/cloudevents/eventtype/clean.go @@ -0,0 +1,79 @@ +package eventtype + +import ( + "regexp" + + "github.com/sirupsen/logrus" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" +) + +var ( + // invalidEventTypeSegment used to match and replace none-alphanumeric characters in the event-type segments + // as per SAP Event spec https://github.tools.sap/CentralEngineering/sap-event-specification#type. + invalidEventTypeSegment = regexp.MustCompile("[^a-zA-Z0-9.]") + + // cleanerName used as the logger name. + cleanerName = "event-type-cleaner" +) + +type Cleaner interface { + Clean(eventType string) (string, error) +} + +type cleaner struct { + eventTypePrefix string + applicationLister *application.Lister + logger *logrus.Logger +} + +// compile-time check +var _ Cleaner = &cleaner{} + +func NewCleaner(eventTypePrefix string, applicationLister *application.Lister, logger *logrus.Logger) Cleaner { + return &cleaner{eventTypePrefix: eventTypePrefix, applicationLister: applicationLister, logger: logger} +} + +// Clean cleans the event-type from none-alphanumeric characters and returns it +// or returns an error if the event-type parsing failed. +func (c *cleaner) Clean(eventType string) (string, error) { + // format logger + log := c.namedLogger().WithFields(logrus.Fields{ + "prefix": c.eventTypePrefix, + "type": eventType, + }) + + appName, event, version, err := parse(eventType, c.eventTypePrefix) + if err != nil { + log.WithField("error", err).Error("parse event-type failed") + return "", err + } + + // clean the application name + var eventTypeClean string + if appObj, err := c.applicationLister.Get(appName); err != nil { + log.WithField("application", appName).Debug("cannot find application") + eventTypeClean = build(c.eventTypePrefix, application.GetCleanName(appName), event, version) + } else { + eventTypeClean = build(c.eventTypePrefix, application.GetCleanTypeOrName(appObj), event, version) + } + + // clean the event-type segments + eventTypeClean = cleanEventType(eventTypeClean) + log.WithFields( + logrus.Fields{ + "before": eventType, + "after": eventTypeClean, + }, + ).Debug("clean event-type") + + return eventTypeClean, nil +} + +func (c *cleaner) namedLogger() *logrus.Logger { + return c.logger.WithField("name", cleanerName).Logger +} + +func cleanEventType(eventType string) string { + return invalidEventTypeSegment.ReplaceAllString(eventType, "") +} diff --git a/pkg/cloudevents/eventtype/clean_test.go b/pkg/cloudevents/eventtype/clean_test.go new file mode 100644 index 0000000..5ecc69c --- /dev/null +++ b/pkg/cloudevents/eventtype/clean_test.go @@ -0,0 +1,176 @@ +package eventtype + +import ( + "context" + "testing" + + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" +) + +func TestCleaner(t *testing.T) { + t.Parallel() + testCases := []struct { + name string + givenEventTypePrefix string + givenApplicationName string + givenApplicationLabels map[string]string + givenEventType string + wantEventType string + wantError bool + }{ + // valid even-types for existing applications + { + name: "success if prefix is empty", + givenEventTypePrefix: "", + givenApplicationName: "testapp", + givenEventType: "testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "testapp.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name is clean", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenEventType: "prefix.testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name is clean and event has more than two segments", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenEventType: "prefix.testapp.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application type label is clean", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenApplicationLabels: map[string]string{application.TypeLabel: "testapptype"}, + givenEventType: "prefix.testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapptype.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application type label is clean and event has more than two segments", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenApplicationLabels: map[string]string{application.TypeLabel: "testapptype"}, + givenEventType: "prefix.testapp.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapptype.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name needs to be cleaned", + givenEventTypePrefix: "prefix", + givenApplicationName: "te--s__t!!a@@p##p%%", + givenEventType: "prefix.te--s__t!!a@@p##p%%.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name needs to be cleaned and event has more than two segments", + givenEventTypePrefix: "prefix", + givenApplicationName: "te--s__t!!a@@p##p%%", + givenEventType: "prefix.te--s__t!!a@@p##p%%.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application type label needs to be cleaned", + givenEventTypePrefix: "prefix", + givenApplicationName: "te--s__t!!a@@p##p%%", + givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, + givenEventType: "prefix.te--s__t!!a@@p##p%%.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapptype.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application type label needs to be cleaned and event has more than two segments", + givenEventTypePrefix: "prefix", + givenApplicationName: "te--s__t!!a@@p##p%%", + givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, + givenEventType: "prefix.te--s__t!!a@@p##p%%.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapptype.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", + wantError: false, + }, + // valid even-types for non-existing applications to simulate in-cluster eventing + { + name: "success if the given application name is clean for non-existing application", + givenEventTypePrefix: "prefix", + givenApplicationName: "", + givenEventType: "prefix.test-app.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name is clean for non-existing application and event has more than two segments", + givenEventTypePrefix: "prefix", + givenApplicationName: "", + givenEventType: "prefix.test-app.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name is not clean for non-existing application", + givenEventTypePrefix: "prefix", + givenApplicationName: "", + givenEventType: "prefix.testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name is not clean for non-existing application and event has more than two segments", + givenEventTypePrefix: "prefix", + givenApplicationName: "", + givenEventType: "prefix.testapp.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", + wantError: false, + }, + // invalid even-types + { + name: "fail if the prefix is invalid", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenEventType: "invalid.prefix.testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantError: true, + }, + { + name: "fail if the prefix is missing", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenEventType: "testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantError: true, + }, + { + name: "fail if the event-type is incomplete", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenEventType: "prefix.testapp.Segment1-Part1-Part2-Ä.v1", + wantError: true, + }, + } + + logger := logrus.New() + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + app := applicationtest.NewApplication(tc.givenApplicationName, tc.givenApplicationLabels) + appLister := fake.NewApplicationListerOrDie(context.Background(), app) + cleaner := NewCleaner(tc.givenEventTypePrefix, appLister, logger) + eventType, err := cleaner.Clean(tc.givenEventType) + require.Equal(t, tc.wantError, err != nil) + if !tc.wantError { + require.Equal(t, tc.wantEventType, eventType) + } + }) + } +} diff --git a/pkg/cloudevents/eventtype/eventtypetest/eventtypetest.go b/pkg/cloudevents/eventtype/eventtypetest/eventtypetest.go new file mode 100644 index 0000000..4efafbb --- /dev/null +++ b/pkg/cloudevents/eventtype/eventtypetest/eventtypetest.go @@ -0,0 +1,12 @@ +// Package eventtypetest provides utilities for eventype testing. +package eventtypetest + +type CleanerFunc func(string) (string, error) + +func (cf CleanerFunc) Clean(eventType string) (string, error) { + return cf(eventType) +} + +var DefaultCleaner = func(eventType string) (string, error) { + return eventType, nil +} diff --git a/pkg/cloudevents/eventtype/parse.go b/pkg/cloudevents/eventtype/parse.go new file mode 100644 index 0000000..34fad73 --- /dev/null +++ b/pkg/cloudevents/eventtype/parse.go @@ -0,0 +1,38 @@ +package eventtype + +import ( + "errors" + "fmt" + "strings" +) + +// parse splits the event-type using the given prefix and returns the application name, event and version +// or an error if the event-type format is invalid. +// A valid even-type format should be: prefix.application.event.version or application.event.version +// where event should consist of at least two segments separated by "." (e.g. businessObject.operation). +// Constraint: the application segment in the input event-type should not contain ".". +func parse(eventType, prefix string) (string, string, string, error) { + if !strings.HasPrefix(eventType, prefix) { + return "", "", "", errors.New("prefix not found") + } + + // remove the prefix + eventType = strings.ReplaceAll(eventType, prefix, "") + eventType = strings.TrimPrefix(eventType, ".") + + // make sure that the remaining string has at least 4 segments separated by "." + // (e.g. application.businessObject.operation.version) + parts := strings.Split(eventType, ".") + if len(parts) < 4 { + return "", "", "", errors.New("invalid format") + } + + // parse the event-type segments + applicationName := parts[0] + businessObject := strings.Join(parts[1:len(parts)-2], "") // combine segments + operation := parts[len(parts)-2] + version := parts[len(parts)-1] + event := fmt.Sprintf("%s.%s", businessObject, operation) + + return applicationName, event, version, nil +} diff --git a/pkg/cloudevents/eventtype/parse_test.go b/pkg/cloudevents/eventtype/parse_test.go new file mode 100644 index 0000000..37582b7 --- /dev/null +++ b/pkg/cloudevents/eventtype/parse_test.go @@ -0,0 +1,73 @@ +package eventtype + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestParser(t *testing.T) { + t.Parallel() + testCases := []struct { + name string + givenEventType string + givenPrefix string + wantApplicationName string + wantEvent string + wantVersion string + wantError bool + }{ + { + name: "should fail if prefix is missing", + givenEventType: "prefix.test.app.name.123.order.created.v1", + givenPrefix: "missing.prefix", + wantError: true, + }, + { + name: "should fail if event-type is incomplete", + givenEventType: "prefix.order.created.v1", + givenPrefix: "prefix", + wantError: true, + }, + { + name: "should succeed if prefix is empty", + givenEventType: "application.order.created.v1", + givenPrefix: "", + wantApplicationName: "application", + wantEvent: "order.created", + wantVersion: "v1", + wantError: false, + }, + { + name: "should succeed if event has two segments", + givenEventType: "prefix.test_app-123.Segment1.Segment2.v1", + givenPrefix: "prefix", + wantApplicationName: "test_app-123", + wantEvent: "Segment1.Segment2", + wantVersion: "v1", + wantError: false, + }, + { + name: "should succeed if event has more than two segments", + givenEventType: "prefix.test_app-123.Segment1.Segment2.Segment3.Segment4.Segment5.v1", + givenPrefix: "prefix", + wantApplicationName: "test_app-123", + wantEvent: "Segment1Segment2Segment3Segment4.Segment5", + wantVersion: "v1", + wantError: false, + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + applicationName, event, version, err := parse(tc.givenEventType, tc.givenPrefix) + require.Equal(t, tc.wantError, err != nil) + if !tc.wantError { + require.Equal(t, tc.wantApplicationName, applicationName) + require.Equal(t, tc.wantEvent, event) + require.Equal(t, tc.wantVersion, version) + } + }) + } +} diff --git a/pkg/cloudevents/utils_test.go b/pkg/cloudevents/utils_test.go index cfac9bd..374a867 100644 --- a/pkg/cloudevents/utils_test.go +++ b/pkg/cloudevents/utils_test.go @@ -9,6 +9,8 @@ import ( "testing" cehttp "github.com/cloudevents/sdk-go/v2/protocol/http" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/ems" ) @@ -16,14 +18,14 @@ func TestWriteRequestWithHeaders(t *testing.T) { t.Parallel() req := httptest.NewRequest(http.MethodPost, "/", nil) - req.Header.Add("Content-Type", "application/cloudevents+json") + req.Header.Add(internal.HeaderContentType, internal.ContentTypeApplicationCloudEventsJSON) message := cehttp.NewMessageFromHttpRequest(req) defer func() { _ = message.Finish(nil) }() additionalHeaders := http.Header{ "qos": []string{string(ems.QosAtLeastOnce)}, - "accept": []string{"application/json"}, + "accept": []string{internal.ContentTypeApplicationJSON}, "key1": []string{"value1", "value2"}, "key2": []string{"value3"}, } diff --git a/pkg/handler/beb/handler.go b/pkg/handler/beb/handler.go index e06b868..a61f0bd 100644 --- a/pkg/handler/beb/handler.go +++ b/pkg/handler/beb/handler.go @@ -10,10 +10,11 @@ import ( cev2client "github.com/cloudevents/sdk-go/v2/client" cev2event "github.com/cloudevents/sdk-go/v2/event" cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" - "github.com/sirupsen/logrus" + "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" cloudevents "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/ems" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" @@ -35,7 +36,7 @@ var ( // Any alteration or removal of those headers might cause publish requests to fail. additionalHeaders = http.Header{ "qos": []string{string(ems.QosAtLeastOnce)}, - "Accept": []string{"application/json"}, + "Accept": []string{internal.ContentTypeApplicationJSON}, } ) @@ -60,12 +61,14 @@ type Handler struct { Options *options.Options // collector collects metrics collector *metrics.Collector + // eventTypeCleaner cleans the cloud event type + eventTypeCleaner eventtype.Cleaner } // NewHandler returns a new HTTP Handler instance. func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.BebMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, - logger *logrus.Logger, collector *metrics.Collector) *Handler { + logger *logrus.Logger, collector *metrics.Collector, eventTypeCleaner eventtype.Cleaner) *Handler { return &Handler{ Receiver: receiver, Sender: sender, @@ -75,6 +78,7 @@ func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.BebMessag Logger: logger, Options: opts, collector: collector, + eventTypeCleaner: eventTypeCleaner, } } @@ -123,7 +127,7 @@ func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { } func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { - event := h.LegacyTransformer.TransformLegacyRequestsToCE(writer, request) + event, eventTypeOriginal := h.LegacyTransformer.TransformLegacyRequestsToCE(writer, request) if event == nil { h.Logger.Debug("failed to transform legacy event to CE, event is nil") return @@ -141,7 +145,8 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h logrus.Fields{ "id": event.ID(), "source": event.Source(), - "type": event.Type(), + "before": eventTypeOriginal, + "after": event.Type(), "statusCode": statusCode, "duration": dispatchTime, "responseBody": string(respBody), @@ -157,13 +162,22 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R event, err := binding.ToEvent(ctx, message) if err != nil { - h.Logger.Warnf("Failed to extract event from request with error: %s", err) + h.Logger.Errorf("Failed to extract event from request with error: %s", err) + h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) + return + } + + eventTypeOriginal := event.Type() + eventTypeClean, err := h.eventTypeCleaner.Clean(eventTypeOriginal) + if err != nil { + h.Logger.Errorf("Failed to clean event type with error: %s", err) h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) return } + event.SetType(eventTypeClean) if err := event.Validate(); err != nil { - h.Logger.Warnf("Request is invalid as per CE spec with error: %s", err) + h.Logger.Errorf("Request is invalid as per CE spec with error: %s", err) h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) return } @@ -182,7 +196,8 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R logrus.Fields{ "id": event.ID(), "source": event.Source(), - "type": event.Type(), + "before": eventTypeOriginal, + "after": eventTypeClean, "statusCode": statusCode, "duration": dispatchTime, "responseBody": string(respBody), diff --git a/pkg/handler/beb/handler_integration_test.go b/pkg/handler/beb/handler_integration_test.go index 73e37eb..8fe0655 100644 --- a/pkg/handler/beb/handler_integration_test.go +++ b/pkg/handler/beb/handler_integration_test.go @@ -44,32 +44,67 @@ func TestHandlerForCloudEvents(t *testing.T) { testCases := []struct { name string givenEventTypePrefix string + givenEventType string givenApplicationNameToCreate string givenApplicationNameToValidate string }{ + // not-clean event-types { - name: "With prefix and clean application name", + name: "With prefix and clean application name and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenEventType: testingutils.CloudEventTypeNotClean, givenApplicationNameToCreate: testingutils.ApplicationName, - givenApplicationNameToValidate: testingutils.ApplicationNameNotClean, + givenApplicationNameToValidate: testingutils.ApplicationName, }, { - name: "With empty prefix and clean application name", + name: "With empty prefix and clean application name and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenEventType: testingutils.CloudEventTypeNotClean, givenApplicationNameToCreate: testingutils.ApplicationName, - givenApplicationNameToValidate: testingutils.ApplicationNameNotClean, + givenApplicationNameToValidate: testingutils.ApplicationName, }, { - name: "With prefix and not-clean application name", + name: "With prefix and not-clean application name and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenEventType: testingutils.CloudEventTypeNotClean, givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, - givenApplicationNameToValidate: testingutils.ApplicationNameNotClean, + givenApplicationNameToValidate: testingutils.ApplicationName, }, { - name: "With empty prefix and not-clean application name", + name: "With empty prefix and not-clean application name and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenEventType: testingutils.CloudEventTypeNotClean, givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, - givenApplicationNameToValidate: testingutils.ApplicationNameNotClean, + givenApplicationNameToValidate: testingutils.ApplicationName, + }, + // clean event-types + { + name: "With prefix and clean application name and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenEventType: testingutils.CloudEventType, + givenApplicationNameToCreate: testingutils.ApplicationName, + givenApplicationNameToValidate: testingutils.ApplicationName, + }, + { + name: "With empty prefix and clean application name and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenEventType: testingutils.CloudEventType, + givenApplicationNameToCreate: testingutils.ApplicationName, + givenApplicationNameToValidate: testingutils.ApplicationName, + }, + { + name: "With prefix and not-clean application name and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenEventType: testingutils.CloudEventType, + givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, + givenApplicationNameToValidate: testingutils.ApplicationName, + }, + { + name: "With empty prefix and not-clean application name and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenEventType: testingutils.CloudEventType, + givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, + givenApplicationNameToValidate: testingutils.ApplicationName, }, } for _, tc := range testCases { @@ -85,6 +120,7 @@ func TestHandlerForCloudEvents(t *testing.T) { ) handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, + mock.WithEventTypePrefix(tc.givenEventTypePrefix), mock.WithApplication(tc.givenApplicationNameToCreate, tc.givenApplicationNameToValidate), ) defer handlerMock.Close() @@ -93,10 +129,10 @@ func TestHandlerForCloudEvents(t *testing.T) { for _, testCase := range handlertest.TestCasesForCloudEvents { testCase := testCase t.Run(testCase.Name, func(t *testing.T) { - body, headers := testCase.ProvideMessage() + body, headers := testCase.ProvideMessage(tc.givenEventType) resp, err := testingutils.SendEvent(publishEndpoint, body, headers) require.NoError(t, err) - _ = resp.Body.Close() + require.NoError(t, resp.Body.Close()) require.Equal(t, testCase.WantStatusCode, resp.StatusCode) if testingutils.Is2XX(resp.StatusCode) { metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) @@ -154,6 +190,7 @@ func TestHandlerForLegacyEvents(t *testing.T) { ) handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, + mock.WithEventTypePrefix(tc.givenEventTypePrefix), mock.WithApplication(tc.givenApplicationNameToCreate, tc.givenApplicationNameToValidate), ) defer handlerMock.Close() @@ -210,6 +247,7 @@ func TestHandlerForBEBFailures(t *testing.T) { ) handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, + mock.WithEventTypePrefix(tc.givenEventTypePrefix), mock.WithApplication(applicationName, applicationName), ) defer handlerMock.Close() @@ -226,20 +264,21 @@ func TestHandlerForBEBFailures(t *testing.T) { { name: "Send a legacy event with event-id", provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventID, testingutils.GetApplicationJSONHeaders() + builder := testingutils.NewLegacyEventBuilder() + return builder.Build() }, givenEndpoint: publishLegacyEndpoint, wantStatusCode: http.StatusBadRequest, wantResponse: legacyapi.PublishEventResponses{ Error: &legacyapi.Error{ - Status: 400, + Status: http.StatusBadRequest, Message: "invalid request"}, }, }, { name: "Binary CloudEvent is valid with required headers", provideMessage: func() (string, http.Header) { - return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), testingutils.GetBinaryMessageHeaders() + return fmt.Sprintf(`"%s"`, testingutils.EventData), testingutils.GetBinaryMessageHeaders() }, givenEndpoint: publishEndpoint, wantStatusCode: http.StatusBadRequest, @@ -294,6 +333,7 @@ func TestHandlerForHugeRequests(t *testing.T) { ) handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, + mock.WithEventTypePrefix(tc.givenEventTypePrefix), mock.WithApplication(applicationName, applicationName), ) defer handlerMock.Close() @@ -308,7 +348,8 @@ func TestHandlerForHugeRequests(t *testing.T) { { name: "Should fail with HTTP 413 with a request which is larger than 2 Bytes as the maximum accepted size is 2 Bytes", provideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventID, testingutils.GetApplicationJSONHeaders() + builder := testingutils.NewLegacyEventBuilder() + return builder.Build() }, givenEndpoint: publishLegacyEndpoint, wantStatusCode: http.StatusRequestEntityTooLarge, @@ -387,7 +428,7 @@ func TestHandlerForSubscribedEndpoint(t *testing.T) { resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) require.NoError(t, err) require.Equal(t, testCase.WantStatusCode, resp.StatusCode) - defer func() { _ = resp.Body.Close() }() + defer func() { require.NoError(t, resp.Body.Close()) }() respBodyBytes, err := ioutil.ReadAll(resp.Body) require.NoError(t, err) gotEventsResponse := subscribed.Events{} @@ -406,14 +447,29 @@ func TestHandlerTimeout(t *testing.T) { testCases := []struct { name string givenEventTypePrefix string + givenEventType string }{ + // not-clean event-types { - name: "With prefix", + name: "With prefix and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenEventType: testingutils.CloudEventTypeNotClean, }, { - name: "With empty prefix", + name: "With empty prefix and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, + }, + // clean event-types + { + name: "With prefix and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenEventType: testingutils.CloudEventType, + }, + { + name: "With empty prefix and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenEventType: testingutils.CloudEventTypePrefixEmpty, }, } for _, tc := range testCases { @@ -430,15 +486,19 @@ func TestHandlerTimeout(t *testing.T) { ) handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, + mock.WithEventTypePrefix(tc.givenEventTypePrefix), mock.WithApplication(applicationName, applicationName), ) defer handlerMock.Close() publishEndpoint := fmt.Sprintf(publishEndpointFormat, handlerMock.GetPort()) - body, headers := testingutils.StructuredCloudEventPayload, testingutils.GetStructuredMessageHeaders() + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(tc.givenEventType), + ) + body, headers := builder.BuildStructured() resp, err := testingutils.SendEvent(publishEndpoint, body, headers) require.NoError(t, err) - _ = resp.Body.Close() + require.NoError(t, resp.Body.Close()) require.Equal(t, http.StatusInternalServerError, resp.StatusCode) metricstest.EnsureMetricErrors(t, handlerMock.GetMetricsCollector()) }) diff --git a/pkg/handler/beb/mock/mock.go b/pkg/handler/beb/mock/mock.go index 385aebd..87aeb5b 100644 --- a/pkg/handler/beb/mock/mock.go +++ b/pkg/handler/beb/mock/mock.go @@ -9,8 +9,6 @@ import ( "testing" "time" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/dynamic/dynamicinformer" @@ -22,9 +20,12 @@ import ( "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype/eventtypetest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/beb" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" @@ -54,6 +55,7 @@ type BebHandlerMock struct { legacyTransformer *legacy.Transformer subscribedProcessor *subscribed.Processor mockServer *testingutils.MockServer + eventTypeCleaner eventtype.Cleaner } // BebHandlerMockOpt represents a BebHandlerMock option. @@ -110,6 +112,7 @@ func StartOrDie(ctx context.Context, t *testing.T, requestSize int, eventTypePre legacyTransformer: &legacy.Transformer{}, subscribedProcessor: &subscribed.Processor{}, mockServer: mockServer, + eventTypeCleaner: eventtypetest.CleanerFunc(eventtypetest.DefaultCleaner), } for _, opt := range opts { @@ -122,7 +125,17 @@ func StartOrDie(ctx context.Context, t *testing.T, requestSize int, eventTypePre msgReceiver := receiver.NewHTTPMessageReceiver(mock.cfg.Port) msgSender := sender.NewBebMessageSender(mock.cfg.EmsPublishURL, client) msgHandlerOpts := &options.Options{MaxRequestSize: int64(requestSize)} - msgHandler := beb.NewHandler(msgReceiver, msgSender, mock.cfg.RequestTimeout, mock.legacyTransformer, msgHandlerOpts, mock.subscribedProcessor, mock.logger, mock.collector) + msgHandler := beb.NewHandler( + msgReceiver, + msgSender, + mock.cfg.RequestTimeout, + mock.legacyTransformer, + msgHandlerOpts, + mock.subscribedProcessor, + mock.logger, + mock.collector, + mock.eventTypeCleaner, + ) go func() { require.NoError(t, msgHandler.Start(ctx)) }() testingutils.WaitForEndpointStatusCodeOrFail(mock.livenessEndpoint, health.StatusCodeHealthy) @@ -166,6 +179,13 @@ func extractEventTypeFromRequest(r *http.Request) (string, error) { return eventType, nil } +// WithEventTypePrefix returns BebHandlerMockOpt which sets the eventTypePrefix for the given BebHandlerMock. +func WithEventTypePrefix(eventTypePrefix string) BebHandlerMockOpt { + return func(m *BebHandlerMock) { + m.cfg.EventTypePrefix = eventTypePrefix + } +} + // WithApplication returns BebHandlerMockOpt which sets the subscribed.Processor for the given BebHandlerMock. func WithApplication(applicationNameToCreate, applicationNameToValidate string) BebHandlerMockOpt { return func(m *BebHandlerMock) { @@ -173,6 +193,7 @@ func WithApplication(applicationNameToCreate, applicationNameToValidate string) m.legacyTransformer = legacy.NewTransformer(m.cfg.BEBNamespace, m.cfg.EventTypePrefix, applicationLister) validator := validateEventTypeContainsApplicationName(applicationNameToValidate) testingutils.WithValidator(validator)(m.mockServer) + m.eventTypeCleaner = eventtype.NewCleaner(m.cfg.EventTypePrefix, applicationLister, m.logger) } } diff --git a/pkg/handler/handlertest/handlertest.go b/pkg/handler/handlertest/handlertest.go index 38613f9..3c733f8 100644 --- a/pkg/handler/handlertest/handlertest.go +++ b/pkg/handler/handlertest/handlertest.go @@ -4,7 +4,6 @@ package handlertest import ( "context" "encoding/json" - "fmt" "io/ioutil" "net/http" "testing" @@ -84,94 +83,120 @@ func getInvalidValidationError(field string) *legacyapi.Error { func NewApplicationListerOrDie(ctx context.Context, appName string) *application.Lister { app := applicationtest.NewApplication(appName, nil) - appLister := fake.NewListerOrDie(ctx, app) + appLister := fake.NewApplicationListerOrDie(ctx, app) return appLister } -// common test-cases for the HTTP handler and NATS handler var ( TestCasesForCloudEvents = []struct { Name string - ProvideMessage func() (string, http.Header) + ProvideMessage func(string) (string, http.Header) WantStatusCode int }{ // structured cloudevents { Name: "Structured CloudEvent without id", - ProvideMessage: func() (string, http.Header) { - return testingutils.StructuredCloudEventPayloadWithoutID, testingutils.GetStructuredMessageHeaders() + ProvideMessage: func(eventType string) (string, http.Header) { + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(eventType), + testingutils.WithCloudEventID(""), + ) + return builder.BuildStructured() }, WantStatusCode: http.StatusBadRequest, }, { Name: "Structured CloudEvent without type", - ProvideMessage: func() (string, http.Header) { - return testingutils.StructuredCloudEventPayloadWithoutType, testingutils.GetStructuredMessageHeaders() + ProvideMessage: func(eventType string) (string, http.Header) { + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(""), + ) + return builder.BuildStructured() }, WantStatusCode: http.StatusBadRequest, }, { Name: "Structured CloudEvent without specversion", - ProvideMessage: func() (string, http.Header) { - return testingutils.StructuredCloudEventPayloadWithoutSpecVersion, testingutils.GetStructuredMessageHeaders() + ProvideMessage: func(eventType string) (string, http.Header) { + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(eventType), + testingutils.WithCloudEventSpecVersion(""), + ) + return builder.BuildStructured() }, WantStatusCode: http.StatusBadRequest, }, { Name: "Structured CloudEvent without source", - ProvideMessage: func() (string, http.Header) { - return testingutils.StructuredCloudEventPayloadWithoutSource, testingutils.GetStructuredMessageHeaders() + ProvideMessage: func(eventType string) (string, http.Header) { + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(eventType), + testingutils.WithCloudEventSource(""), + ) + return builder.BuildStructured() }, WantStatusCode: http.StatusBadRequest, }, { Name: "Structured CloudEvent is valid", - ProvideMessage: func() (string, http.Header) { - return testingutils.StructuredCloudEventPayload, testingutils.GetStructuredMessageHeaders() + ProvideMessage: func(eventType string) (string, http.Header) { + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(eventType), + ) + return builder.BuildStructured() }, WantStatusCode: http.StatusNoContent, }, // binary cloudevents { Name: "Binary CloudEvent without CE-ID header", - ProvideMessage: func() (string, http.Header) { - headers := testingutils.GetBinaryMessageHeaders() - headers.Del(testingutils.CeIDHeader) - return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), headers + ProvideMessage: func(eventType string) (string, http.Header) { + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventID(""), + ) + return builder.BuildBinary() }, WantStatusCode: http.StatusBadRequest, }, { Name: "Binary CloudEvent without CE-Type header", - ProvideMessage: func() (string, http.Header) { - headers := testingutils.GetBinaryMessageHeaders() - headers.Del(testingutils.CeTypeHeader) - return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), headers + ProvideMessage: func(eventType string) (string, http.Header) { + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(""), + ) + return builder.BuildBinary() }, WantStatusCode: http.StatusBadRequest, }, { Name: "Binary CloudEvent without CE-SpecVersion header", - ProvideMessage: func() (string, http.Header) { - headers := testingutils.GetBinaryMessageHeaders() - headers.Del(testingutils.CeSpecVersionHeader) - return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), headers + ProvideMessage: func(eventType string) (string, http.Header) { + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(eventType), + testingutils.WithCloudEventSpecVersion(""), + ) + return builder.BuildBinary() }, WantStatusCode: http.StatusBadRequest, }, { Name: "Binary CloudEvent without CE-Source header", - ProvideMessage: func() (string, http.Header) { - headers := testingutils.GetBinaryMessageHeaders() - headers.Del(testingutils.CeSourceHeader) - return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), headers + ProvideMessage: func(eventType string) (string, http.Header) { + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(eventType), + testingutils.WithCloudEventSource(""), + ) + return builder.BuildBinary() }, WantStatusCode: http.StatusBadRequest, }, { Name: "Binary CloudEvent is valid with required headers", - ProvideMessage: func() (string, http.Header) { - return fmt.Sprintf(`"%s"`, testingutils.CloudEventData), testingutils.GetBinaryMessageHeaders() + ProvideMessage: func(eventType string) (string, http.Header) { + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(eventType), + ) + return builder.BuildBinary() }, WantStatusCode: http.StatusNoContent, }, @@ -184,9 +209,10 @@ var ( WantResponse legacyapi.PublishEventResponses }{ { - Name: "Send a legacy event successfully with event-id", + Name: "Send a legacy event successfully with event id", ProvideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithEventID, testingutils.GetApplicationJSONHeaders() + builder := testingutils.NewLegacyEventBuilder() + return builder.Build() }, WantStatusCode: http.StatusOK, WantResponse: legacyapi.PublishEventResponses{ @@ -198,9 +224,12 @@ var ( }, }, { - Name: "Send a legacy event successfully without event-id", + Name: "Send a legacy event successfully without event id", ProvideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithoutEventID, testingutils.GetApplicationJSONHeaders() + builder := testingutils.NewLegacyEventBuilder( + testingutils.WithLegacyEventID(""), + ) + return builder.Build() }, WantStatusCode: http.StatusOK, WantResponse: legacyapi.PublishEventResponses{ @@ -214,7 +243,10 @@ var ( { Name: "Send a legacy event with invalid event id", ProvideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithInvalidEventID, testingutils.GetApplicationJSONHeaders() + builder := testingutils.NewLegacyEventBuilder( + testingutils.WithLegacyEventID("invalid-id"), + ) + return builder.Build() }, WantStatusCode: http.StatusBadRequest, WantResponse: legacyapi.PublishEventResponses{ @@ -224,7 +256,10 @@ var ( { Name: "Send a legacy event without event time", ProvideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithoutEventTime, testingutils.GetApplicationJSONHeaders() + builder := testingutils.NewLegacyEventBuilder( + testingutils.WithLegacyEventTime(""), + ) + return builder.Build() }, WantStatusCode: http.StatusBadRequest, WantResponse: legacyapi.PublishEventResponses{ @@ -234,7 +269,10 @@ var ( { Name: "Send a legacy event without event type", ProvideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithoutEventType, testingutils.GetApplicationJSONHeaders() + builder := testingutils.NewLegacyEventBuilder( + testingutils.WithLegacyEventType(""), + ) + return builder.Build() }, WantStatusCode: http.StatusBadRequest, WantResponse: legacyapi.PublishEventResponses{ @@ -244,7 +282,10 @@ var ( { Name: "Send a legacy event with invalid event time", ProvideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithInvalidEventTime, testingutils.GetApplicationJSONHeaders() + builder := testingutils.NewLegacyEventBuilder( + testingutils.WithLegacyEventTime("invalid-time"), + ) + return builder.Build() }, WantStatusCode: http.StatusBadRequest, WantResponse: legacyapi.PublishEventResponses{ @@ -252,9 +293,12 @@ var ( }, }, { - Name: "Send a legacy event without event version", + Name: "Send a legacy event without event type version", ProvideMessage: func() (string, http.Header) { - return testingutils.LegacyEventPayloadWithWithoutEventVersion, testingutils.GetApplicationJSONHeaders() + builder := testingutils.NewLegacyEventBuilder( + testingutils.WithLegacyEventTypeVersion(""), + ) + return builder.Build() }, WantStatusCode: http.StatusBadRequest, WantResponse: legacyapi.PublishEventResponses{ @@ -262,9 +306,12 @@ var ( }, }, { - Name: "Send a legacy event without data field", + Name: "Send a legacy event without data", ProvideMessage: func() (string, http.Header) { - return testingutils.ValidLegacyEventPayloadWithoutData, testingutils.GetApplicationJSONHeaders() + builder := testingutils.NewLegacyEventBuilder( + testingutils.WithLegacyEventData(""), + ) + return builder.Build() }, WantStatusCode: http.StatusBadRequest, WantResponse: legacyapi.PublishEventResponses{ @@ -286,8 +333,8 @@ var ( WantStatusCode: http.StatusOK, WantResponse: subscribed.Events{ EventsInfo: []subscribed.Event{{ - Name: testingutils.LegacyEventType, - Version: testingutils.LegacyEventTypeVersion, + Name: testingutils.EventName, + Version: testingutils.EventVersion, }}, }, }, diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index 78baa05..ff68302 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -11,6 +11,7 @@ import ( cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" "github.com/sirupsen/logrus" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" @@ -43,12 +44,14 @@ type Handler struct { Options *options.Options // collector collects metrics collector *metrics.Collector + // eventTypeCleaner cleans the cloud event type + eventTypeCleaner eventtype.Cleaner } // NewHandler returns a new NATS Handler instance. func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.NatsMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, - logger *logrus.Logger, collector *metrics.Collector) *Handler { + logger *logrus.Logger, collector *metrics.Collector, eventTypeCleaner eventtype.Cleaner) *Handler { return &Handler{ Receiver: receiver, Sender: sender, @@ -58,6 +61,7 @@ func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.NatsMessa Logger: logger, Options: opts, collector: collector, + eventTypeCleaner: eventTypeCleaner, } } @@ -108,7 +112,7 @@ func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { } func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { - event := h.LegacyTransformer.TransformLegacyRequestsToCE(writer, request) + event, eventTypeOriginal := h.LegacyTransformer.TransformLegacyRequestsToCE(writer, request) if event == nil { h.Logger.Debug("failed to transform legacy event to CE, event is nil") return @@ -125,7 +129,8 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h logrus.Fields{ "id": event.ID(), "source": event.Source(), - "type": event.Type(), + "before": eventTypeOriginal, + "after": event.Type(), "statusCode": statusCode, "duration": dispatchTime, "responseBody": string(respBody), @@ -141,13 +146,22 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R event, err := binding.ToEvent(ctx, message) if err != nil { - h.Logger.Warnf("Failed to extract event from request with error: %s", err) + h.Logger.Errorf("Failed to extract event from request with error: %s", err) h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) return } + eventTypeOriginal := event.Type() + eventTypeClean, err := h.eventTypeCleaner.Clean(eventTypeOriginal) + if err != nil { + h.Logger.Errorf("Failed to clean event type with error: %s", err) + h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) + return + } + event.SetType(eventTypeClean) + if err := event.Validate(); err != nil { - h.Logger.Warnf("Request is invalid as per CE spec with error: %s", err) + h.Logger.Errorf("Request is invalid as per CE spec with error: %s", err) h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) return } @@ -170,7 +184,8 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R logrus.Fields{ "id": event.ID(), "source": event.Source(), - "type": event.Type(), + "before": eventTypeOriginal, + "after": eventTypeClean, "statusCode": statusCode, "duration": dispatchTime, "responseBody": string(respBody), diff --git a/pkg/handler/nats/handler_health_test.go b/pkg/handler/nats/handler_health_test.go index 4d5f1fd..4213c29 100644 --- a/pkg/handler/nats/handler_health_test.go +++ b/pkg/handler/nats/handler_health_test.go @@ -35,7 +35,7 @@ func TestHandlerHealth(t *testing.T) { t.Parallel() handlerMock := mock.StartOrDie(context.TODO(), t) - defer handlerMock.ShutdownNatsServerAndWait() + defer handlerMock.Stop() if tc.givenNatsServerShutdown { handlerMock.ShutdownNatsServerAndWait() diff --git a/pkg/handler/nats/handler_integration_test.go b/pkg/handler/nats/handler_integration_test.go index 200a1e2..6d6066b 100644 --- a/pkg/handler/nats/handler_integration_test.go +++ b/pkg/handler/nats/handler_integration_test.go @@ -24,41 +24,71 @@ import ( eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) -func TestNatsHandlerForCloudEvents(t *testing.T) { +func TestHandlerForCloudEvents(t *testing.T) { testCases := []struct { name string givenEventTypePrefix string givenApplicationName string givenEventType string - wantNatsSubject string + wantEventType string }{ + // not-clean event-types { name: "With prefix and clean application name and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefix, givenApplicationName: testingutils.ApplicationName, givenEventType: testingutils.CloudEventTypeNotClean, - wantNatsSubject: testingutils.CloudEventTypeNotClean, + wantEventType: testingutils.CloudEventType, }, { name: "With prefix and not-clean application name and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefix, givenApplicationName: testingutils.ApplicationNameNotClean, givenEventType: testingutils.CloudEventTypeNotClean, - wantNatsSubject: testingutils.CloudEventTypeNotClean, + wantEventType: testingutils.CloudEventType, }, { name: "With empty prefix and clean application name and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, givenApplicationName: testingutils.ApplicationName, givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, - wantNatsSubject: testingutils.CloudEventTypeNotClean, + wantEventType: testingutils.CloudEventTypePrefixEmpty, }, { name: "With empty prefix and not-clean application name and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, givenApplicationName: testingutils.ApplicationNameNotClean, givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, - wantNatsSubject: testingutils.CloudEventTypeNotClean, + wantEventType: testingutils.CloudEventTypePrefixEmpty, + }, + // clean event-types + { + name: "With prefix and clean application name and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenApplicationName: testingutils.ApplicationName, + givenEventType: testingutils.CloudEventType, + wantEventType: testingutils.CloudEventType, + }, + { + name: "With prefix and not-clean application name and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenApplicationName: testingutils.ApplicationNameNotClean, + givenEventType: testingutils.CloudEventType, + wantEventType: testingutils.CloudEventType, + }, + { + name: "With empty prefix and clean application name and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenApplicationName: testingutils.ApplicationName, + givenEventType: testingutils.CloudEventTypePrefixEmpty, + wantEventType: testingutils.CloudEventTypePrefixEmpty, + }, + { + name: "With empty prefix and not-clean application name and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenApplicationName: testingutils.ApplicationNameNotClean, + givenEventType: testingutils.CloudEventTypePrefixEmpty, + wantEventType: testingutils.CloudEventTypePrefixEmpty, }, } for _, tc := range testCases { @@ -70,45 +100,40 @@ func TestNatsHandlerForCloudEvents(t *testing.T) { defer cancel() handlerMock := mock.StartOrDie(ctx, t, + mock.WithEventTypePrefix(tc.givenEventTypePrefix), mock.WithApplication(tc.givenApplicationName), ) - defer handlerMock.ShutdownNatsServerAndWait() - - // setup test environment - publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", handlerMock.GetNatsConfig().Port) - subscription := testingutils.NewSubscription( - testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, tc.givenEventType), - ) - - // prepare event type from subscription - assert.NotNil(t, subscription.Spec.Filter) - assert.NotEmpty(t, subscription.Spec.Filter.Filters) - eventTypeToSubscribe := subscription.Spec.Filter.Filters[0].EventType.Value - - // connect to nats - connection, err := pkgnats.Connect(handlerMock.GetNatsURL(), - pkgnats.WithRetryOnFailedConnect(true), - pkgnats.WithMaxReconnects(3), - pkgnats.WithReconnectWait(time.Second), - ) - assert.Nil(t, err) - assert.NotNil(t, connection) - - // publish a message to NATS and validate it - validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantNatsSubject) - testingutils.SubscribeToEventOrFail(t, connection, eventTypeToSubscribe, validator) + defer handlerMock.Stop() // run the tests for publishing cloudevents + publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", handlerMock.GetNatsConfig().Port) for _, testCase := range handlertest.TestCasesForCloudEvents { testCase := testCase t.Run(testCase.Name, func(t *testing.T) { - body, headers := testCase.ProvideMessage() + // connect to nats + connection, err := pkgnats.Connect(handlerMock.GetNatsURL(), + pkgnats.WithRetryOnFailedConnect(true), + pkgnats.WithMaxReconnects(3), + pkgnats.WithReconnectWait(time.Second), + ) + assert.Nil(t, err) + assert.NotNil(t, connection) + defer connection.Close() + + // validator to check NATS received events + notify := make(chan bool) + defer close(notify) + validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantEventType, notify) + testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) + + body, headers := testCase.ProvideMessage(tc.wantEventType) resp, err := testingutils.SendEvent(publishEndpoint, body, headers) assert.NoError(t, err) - _ = resp.Body.Close() + assert.NoError(t, resp.Body.Close()) assert.Equal(t, testCase.WantStatusCode, resp.StatusCode) if testingutils.Is2XX(resp.StatusCode) { metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) + assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*3)) } }) } @@ -116,41 +141,71 @@ func TestNatsHandlerForCloudEvents(t *testing.T) { } } -func TestNatsHandlerForLegacyEvents(t *testing.T) { +func TestHandlerForLegacyEvents(t *testing.T) { testCases := []struct { name string givenEventTypePrefix string givenApplicationName string givenEventType string - wantNatsSubject string + wantEventType string }{ + // not-clean event-types { name: "With prefix and clean application name and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefix, givenApplicationName: testingutils.ApplicationName, givenEventType: testingutils.CloudEventTypeNotClean, - wantNatsSubject: testingutils.CloudEventType, + wantEventType: testingutils.CloudEventType, }, { name: "With empty prefix and clean application name and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, givenApplicationName: testingutils.ApplicationName, givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, - wantNatsSubject: testingutils.CloudEventType, + wantEventType: testingutils.CloudEventTypePrefixEmpty, }, { name: "With prefix and not-clean application name and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefix, givenApplicationName: testingutils.ApplicationNameNotClean, givenEventType: testingutils.CloudEventTypeNotClean, - wantNatsSubject: testingutils.CloudEventType, + wantEventType: testingutils.CloudEventType, }, { name: "With empty prefix and not-clean application name and not-clean event-type", givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, givenApplicationName: testingutils.ApplicationNameNotClean, givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, - wantNatsSubject: testingutils.CloudEventType, + wantEventType: testingutils.CloudEventTypePrefixEmpty, + }, + // clean event-types + { + name: "With prefix and clean application name and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenApplicationName: testingutils.ApplicationName, + givenEventType: testingutils.CloudEventType, + wantEventType: testingutils.CloudEventType, + }, + { + name: "With empty prefix and clean application name and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenApplicationName: testingutils.ApplicationName, + givenEventType: testingutils.CloudEventTypePrefixEmpty, + wantEventType: testingutils.CloudEventTypePrefixEmpty, + }, + { + name: "With prefix and not-clean application name and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefix, + givenApplicationName: testingutils.ApplicationNameNotClean, + givenEventType: testingutils.CloudEventType, + wantEventType: testingutils.CloudEventType, + }, + { + name: "With empty prefix and not-clean application name and clean event-type", + givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, + givenApplicationName: testingutils.ApplicationNameNotClean, + givenEventType: testingutils.CloudEventTypePrefixEmpty, + wantEventType: testingutils.CloudEventTypePrefixEmpty, }, } for _, tc := range testCases { @@ -162,36 +217,32 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { defer cancel() handlerMock := mock.StartOrDie(ctx, t, + mock.WithEventTypePrefix(tc.givenEventTypePrefix), mock.WithApplication(tc.givenApplicationName), ) - defer handlerMock.ShutdownNatsServerAndWait() - - // setup test environment - publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/%s/v1/events", handlerMock.GetNatsConfig().Port, tc.givenApplicationName) - subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, tc.givenEventType)) - - // prepare event type from subscription - assert.NotNil(t, subscription.Spec.Filter) - assert.NotEmpty(t, subscription.Spec.Filter.Filters) - eventTypeToSubscribe := subscription.Spec.Filter.Filters[0].EventType.Value - - // connect to nats - connection, err := pkgnats.Connect(handlerMock.GetNatsURL(), - pkgnats.WithRetryOnFailedConnect(true), - pkgnats.WithMaxReconnects(3), - pkgnats.WithReconnectWait(time.Second), - ) - assert.Nil(t, err) - assert.NotNil(t, connection) - - // publish a message to NATS and validate it - validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantNatsSubject) - testingutils.SubscribeToEventOrFail(t, connection, eventTypeToSubscribe, validator) + defer handlerMock.Stop() // run the tests for publishing legacy events + publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/%s/v1/events", handlerMock.GetNatsConfig().Port, tc.givenApplicationName) for _, testCase := range handlertest.TestCasesForLegacyEvents { testCase := testCase t.Run(testCase.Name, func(t *testing.T) { + // connect to nats + connection, err := pkgnats.Connect(handlerMock.GetNatsURL(), + pkgnats.WithRetryOnFailedConnect(true), + pkgnats.WithMaxReconnects(3), + pkgnats.WithReconnectWait(time.Second), + ) + assert.Nil(t, err) + assert.NotNil(t, connection) + defer connection.Close() + + // publish a message to NATS and validate it + notify := make(chan bool) + defer close(notify) + validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantEventType, notify) + testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) + body, headers := testCase.ProvideMessage() resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) require.NoError(t, err) @@ -205,6 +256,7 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { if testingutils.Is2XX(resp.StatusCode) { metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) + assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*3)) } }) } @@ -212,7 +264,7 @@ func TestNatsHandlerForLegacyEvents(t *testing.T) { } } -func TestNatsHandlerForSubscribedEndpoint(t *testing.T) { +func TestHandlerForSubscribedEndpoint(t *testing.T) { testCases := []struct { name string givenEventTypePrefix string @@ -247,10 +299,11 @@ func TestNatsHandlerForSubscribedEndpoint(t *testing.T) { testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, tc.givenEventType), ) handlerMock := mock.StartOrDie(ctx, t, - mock.WithSubscription(scheme, subscription, tc.givenEventTypePrefix), + mock.WithEventTypePrefix(tc.givenEventTypePrefix), + mock.WithSubscription(scheme, subscription), mock.WithApplication(testingutils.ApplicationName), ) - defer handlerMock.ShutdownNatsServerAndWait() + defer handlerMock.Stop() // run the tests for subscribed endpoint for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { @@ -260,10 +313,10 @@ func TestNatsHandlerForSubscribedEndpoint(t *testing.T) { resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) require.NoError(t, err) require.Equal(t, testCase.WantStatusCode, resp.StatusCode) - defer func() { _ = resp.Body.Close() }() respBodyBytes, err := ioutil.ReadAll(resp.Body) require.NoError(t, err) + require.NoError(t, resp.Body.Close()) gotEventsResponse := subscribed.Events{} err = json.Unmarshal(respBodyBytes, &gotEventsResponse) diff --git a/pkg/handler/nats/health_test.go b/pkg/handler/nats/health_test.go index 85ad055..d4e8615 100644 --- a/pkg/handler/nats/health_test.go +++ b/pkg/handler/nats/health_test.go @@ -45,7 +45,7 @@ func TestReadinessCheck(t *testing.T) { }() handlerMock := mock.StartOrDie(context.TODO(), t) - defer handlerMock.ShutdownNatsServerAndWait() + defer handlerMock.Stop() var handler http.HandlerFunc if tc.wantPanicForNilHandler { diff --git a/pkg/handler/nats/mock/mock.go b/pkg/handler/nats/mock/mock.go index 17a5845..c8553fe 100644 --- a/pkg/handler/nats/mock/mock.go +++ b/pkg/handler/nats/mock/mock.go @@ -12,9 +12,12 @@ import ( dynamicfake "k8s.io/client-go/dynamic/fake" "github.com/nats-io/nats-server/v2/server" + natsio "github.com/nats-io/nats.go" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype/eventtypetest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" @@ -37,12 +40,15 @@ type NatsHandlerMock struct { handler *nats.Handler livenessEndpoint string readinessEndpoint string + eventTypePrefix string logger *logrus.Logger natsServer *server.Server natsConfig *env.NatsConfig collector *metrics.Collector legacyTransformer *legacy.Transformer subscribedProcessor *subscribed.Processor + eventTypeCleaner eventtype.Cleaner + connection *natsio.Conn } // NatsHandlerMockOpt represents a NatsHandlerMock option. @@ -62,6 +68,7 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) * collector: metrics.NewCollector(), legacyTransformer: &legacy.Transformer{}, subscribedProcessor: &subscribed.Processor{}, + eventTypeCleaner: eventtypetest.CleanerFunc(eventtypetest.DefaultCleaner), } for _, opt := range opts { @@ -76,8 +83,9 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) * pkgnats.WithReconnectWait(time.Second), ) require.NoError(t, err) + mock.connection = connection - msgSender := sender.NewNatsMessageSender(ctx, connection, mock.logger) + msgSender := sender.NewNatsMessageSender(ctx, mock.connection, mock.logger) mock.handler = nats.NewHandler( msgReceiver, @@ -88,6 +96,7 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) * mock.subscribedProcessor, mock.logger, mock.collector, + mock.eventTypeCleaner, ) go func() { require.NoError(t, mock.handler.Start(ctx)) }() @@ -96,6 +105,12 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) * return mock } +// Stop closes the sender.NatsMessageSender connection and calls the NatsHandlerMock.ShutdownNatsServerAndWait. +func (m *NatsHandlerMock) Stop() { + m.connection.Close() + m.ShutdownNatsServerAndWait() +} + // ShutdownNatsServerAndWait shuts down the NATS server used by the NatsHandlerMock and waits for the shutdown. func (m *NatsHandlerMock) ShutdownNatsServerAndWait() { m.natsServer.Shutdown() @@ -132,10 +147,17 @@ func (m *NatsHandlerMock) GetNatsConfig() *env.NatsConfig { return m.natsConfig } +// WithEventTypePrefix returns NatsHandlerMockOpt which sets the eventTypePrefix for the given NatsHandlerMock. +func WithEventTypePrefix(eventTypePrefix string) NatsHandlerMockOpt { + return func(m *NatsHandlerMock) { + m.eventTypePrefix = eventTypePrefix + } +} + // WithSubscription returns NatsHandlerMockOpt which sets the subscribed.Processor for the given NatsHandlerMock. -func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Subscription, eventTypePrefix string) NatsHandlerMockOpt { +func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Subscription) NatsHandlerMockOpt { return func(m *NatsHandlerMock) { - m.natsConfig.LegacyEventTypePrefix = eventTypePrefix + m.natsConfig.LegacyEventTypePrefix = m.eventTypePrefix dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, 10*time.Second, v1.NamespaceAll, nil) genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) @@ -144,7 +166,7 @@ func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Sub m.subscribedProcessor = &subscribed.Processor{ SubscriptionLister: &subLister, Config: m.natsConfig.ToConfig(), - Logger: logrus.New(), + Logger: m.logger, } } } @@ -152,12 +174,13 @@ func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Sub // WithApplication returns NatsHandlerMockOpt which sets the legacy.Transformer for the given NatsHandlerMock. func WithApplication(applicationName string) NatsHandlerMockOpt { return func(m *NatsHandlerMock) { - appLister := handlertest.NewApplicationListerOrDie(m.ctx, applicationName) + applicationLister := handlertest.NewApplicationListerOrDie(m.ctx, applicationName) m.legacyTransformer = legacy.NewTransformer( m.natsConfig.ToConfig().BEBNamespace, - m.natsConfig.ToConfig().EventTypePrefix, - appLister, + m.eventTypePrefix, + applicationLister, ) + m.eventTypeCleaner = eventtype.NewCleaner(m.eventTypePrefix, applicationLister, m.logger) } } diff --git a/pkg/legacy-events/constants.go b/pkg/legacy-events/constants.go index a591544..2a8ee86 100644 --- a/pkg/legacy-events/constants.go +++ b/pkg/legacy-events/constants.go @@ -31,9 +31,3 @@ const ( FieldEventTypeVersion = "event-type-version" FieldData = "data" ) - -// HTTP ContentType constants -const ( - ContentTypeApplicationJSON = "application/json" - HeaderContentType = "Content-Type" -) diff --git a/pkg/legacy-events/helpers.go b/pkg/legacy-events/helpers.go index a8a66b8..595effb 100644 --- a/pkg/legacy-events/helpers.go +++ b/pkg/legacy-events/helpers.go @@ -8,6 +8,7 @@ import ( log "github.com/sirupsen/logrus" + "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" ) @@ -44,7 +45,7 @@ func is2XXStatusCode(statusCode int) bool { // writeJSONResponse writes a JSON response func writeJSONResponse(w http.ResponseWriter, resp *api.PublishEventResponses) { encoder := json.NewEncoder(w) - w.Header().Set("Content-Type", ContentTypeApplicationJSON) + w.Header().Set(internal.HeaderContentType, internal.ContentTypeApplicationJSON) if resp.Error != nil { w.WriteHeader(resp.Error.Status) @@ -60,10 +61,11 @@ func writeJSONResponse(w http.ResponseWriter, resp *api.PublishEventResponses) { log.Errorf("received an empty response") } -// formatEventType4BEB format eventType as per BEB spec -func formatEventType4BEB(eventTypePrefix, app, eventType, version string) string { - if len(strings.TrimSpace(eventTypePrefix)) == 0 { - return fmt.Sprintf(eventTypeFormatWithoutPrefix, app, eventType, version) +// formatEventType joins the given prefix, application, eventType and version with a "." as a separator. +// It ignores the prefix if it is empty. +func formatEventType(prefix, application, eventType, version string) string { + if len(strings.TrimSpace(prefix)) == 0 { + return fmt.Sprintf(eventTypeFormatWithoutPrefix, application, eventType, version) } - return fmt.Sprintf(eventTypeFormat, eventTypePrefix, app, eventType, version) + return fmt.Sprintf(eventTypeFormat, prefix, application, eventType, version) } diff --git a/pkg/legacy-events/helpers_test.go b/pkg/legacy-events/helpers_test.go index 3d7cddb..8a17f59 100644 --- a/pkg/legacy-events/helpers_test.go +++ b/pkg/legacy-events/helpers_test.go @@ -2,73 +2,82 @@ package legacy import ( "testing" + + "github.com/stretchr/testify/assert" ) func TestParseApplicationNameFromPath(t *testing.T) { testCases := []struct { - name string - inputPath string - wantedAppName string + name string + givenInputPath string + wantAppName string }{ { - name: "should return application when correct path is used", - inputPath: "/application/v1/events", - wantedAppName: "application", + name: "should return application when correct path is used", + givenInputPath: "/application/v1/events", + wantAppName: "application", }, { - name: "should return application when extra slash is in the path", - inputPath: "//application/v1/events", - wantedAppName: "application", + name: "should return application when extra slash is in the path", + givenInputPath: "//application/v1/events", + wantAppName: "application", }, } for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() - - gotAppName := ParseApplicationNameFromPath(tc.inputPath) - if tc.wantedAppName != gotAppName { - t.Errorf("incorrect parsing, wanted: %s, got: %s", tc.wantedAppName, gotAppName) - } + gotAppName := ParseApplicationNameFromPath(tc.givenInputPath) + assert.Equal(t, tc.wantAppName, gotAppName) }) } } -func TestFormatEventType4BEB(t *testing.T) { +func TestFormatEventType(t *testing.T) { testCases := []struct { - eventTypePrefix string - app string - eventType string - version string - expectedEventType string + givenPrefix string + givenApplication string + givenEventType string + givenVersion string + wantEventType string }{ { - eventTypePrefix: "prefix", - app: "app", - eventType: "order.foo", - version: "v1", - expectedEventType: "prefix.app.order.foo.v1", + givenPrefix: "prefix", + givenApplication: "app", + givenEventType: "order.foo", + givenVersion: "v1", + wantEventType: "prefix.app.order.foo.v1", + }, + { + givenPrefix: "prefix", + givenApplication: "app", + givenEventType: "order-foo", + givenVersion: "v1", + wantEventType: "prefix.app.order-foo.v1", }, { - eventTypePrefix: "prefix", - app: "app", - eventType: "order-foo", - version: "v1", - expectedEventType: "prefix.app.order-foo.v1", + givenPrefix: "prefix", + givenApplication: "app", + givenEventType: "order-foo.bar@123", + givenVersion: "v1", + wantEventType: "prefix.app.order-foo.bar@123.v1", }, { - eventTypePrefix: "", - app: "app", - eventType: "order-foo", - version: "v1", - expectedEventType: "app.order-foo.v1", + givenPrefix: "", + givenApplication: "app", + givenEventType: "order-foo", + givenVersion: "v1", + wantEventType: "app.order-foo.v1", + }, + { + givenPrefix: "", + givenApplication: "app", + givenEventType: "order-foo.bar@123", + givenVersion: "v1", + wantEventType: "app.order-foo.bar@123.v1", }, } - for _, tc := range testCases { - gotEventType := formatEventType4BEB(tc.eventTypePrefix, tc.app, tc.eventType, tc.version) - if tc.expectedEventType != gotEventType { - t.Errorf("incorrect formatting of eventType: "+ - "%s, wanted: %s got: %s", tc.eventType, tc.expectedEventType, gotEventType) - } + eventType := formatEventType(tc.givenPrefix, tc.givenApplication, tc.givenEventType, tc.givenVersion) + assert.Equal(t, tc.wantEventType, eventType) } } diff --git a/pkg/legacy-events/legacy.go b/pkg/legacy-events/legacy.go index 9160ca1..3e56d0c 100644 --- a/pkg/legacy-events/legacy.go +++ b/pkg/legacy-events/legacy.go @@ -8,14 +8,14 @@ import ( "strings" "time" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing" - cev2event "github.com/cloudevents/sdk-go/v2/event" "github.com/google/uuid" "github.com/pkg/errors" + "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" apiv1 "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing" ) var ( @@ -43,7 +43,7 @@ func NewTransformer(bebNamespace string, eventTypePrefix string, applicationList } // CheckParameters validates the parameters in the request and sends error responses if found invalid -func (t Transformer) checkParameters(parameters *apiv1.PublishEventParametersV1) (response *apiv1.PublishEventResponses) { +func (t *Transformer) checkParameters(parameters *apiv1.PublishEventParametersV1) (response *apiv1.PublishEventResponses) { if parameters == nil { return ErrorResponseBadRequest(ErrorMessageBadPayload) } @@ -76,12 +76,14 @@ func (t Transformer) checkParameters(parameters *apiv1.PublishEventParametersV1) return &apiv1.PublishEventResponses{} } -func (t Transformer) TransformLegacyRequestsToCE(writer http.ResponseWriter, request *http.Request) *cev2event.Event { +// TransformLegacyRequestsToCE transforms the legacy event to cloudevent from the given request. +// It also returns the original event-type without cleanup as the second return type. +func (t *Transformer) TransformLegacyRequestsToCE(writer http.ResponseWriter, request *http.Request) (*cev2event.Event, string) { // parse request body to PublishRequestV1 if request.Body == nil || request.ContentLength == 0 { resp := ErrorResponseBadRequest(ErrorMessageBadPayload) writeJSONResponse(writer, resp) - return nil + return nil, "" } parameters := &apiv1.PublishEventParametersV1{} @@ -94,18 +96,19 @@ func (t Transformer) TransformLegacyRequestsToCE(writer http.ResponseWriter, req resp = ErrorResponseBadRequest(err.Error()) } writeJSONResponse(writer, resp) - return nil + return nil, "" } // validate the PublishRequestV1 for missing / incoherent values checkResp := t.checkParameters(parameters) if checkResp.Error != nil { writeJSONResponse(writer, checkResp) - return nil + return nil, "" } // clean the application name form non-alphanumeric characters - appName := ParseApplicationNameFromPath(request.URL.Path) + appNameOriginal := ParseApplicationNameFromPath(request.URL.Path) + appName := appNameOriginal if appObj, err := t.applicationLister.Get(appName); err == nil { // handle existing applications appName = application.GetCleanTypeOrName(appObj) @@ -118,16 +121,19 @@ func (t Transformer) TransformLegacyRequestsToCE(writer http.ResponseWriter, req if err != nil { response := ErrorResponse(http.StatusInternalServerError, err) writeJSONResponse(writer, response) - return nil + return nil, "" } // Add tracing context to cloud events tracing.AddTracingContextToCEExtensions(request.Header, event) - return event + // prepare the original event-type without cleanup + eventType := formatEventType(t.eventTypePrefix, appNameOriginal, parameters.PublishrequestV1.EventType, parameters.PublishrequestV1.EventTypeVersion) + + return event, eventType } -func (t Transformer) TransformsCEResponseToLegacyResponse(writer http.ResponseWriter, statusCode int, event *cev2event.Event, msg string) { +func (t *Transformer) TransformsCEResponseToLegacyResponse(writer http.ResponseWriter, statusCode int, event *cev2event.Event, msg string) { response := &apiv1.PublishEventResponses{} // Fail if !is2XXStatusCode(statusCode) { @@ -145,7 +151,7 @@ func (t Transformer) TransformsCEResponseToLegacyResponse(writer http.ResponseWr } // convertPublishRequestToCloudEvent converts the given publish request to a CloudEvent. -func (t Transformer) convertPublishRequestToCloudEvent(appName string, publishRequest *apiv1.PublishEventParametersV1) (*cev2event.Event, error) { +func (t *Transformer) convertPublishRequestToCloudEvent(appName string, publishRequest *apiv1.PublishEventParametersV1) (*cev2event.Event, error) { if !application.IsCleanName(appName) { return nil, errors.New("application name should be cleaned from none-alphanumeric characters") } @@ -158,7 +164,7 @@ func (t Transformer) convertPublishRequestToCloudEvent(appName string, publishRe } event.SetTime(evTime) - if err := event.SetData(ContentTypeApplicationJSON, publishRequest.PublishrequestV1.Data); err != nil { + if err := event.SetData(internal.ContentTypeApplicationJSON, publishRequest.PublishrequestV1.Data); err != nil { return nil, errors.Wrap(err, "failed to set data to CE data field") } @@ -172,11 +178,11 @@ func (t Transformer) convertPublishRequestToCloudEvent(appName string, publishRe eventName := combineEventNameSegments(removeNonAlphanumeric(publishRequest.PublishrequestV1.EventType)) prefix := removeNonAlphanumeric(t.eventTypePrefix) - eventType := formatEventType4BEB(prefix, appName, eventName, publishRequest.PublishrequestV1.EventTypeVersion) + eventType := formatEventType(prefix, appName, eventName, publishRequest.PublishrequestV1.EventTypeVersion) event.SetType(eventType) event.SetSource(t.bebNamespace) event.SetExtension(eventTypeVersionExtensionKey, publishRequest.PublishrequestV1.EventTypeVersion) - event.SetDataContentType(ContentTypeApplicationJSON) + event.SetDataContentType(internal.ContentTypeApplicationJSON) return &event, nil } @@ -194,5 +200,5 @@ func combineEventNameSegments(eventName string) string { // removeNonAlphanumeric returns an eventName without any non-alphanumerical character besides dot (".") func removeNonAlphanumeric(eventType string) string { - return regexp.MustCompile(("[^a-zA-Z0-9.]+")).ReplaceAllString(eventType, "") + return regexp.MustCompile("[^a-zA-Z0-9.]+").ReplaceAllString(eventType, "") } diff --git a/pkg/legacy-events/legacy_test.go b/pkg/legacy-events/legacy_test.go index 855276b..85b0a8f 100644 --- a/pkg/legacy-events/legacy_test.go +++ b/pkg/legacy-events/legacy_test.go @@ -10,6 +10,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" @@ -21,12 +26,12 @@ const ( eventTypeMultiSegmentCombined = "Segment1Segment2Segment3Segment4.Segment5" ) -// TestTransformLegacyRequestsToCE ensures that TransformLegacyRequestsToCE transforms a http reuqest containing +// TestTransformLegacyRequestsToCE ensures that TransformLegacyRequestsToCE transforms a http request containing // a legacy request to a valid cloud event by creating mock http requests func TestTransformLegacyRequestsToCE(t *testing.T) { testCases := []struct { name string - // the event type has the strurcture + // the event type has the structure // ... // or, more specific // ...... @@ -36,51 +41,51 @@ func TestTransformLegacyRequestsToCE(t *testing.T) { // "ordertest.created" ts the (or .) // and "v2" is the // - // derrived from that a legacy event path (a.k.a. endpoint) has the structure + // derived from that a legacy event path (a.k.a. endpoint) has the structure // http://:///events // e.g. http://localhost:8081/varkestest/v1/events - prefix string - appName string - typeLabel string - eventName string - version string - expectedType string + givenPrefix string + givenApplication string + givenTypeLabel string + givenEventName string + wantVersion string + wantType string }{ { - name: "clean", - prefix: "pre1.pre2.pre3", - appName: "app", - typeLabel: "", - eventName: "object.do", - version: "v1", - expectedType: "pre1.pre2.pre3.app.object.do.v1", + name: "clean", + givenPrefix: "pre1.pre2.pre3", + givenApplication: "app", + givenTypeLabel: "", + givenEventName: "object.do", + wantVersion: "v1", + wantType: "pre1.pre2.pre3.app.object.do.v1", }, { - name: "unclean", - prefix: "p!r@e&1.p,r:e2.p|r+e3", - appName: "m(i_s+h*a}p", - typeLabel: "", - eventName: "o{b?j>e$c't.d;o", - version: "v1", - expectedType: "pre1.pre2.pre3.mishap.object.do.v1", + name: "unclean", + givenPrefix: "p!r@e&1.p,r:e2.p|r+e3", + givenApplication: "m(i_s+h*a}p", + givenTypeLabel: "", + givenEventName: "o{b?j>e$c't.d;o", + wantVersion: "v1", + wantType: "pre1.pre2.pre3.mishap.object.do.v1", }, { - name: "event name too many segments", - prefix: "pre1.pre2.pre3", - appName: "app", - typeLabel: "", - eventName: "too.many.dots.object.do", - version: "v1", - expectedType: "pre1.pre2.pre3.app.toomanydotsobject.do.v1", + name: "event name too many segments", + givenPrefix: "pre1.pre2.pre3", + givenApplication: "app", + givenTypeLabel: "", + givenEventName: "too.many.dots.object.do", + wantVersion: "v1", + wantType: "pre1.pre2.pre3.app.toomanydotsobject.do.v1", }, { - name: "with event type label", - prefix: "pre1.pre2.pre3", - appName: "app", - typeLabel: "different", - eventName: "object.do", - version: "v1", - expectedType: "pre1.pre2.pre3.different.object.do.v1", + name: "with event type label", + givenPrefix: "pre1.pre2.pre3", + givenApplication: "app", + givenTypeLabel: "different", + givenEventName: "object.do", + wantVersion: "v1", + wantType: "pre1.pre2.pre3.different.object.do.v1", }, } @@ -91,44 +96,37 @@ func TestTransformLegacyRequestsToCE(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - app := applicationtest.NewApplication(tc.appName, applicationTypeLabel(tc.typeLabel)) - appLister := fake.NewListerOrDie(ctx, app) - request, err := mockLegacyRequest(tc.version, tc.appName, tc.eventName) - if err != nil { - t.Errorf("error while creating mock legacy request in case %s:\n%s", tc.name, err.Error()) - } + request, err := mockLegacyRequest(tc.wantVersion, tc.givenApplication, tc.givenEventName) + assert.NoError(t, err) writer := httptest.NewRecorder() - - transformer := NewTransformer("test", tc.prefix, appLister) - actualEvent := transformer.TransformLegacyRequestsToCE(writer, request) - - errorString := func(caseName, subject, actual, expected string) string { - return fmt.Sprintf("Unexpected %s in case %s\nwas:\n\t%s\nexpected:\n\t%s", subject, caseName, actual, expected) - } + app := applicationtest.NewApplication(tc.givenApplication, applicationTypeLabel(tc.givenTypeLabel)) + appLister := fake.NewApplicationListerOrDie(ctx, app) + transformer := NewTransformer("test", tc.givenPrefix, appLister) + gotEvent, gotEventType := transformer.TransformLegacyRequestsToCE(writer, request) + wantEventType := formatEventType(tc.givenPrefix, tc.givenApplication, tc.givenEventName, tc.wantVersion) + assert.Equal(t, wantEventType, gotEventType) //check eventType - if actual := actualEvent.Context.GetType(); tc.expectedType != actual { - t.Errorf(errorString(tc.name, "event type", actual, tc.expectedType)) - } + gotType := gotEvent.Context.GetType() + assert.Equal(t, tc.wantType, gotType) // check extensions 'eventtypeversion' - if actual := actualEvent.Extensions()["eventtypeversion"].(string); actual != tc.version { - t.Errorf(errorString(tc.name, "event type", actual, tc.expectedType)) - } + gotVersion, ok := gotEvent.Extensions()["eventtypeversion"].(string) + assert.True(t, ok) + assert.Equal(t, tc.wantVersion, gotVersion) // check HTTP ContentType set properly - if actualContentType := actualEvent.Context.GetDataContentType(); actualContentType != ContentTypeApplicationJSON { - t.Errorf(errorString(tc.name, "HTTP Content Type", actualContentType, ContentTypeApplicationJSON)) - } + gotContentType := gotEvent.Context.GetDataContentType() + assert.Equal(t, internal.ContentTypeApplicationJSON, gotContentType) }) } } func applicationTypeLabel(label string) map[string]string { if label != "" { - return map[string]string{"application-type": label} + return map[string]string{application.TypeLabel: label} } return nil } @@ -149,53 +147,40 @@ func mockLegacyRequest(version, appname, eventType string) (*http.Request, error } func TestConvertPublishRequestToCloudEvent(t *testing.T) { - bebNs := MessagingNamespace - eventTypePrefix := MessagingEventTypePrefix - legacyTransformer := NewTransformer(bebNs, eventTypePrefix, nil) - eventID := EventID - appName := ApplicationName - legacyEventVersion := LegacyEventTypeVersion - data := LegacyEventData - timeNow := time.Now() - expectedEventType := formatEventType4BEB(eventTypePrefix, appName, eventTypeMultiSegmentCombined, legacyEventVersion) - timeNowStr := timeNow.Format(time.RFC3339) - timeNowFormatted, _ := time.Parse(time.RFC3339, timeNowStr) - publishReqParams := &legacyapi.PublishEventParametersV1{ + givenEventID := EventID + givenApplicationName := ApplicationName + givenEventTypePrefix := MessagingEventTypePrefix + givenTimeNow := time.Now().Format(time.RFC3339) + givenLegacyEventVersion := EventVersion + givenPublishReqParams := &legacyapi.PublishEventParametersV1{ PublishrequestV1: legacyapi.PublishRequestV1{ - EventID: eventID, + EventID: givenEventID, EventType: eventTypeMultiSegment, - EventTime: timeNowStr, - EventTypeVersion: legacyEventVersion, - Data: data, + EventTime: givenTimeNow, + EventTypeVersion: givenLegacyEventVersion, + Data: EventData, }, } - gotEvent, err := legacyTransformer.convertPublishRequestToCloudEvent(appName, publishReqParams) - if err != nil { - t.Fatal("failed to convert publish request to CE", err) - } - if gotEvent.Context.GetID() != eventID { - t.Errorf("incorrect id, want: %s, got: %s", eventID, gotEvent.Context.GetDataContentType()) - } - if gotEvent.Context.GetType() != expectedEventType { - t.Errorf("incorrect eventType, want: %s, got: %s", expectedEventType, gotEvent.Context.GetType()) - } - if gotEvent.Context.GetTime() != timeNowFormatted { - t.Errorf("incorrect eventTime, want: %s, got: %s", timeNowFormatted, gotEvent.Context.GetTime()) - } - if gotEvent.Context.GetSource() != bebNs { - t.Errorf("incorrect source want: %s, got: %s", bebNs, gotEvent.Context.GetDataContentType()) - } - if gotEvent.Context.GetDataContentType() != ContentTypeApplicationJSON { - t.Errorf("incorrect content-type, want: %s, got: %s", ContentTypeApplicationJSON, gotEvent.Context.GetDataContentType()) - } + wantBebNs := MessagingNamespace + wantEventID := givenEventID + wantEventType := formatEventType(givenEventTypePrefix, givenApplicationName, eventTypeMultiSegmentCombined, givenLegacyEventVersion) + wantTimeNowFormatted, _ := time.Parse(time.RFC3339, givenTimeNow) + wantDataContentType := internal.ContentTypeApplicationJSON + + legacyTransformer := NewTransformer(wantBebNs, givenEventTypePrefix, nil) + gotEvent, err := legacyTransformer.convertPublishRequestToCloudEvent(givenApplicationName, givenPublishReqParams) + require.NoError(t, err) + assert.Equal(t, wantBebNs, gotEvent.Context.GetSource()) + assert.Equal(t, wantEventID, gotEvent.Context.GetID()) + assert.Equal(t, wantEventType, gotEvent.Context.GetType()) + assert.Equal(t, wantTimeNowFormatted, gotEvent.Context.GetTime()) + assert.Equal(t, wantDataContentType, gotEvent.Context.GetDataContentType()) + + wantLegacyEventVersion := givenLegacyEventVersion gotExtension, err := gotEvent.Context.GetExtension(eventTypeVersionExtensionKey) - if err != nil { - t.Errorf("eventtype extension is missing: %v", err) - } - if gotExtension != legacyEventVersion { - t.Errorf("incorrect eventtype extension, want: %s, got: %s", legacyEventVersion, gotExtension) - } + assert.NoError(t, err) + assert.Equal(t, wantLegacyEventVersion, gotExtension) } func TestCombineEventTypeSegments(t *testing.T) { @@ -206,8 +191,8 @@ func TestCombineEventTypeSegments(t *testing.T) { }{ { name: "event-type with two segments", - givenEventType: LegacyEventType, - wantEventType: LegacyEventType, + givenEventType: EventName, + wantEventType: EventName, }, { name: "event-type with more than two segments", @@ -230,29 +215,29 @@ func TestCombineEventTypeSegments(t *testing.T) { func TestRemoveNonAlphanumeric(t *testing.T) { testCases := []struct { - name string - givenEventType string - expectedEventType string + name string + givenEventType string + wantEventType string }{ { - name: "unclean", - givenEventType: "1-2+3=4.t&h$i#s.t!h@a%t.t;o/m$f*o{o]lery", - expectedEventType: "1234.this.that.tomfoolery", + name: "unclean", + givenEventType: "1-2+3=4.t&h$i#s.t!h@a%t.t;o/m$f*o{o]lery", + wantEventType: "1234.this.that.tomfoolery", }, { - name: "clean", - givenEventType: "1234.this.that", - expectedEventType: "1234.this.that", + name: "clean", + givenEventType: "1234.this.that", + wantEventType: "1234.this.that", }, { - name: "single unclean segment", - givenEventType: "t_o_m_f_o_o_l_e_r_y", - expectedEventType: "tomfoolery", + name: "single unclean segment", + givenEventType: "t_o_m_f_o_o_l_e_r_y", + wantEventType: "tomfoolery", }, { - name: "empty", - givenEventType: "", - expectedEventType: "", + name: "empty", + givenEventType: "", + wantEventType: "", }, } for _, tc := range testCases { @@ -260,10 +245,8 @@ func TestRemoveNonAlphanumeric(t *testing.T) { t.Run(fmt.Sprintf("%s eventType", tc.name), func(t *testing.T) { t.Parallel() - actual := removeNonAlphanumeric(tc.givenEventType) - if actual != tc.expectedEventType { - t.Errorf("invalid eventType; expected: %s, got %s", tc.expectedEventType, actual) - } + gotEventType := removeNonAlphanumeric(tc.givenEventType) + assert.Equal(t, tc.wantEventType, gotEventType) }) } } diff --git a/pkg/nats/connect_test.go b/pkg/nats/connect_test.go index 3a2842c..49e9862 100644 --- a/pkg/nats/connect_test.go +++ b/pkg/nats/connect_test.go @@ -51,6 +51,7 @@ func TestConnect(t *testing.T) { ) assert.Nil(t, err) assert.NotNil(t, connection) + defer func() { connection.Close() }() // then assert.Equal(t, connection.Status(), nats.CONNECTED) diff --git a/pkg/sender/nats_test.go b/pkg/sender/nats_test.go index 4dec4af..44dc4f2 100644 --- a/pkg/sender/nats_test.go +++ b/pkg/sender/nats_test.go @@ -54,15 +54,19 @@ func TestNatsMessageSender(t *testing.T) { ) assert.NoError(t, err) assert.NotNil(t, connection) + defer func() { connection.Close() }() receive := make(chan bool, 1) - validator := testingutils.ValidateNatsMessageDataOrFail(t, fmt.Sprintf(`"%s"`, testingutils.CloudEventData), receive) + validator := testingutils.ValidateNatsMessageDataOrFail(t, fmt.Sprintf(`"%s"`, testingutils.EventData), receive) testingutils.SubscribeToEventOrFail(t, connection, testingutils.CloudEventType, validator) - ce := testingutils.StructuredCloudEventPayloadWithCleanEventType + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(testingutils.CloudEventType), + ) + payload, _ := builder.BuildStructured() event := cloudevents.NewEvent() event.SetType(testingutils.CloudEventType) - err = json.Unmarshal([]byte(ce), &event) + err = json.Unmarshal([]byte(payload), &event) assert.NoError(t, err) ctx := context.Background() diff --git a/pkg/subscribed/response.go b/pkg/subscribed/response.go index ad1bcbd..855c59e 100644 --- a/pkg/subscribed/response.go +++ b/pkg/subscribed/response.go @@ -6,6 +6,7 @@ import ( "github.com/sirupsen/logrus" + "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" ) @@ -31,7 +32,7 @@ func RespondWithErrorAndLog(e error, w http.ResponseWriter) { } func respond(w http.ResponseWriter, httpCode int) { - w.Header().Set(legacy.HeaderContentType, legacy.ContentTypeApplicationJSON) + w.Header().Set(internal.HeaderContentType, internal.ContentTypeApplicationJSON) w.WriteHeader(httpCode) logrus.Infof("Response code from \"subscribed\" request: HTTP %d", httpCode) } diff --git a/testing/fixtures.go b/testing/fixtures.go index f4e2fd8..e2735fb 100644 --- a/testing/fixtures.go +++ b/testing/fixtures.go @@ -1,132 +1,197 @@ package testing +import ( + "fmt" + "net/http" + "strings" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" +) + const ( ApplicationName = "testapp1023" - ApplicationNameNotClean = "test.app_1-0+2=3" + ApplicationNameNotClean = "testapp_1-0+2=3" MessagingNamespace = "/messaging.namespace" MessagingEventTypePrefix = "prefix" MessagingEventTypePrefixEmpty = "" - EventID = "8945ec08-256b-11eb-9928-acde48001122" - CloudEventType = MessagingEventTypePrefix + "." + ApplicationName + ".order.created.v1" - CloudEventTypePrefixEmpty = ApplicationName + ".order.created.v1" - CloudEventTypeNotClean = MessagingEventTypePrefix + "." + ApplicationNameNotClean + ".order.created.v1" - CloudEventTypeNotCleanPrefixEmpty = ApplicationNameNotClean + ".order.created.v1" + EventID = "8945ec08-256b-11eb-9928-acde48001122" + EventData = `{\"key\":\"value\"}` + EventName = "order.created" + EventVersion = "v1" + + CloudEventNameAndVersion = EventName + "." + EventVersion + CloudEventType = MessagingEventTypePrefix + "." + ApplicationName + "." + CloudEventNameAndVersion + CloudEventTypePrefixEmpty = ApplicationName + "." + CloudEventNameAndVersion + CloudEventTypeNotClean = MessagingEventTypePrefix + "." + ApplicationNameNotClean + "." + CloudEventNameAndVersion + CloudEventTypeNotCleanPrefixEmpty = ApplicationNameNotClean + "." + CloudEventNameAndVersion CloudEventSource = "/default/sap.kyma/id" CloudEventSpecVersion = "1.0" - CloudEventData = `{\"key\":\"value\"}` - CloudEventDataContentType = "application/json" - LegacyEventType = "order.created" - LegacyEventTypeVersion = "v1" - LegacyEventTime = "2020-04-02T21:37:00Z" - LegacyEventData = `{"key": "value"}` - - StructuredCloudEventPayloadWithoutID = `{ - "type":"` + CloudEventTypeNotClean + `", - "specversion":"` + CloudEventSpecVersion + `", - "source":"` + CloudEventSource + `", - "data":"` + CloudEventData + `", - "datacontenttype":"` + CloudEventDataContentType + `" - }` - - StructuredCloudEventPayloadWithoutType = `{ - "id":"` + EventID + `", - "specversion":"` + CloudEventSpecVersion + `", - "source":"` + CloudEventSource + `", - "data":"` + CloudEventData + `", - "datacontenttype":"` + CloudEventDataContentType + `" - }` - - StructuredCloudEventPayloadWithoutSpecVersion = `{ - "id":"` + EventID + `", - "type":"` + CloudEventTypeNotClean + `", - "source":"` + CloudEventSource + `", - "data":"` + CloudEventData + `", - "datacontenttype":"` + CloudEventDataContentType + `" - }` - - StructuredCloudEventPayloadWithoutSource = `{ - "id":"` + EventID + `", - "type":"` + CloudEventTypeNotClean + `", - "specversion":"` + CloudEventSpecVersion + `", - "data":"` + CloudEventData + `", - "datacontenttype":"` + CloudEventDataContentType + `" - }` - - StructuredCloudEventPayload = `{ - "id":"` + EventID + `", - "type":"` + CloudEventTypeNotClean + `", - "specversion":"` + CloudEventSpecVersion + `", - "source":"` + CloudEventSource + `", - "data":"` + CloudEventData + `", - "datacontenttype":"` + CloudEventDataContentType + `" - }` - - StructuredCloudEventPayloadWithCleanEventType = `{ - "id":"` + EventID + `", - "type":"` + CloudEventType + `", - "specversion":"` + CloudEventSpecVersion + `", - "source":"` + CloudEventSource + `", - "data":"` + CloudEventData + `", - "datacontenttype":"` + CloudEventDataContentType + `" - }` - - ValidLegacyEventPayloadWithEventID = `{ - "event-id": "` + EventID + `", - "event-type":"` + LegacyEventType + `", - "event-type-version":"` + LegacyEventTypeVersion + `", - "event-time": "` + LegacyEventTime + `", - "data": ` + LegacyEventData + ` - }` - - ValidLegacyEventPayloadWithoutEventID = `{ - "event-type":"` + LegacyEventType + `", - "event-type-version":"` + LegacyEventTypeVersion + `", - "event-time": "` + LegacyEventTime + `", - "data": ` + LegacyEventData + ` - }` - LegacyEventPayloadWithInvalidEventID = `{ - "event-id":"foo-bar", - "event-type":"` + LegacyEventType + `", - "event-type-version":"` + LegacyEventTypeVersion + `", - "event-time": "` + LegacyEventTime + `", - "data": ` + LegacyEventData + ` - }` - - LegacyEventPayloadWithoutEventTime = `{ - "event-id": "` + EventID + `", - "event-type":"` + LegacyEventType + `", - "event-type-version":"` + LegacyEventTypeVersion + `", - "data": ` + LegacyEventData + ` - }` - - LegacyEventPayloadWithoutEventType = `{ - "event-id": "` + EventID + `", - "event-type-version":"` + LegacyEventTypeVersion + `", - "event-time": "` + LegacyEventTime + `", - "data": ` + LegacyEventData + ` - }` - LegacyEventPayloadWithInvalidEventTime = `{ - "event-id": "` + EventID + `", - "event-type":"` + LegacyEventType + `", - "event-type-version":"` + LegacyEventTypeVersion + `", - "event-time": "some time 10:23", - "data": ` + LegacyEventData + ` - }` + LegacyEventTime = "2020-04-02T21:37:00Z" +) - LegacyEventPayloadWithWithoutEventVersion = `{ - "event-id": "` + EventID + `", - "event-type":"` + LegacyEventType + `", - "event-time": "` + LegacyEventTime + `", - "data": ` + LegacyEventData + ` +type Event struct { + id string + data string + eventType string +} + +type CloudEvent struct { + Event + specVersion string + eventSource string + dataContentType string +} + +type CloudEventBuilder struct { + CloudEvent +} + +type CloudEventBuilderOpt func(*CloudEventBuilder) + +func NewCloudEventBuilder(opts ...CloudEventBuilderOpt) *CloudEventBuilder { + builder := &CloudEventBuilder{ + CloudEvent{ + Event: Event{ + id: EventID, + data: EventData, + eventType: CloudEventType, + }, + specVersion: CloudEventSpecVersion, + eventSource: CloudEventSource, + dataContentType: internal.ContentTypeApplicationJSON, + }, + } + for _, opt := range opts { + opt(builder) + } + return builder +} + +func WithCloudEventID(id string) CloudEventBuilderOpt { + return func(b *CloudEventBuilder) { + b.id = id + } +} + +func WithCloudEventSource(eventSource string) CloudEventBuilderOpt { + return func(b *CloudEventBuilder) { + b.eventSource = eventSource + } +} + +func WithCloudEventSpecVersion(specVersion string) CloudEventBuilderOpt { + return func(b *CloudEventBuilder) { + b.specVersion = specVersion + } +} + +func WithCloudEventType(eventType string) CloudEventBuilderOpt { + return func(b *CloudEventBuilder) { + b.eventType = eventType + } +} + +func addAsHeaderIfPresent(header http.Header, key, value string) { + if len(strings.TrimSpace(key)) == 0 || len(strings.TrimSpace(value)) == 0 { + return + } + header.Add(key, value) +} + +func (b *CloudEventBuilder) BuildBinary() (string, http.Header) { + payload := fmt.Sprintf(`"%s"`, b.data) + headers := make(http.Header) + addAsHeaderIfPresent(headers, CeIDHeader, b.id) + addAsHeaderIfPresent(headers, CeTypeHeader, b.eventType) + addAsHeaderIfPresent(headers, CeSourceHeader, b.eventSource) + addAsHeaderIfPresent(headers, CeSpecVersionHeader, b.specVersion) + return payload, headers +} + +func (b *CloudEventBuilder) BuildStructured() (string, http.Header) { + payload := `{ + "id":"` + b.id + `", + "data":"` + b.data + `", + "type":"` + b.eventType + `", + "source":"` + b.eventSource + `", + "specversion":"` + b.specVersion + `", + "datacontenttype":"` + b.dataContentType + `" }` - - ValidLegacyEventPayloadWithoutData = `{ - "event-id": "` + EventID + `", - "event-type":"` + LegacyEventType + `", - "event-type-version":"` + LegacyEventTypeVersion + `", - "event-time": "` + LegacyEventTime + `" + headers := http.Header{internal.HeaderContentType: []string{internal.ContentTypeApplicationCloudEventsJSON}} + return payload, headers +} + +type LegacyEvent struct { + Event + eventTime string + eventTypeVersion string +} + +type LegacyEventBuilder struct { + LegacyEvent +} + +type LegacyEventBuilderOpt func(*LegacyEventBuilder) + +func NewLegacyEventBuilder(opts ...LegacyEventBuilderOpt) *LegacyEventBuilder { + builder := &LegacyEventBuilder{ + LegacyEvent{ + Event: Event{ + id: EventID, + data: EventData, + eventType: EventName, + }, + eventTime: LegacyEventTime, + eventTypeVersion: EventVersion, + }, + } + for _, opt := range opts { + opt(builder) + } + return builder +} + +func WithLegacyEventID(id string) LegacyEventBuilderOpt { + return func(b *LegacyEventBuilder) { + b.id = id + } +} + +func WithLegacyEventType(eventType string) LegacyEventBuilderOpt { + return func(b *LegacyEventBuilder) { + b.eventType = eventType + } +} + +func WithLegacyEventTime(eventTime string) LegacyEventBuilderOpt { + return func(b *LegacyEventBuilder) { + b.eventTime = eventTime + } +} + +func WithLegacyEventTypeVersion(eventTypeVersion string) LegacyEventBuilderOpt { + return func(b *LegacyEventBuilder) { + b.eventTypeVersion = eventTypeVersion + } +} + +func WithLegacyEventData(data string) LegacyEventBuilderOpt { + return func(b *LegacyEventBuilder) { + b.data = data + } +} + +func (b *LegacyEventBuilder) Build() (string, http.Header) { + payload := `{ + "data": "` + b.data + `", + "event-id": "` + b.id + `", + "event-type":"` + b.eventType + `", + "event-time": "` + b.eventTime + `", + "event-type-version":"` + b.eventTypeVersion + `" }` -) + headers := http.Header{internal.HeaderContentType: []string{internal.ContentTypeApplicationJSON}} + return payload, headers +} diff --git a/testing/utils.go b/testing/utils.go index dfab470..90688a5 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -13,13 +13,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - http2 "github.com/cloudevents/sdk-go/v2/protocol/http" - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) +// binary cloudevent headers const ( - // binary cloudevent headers CeIDHeader = "ce-id" CeTypeHeader = "ce-type" CeSourceHeader = "ce-source" @@ -55,10 +53,6 @@ func SendEvent(endpoint, body string, headers http.Header) (*http.Response, erro return client.Do(req) } -func GetStructuredMessageHeaders() http.Header { - return http.Header{"Content-Type": []string{"application/cloudevents+json"}} -} - func GetBinaryMessageHeaders() http.Header { headers := make(http.Header) headers.Add(CeIDHeader, EventID) @@ -68,12 +62,6 @@ func GetBinaryMessageHeaders() http.Header { return headers } -func GetApplicationJSONHeaders() http.Header { - headers := make(http.Header) - headers.Add(http2.ContentType, "application/json") - return headers -} - type SubscriptionOpt func(*eventingv1alpha1.Subscription) func NewSubscription(opts ...SubscriptionOpt) *eventingv1alpha1.Subscription { From 5c2da19969c54183aafcb3eb590f68bd72e99feb Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Thu, 17 Mar 2022 13:55:15 +0100 Subject: [PATCH 050/194] Update golang version for Eventing components (#13648) --- cmd/event-publisher-proxy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/event-publisher-proxy/Dockerfile b/cmd/event-publisher-proxy/Dockerfile index 52f0df1..b2cbe71 100644 --- a/cmd/event-publisher-proxy/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.17.7-alpine3.15 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.17.8-alpine3.15 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From b072e0dae3115dc8ffaa402b763d2de5330db9d5 Mon Sep 17 00:00:00 2001 From: Kamil Kasperski Date: Mon, 21 Mar 2022 14:29:57 +0100 Subject: [PATCH 051/194] Kyma migration to OWNERS from CODEOWNERS (#13543) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Kyma migration to OWNERS from CODEOWNERS * Add Nina and Grzegorz to TW aliases & remove Alex * add label for eventing resources * update observability owners * add tests/fast-integration owners file * update application connector owners * Update OWNERS * Add missing OWNERS for SKR fast-integration, .github, tools and kyma-project.io directories * Update service-management owners * Update service-management owners 2 * Missing Jellyfish memebers * docs: Add jakobmoellersap to reconciler-reviewers * Update OWNERS * update tests/perf owners * Add API Gateway, Istio and other security resources OWNERS * update wookiees components * Add final batch of OWNERS files and fix intend errors in OWNERS_ALIASES Co-authored-by: Maja Kurcius Co-authored-by: Korbinian Stoemmer <292906+k15r@users.noreply.github.com> Co-authored-by: Dennis Geiselmann Co-authored-by: Rafał Foks Co-authored-by: Grzondziel, Klaudia Co-authored-by: Jeremy Harisch Co-authored-by: d067928 Co-authored-by: Jeremy Harisch <48282931+jeremyharisch@users.noreply.github.com> Co-authored-by: mjakobczyk Co-authored-by: pPrecel --- OWNERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OWNERS b/OWNERS index 4fbde54..51519a9 100644 --- a/OWNERS +++ b/OWNERS @@ -2,3 +2,6 @@ reviewers: - eventing-reviewers approvers: - eventing-approvers + +labels: + - area/eventing From a5441d858b26bb48fe06924e6dcdd31db09ebc46 Mon Sep 17 00:00:00 2001 From: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> Date: Wed, 23 Mar 2022 15:32:44 +0100 Subject: [PATCH 052/194] upgrade packages in epp (#13673) * upgrade package * bump img --- go.mod | 38 +++++++++++++++---------------- go.sum | 70 +++++++++++++++++++++++++++++++++++++++------------------- 2 files changed, 66 insertions(+), 42 deletions(-) diff --git a/go.mod b/go.mod index cab345d..29ebc21 100644 --- a/go.mod +++ b/go.mod @@ -7,20 +7,20 @@ require ( github.com/cloudevents/sdk-go/v2 v2.8.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20211006112227-6d16a34ea468 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20211123105853-ceeb73d8a841 - github.com/nats-io/nats-server/v2 v2.6.1 - github.com/nats-io/nats.go v1.12.3 - github.com/onsi/gomega v1.17.0 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220318153915-799f491b2fd1 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220318153915-799f491b2fd1 + github.com/nats-io/nats-server/v2 v2.7.4 + github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d + github.com/onsi/gomega v1.18.1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 github.com/sirupsen/logrus v1.8.1 - github.com/stretchr/testify v1.7.0 + github.com/stretchr/testify v1.7.1 go.opencensus.io v0.23.0 - golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f - k8s.io/api v0.23.4 - k8s.io/apimachinery v0.23.4 - k8s.io/client-go v0.23.0 + golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a + k8s.io/api v0.23.5 + k8s.io/apimachinery v0.23.5 + k8s.io/client-go v0.23.5 sigs.k8s.io/controller-runtime v0.11.1 ) @@ -39,13 +39,13 @@ require ( github.com/googleapis/gnostic v0.5.5 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.13.4 // indirect + github.com/klauspost/compress v1.14.4 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/minio/highwayhash v1.0.1 // indirect + github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/nats-io/jwt/v2 v2.0.3 // indirect + github.com/nats-io/jwt/v2 v2.2.1-0.20220113022732-58e87895b296 // indirect github.com/nats-io/nkeys v0.3.0 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -53,15 +53,15 @@ require ( github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/spf13/pflag v1.0.5 // indirect - go.uber.org/atomic v1.7.0 // indirect + go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.19.1 // indirect - golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect - golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect + go.uber.org/zap v1.21.0 // indirect + golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce // indirect + golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect - golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect + golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.27.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index c86401a..f7f67c9 100644 --- a/go.sum +++ b/go.sum @@ -154,10 +154,8 @@ github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmE github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/protocol/nats/v2 v2.5.0/go.mod h1:69I3AikdiNccEO/188fSiEVFphftrxJ5fgLdG40PAKk= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.8.0 h1:sn/ExiNFh1ooLGRVu/YvKF1WyaX65b4wGE99BMcvvKg= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.8.0/go.mod h1:YdfvPwlNoyTW6exGMoayTlHdb9R/ZbFk9ZT5S/aPD1Y= -github.com/cloudevents/sdk-go/v2 v2.5.0/go.mod h1:nlXhgFkf0uTopxmRXalyMwS2LG70cRGPrxzmjJgSG0U= github.com/cloudevents/sdk-go/v2 v2.8.0 h1:kmRaLbsafZmidZ0rZ6h7WOMqCkRMcVTLV5lxV/HKQ9Y= github.com/cloudevents/sdk-go/v2 v2.8.0/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -406,7 +404,6 @@ github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -444,6 +441,7 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -548,8 +546,9 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.13.4 h1:0zhec2I8zGnjWcKyLl6i3gPqKANCCn5e9xmviEEeX6s= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4= +github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -566,10 +565,11 @@ github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4 github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20210909101151-ac45e9ce3553/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= github.com/kyma-project/kyma/common/logging v0.0.0-20211006112227-6d16a34ea468/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20211006112227-6d16a34ea468 h1:0SPnmY0G+KntNdcVkzDnkCiWlmcKZxhrDVId1evT+jc= github.com/kyma-project/kyma/components/application-operator v0.0.0-20211006112227-6d16a34ea468/go.mod h1:tHyxTctgL2M0a0Rn25goIO6SVp1Hvo7eoZcrnDCIXxA= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20211123105853-ceeb73d8a841 h1:Jka8zBprgoUfutZH76EysIqqLLr61JEh6v0aXagZrl8= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20211123105853-ceeb73d8a841/go.mod h1:GQPUb9xnwDxDecH/lxZhswnH9vyvtkqTzkmbDtvMZts= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220318153915-799f491b2fd1 h1:85BEpUmw9yJKh8Ref0wYC01kKGpnoGq5W+KLTTytqQw= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220318153915-799f491b2fd1/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220318153915-799f491b2fd1 h1:NJ8Z/8rO2TM9BuNs2dAgr/jN2TWXRSgVTZ9V24x6W2w= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220318153915-799f491b2fd1/go.mod h1:NjmxsBfnqBnOT5H9Z7wnukHjwk/yi2Y9aS4N6hennEE= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -611,8 +611,9 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.1 h1:dZ6IIu8Z14VlC0VpfKofAhCy74wu/Qb5gcn52yWoz/0= github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= +github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.1.1/go.mod h1:EBArHfARyrSWO/+Wyr9zwEkc6XMFB9XyNgFNmRkZZU4= @@ -655,16 +656,20 @@ github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5Vgl github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= github.com/nats-io/jwt v1.2.2 h1:w3GMTO969dFg+UOKTmmyuu7IGdusK+7Ytlt//OYH/uU= github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= -github.com/nats-io/jwt/v2 v2.0.3 h1:i/O6cmIsjpcQyWDYNcq2JyZ3/VTF8SJ4JWluI5OhpvI= github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= +github.com/nats-io/jwt/v2 v2.2.1-0.20220113022732-58e87895b296 h1:vU9tpM3apjYlLLeY23zRWJ9Zktr5jp+mloR942LEOpY= +github.com/nats-io/jwt/v2 v2.2.1-0.20220113022732-58e87895b296/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= -github.com/nats-io/nats-server/v2 v2.6.1 h1:cJy+ia7/4EaJL+ZYDmIy2rD1mDWTfckhtPBU0GYo8xM= github.com/nats-io/nats-server/v2 v2.6.1/go.mod h1:Az91TbZiV7K4a6k/4v6YYdOKEoxCXj+iqhHVf/MlrKo= +github.com/nats-io/nats-server/v2 v2.7.4 h1:c+BZJ3rGzUKCBIM4IXO8uNT2u1vajGbD1kPA6wqCEaM= +github.com/nats-io/nats-server/v2 v2.7.4/go.mod h1:1vZ2Nijh8tcyNe8BDVyTviCd9NYzRbubQYiEHsvOQWc= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nats.go v1.12.3 h1:te0GLbRsjtejEkZKKiuk46tbfIn6FfCSv3WWSo1+51E= github.com/nats-io/nats.go v1.12.3/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats.go v1.13.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d h1:zJf4l8Kp67RIZhoVeniSLZs69SHNgjLHz0aNsqPPlx8= +github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= @@ -696,6 +701,8 @@ github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= +github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -705,8 +712,9 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg= github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -863,8 +871,9 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -943,10 +952,12 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -963,8 +974,9 @@ go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= +go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -990,8 +1002,9 @@ golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce h1:Roh6XWxHFKrPgC/EQhVubSAGQ6Ozk6IdxHSzt1mR0EI= +golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1088,8 +1101,10 @@ golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1103,8 +1118,9 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a h1:qfl7ob3DIEs3Ml9oLuPwY2N04gymzAW04WsUQHIClgM= +golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -1207,13 +1223,16 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1232,8 +1251,9 @@ golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M= +golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1503,8 +1523,9 @@ k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= k8s.io/api v0.23.0/go.mod h1:8wmDdLBHBNxtOIytwLstXt5E9PddnZb0GaMcqsvDBpg= -k8s.io/api v0.23.4 h1:85gnfXQOWbJa1SiWGpE9EEtHs0UVvDyIsSMpEtl2D4E= k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= +k8s.io/api v0.23.5 h1:zno3LUiMubxD/V1Zw3ijyKO3wxrhbUF1Ck+VjBvfaoA= +k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= @@ -1522,8 +1543,9 @@ k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswP k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apimachinery v0.23.0/go.mod h1:fFCTTBKvKcwTPFzjlcxp91uPFZr+JA0FubU4fLzzFYc= -k8s.io/apimachinery v0.23.4 h1:fhnuMd/xUL3Cjfl64j5ULKZ1/J9n8NuQEgNL+WXWfdM= k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= +k8s.io/apimachinery v0.23.5 h1:Va7dwhp8wgkUPWsEXk6XglXWU4IKYLKNlv8VkX7SDM0= +k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= @@ -1541,8 +1563,10 @@ k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= -k8s.io/client-go v0.23.0 h1:vcsOqyPq7XV3QmQRCBH/t9BICJM9Q1M18qahjv+rebY= k8s.io/client-go v0.23.0/go.mod h1:hrDnpnK1mSr65lHHcUuIZIXDgEbzc7/683c6hyG4jTA= +k8s.io/client-go v0.23.4/go.mod h1:PKnIL4pqLuvYUK1WU7RLTMYKPiIh7MYShLshtRY9cj0= +k8s.io/client-go v0.23.5 h1:zUXHmEuqx0RY4+CsnkOn5l0GU+skkRXKGJrhmE2SLd8= +k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= From bcc7712ea10f62dd33bbb93d0eb88ad49fe572ba Mon Sep 17 00:00:00 2001 From: Nils Seip Date: Tue, 5 Apr 2022 12:39:24 +0200 Subject: [PATCH 053/194] Upgrade eventing images to use go 1.18 runtime (#13830) * Upgrade eventing images to use go 1.18 runtime * Use PR images --- cmd/event-publisher-proxy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/event-publisher-proxy/Dockerfile b/cmd/event-publisher-proxy/Dockerfile index b2cbe71..83b08d9 100644 --- a/cmd/event-publisher-proxy/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.17.8-alpine3.15 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.18.0-alpine3.15 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From 4f0aeeae109098d3c5ff4ac836c248f27fae46ca Mon Sep 17 00:00:00 2001 From: VladislavPaskar <15933100+VladislavPaskar@users.noreply.github.com> Date: Tue, 5 Apr 2022 23:31:24 +0200 Subject: [PATCH 054/194] add support for publishing in the jetstream mode, add test cases for jetstream enabled NATS server (#13763) --- cmd/event-publisher-proxy/main.go | 13 +- cmd/event-publisher-proxy/nats/nats.go | 30 +- internal/httpconsts.go | 8 +- pkg/env/nats_config.go | 4 + pkg/handler/nats/handler.go | 7 +- pkg/handler/nats/handler_health_test.go | 20 +- pkg/handler/nats/handler_integration_test.go | 199 +++++++------- pkg/handler/nats/health.go | 3 +- pkg/handler/nats/health_test.go | 40 +-- pkg/handler/nats/mock/mock.go | 24 +- pkg/nats/connect_test.go | 51 ++-- pkg/sender/jetstream.go | 116 ++++++++ pkg/sender/jetstream_test.go | 272 +++++++++++++++++++ pkg/sender/nats.go | 1 + pkg/sender/nats_test.go | 15 +- testing/nats.go | 37 ++- 16 files changed, 660 insertions(+), 180 deletions(-) create mode 100644 pkg/sender/jetstream.go create mode 100644 pkg/sender/jetstream_test.go diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index 969d17e..87b4396 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -16,8 +16,11 @@ const ( ) type Config struct { - // Backend used for Eventing. It could be "nats" or "beb" + // Backend used for Eventing. It could be "nats" or "beb". Backend string `envconfig:"BACKEND" required:"true"` + + // JetstreamModeEnabled indicates whether NATS backend will be used in default or jetstream mode. + JetstreamModeEnabled bool `envconfig:"ENABLE_JETSTREAM_BACKEND" default:"false"` } // Commander defines the interface of different implementations @@ -52,7 +55,7 @@ func main() { case backendBEB: commander = beb.NewCommander(opts, metricsCollector, logger) case backendNATS: - commander = nats.NewCommander(opts, metricsCollector, logger) + commander = nats.NewCommander(opts, metricsCollector, logger, cfg.JetstreamModeEnabled) default: logger.Fatalf("Invalid publisher backend: %v", cfg.Backend) } @@ -69,7 +72,11 @@ func main() { logger.Infof("Metrics server failed to start with error: %v", err) } - logger.Infof("Starting publisher to: %v", cfg.Backend) + if cfg.JetstreamModeEnabled { + logger.Infof("Starting publisher to: %v in the Jetstream mode", cfg.Backend) + } else { + logger.Infof("Starting publisher to: %v", cfg.Backend) + } // Start the commander. if err := commander.Start(); err != nil { diff --git a/cmd/event-publisher-proxy/nats/nats.go b/cmd/event-publisher-proxy/nats/nats.go index 3357a29..8c5422a 100644 --- a/cmd/event-publisher-proxy/nats/nats.go +++ b/cmd/event-publisher-proxy/nats/nats.go @@ -32,22 +32,24 @@ type Commander struct { logger *logrus.Logger envCfg *env.NatsConfig opts *options.Options + jetstreamMode bool } // NewCommander creates the Commander for publisher to NATS. -func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, logger *logrus.Logger) *Commander { +func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, logger *logrus.Logger, jetstreamMode bool) *Commander { return &Commander{ envCfg: new(env.NatsConfig), logger: logger, metricsCollector: metricsCollector, opts: opts, + jetstreamMode: jetstreamMode, } } // Init implements the Commander interface and initializes the publisher to NATS. func (c *Commander) Init() error { if err := envconfig.Process("", c.envCfg); err != nil { - c.logger.Errorf("Read NATS configuration failed with error: %s", err) + c.logger.Errorf("Read %s configuration failed with error: %s", c.getBackendName(), err) return err } return nil @@ -55,7 +57,7 @@ func (c *Commander) Init() error { // Start implements the Commander interface and starts the publisher. func (c *Commander) Start() error { - c.logger.Infof("Starting Event Publisher to NATS, envCfg: %v; opts: %#v", c.envCfg.String(), c.opts) + c.logger.Infof("Starting Event Publisher to %s, envCfg: %v; opts: %#v", c.getBackendName(), c.envCfg.String(), c.opts) // assure uniqueness var ctx context.Context @@ -71,13 +73,18 @@ func (c *Commander) Start() error { pkgnats.WithReconnectWait(c.envCfg.ReconnectWait), ) if err != nil { - c.logger.Errorf("Failed to connect to NATS server with error: %s", err) + c.logger.Errorf("Failed to connect to %s server with error: %s", c.getBackendName(), err) return err } defer connection.Close() - // configure message sender - messageSenderToNats := sender.NewNatsMessageSender(ctx, connection, c.logger) + // configure the message sender + var messageSenderToNats sender.GenericSender + if c.jetstreamMode { + messageSenderToNats = sender.NewJetstreamMessageSender(ctx, connection, c.envCfg, c.logger) + } else { + messageSenderToNats = sender.NewNatsMessageSender(ctx, connection, c.logger) + } // cluster config k8sConfig := config.GetConfigOrDie() @@ -111,13 +118,13 @@ func (c *Commander) Start() error { eventTypeCleaner := eventtype.NewCleaner(c.envCfg.LegacyEventTypePrefix, applicationLister, c.logger) // start handler which blocks until it receives a shutdown signal - if err := nats.NewHandler(messageReceiver, messageSenderToNats, c.envCfg.RequestTimeout, legacyTransformer, c.opts, + if err := nats.NewHandler(messageReceiver, &messageSenderToNats, c.envCfg.RequestTimeout, legacyTransformer, c.opts, subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleaner).Start(ctx); err != nil { c.logger.Errorf("Start handler failed with error: %s", err) return err } - c.logger.Info("Event Publisher NATS shutdown") + c.logger.Infof("Event Publisher %s shutdown", c.getBackendName()) return nil } @@ -127,3 +134,10 @@ func (c *Commander) Stop() error { c.cancel() return nil } + +func (c *Commander) getBackendName() string { + if c.jetstreamMode { + return "NATS in Jetstream mode" + } + return "NATS" +} diff --git a/internal/httpconsts.go b/internal/httpconsts.go index 0d5db85..0964813 100644 --- a/internal/httpconsts.go +++ b/internal/httpconsts.go @@ -1,8 +1,14 @@ package internal -// HTTP ContentType constants const ( + // HTTP ContentType constants HeaderContentType = "Content-Type" ContentTypeApplicationJSON = "application/json" ContentTypeApplicationCloudEventsJSON = "application/cloudevents+json" + + // cloud event header constants + CeIDHeader = "ce-id" + CeTypeHeader = "ce-type" + CeSourceHeader = "ce-source" + CeSpecVersionHeader = "ce-specversion" ) diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go index 0cb4ef3..8df0f3e 100644 --- a/pkg/env/nats_config.go +++ b/pkg/env/nats_config.go @@ -22,6 +22,10 @@ type NatsConfig struct { // LegacyEventTypePrefix is the prefix of each event as per the eventing specification, used for legacy events // It follows the eventType format: ... LegacyEventTypePrefix string `envconfig:"LEGACY_EVENT_TYPE_PREFIX" default:"kyma"` + + // JetStream-specific configs + JSStreamName string `envconfig:"JS_STREAM_NAME" default:"kyma"` + JSStreamSubjectPrefix string `envconfig:"JS_STREAM_SUBJECT_PREFIX" required:"true"` } // ToConfig converts to a default BEB BebConfig diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index ff68302..e06e0ab 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -29,7 +29,7 @@ type Handler struct { // Receiver receives incoming HTTP requests Receiver *receiver.HTTPMessageReceiver // Sender sends requests to the broker - Sender *sender.NatsMessageSender + Sender *sender.GenericSender // Defaulter sets default values to incoming events Defaulter cev2client.EventDefaulter // LegacyTransformer handles transformations needed to handle legacy events @@ -49,7 +49,7 @@ type Handler struct { } // NewHandler returns a new NATS Handler instance. -func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.NatsMessageSender, requestTimeout time.Duration, +func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.GenericSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logrus.Logger, collector *metrics.Collector, eventTypeCleaner eventtype.Cleaner) *Handler { return &Handler{ @@ -217,7 +217,8 @@ func (h *Handler) receive(ctx context.Context, event *cev2event.Event) { // send dispatches the given Cloud Event to NATS and returns the response details and dispatch time. func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.Duration, []byte) { start := time.Now() - resp, err := h.Sender.Send(ctx, event) + s := *h.Sender + resp, err := s.Send(ctx, event) dispatchTime := time.Since(start) if err != nil { h.collector.RecordError() diff --git a/pkg/handler/nats/handler_health_test.go b/pkg/handler/nats/handler_health_test.go index 4213c29..990d188 100644 --- a/pkg/handler/nats/handler_health_test.go +++ b/pkg/handler/nats/handler_health_test.go @@ -29,20 +29,24 @@ func TestHandlerHealth(t *testing.T) { wantReadinessStatusCode: health.StatusCodeNotHealthy, }, } + for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - t.Parallel() + // test in both default and jetstream NATS modes + for _, serverMode := range testingutils.NatsServerModes { + t.Run(serverMode.Name, func(t *testing.T) { + handlerMock := mock.StartOrDie(context.TODO(), t, mock.WithJetstream(serverMode.JetstreamEnabled)) + defer handlerMock.Stop() - handlerMock := mock.StartOrDie(context.TODO(), t) - defer handlerMock.Stop() + if tc.givenNatsServerShutdown { + handlerMock.ShutdownNatsServerAndWait() + } - if tc.givenNatsServerShutdown { - handlerMock.ShutdownNatsServerAndWait() + testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetLivenessEndpoint(), tc.wantLivenessStatusCode) + testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetReadinessEndpoint(), tc.wantReadinessStatusCode) + }) } - - testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetLivenessEndpoint(), tc.wantLivenessStatusCode) - testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetReadinessEndpoint(), tc.wantReadinessStatusCode) }) } } diff --git a/pkg/handler/nats/handler_integration_test.go b/pkg/handler/nats/handler_integration_test.go index 6d6066b..c40216a 100644 --- a/pkg/handler/nats/handler_integration_test.go +++ b/pkg/handler/nats/handler_integration_test.go @@ -18,7 +18,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats/mock" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" - pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" @@ -91,49 +90,50 @@ func TestHandlerForCloudEvents(t *testing.T) { wantEventType: testingutils.CloudEventTypePrefixEmpty, }, } + for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - t.Parallel() - ctx, cancel := context.WithCancel(context.Background()) defer cancel() - handlerMock := mock.StartOrDie(ctx, t, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithApplication(tc.givenApplicationName), - ) - defer handlerMock.Stop() - - // run the tests for publishing cloudevents - publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", handlerMock.GetNatsConfig().Port) - for _, testCase := range handlertest.TestCasesForCloudEvents { - testCase := testCase - t.Run(testCase.Name, func(t *testing.T) { - // connect to nats - connection, err := pkgnats.Connect(handlerMock.GetNatsURL(), - pkgnats.WithRetryOnFailedConnect(true), - pkgnats.WithMaxReconnects(3), - pkgnats.WithReconnectWait(time.Second), + // test in both default and jetstream NATS modes + for _, serverMode := range testingutils.NatsServerModes { + t.Run(serverMode.Name, func(t *testing.T) { + handlerMock := mock.StartOrDie(ctx, t, + mock.WithEventTypePrefix(tc.givenEventTypePrefix), + mock.WithApplication(tc.givenApplicationName), + mock.WithJetstream(serverMode.JetstreamEnabled), ) - assert.Nil(t, err) - assert.NotNil(t, connection) - defer connection.Close() + defer handlerMock.Stop() + + // run the tests for publishing cloudevents + publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", handlerMock.GetNatsConfig().Port) + for _, testCase := range handlertest.TestCasesForCloudEvents { + testCase := testCase + t.Run(testCase.Name, func(t *testing.T) { + // connect to nats + connection, err := testingutils.ConnectToNatsServer(handlerMock.GetNatsURL()) + assert.Nil(t, err) + assert.NotNil(t, connection) + defer connection.Close() - // validator to check NATS received events - notify := make(chan bool) - defer close(notify) - validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantEventType, notify) - testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) + // validator to check NATS received events + notify := make(chan bool) + defer close(notify) + validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantEventType, notify) + testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) - body, headers := testCase.ProvideMessage(tc.wantEventType) - resp, err := testingutils.SendEvent(publishEndpoint, body, headers) - assert.NoError(t, err) - assert.NoError(t, resp.Body.Close()) - assert.Equal(t, testCase.WantStatusCode, resp.StatusCode) - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) - assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*3)) + body, headers := testCase.ProvideMessage(tc.wantEventType) + resp, err := testingutils.SendEvent(publishEndpoint, body, headers) + assert.NoError(t, err) + assert.NoError(t, resp.Body.Close()) + assert.Equal(t, testCase.WantStatusCode, resp.StatusCode) + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) + assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*3)) + } + }) } }) } @@ -208,55 +208,56 @@ func TestHandlerForLegacyEvents(t *testing.T) { wantEventType: testingutils.CloudEventTypePrefixEmpty, }, } + for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - t.Parallel() - ctx, cancel := context.WithCancel(context.Background()) defer cancel() - handlerMock := mock.StartOrDie(ctx, t, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithApplication(tc.givenApplicationName), - ) - defer handlerMock.Stop() - - // run the tests for publishing legacy events - publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/%s/v1/events", handlerMock.GetNatsConfig().Port, tc.givenApplicationName) - for _, testCase := range handlertest.TestCasesForLegacyEvents { - testCase := testCase - t.Run(testCase.Name, func(t *testing.T) { - // connect to nats - connection, err := pkgnats.Connect(handlerMock.GetNatsURL(), - pkgnats.WithRetryOnFailedConnect(true), - pkgnats.WithMaxReconnects(3), - pkgnats.WithReconnectWait(time.Second), + // test in both default and jetstream NATS modes + for _, serverMode := range testingutils.NatsServerModes { + t.Run(serverMode.Name, func(t *testing.T) { + handlerMock := mock.StartOrDie(ctx, t, + mock.WithEventTypePrefix(tc.givenEventTypePrefix), + mock.WithApplication(tc.givenApplicationName), + mock.WithJetstream(serverMode.JetstreamEnabled), ) - assert.Nil(t, err) - assert.NotNil(t, connection) - defer connection.Close() + defer handlerMock.Stop() - // publish a message to NATS and validate it - notify := make(chan bool) - defer close(notify) - validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantEventType, notify) - testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) + // run the tests for publishing legacy events + publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/%s/v1/events", handlerMock.GetNatsConfig().Port, tc.givenApplicationName) + for _, testCase := range handlertest.TestCasesForLegacyEvents { + testCase := testCase + t.Run(testCase.Name, func(t *testing.T) { + // connect to nats + connection, err := testingutils.ConnectToNatsServer(handlerMock.GetNatsURL()) + assert.Nil(t, err) + assert.NotNil(t, connection) + defer connection.Close() - body, headers := testCase.ProvideMessage() - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - require.NoError(t, err) - require.Equal(t, testCase.WantStatusCode, resp.StatusCode) + // publish a message to NATS and validate it + notify := make(chan bool) + defer close(notify) + validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantEventType, notify) + testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) - if testCase.WantStatusCode == http.StatusOK { - handlertest.ValidateLegacyOkResponse(t, *resp, &testCase.WantResponse) - } else { - handlertest.ValidateLegacyErrorResponse(t, *resp, &testCase.WantResponse) - } + body, headers := testCase.ProvideMessage() + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + require.NoError(t, err) + require.Equal(t, testCase.WantStatusCode, resp.StatusCode) + + if testCase.WantStatusCode == http.StatusOK { + handlertest.ValidateLegacyOkResponse(t, *resp, &testCase.WantResponse) + } else { + handlertest.ValidateLegacyErrorResponse(t, *resp, &testCase.WantResponse) + } - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) - assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*3)) + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) + assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*3)) + } + }) } }) } @@ -281,11 +282,10 @@ func TestHandlerForSubscribedEndpoint(t *testing.T) { givenEventType: testingutils.CloudEventTypePrefixEmpty, }, } + for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - t.Parallel() - ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -298,30 +298,37 @@ func TestHandlerForSubscribedEndpoint(t *testing.T) { subscription := testingutils.NewSubscription( testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, tc.givenEventType), ) - handlerMock := mock.StartOrDie(ctx, t, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithSubscription(scheme, subscription), - mock.WithApplication(testingutils.ApplicationName), - ) - defer handlerMock.Stop() - // run the tests for subscribed endpoint - for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { - testCase := testCase - t.Run(testCase.Name, func(t *testing.T) { - subscribedURL := fmt.Sprintf(subscribedEndpointFormat, handlerMock.GetNatsConfig().Port, testCase.AppName) - resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) - require.NoError(t, err) - require.Equal(t, testCase.WantStatusCode, resp.StatusCode) + // test in both default and jetstream NATS modes + for _, serverMode := range testingutils.NatsServerModes { + t.Run(serverMode.Name, func(t *testing.T) { + handlerMock := mock.StartOrDie(ctx, t, + mock.WithEventTypePrefix(tc.givenEventTypePrefix), + mock.WithSubscription(scheme, subscription), + mock.WithApplication(testingutils.ApplicationName), + mock.WithJetstream(serverMode.JetstreamEnabled), + ) + defer handlerMock.Stop() + + // run the tests for subscribed endpoint + for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { + testCase := testCase + t.Run(testCase.Name, func(t *testing.T) { + subscribedURL := fmt.Sprintf(subscribedEndpointFormat, handlerMock.GetNatsConfig().Port, testCase.AppName) + resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) + require.NoError(t, err) + require.Equal(t, testCase.WantStatusCode, resp.StatusCode) - respBodyBytes, err := ioutil.ReadAll(resp.Body) - require.NoError(t, err) - require.NoError(t, resp.Body.Close()) + respBodyBytes, err := ioutil.ReadAll(resp.Body) + require.NoError(t, err) + require.NoError(t, resp.Body.Close()) - gotEventsResponse := subscribed.Events{} - err = json.Unmarshal(respBodyBytes, &gotEventsResponse) - require.NoError(t, err) - require.Equal(t, testCase.WantResponse, gotEventsResponse) + gotEventsResponse := subscribed.Events{} + err = json.Unmarshal(respBodyBytes, &gotEventsResponse) + require.NoError(t, err) + require.Equal(t, testCase.WantResponse, gotEventsResponse) + }) + } }) } }) diff --git a/pkg/handler/nats/health.go b/pkg/handler/nats/health.go index b2b8bfa..f5cdc2d 100644 --- a/pkg/handler/nats/health.go +++ b/pkg/handler/nats/health.go @@ -17,7 +17,8 @@ func ReadinessCheck(h *Handler) http.HandlerFunc { } return func(w http.ResponseWriter, _ *http.Request) { - if status := h.Sender.ConnectionStatus(); status != nats.CONNECTED { + s := *h.Sender + if status := s.ConnectionStatus(); status != nats.CONNECTED { h.Logger.WithField("connection-status", status).Info("Disconnected from NATS server") w.WriteHeader(health.StatusCodeNotHealthy) return diff --git a/pkg/handler/nats/health_test.go b/pkg/handler/nats/health_test.go index d4e8615..ff1d373 100644 --- a/pkg/handler/nats/health_test.go +++ b/pkg/handler/nats/health_test.go @@ -7,6 +7,9 @@ import ( "testing" "github.com/stretchr/testify/assert" + + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + "github.com/stretchr/testify/require" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" @@ -32,29 +35,34 @@ func TestReadinessCheck(t *testing.T) { wantHandlerStatusCode: health.StatusCodeHealthy, }, } + for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - t.Parallel() - defer func() { - r := recover() - if !assert.Equal(t, tc.wantPanicForNilHandler, r != nil) { - t.Log(r) - } - }() + // test in both default and jetstream NATS modes + for _, serverMode := range testingutils.NatsServerModes { + t.Run(serverMode.Name, func(t *testing.T) { + defer func() { + r := recover() + if !assert.Equal(t, tc.wantPanicForNilHandler, r != nil) { + t.Log(r) + } + }() - handlerMock := mock.StartOrDie(context.TODO(), t) - defer handlerMock.Stop() + handlerMock := mock.StartOrDie(context.TODO(), t, mock.WithJetstream(serverMode.JetstreamEnabled)) + defer handlerMock.Stop() - var handler http.HandlerFunc - if tc.wantPanicForNilHandler { - handler = nats.ReadinessCheck(nil) - } else { - handler = nats.ReadinessCheck(handlerMock.GetHandler()) - } + var handler http.HandlerFunc + if tc.wantPanicForNilHandler { + handler = nats.ReadinessCheck(nil) + } else { + handler = nats.ReadinessCheck(handlerMock.GetHandler()) + } - assertResponseStatusCode(t, tc.givenHandlerEndpoint, handler, tc.wantHandlerStatusCode) + assertResponseStatusCode(t, tc.givenHandlerEndpoint, handler, tc.wantHandlerStatusCode) + }) + } }) } } diff --git a/pkg/handler/nats/mock/mock.go b/pkg/handler/nats/mock/mock.go index c8553fe..84ff537 100644 --- a/pkg/handler/nats/mock/mock.go +++ b/pkg/handler/nats/mock/mock.go @@ -25,7 +25,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" - pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" @@ -43,6 +42,7 @@ type NatsHandlerMock struct { eventTypePrefix string logger *logrus.Logger natsServer *server.Server + jetstreamMode bool natsConfig *env.NatsConfig collector *metrics.Collector legacyTransformer *legacy.Transformer @@ -63,7 +63,6 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) * livenessEndpoint: fmt.Sprintf("http://localhost:%d%s", port, health.LivenessURI), readinessEndpoint: fmt.Sprintf("http://localhost:%d%s", port, health.ReadinessURI), logger: logrus.New(), - natsServer: testingutils.StartNatsServer(), natsConfig: newNatsConfig(port), collector: metrics.NewCollector(), legacyTransformer: &legacy.Transformer{}, @@ -74,22 +73,21 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) * for _, opt := range opts { opt(mock) } + mock.natsServer = testingutils.StartNatsServer(mock.jetstreamMode) msgReceiver := receiver.NewHTTPMessageReceiver(mock.natsConfig.Port) - connection, err := pkgnats.Connect(mock.GetNatsURL(), - pkgnats.WithRetryOnFailedConnect(true), - pkgnats.WithMaxReconnects(3), - pkgnats.WithReconnectWait(time.Second), - ) + connection, err := testingutils.ConnectToNatsServer(mock.GetNatsURL()) require.NoError(t, err) mock.connection = connection - msgSender := sender.NewNatsMessageSender(ctx, mock.connection, mock.logger) + //nolint:gosimple + var msgSender sender.GenericSender + msgSender = sender.NewNatsMessageSender(ctx, mock.connection, mock.logger) mock.handler = nats.NewHandler( msgReceiver, - msgSender, + &msgSender, mock.natsConfig.RequestTimeout, mock.legacyTransformer, &options.Options{MaxRequestSize: 65536}, @@ -184,10 +182,18 @@ func WithApplication(applicationName string) NatsHandlerMockOpt { } } +// WithJetstream returns NatsHandlerMockOpt which starts the NATS server in the jetstream mode for the given NatsHandlerMock. +func WithJetstream(jsEnabled bool) NatsHandlerMockOpt { + return func(m *NatsHandlerMock) { + m.jetstreamMode = jsEnabled + } +} + func newNatsConfig(port int) *env.NatsConfig { return &env.NatsConfig{ Port: port, LegacyNamespace: testingutils.MessagingNamespace, LegacyEventTypePrefix: testingutils.MessagingEventTypePrefix, + JSStreamName: testingutils.StreamName, } } diff --git a/pkg/nats/connect_test.go b/pkg/nats/connect_test.go index 49e9862..d4a141d 100644 --- a/pkg/nats/connect_test.go +++ b/pkg/nats/connect_test.go @@ -31,34 +31,41 @@ func TestConnect(t *testing.T) { givenReconnectWait: time.Millisecond, }, } + for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - // given - t.Parallel() - natsServer := publishertesting.StartNatsServer() - assert.NotNil(t, natsServer) - defer natsServer.Shutdown() - clientURL := natsServer.ClientURL() - assert.NotEmpty(t, clientURL) + // test in both default and jetstream NATS modes + for _, serverMode := range publishertesting.NatsServerModes { + t.Run(serverMode.Name, func(t *testing.T) { + tc := tc + // given + natsServer := publishertesting.StartNatsServer(serverMode.JetstreamEnabled) + assert.NotNil(t, natsServer) + defer natsServer.Shutdown() + + clientURL := natsServer.ClientURL() + assert.NotEmpty(t, clientURL) - // when - connection, err := pkgnats.Connect(clientURL, - pkgnats.WithRetryOnFailedConnect(tc.givenRetryOnFailedConnect), - pkgnats.WithMaxReconnects(tc.givenMaxReconnect), - pkgnats.WithReconnectWait(tc.givenReconnectWait), - ) - assert.Nil(t, err) - assert.NotNil(t, connection) - defer func() { connection.Close() }() + // when + connection, err := pkgnats.Connect(clientURL, + pkgnats.WithRetryOnFailedConnect(tc.givenRetryOnFailedConnect), + pkgnats.WithMaxReconnects(tc.givenMaxReconnect), + pkgnats.WithReconnectWait(tc.givenReconnectWait), + ) + assert.Nil(t, err) + assert.NotNil(t, connection) + defer func() { connection.Close() }() - // then - assert.Equal(t, connection.Status(), nats.CONNECTED) - assert.Equal(t, clientURL, connection.Opts.Servers[0]) - assert.Equal(t, tc.givenRetryOnFailedConnect, connection.Opts.RetryOnFailedConnect) - assert.Equal(t, tc.givenMaxReconnect, connection.Opts.MaxReconnect) - assert.Equal(t, tc.givenReconnectWait, connection.Opts.ReconnectWait) + // then + assert.Equal(t, connection.Status(), nats.CONNECTED) + assert.Equal(t, clientURL, connection.Opts.Servers[0]) + assert.Equal(t, tc.givenRetryOnFailedConnect, connection.Opts.RetryOnFailedConnect) + assert.Equal(t, tc.givenMaxReconnect, connection.Opts.MaxReconnect) + assert.Equal(t, tc.givenReconnectWait, connection.Opts.ReconnectWait) + }) + } }) } } diff --git a/pkg/sender/jetstream.go b/pkg/sender/jetstream.go new file mode 100644 index 0000000..a4f3123 --- /dev/null +++ b/pkg/sender/jetstream.go @@ -0,0 +1,116 @@ +package sender + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net/http" + "strings" + + "github.com/cloudevents/sdk-go/v2/event" + "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/nats-io/nats.go" + "github.com/sirupsen/logrus" +) + +// compile time check +var _ GenericSender = &JetstreamMessageSender{} + +// JetstreamMessageSender is responsible for sending messages over HTTP. +type JetstreamMessageSender struct { + ctx context.Context + logger *logrus.Logger + connection *nats.Conn + envCfg *env.NatsConfig +} + +// NewJetstreamMessageSender returns a new NewJetstreamMessageSender instance with the given nats connection. +func NewJetstreamMessageSender(ctx context.Context, connection *nats.Conn, envCfg *env.NatsConfig, logger *logrus.Logger) *JetstreamMessageSender { + return &JetstreamMessageSender{ctx: ctx, connection: connection, envCfg: envCfg, logger: logger} +} + +// ConnectionStatus returns nats.Status for the NATS connection used by the JetstreamMessageSender. +func (s *JetstreamMessageSender) ConnectionStatus() nats.Status { + return s.connection.Status() +} + +// Send dispatches the event to the NATS backend in Jetstream mode. +// If the NATS connection is not open, it returns an error. +func (s *JetstreamMessageSender) Send(_ context.Context, event *event.Event) (int, error) { + if s.ConnectionStatus() != nats.CONNECTED { + return http.StatusBadGateway, errors.New("connection status: no connection to NATS Jetstream server") + } + // ensure the stream exists + streamExists, err := s.streamExists(s.connection) + if err != nil && err != nats.ErrStreamNotFound { + return http.StatusInternalServerError, err + } + if !streamExists { + return http.StatusNotFound, nats.ErrStreamNotFound + } + + jsCtx, jsError := s.connection.JetStream() + if jsError != nil { + return http.StatusInternalServerError, jsError + } + msg, err := s.eventToNatsMsg(event) + if err != nil { + return http.StatusUnprocessableEntity, err + } + + // send the event + s.logger.Infof("Sending to NATS in Jetstream mode: %v, stream name: %s", event, s.envCfg.JSStreamName) + _, err = jsCtx.PublishMsg(msg) + if err != nil { + s.logger.Errorf("Cannot send event to NATS Jetsteram: %v", err) + return http.StatusInternalServerError, err + } + return http.StatusNoContent, nil +} + +// streamExists checks if the stream with the expected name exists. +func (s *JetstreamMessageSender) streamExists(connection *nats.Conn) (bool, error) { + jsCtx, err := connection.JetStream() + if err != nil { + return false, err + } + if info, err := jsCtx.StreamInfo(s.envCfg.JSStreamName); err == nil { + s.logger.Infof("Stream %s exists, using it for publishing", info.Config.Name) + return true, nil + } else if err != nats.ErrStreamNotFound { + s.logger.Debug("The connection to NATs server is not established!") + return false, err + } + return false, nats.ErrStreamNotFound +} + +// eventToNatsMsg translates cloud event into the NATS Msg. +func (s *JetstreamMessageSender) eventToNatsMsg(event *event.Event) (*nats.Msg, error) { + header := make(nats.Header) + header.Set(internal.HeaderContentType, event.DataContentType()) + header.Set(internal.CeSpecVersionHeader, event.SpecVersion()) + header.Set(internal.CeTypeHeader, event.Type()) + header.Set(internal.CeSourceHeader, event.Source()) + header.Set(internal.CeIDHeader, event.ID()) + + eventJSON, err := json.Marshal(event) + if err != nil { + return nil, err + } + + return &nats.Msg{ + Subject: s.getJsSubjectToPublish(event.Type()), + Header: header, + Data: eventJSON, + }, err +} + +// getJsSubjectToPublish appends stream name to subject if needed. +func (s *JetstreamMessageSender) getJsSubjectToPublish(subject string) string { + if strings.HasPrefix(subject, s.envCfg.JSStreamSubjectPrefix) { + return subject + } + return fmt.Sprintf("%s.%s", s.envCfg.JSStreamSubjectPrefix, subject) +} diff --git a/pkg/sender/jetstream_test.go b/pkg/sender/jetstream_test.go new file mode 100644 index 0000000..2ce9afb --- /dev/null +++ b/pkg/sender/jetstream_test.go @@ -0,0 +1,272 @@ +package sender + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "testing" + "time" + + "github.com/stretchr/testify/require" + + "github.com/cloudevents/sdk-go/v2/event" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + + cloudevents "github.com/cloudevents/sdk-go/v2" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + "github.com/nats-io/nats-server/v2/server" + "github.com/nats-io/nats.go" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/assert" +) + +func TestJetstreamMessageSender(t *testing.T) { + testCases := []struct { + name string + givenStream bool + givenNatsConnectionClosed bool + wantError bool + wantStatusCode int + }{ + { + name: "send in jetstream mode should not succeed if stream doesn't exist", + givenStream: false, + givenNatsConnectionClosed: false, + wantError: true, + wantStatusCode: http.StatusNotFound, + }, + { + name: "send in jetstream mode should succeed if NATS connection is open and the stream exists", + givenStream: true, + givenNatsConnectionClosed: false, + wantError: false, + wantStatusCode: http.StatusNoContent, + }, + { + name: "send in jetstream mode should fail if NATS connection is not open", + givenNatsConnectionClosed: true, + wantError: true, + wantStatusCode: http.StatusBadGateway, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + // given + testEnv := setupTestEnvironment(t) + natsServer, connection := testEnv.Server, testEnv.Connection + + defer func() { + natsServer.Shutdown() + connection.Close() + }() + + if tc.givenStream { + addStream(t, connection, getStreamConfig()) + } + + ce := createCloudEvent(t) + + // when + ctx := context.Background() + sender := NewJetstreamMessageSender(context.Background(), connection, testEnv.Config, logrus.New()) + + if tc.givenNatsConnectionClosed { + connection.Close() + } + + // then + status, err := sender.Send(ctx, ce) + assert.Equal(t, tc.wantError, err != nil) + assert.Equal(t, tc.wantStatusCode, status) + }) + } +} + +func TestStreamExists(t *testing.T) { + testCases := []struct { + name string + givenStream bool + givenNatsConnectionClosed bool + wantResult bool + wantError error + }{ + { + name: "Stream doesn't exist and should return false", + givenStream: false, + givenNatsConnectionClosed: false, + wantResult: false, + wantError: nats.ErrStreamNotFound, + }, + { + name: "Stream exists and should return true", + givenStream: true, + givenNatsConnectionClosed: false, + wantResult: true, + wantError: nil, + }, + { + name: "Connection closed and error should happen", + givenStream: true, + givenNatsConnectionClosed: true, + wantResult: false, + wantError: nats.ErrConnectionClosed, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + // given + testEnv := setupTestEnvironment(t) + natsServer, connection, sender := testEnv.Server, testEnv.Connection, testEnv.Sender + + defer func() { + connection.Close() + natsServer.Shutdown() + }() + + if tc.givenStream { + addStream(t, connection, getStreamConfig()) + } + + // close the connection to provoke the error + if tc.givenNatsConnectionClosed { + connection.Close() + } + + // when + result, err := sender.streamExists(connection) + + // then + assert.Equal(t, result, tc.wantResult) + assert.Equal(t, err, tc.wantError) + }) + } +} + +func TestJSSubjectPrefix(t *testing.T) { + + testCases := []struct { + name string + givenPrefix string + givenEventSubject string + wantSubject string + }{ + { + name: "With empty prefix", + givenEventSubject: "custom.test", + givenPrefix: "", + wantSubject: "custom.test", + }, + { + name: "With non-empty prefix", + givenEventSubject: "custom.test", + givenPrefix: "prefix", + wantSubject: "prefix.custom.test", + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + // given + config := &env.NatsConfig{ + JSStreamSubjectPrefix: tc.givenPrefix, + } + s := JetstreamMessageSender{envCfg: config} + ce := createCloudEvent(t) + ce.SetType(tc.givenEventSubject) + + // when + subject := s.getJsSubjectToPublish(ce.Type()) + + // then + assert.Equal(t, subject, tc.wantSubject) + }) + } +} + +// helper functions and structs + +type TestEnvironment struct { + Connection *nats.Conn + Config *env.NatsConfig + Logger *logrus.Logger + Sender *JetstreamMessageSender + Server *server.Server + JsContext *nats.JetStreamContext +} + +// setupTestEnvironment sets up the resources and mocks required for testing. +func setupTestEnvironment(t *testing.T) *TestEnvironment { + natsServer := testingutils.StartNatsServer(true) + require.NotNil(t, natsServer) + + connection, err := testingutils.ConnectToNatsServer(natsServer.ClientURL()) + require.NotNil(t, connection) + require.NoError(t, err) + + natsConfig := CreateNatsJsConfig(natsServer.ClientURL(), testingutils.MessagingEventTypePrefix) + logger := logrus.New() + jsCtx, err := connection.JetStream() + require.NoError(t, err) + + sender := &JetstreamMessageSender{ + connection: connection, + envCfg: natsConfig, + logger: logger, + } + + return &TestEnvironment{ + Connection: connection, + Config: natsConfig, + Logger: logger, + Sender: sender, + Server: natsServer, + JsContext: &jsCtx, + } +} + +// createCloudEvent build a cloud event. +func createCloudEvent(t *testing.T) *event.Event { + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(testingutils.CloudEventType), + ) + payload, _ := builder.BuildStructured() + newEvent := cloudevents.NewEvent() + newEvent.SetType(testingutils.CloudEventType) + err := json.Unmarshal([]byte(payload), &newEvent) + assert.NoError(t, err) + + return &newEvent +} + +// getStreamConfig inits a testing stream config. +func getStreamConfig() *nats.StreamConfig { + return &nats.StreamConfig{ + Name: testingutils.MessagingEventTypePrefix, + Subjects: []string{fmt.Sprintf("%s.>", testingutils.MessagingEventTypePrefix)}, + Storage: nats.MemoryStorage, + Retention: nats.InterestPolicy, + } +} + +// addStream creates a stream for the test events. +func addStream(t *testing.T, connection *nats.Conn, config *nats.StreamConfig) { + js, err := connection.JetStream() + assert.NoError(t, err) + _, err = js.AddStream(config) + assert.NoError(t, err) +} + +func CreateNatsJsConfig(url string, streamName string) *env.NatsConfig { + return &env.NatsConfig{ + JSStreamName: streamName, + URL: url, + ReconnectWait: time.Second, + } +} diff --git a/pkg/sender/nats.go b/pkg/sender/nats.go index f7ee5d0..cd54a4e 100644 --- a/pkg/sender/nats.go +++ b/pkg/sender/nats.go @@ -17,6 +17,7 @@ var _ GenericSender = &NatsMessageSender{} type GenericSender interface { Send(context.Context, *event.Event) (int, error) + ConnectionStatus() nats.Status } // NatsMessageSender is responsible for sending messages over HTTP. diff --git a/pkg/sender/nats_test.go b/pkg/sender/nats_test.go index 44dc4f2..80971f6 100644 --- a/pkg/sender/nats_test.go +++ b/pkg/sender/nats_test.go @@ -2,13 +2,11 @@ package sender import ( "context" - "encoding/json" "fmt" "net/http" "testing" "time" - cloudevents "github.com/cloudevents/sdk-go/v2" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" @@ -43,7 +41,7 @@ func TestNatsMessageSender(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() - natsServer := testingutils.StartNatsServer() + natsServer := testingutils.StartNatsServer(false) assert.NotNil(t, natsServer) defer natsServer.Shutdown() @@ -60,14 +58,7 @@ func TestNatsMessageSender(t *testing.T) { validator := testingutils.ValidateNatsMessageDataOrFail(t, fmt.Sprintf(`"%s"`, testingutils.EventData), receive) testingutils.SubscribeToEventOrFail(t, connection, testingutils.CloudEventType, validator) - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(testingutils.CloudEventType), - ) - payload, _ := builder.BuildStructured() - event := cloudevents.NewEvent() - event.SetType(testingutils.CloudEventType) - err = json.Unmarshal([]byte(payload), &event) - assert.NoError(t, err) + ce := createCloudEvent(t) ctx := context.Background() sender := NewNatsMessageSender(context.Background(), connection, logrus.New()) @@ -76,7 +67,7 @@ func TestNatsMessageSender(t *testing.T) { connection.Close() } - status, err := sender.Send(ctx, &event) + status, err := sender.Send(ctx, ce) assert.Equal(t, tc.wantError, err != nil) assert.Equal(t, tc.wantStatusCode, status) diff --git a/testing/nats.go b/testing/nats.go index 2d247e9..66e673f 100644 --- a/testing/nats.go +++ b/testing/nats.go @@ -6,18 +6,53 @@ import ( "testing" "time" + pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" + "github.com/sirupsen/logrus" + cev2 "github.com/cloudevents/sdk-go/v2/event" "github.com/nats-io/nats-server/v2/server" "github.com/nats-io/nats-server/v2/test" "github.com/nats-io/nats.go" ) -func StartNatsServer() *server.Server { +const ( + StreamName = "kyma" +) + +var NatsServerModes = []struct { + Name string + JetstreamEnabled bool +}{ + { + Name: "jetstream disabled", + JetstreamEnabled: false, + }, + { + Name: "jetstream enabled", + JetstreamEnabled: true, + }, +} + +func StartNatsServer(enableJetstream bool) *server.Server { opts := test.DefaultTestOptions opts.Port = server.RANDOM_PORT + opts.JetStream = enableJetstream + if enableJetstream { + logrus.New().Info("Starting test NATS Server in Jetstream mode") + } else { + logrus.New().Info("Starting test NATS Server in default mode") + } return test.RunServer(&opts) } +func ConnectToNatsServer(url string) (*nats.Conn, error) { + return pkgnats.Connect(url, + pkgnats.WithRetryOnFailedConnect(true), + pkgnats.WithMaxReconnects(3), + pkgnats.WithReconnectWait(time.Second), + ) +} + // SubscribeToEventOrFail subscribes to the given eventType using the given NATS connection. // The received messages are then validated using the given validator. func SubscribeToEventOrFail(t *testing.T, connection *nats.Conn, eventType string, validator nats.MsgHandler) { From ac7f7dfc564f3ff0b9e9efd41ee96cbda92e7592 Mon Sep 17 00:00:00 2001 From: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> Date: Wed, 6 Apr 2022 18:21:25 +0200 Subject: [PATCH 055/194] bump dependencies in epp (#13864) * bump deps * bump image --- go.mod | 16 ++++++++-------- go.sum | 52 +++++++++++++++++++++++++++++----------------------- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index 29ebc21..6fa4008 100644 --- a/go.mod +++ b/go.mod @@ -3,15 +3,15 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy go 1.17 require ( - github.com/cloudevents/sdk-go/protocol/nats/v2 v2.8.0 - github.com/cloudevents/sdk-go/v2 v2.8.0 + github.com/cloudevents/sdk-go/protocol/nats/v2 v2.9.0 + github.com/cloudevents/sdk-go/v2 v2.9.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220318153915-799f491b2fd1 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220318153915-799f491b2fd1 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220406095324-6137b612a940 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220406095324-6137b612a940 github.com/nats-io/nats-server/v2 v2.7.4 github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d - github.com/onsi/gomega v1.18.1 + github.com/onsi/gomega v1.19.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 github.com/sirupsen/logrus v1.8.1 @@ -21,7 +21,7 @@ require ( k8s.io/api v0.23.5 k8s.io/apimachinery v0.23.5 k8s.io/client-go v0.23.5 - sigs.k8s.io/controller-runtime v0.11.1 + sigs.k8s.io/controller-runtime v0.11.2 ) require ( @@ -30,7 +30,7 @@ require ( github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/go-logr/logr v1.2.0 // indirect + github.com/go-logr/logr v1.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect @@ -57,7 +57,7 @@ require ( go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.21.0 // indirect golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce // indirect - golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect + golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect diff --git a/go.sum b/go.sum index f7f67c9..b8403b7 100644 --- a/go.sum +++ b/go.sum @@ -154,10 +154,12 @@ github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmE github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/protocol/nats/v2 v2.8.0 h1:sn/ExiNFh1ooLGRVu/YvKF1WyaX65b4wGE99BMcvvKg= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.8.0/go.mod h1:YdfvPwlNoyTW6exGMoayTlHdb9R/ZbFk9ZT5S/aPD1Y= -github.com/cloudevents/sdk-go/v2 v2.8.0 h1:kmRaLbsafZmidZ0rZ6h7WOMqCkRMcVTLV5lxV/HKQ9Y= +github.com/cloudevents/sdk-go/protocol/nats/v2 v2.9.0 h1:3d1z9UQer8v2KLxRba3tNd7M5x9Te7g9g9ZLqdzfpVc= +github.com/cloudevents/sdk-go/protocol/nats/v2 v2.9.0/go.mod h1:QJzS5Pw2lWu22wJfrq43o90Nj7xr9H8JDbd+T3IpwCE= github.com/cloudevents/sdk-go/v2 v2.8.0/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= +github.com/cloudevents/sdk-go/v2 v2.9.0 h1:StQ9q2JuGvclGFoT7kpTdQm+qjW0LQzg51CgUF4ncpY= +github.com/cloudevents/sdk-go/v2 v2.9.0/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -284,13 +286,16 @@ github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7 github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v1.2.0 h1:n4JnPI1T3Qq1SFEi/F8rwLrZERp2bso19PJZDB9dayk= github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= +github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= +github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= @@ -404,7 +409,6 @@ github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -546,7 +550,6 @@ github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQL github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4= github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -563,13 +566,13 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= -github.com/kyma-incubator/api-gateway v0.0.0-20210909101151-ac45e9ce3553/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20211006112227-6d16a34ea468/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20211006112227-6d16a34ea468/go.mod h1:tHyxTctgL2M0a0Rn25goIO6SVp1Hvo7eoZcrnDCIXxA= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220318153915-799f491b2fd1 h1:85BEpUmw9yJKh8Ref0wYC01kKGpnoGq5W+KLTTytqQw= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220318153915-799f491b2fd1/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220318153915-799f491b2fd1 h1:NJ8Z/8rO2TM9BuNs2dAgr/jN2TWXRSgVTZ9V24x6W2w= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220318153915-799f491b2fd1/go.mod h1:NjmxsBfnqBnOT5H9Z7wnukHjwk/yi2Y9aS4N6hennEE= +github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= +github.com/kyma-project/kyma/common/logging v0.0.0-20220318092714-2229a6be2cc1/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220318113114-607b05389daf/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220406095324-6137b612a940 h1:cx3p3od7B21gAkZiQSyU0xBmnXw5AdZE9BTLeMSJ99g= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220406095324-6137b612a940/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220406095324-6137b612a940 h1:M4MXExptq+dl+vrH1ANBg1YlfM6Yp5IU8q0JGOUeckU= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220406095324-6137b612a940/go.mod h1:lUk+LYWblKNVnhHqo/5JXzsRkwUyTCwyo0M+864CHUo= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -661,13 +664,10 @@ github.com/nats-io/jwt/v2 v2.2.1-0.20220113022732-58e87895b296 h1:vU9tpM3apjYlLL github.com/nats-io/jwt/v2 v2.2.1-0.20220113022732-58e87895b296/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= -github.com/nats-io/nats-server/v2 v2.6.1/go.mod h1:Az91TbZiV7K4a6k/4v6YYdOKEoxCXj+iqhHVf/MlrKo= github.com/nats-io/nats-server/v2 v2.7.4 h1:c+BZJ3rGzUKCBIM4IXO8uNT2u1vajGbD1kPA6wqCEaM= github.com/nats-io/nats-server/v2 v2.7.4/go.mod h1:1vZ2Nijh8tcyNe8BDVyTviCd9NYzRbubQYiEHsvOQWc= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nats.go v1.12.3/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nats.go v1.13.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d h1:zJf4l8Kp67RIZhoVeniSLZs69SHNgjLHz0aNsqPPlx8= github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= @@ -701,8 +701,9 @@ github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -713,8 +714,9 @@ github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg= github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -1103,8 +1105,9 @@ golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1523,7 +1526,6 @@ k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= k8s.io/api v0.23.0/go.mod h1:8wmDdLBHBNxtOIytwLstXt5E9PddnZb0GaMcqsvDBpg= -k8s.io/api v0.23.4/go.mod h1:i77F4JfyNNrhOjZF7OwwNJS5Y1S9dpwvb9iYRYRczfI= k8s.io/api v0.23.5 h1:zno3LUiMubxD/V1Zw3ijyKO3wxrhbUF1Ck+VjBvfaoA= k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= @@ -1533,6 +1535,7 @@ k8s.io/apiextensions-apiserver v0.20.2/go.mod h1:F6TXp389Xntt+LUq3vw6HFOLttPa0V8 k8s.io/apiextensions-apiserver v0.21.0/go.mod h1:gsQGNtGkc/YoDG9loKI0V+oLZM4ljRPjc/sql5tmvzc= k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE= k8s.io/apiextensions-apiserver v0.23.0/go.mod h1:xIFAEEDlAZgpVBl/1VSjGDmLoXAWRG40+GsWhKhAxY4= +k8s.io/apiextensions-apiserver v0.23.5/go.mod h1:ntcPWNXS8ZPKN+zTXuzYMeg731CP0heCTl6gYBxLcuQ= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= k8s.io/apimachinery v0.17.8/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= k8s.io/apimachinery v0.18.1/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= @@ -1543,7 +1546,6 @@ k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswP k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apimachinery v0.23.0/go.mod h1:fFCTTBKvKcwTPFzjlcxp91uPFZr+JA0FubU4fLzzFYc= -k8s.io/apimachinery v0.23.4/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apimachinery v0.23.5 h1:Va7dwhp8wgkUPWsEXk6XglXWU4IKYLKNlv8VkX7SDM0= k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= @@ -1553,6 +1555,7 @@ k8s.io/apiserver v0.20.2/go.mod h1:2nKd93WyMhZx4Hp3RfgH2K5PhwyTrprrkWYnI7id7jA= k8s.io/apiserver v0.21.0/go.mod h1:w2YSn4/WIwYuxG5zJmcqtRdtqgW/J2JRgFAqps3bBpg= k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU= k8s.io/apiserver v0.23.0/go.mod h1:Cec35u/9zAepDPPFyT+UMrgqOCjgJ5qtfVJDxjZYmt4= +k8s.io/apiserver v0.23.5/go.mod h1:7wvMtGJ42VRxzgVI7jkbKvMbuCbVbgsWFT7RyXiRNTw= k8s.io/cli-runtime v0.18.2/go.mod h1:yfFR2sQQzDsV0VEKGZtrJwEy4hLZ2oj4ZIfodgxAHWQ= k8s.io/cli-runtime v0.21.0/go.mod h1:XoaHP93mGPF37MkLbjGVYqg3S1MnsFdKtiA/RZzzxOo= k8s.io/cli-runtime v0.22.0/go.mod h1:An6zELQ7udUI0GaXvkuMqyopPA14dIgNqpH8cZu1vig= @@ -1564,7 +1567,6 @@ k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= k8s.io/client-go v0.23.0/go.mod h1:hrDnpnK1mSr65lHHcUuIZIXDgEbzc7/683c6hyG4jTA= -k8s.io/client-go v0.23.4/go.mod h1:PKnIL4pqLuvYUK1WU7RLTMYKPiIh7MYShLshtRY9cj0= k8s.io/client-go v0.23.5 h1:zUXHmEuqx0RY4+CsnkOn5l0GU+skkRXKGJrhmE2SLd8= k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= @@ -1574,6 +1576,7 @@ k8s.io/code-generator v0.20.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbW k8s.io/code-generator v0.21.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo= k8s.io/code-generator v0.23.0/go.mod h1:vQvOhDXhuzqiVfM/YHp+dmg10WDZCchJVObc9MvowsE= +k8s.io/code-generator v0.23.5/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= k8s.io/component-base v0.17.8/go.mod h1:xfNNdTAMsYzdiAa8vXnqDhRVSEgkfza0iMt0FrZDY7s= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= @@ -1581,6 +1584,7 @@ k8s.io/component-base v0.20.2/go.mod h1:pzFtCiwe/ASD0iV7ySMu8SYVJjCapNM9bjvk7ptp k8s.io/component-base v0.21.0/go.mod h1:qvtjz6X0USWXbgmbfXR+Agik4RZ3jv2Bgr5QnZzdPYw= k8s.io/component-base v0.21.3/go.mod h1:kkuhtfEHeZM6LkX0saqSK8PbdO7A0HigUngmhhrwfGQ= k8s.io/component-base v0.23.0/go.mod h1:DHH5uiFvLC1edCpvcTDV++NKULdYYU6pR9Tt3HIKMKI= +k8s.io/component-base v0.23.5/go.mod h1:c5Nq44KZyt1aLl0IpHX82fhsn84Sb0jjzwjpcA42bY0= k8s.io/component-helpers v0.21.0/go.mod h1:tezqefP7lxfvJyR+0a+6QtVrkZ/wIkyMLK4WcQ3Cj8U= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -1636,12 +1640,14 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyz sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.25/go.mod h1:Mlj9PNLmG9bZ6BHFwFKDo5afkpWyUISkb9Me0GnK66I= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+aqSv/M3njpmo= sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= -sigs.k8s.io/controller-runtime v0.11.1 h1:7YIHT2QnHJArj/dk9aUkYhfqfK5cIxPOX5gPECfdZLU= sigs.k8s.io/controller-runtime v0.11.1/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA= +sigs.k8s.io/controller-runtime v0.11.2 h1:H5GTxQl0Mc9UjRJhORusqfJCIjBO8UtUxGggCwL1rLA= +sigs.k8s.io/controller-runtime v0.11.2/go.mod h1:P6QCzrEjLaZGqHsfd+os7JQ+WFZhvB8MRFsn4dWF7O4= sigs.k8s.io/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= From c41947a2515add186e51e302779389cc66199736 Mon Sep 17 00:00:00 2001 From: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> Date: Fri, 8 Apr 2022 13:27:29 +0200 Subject: [PATCH 056/194] fix security vulnerability in epp (#13883) * bump lib * bump image * use replace * bump prometheus/client_go --- go.mod | 8 +++--- go.sum | 83 +++++----------------------------------------------------- 2 files changed, 12 insertions(+), 79 deletions(-) diff --git a/go.mod b/go.mod index 6fa4008..df0a987 100644 --- a/go.mod +++ b/go.mod @@ -7,8 +7,8 @@ require ( github.com/cloudevents/sdk-go/v2 v2.9.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220406095324-6137b612a940 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220406095324-6137b612a940 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220407134928-1e5a88a2e543 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220407134928-1e5a88a2e543 github.com/nats-io/nats-server/v2 v2.7.4 github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d github.com/onsi/gomega v1.19.0 @@ -56,7 +56,7 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.21.0 // indirect - golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce // indirect + golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect @@ -81,4 +81,6 @@ replace ( github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d github.com/docker/docker => github.com/docker/docker v20.10.3+incompatible github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.0-rc93 + github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.12.1 + golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 ) diff --git a/go.sum b/go.sum index b8403b7..cfadbd1 100644 --- a/go.sum +++ b/go.sum @@ -121,7 +121,6 @@ github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLj github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= @@ -154,10 +153,8 @@ github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmE github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/protocol/nats/v2 v2.8.0/go.mod h1:YdfvPwlNoyTW6exGMoayTlHdb9R/ZbFk9ZT5S/aPD1Y= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.9.0 h1:3d1z9UQer8v2KLxRba3tNd7M5x9Te7g9g9ZLqdzfpVc= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.9.0/go.mod h1:QJzS5Pw2lWu22wJfrq43o90Nj7xr9H8JDbd+T3IpwCE= -github.com/cloudevents/sdk-go/v2 v2.8.0/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= github.com/cloudevents/sdk-go/v2 v2.9.0 h1:StQ9q2JuGvclGFoT7kpTdQm+qjW0LQzg51CgUF4ncpY= github.com/cloudevents/sdk-go/v2 v2.9.0/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -210,7 +207,6 @@ github.com/deislabs/oras v0.11.1/go.mod h1:39lCtf8Q6WDC7ul9cnyWXONNzKvabEKk+AX+L github.com/denisenkom/go-mssqldb v0.0.0-20191001013358-cfbb681360f0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/docker/cli v20.10.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v0.0.0-20191216044856-a8371794149d/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= @@ -567,12 +563,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20220318092714-2229a6be2cc1/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220318113114-607b05389daf/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220406095324-6137b612a940 h1:cx3p3od7B21gAkZiQSyU0xBmnXw5AdZE9BTLeMSJ99g= +github.com/kyma-project/kyma/common/logging v0.0.0-20220406095324-6137b612a940/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220406095324-6137b612a940/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220406095324-6137b612a940 h1:M4MXExptq+dl+vrH1ANBg1YlfM6Yp5IU8q0JGOUeckU= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220406095324-6137b612a940/go.mod h1:lUk+LYWblKNVnhHqo/5JXzsRkwUyTCwyo0M+864CHUo= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220407134928-1e5a88a2e543 h1:sFyzngYDYwI7p5wV9Lltxzw6oYtWvB2rzKOwSTSloj0= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220407134928-1e5a88a2e543/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220407134928-1e5a88a2e543 h1:YzHfMXJI+Q2VCbNcxQtru0zrullgpVSXV5bddEuztys= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220407134928-1e5a88a2e543/go.mod h1:6uzrBKoOuS28C+M/JuBNl7c6J3hY8+W5pY8tjLls+cs= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -685,7 +681,6 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= @@ -701,7 +696,6 @@ github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -714,7 +708,6 @@ github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg= github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= @@ -760,30 +753,16 @@ 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= 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_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 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.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= @@ -791,17 +770,12 @@ github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuI github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -979,34 +953,8 @@ go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce h1:Roh6XWxHFKrPgC/EQhVubSAGQ6Ozk6IdxHSzt1mR0EI= -golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 h1:tkVvjkPTB7pnW3jnid7kNyAMPVWllTNOf/qKDze4p9o= +golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1055,11 +1003,9 @@ golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -1173,7 +1119,6 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1193,7 +1138,6 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1219,7 +1163,6 @@ golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1230,7 +1173,6 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1525,7 +1467,6 @@ k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= -k8s.io/api v0.23.0/go.mod h1:8wmDdLBHBNxtOIytwLstXt5E9PddnZb0GaMcqsvDBpg= k8s.io/api v0.23.5 h1:zno3LUiMubxD/V1Zw3ijyKO3wxrhbUF1Ck+VjBvfaoA= k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= @@ -1534,7 +1475,6 @@ k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt k8s.io/apiextensions-apiserver v0.20.2/go.mod h1:F6TXp389Xntt+LUq3vw6HFOLttPa0V8821ogLGwb6Zs= k8s.io/apiextensions-apiserver v0.21.0/go.mod h1:gsQGNtGkc/YoDG9loKI0V+oLZM4ljRPjc/sql5tmvzc= k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE= -k8s.io/apiextensions-apiserver v0.23.0/go.mod h1:xIFAEEDlAZgpVBl/1VSjGDmLoXAWRG40+GsWhKhAxY4= k8s.io/apiextensions-apiserver v0.23.5/go.mod h1:ntcPWNXS8ZPKN+zTXuzYMeg731CP0heCTl6gYBxLcuQ= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= k8s.io/apimachinery v0.17.8/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= @@ -1545,7 +1485,6 @@ k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRp k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.23.0/go.mod h1:fFCTTBKvKcwTPFzjlcxp91uPFZr+JA0FubU4fLzzFYc= k8s.io/apimachinery v0.23.5 h1:Va7dwhp8wgkUPWsEXk6XglXWU4IKYLKNlv8VkX7SDM0= k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= @@ -1554,7 +1493,6 @@ k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.2/go.mod h1:2nKd93WyMhZx4Hp3RfgH2K5PhwyTrprrkWYnI7id7jA= k8s.io/apiserver v0.21.0/go.mod h1:w2YSn4/WIwYuxG5zJmcqtRdtqgW/J2JRgFAqps3bBpg= k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU= -k8s.io/apiserver v0.23.0/go.mod h1:Cec35u/9zAepDPPFyT+UMrgqOCjgJ5qtfVJDxjZYmt4= k8s.io/apiserver v0.23.5/go.mod h1:7wvMtGJ42VRxzgVI7jkbKvMbuCbVbgsWFT7RyXiRNTw= k8s.io/cli-runtime v0.18.2/go.mod h1:yfFR2sQQzDsV0VEKGZtrJwEy4hLZ2oj4ZIfodgxAHWQ= k8s.io/cli-runtime v0.21.0/go.mod h1:XoaHP93mGPF37MkLbjGVYqg3S1MnsFdKtiA/RZzzxOo= @@ -1566,7 +1504,6 @@ k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= -k8s.io/client-go v0.23.0/go.mod h1:hrDnpnK1mSr65lHHcUuIZIXDgEbzc7/683c6hyG4jTA= k8s.io/client-go v0.23.5 h1:zUXHmEuqx0RY4+CsnkOn5l0GU+skkRXKGJrhmE2SLd8= k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= @@ -1575,7 +1512,6 @@ k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbW k8s.io/code-generator v0.20.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= k8s.io/code-generator v0.21.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo= -k8s.io/code-generator v0.23.0/go.mod h1:vQvOhDXhuzqiVfM/YHp+dmg10WDZCchJVObc9MvowsE= k8s.io/code-generator v0.23.5/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= k8s.io/component-base v0.17.8/go.mod h1:xfNNdTAMsYzdiAa8vXnqDhRVSEgkfza0iMt0FrZDY7s= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= @@ -1583,7 +1519,6 @@ k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeY k8s.io/component-base v0.20.2/go.mod h1:pzFtCiwe/ASD0iV7ySMu8SYVJjCapNM9bjvk7ptpKh0= k8s.io/component-base v0.21.0/go.mod h1:qvtjz6X0USWXbgmbfXR+Agik4RZ3jv2Bgr5QnZzdPYw= k8s.io/component-base v0.21.3/go.mod h1:kkuhtfEHeZM6LkX0saqSK8PbdO7A0HigUngmhhrwfGQ= -k8s.io/component-base v0.23.0/go.mod h1:DHH5uiFvLC1edCpvcTDV++NKULdYYU6pR9Tt3HIKMKI= k8s.io/component-base v0.23.5/go.mod h1:c5Nq44KZyt1aLl0IpHX82fhsn84Sb0jjzwjpcA42bY0= k8s.io/component-helpers v0.21.0/go.mod h1:tezqefP7lxfvJyR+0a+6QtVrkZ/wIkyMLK4WcQ3Cj8U= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -1624,7 +1559,6 @@ k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= @@ -1639,13 +1573,11 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.25/go.mod h1:Mlj9PNLmG9bZ6BHFwFKDo5afkpWyUISkb9Me0GnK66I= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+aqSv/M3njpmo= sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= -sigs.k8s.io/controller-runtime v0.11.1/go.mod h1:KKwLiTooNGu+JmLZGn9Sl3Gjmfj66eMbCQznLP5zcqA= sigs.k8s.io/controller-runtime v0.11.2 h1:H5GTxQl0Mc9UjRJhORusqfJCIjBO8UtUxGggCwL1rLA= sigs.k8s.io/controller-runtime v0.11.2/go.mod h1:P6QCzrEjLaZGqHsfd+os7JQ+WFZhvB8MRFsn4dWF7O4= sigs.k8s.io/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I= @@ -1667,7 +1599,6 @@ sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnM sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= -sigs.k8s.io/structured-merge-diff/v4 v4.2.0/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= 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.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= From 9d717e303c8345050aa5525bd8c99d6fcd4ef5cf Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Thu, 14 Apr 2022 09:36:24 +0200 Subject: [PATCH 057/194] Fix `make test` for eventing-controller and event-publisher-proxy (#13949) * Add missing BUILDPACK image name to event-publisher-proxy makefile * Update make test in eventing-controller --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index db24832..c359f73 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ APP_NAME = event-publisher-proxy APP_PATH = components/$(APP_NAME) +BUILDPACK = eu.gcr.io/kyma-project/test-infra/buildpack-golang:v20220407-4da6c929 SCRIPTS_DIR = $(realpath $(shell pwd)/../..)/common/makefiles # fail on lint issues From 1aa50898cebebba1a7c46f4a5b39c2cf0fa076f6 Mon Sep 17 00:00:00 2001 From: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> Date: Thu, 21 Apr 2022 09:22:31 +0200 Subject: [PATCH 058/194] bump-build-image (#14010) bump image --- cmd/event-publisher-proxy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/event-publisher-proxy/Dockerfile b/cmd/event-publisher-proxy/Dockerfile index 83b08d9..b492b99 100644 --- a/cmd/event-publisher-proxy/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.18.0-alpine3.15 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.18.1-alpine3.15 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From a30951d7063541e6f2dd41332e4f8e36c04831a9 Mon Sep 17 00:00:00 2001 From: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> Date: Thu, 21 Apr 2022 15:48:32 +0200 Subject: [PATCH 059/194] bump dependencies (#14024) bump image --- go.mod | 18 +++++++++--------- go.sum | 37 ++++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index df0a987..9cdc221 100644 --- a/go.mod +++ b/go.mod @@ -7,20 +7,20 @@ require ( github.com/cloudevents/sdk-go/v2 v2.9.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220407134928-1e5a88a2e543 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220407134928-1e5a88a2e543 - github.com/nats-io/nats-server/v2 v2.7.4 - github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220421104831-69143eb27c90 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220421104831-69143eb27c90 + github.com/nats-io/nats-server/v2 v2.8.0 + github.com/nats-io/nats.go v1.14.0 github.com/onsi/gomega v1.19.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.1 go.opencensus.io v0.23.0 - golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a - k8s.io/api v0.23.5 - k8s.io/apimachinery v0.23.5 - k8s.io/client-go v0.23.5 + golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 + k8s.io/api v0.23.6 + k8s.io/apimachinery v0.23.6 + k8s.io/client-go v0.23.6 sigs.k8s.io/controller-runtime v0.11.2 ) @@ -45,7 +45,7 @@ require ( github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/nats-io/jwt/v2 v2.2.1-0.20220113022732-58e87895b296 // indirect + github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a // indirect github.com/nats-io/nkeys v0.3.0 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/go.sum b/go.sum index cfadbd1..34d3f6a 100644 --- a/go.sum +++ b/go.sum @@ -563,12 +563,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20220406095324-6137b612a940/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220406095324-6137b612a940/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220407134928-1e5a88a2e543 h1:sFyzngYDYwI7p5wV9Lltxzw6oYtWvB2rzKOwSTSloj0= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220407134928-1e5a88a2e543/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220407134928-1e5a88a2e543 h1:YzHfMXJI+Q2VCbNcxQtru0zrullgpVSXV5bddEuztys= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220407134928-1e5a88a2e543/go.mod h1:6uzrBKoOuS28C+M/JuBNl7c6J3hY8+W5pY8tjLls+cs= +github.com/kyma-project/kyma/common/logging v0.0.0-20220412113922-54faf51c33cb/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220412113922-54faf51c33cb/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220421104831-69143eb27c90 h1:A7mn5Y972yudNfvckiky7L6MF3C+O2uOvSZ339laJG4= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220421104831-69143eb27c90/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220421104831-69143eb27c90 h1:V3d+vtREZcthWcOGzt7ug980zJc77Yw04cC/173qeps= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220421104831-69143eb27c90/go.mod h1:0n9VDEgcb+BTxJirgmKhllU7bahMtQNBxhq30dQrmOg= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -656,16 +656,19 @@ github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL github.com/nats-io/jwt v1.2.2 h1:w3GMTO969dFg+UOKTmmyuu7IGdusK+7Ytlt//OYH/uU= github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= -github.com/nats-io/jwt/v2 v2.2.1-0.20220113022732-58e87895b296 h1:vU9tpM3apjYlLLeY23zRWJ9Zktr5jp+mloR942LEOpY= github.com/nats-io/jwt/v2 v2.2.1-0.20220113022732-58e87895b296/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= +github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28gth9P+wV2K/zYUUAkJ+55U8cpS0p5I= +github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= -github.com/nats-io/nats-server/v2 v2.7.4 h1:c+BZJ3rGzUKCBIM4IXO8uNT2u1vajGbD1kPA6wqCEaM= github.com/nats-io/nats-server/v2 v2.7.4/go.mod h1:1vZ2Nijh8tcyNe8BDVyTviCd9NYzRbubQYiEHsvOQWc= +github.com/nats-io/nats-server/v2 v2.8.0 h1:9cX87APzxnmVhr+Oiv1t41eGrDaRDG2ffuu/e+gGwaQ= +github.com/nats-io/nats-server/v2 v2.8.0/go.mod h1:5vic7C58BFEVltiZhs7Kq81q2WcEPhJPsmNv1FOrdv0= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d h1:zJf4l8Kp67RIZhoVeniSLZs69SHNgjLHz0aNsqPPlx8= github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats.go v1.14.0 h1:/QLCss4vQ6wvDpbqXucsVRDi13tFIR6kTdau+nXzKJw= +github.com/nats-io/nats.go v1.14.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= @@ -1068,8 +1071,8 @@ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a h1:qfl7ob3DIEs3Ml9oLuPwY2N04gymzAW04WsUQHIClgM= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +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-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -1273,8 +1276,9 @@ golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpd golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +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= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= @@ -1467,8 +1471,9 @@ k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= -k8s.io/api v0.23.5 h1:zno3LUiMubxD/V1Zw3ijyKO3wxrhbUF1Ck+VjBvfaoA= k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= +k8s.io/api v0.23.6 h1:yOK34wbYECH4RsJbQ9sfkFK3O7f/DUHRlzFehkqZyVw= +k8s.io/api v0.23.6/go.mod h1:1kFaYxGCFHYp3qd6a85DAj/yW8aVD6XLZMqJclkoi9g= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= @@ -1485,8 +1490,9 @@ k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRp k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.23.5 h1:Va7dwhp8wgkUPWsEXk6XglXWU4IKYLKNlv8VkX7SDM0= k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= +k8s.io/apimachinery v0.23.6 h1:RH1UweWJkWNTlFx0D8uxOpaU1tjIOvVVWV/bu5b3/NQ= +k8s.io/apimachinery v0.23.6/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= @@ -1504,8 +1510,9 @@ k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= -k8s.io/client-go v0.23.5 h1:zUXHmEuqx0RY4+CsnkOn5l0GU+skkRXKGJrhmE2SLd8= k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= +k8s.io/client-go v0.23.6 h1:7h4SctDVQAQbkHQnR4Kzi7EyUyvla5G1pFWf4+Od7hQ= +k8s.io/client-go v0.23.6/go.mod h1:Umt5icFOMLV/+qbtZ3PR0D+JA6lvvb3syzodv4irpK4= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= From 3a2c4401e197ef43352a39ec82a5282f0b37e25f Mon Sep 17 00:00:00 2001 From: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> Date: Fri, 22 Apr 2022 12:27:39 +0200 Subject: [PATCH 060/194] bump dependencies (#14070) bump image --- go.mod | 6 +++--- go.sum | 18 ++++++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 9cdc221..6febd06 100644 --- a/go.mod +++ b/go.mod @@ -7,9 +7,9 @@ require ( github.com/cloudevents/sdk-go/v2 v2.9.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220421104831-69143eb27c90 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220421104831-69143eb27c90 - github.com/nats-io/nats-server/v2 v2.8.0 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220422083339-385009e35e7b + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220422083339-385009e35e7b + github.com/nats-io/nats-server/v2 v2.8.1 github.com/nats-io/nats.go v1.14.0 github.com/onsi/gomega v1.19.0 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 34d3f6a..89b6eb3 100644 --- a/go.sum +++ b/go.sum @@ -563,12 +563,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20220412113922-54faf51c33cb/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220412113922-54faf51c33cb/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220421104831-69143eb27c90 h1:A7mn5Y972yudNfvckiky7L6MF3C+O2uOvSZ339laJG4= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220421104831-69143eb27c90/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220421104831-69143eb27c90 h1:V3d+vtREZcthWcOGzt7ug980zJc77Yw04cC/173qeps= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220421104831-69143eb27c90/go.mod h1:0n9VDEgcb+BTxJirgmKhllU7bahMtQNBxhq30dQrmOg= +github.com/kyma-project/kyma/common/logging v0.0.0-20220421142140-496cc7687d1f/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220421142140-496cc7687d1f/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220422083339-385009e35e7b h1:cE+ne+Oka54ntb5v+Tw0BlWFgbih8J5Ymjd8UopYqds= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220422083339-385009e35e7b/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220422083339-385009e35e7b h1:oNSOEfUE5px/FMevU8fQ0cdjK1y+QDw4SE56YVgY06k= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220422083339-385009e35e7b/go.mod h1:SoJQzIofX+2pu2JZZiTI/4xO+9Iq5XdiP3LwGqD1JyM= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -656,17 +656,15 @@ github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL github.com/nats-io/jwt v1.2.2 h1:w3GMTO969dFg+UOKTmmyuu7IGdusK+7Ytlt//OYH/uU= github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= -github.com/nats-io/jwt/v2 v2.2.1-0.20220113022732-58e87895b296/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28gth9P+wV2K/zYUUAkJ+55U8cpS0p5I= github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= -github.com/nats-io/nats-server/v2 v2.7.4/go.mod h1:1vZ2Nijh8tcyNe8BDVyTviCd9NYzRbubQYiEHsvOQWc= -github.com/nats-io/nats-server/v2 v2.8.0 h1:9cX87APzxnmVhr+Oiv1t41eGrDaRDG2ffuu/e+gGwaQ= github.com/nats-io/nats-server/v2 v2.8.0/go.mod h1:5vic7C58BFEVltiZhs7Kq81q2WcEPhJPsmNv1FOrdv0= +github.com/nats-io/nats-server/v2 v2.8.1 h1:WZ9m/d8rklkWo6opo3X927vXnuaE00VEEl5zXcpL6qw= +github.com/nats-io/nats-server/v2 v2.8.1/go.mod h1:vIdpKz3OG+DCg4q/xVPdXHoztEyKDWRtykQ4N7hd7C4= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nats.go v1.14.0 h1:/QLCss4vQ6wvDpbqXucsVRDi13tFIR6kTdau+nXzKJw= github.com/nats-io/nats.go v1.14.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= From 123c6a2013087f0ea4067f889572d2f2f2a6c7db Mon Sep 17 00:00:00 2001 From: Przemek Pokrywka <12400578+dekiel@users.noreply.github.com> Date: Tue, 26 Apr 2022 17:06:40 +0200 Subject: [PATCH 061/194] Prow approval flow is not used. OWNERS files are not needed. (#14102) * Prow approval flow is not used. OWNERS files are not needed. * Prow approval flow is not used. OWNERS files are not needed. --- OWNERS | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 OWNERS diff --git a/OWNERS b/OWNERS deleted file mode 100644 index 51519a9..0000000 --- a/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -reviewers: - - eventing-reviewers -approvers: - - eventing-approvers - -labels: - - area/eventing From c8e5b551359dac3b434cbc9a69076aa385dd59a9 Mon Sep 17 00:00:00 2001 From: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> Date: Wed, 4 May 2022 20:49:27 +0200 Subject: [PATCH 062/194] bump dependencies (#14177) bump img --- go.mod | 33 +++++++++++++++++++++------------ go.sum | 52 ++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 57 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index 6febd06..cfd011a 100644 --- a/go.mod +++ b/go.mod @@ -7,8 +7,8 @@ require ( github.com/cloudevents/sdk-go/v2 v2.9.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220422083339-385009e35e7b - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220422083339-385009e35e7b + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220504115926-940176391e17 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220504115926-940176391e17 github.com/nats-io/nats-server/v2 v2.8.1 github.com/nats-io/nats.go v1.14.0 github.com/onsi/gomega v1.19.0 @@ -18,33 +18,42 @@ require ( github.com/stretchr/testify v1.7.1 go.opencensus.io v0.23.0 golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 - k8s.io/api v0.23.6 - k8s.io/apimachinery v0.23.6 - k8s.io/client-go v0.23.6 + k8s.io/api v0.24.0 + k8s.io/apimachinery v0.24.0 + k8s.io/client-go v0.24.0 sigs.k8s.io/controller-runtime v0.11.2 ) require ( cloud.google.com/go v0.81.0 // indirect + github.com/PuerkitoBio/purell v1.1.1 // indirect + github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/emicklei/go-restful v2.9.5+incompatible // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/go-logr/logr v1.2.3 // indirect + github.com/go-openapi/jsonpointer v0.19.5 // indirect + github.com/go-openapi/jsonreference v0.19.5 // indirect + github.com/go-openapi/swag v0.19.14 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect + github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-cmp v0.5.5 // indirect github.com/google/gofuzz v1.1.0 // indirect - github.com/googleapis/gnostic v0.5.5 // indirect github.com/imdario/mergo v0.3.12 // indirect + github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.14.4 // indirect + github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a // indirect github.com/nats-io/nkeys v0.3.0 // indirect github.com/nats-io/nuid v1.0.1 // indirect @@ -58,19 +67,19 @@ require ( go.uber.org/zap v1.21.0 // indirect golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect - golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect + golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect + golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.27.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect - k8s.io/klog/v2 v2.30.0 // indirect - k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect - k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect - sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect + k8s.io/klog/v2 v2.60.1 // indirect + k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect + k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect + sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // 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 89b6eb3..fd1211b 100644 --- a/go.sum +++ b/go.sum @@ -82,8 +82,10 @@ github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMo github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= @@ -106,6 +108,7 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= @@ -228,6 +231,7 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -305,12 +309,14 @@ github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwds github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= +github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= @@ -336,6 +342,7 @@ github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/ github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= @@ -411,6 +418,8 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/cel-go v0.9.0/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= github.com/google/cel-spec v0.6.0/go.mod h1:Nwjgxy5CbjlPrtCWjeDjUyKMl8w41YBYGjsyDdqk0xA= +github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= +github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -456,7 +465,6 @@ github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTV github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -524,6 +532,7 @@ github.com/jmoiron/sqlx v1.3.1/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXL github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -563,12 +572,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20220421142140-496cc7687d1f/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220421142140-496cc7687d1f/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220422083339-385009e35e7b h1:cE+ne+Oka54ntb5v+Tw0BlWFgbih8J5Ymjd8UopYqds= +github.com/kyma-project/kyma/common/logging v0.0.0-20220422083339-385009e35e7b/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220422083339-385009e35e7b/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220422083339-385009e35e7b h1:oNSOEfUE5px/FMevU8fQ0cdjK1y+QDw4SE56YVgY06k= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220422083339-385009e35e7b/go.mod h1:SoJQzIofX+2pu2JZZiTI/4xO+9Iq5XdiP3LwGqD1JyM= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220504115926-940176391e17 h1:R3CFQyCbq+kqEyd5dWAk6qm6xF5mD30LQgsVzcSYP1E= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220504115926-940176391e17/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220504115926-940176391e17 h1:QafxqYXP0L1gvW4dHhKgPX1iqoZOD9XqIQ9+xOaumRU= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220504115926-940176391e17/go.mod h1:9gmUQ/3ZGumwxryhc13h5W1ENri08rGyOLSY/17E5Mk= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -587,6 +596,7 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN 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/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= @@ -647,6 +657,7 @@ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -660,7 +671,6 @@ github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28g github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= -github.com/nats-io/nats-server/v2 v2.8.0/go.mod h1:5vic7C58BFEVltiZhs7Kq81q2WcEPhJPsmNv1FOrdv0= github.com/nats-io/nats-server/v2 v2.8.1 h1:WZ9m/d8rklkWo6opo3X927vXnuaE00VEEl5zXcpL6qw= github.com/nats-io/nats-server/v2 v2.8.1/go.mod h1:vIdpKz3OG+DCg4q/xVPdXHoztEyKDWRtykQ4N7hd7C4= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= @@ -1069,6 +1079,7 @@ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 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-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1172,8 +1183,9 @@ golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1198,8 +1210,9 @@ golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M= golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= +golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1470,8 +1483,9 @@ k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= -k8s.io/api v0.23.6 h1:yOK34wbYECH4RsJbQ9sfkFK3O7f/DUHRlzFehkqZyVw= k8s.io/api v0.23.6/go.mod h1:1kFaYxGCFHYp3qd6a85DAj/yW8aVD6XLZMqJclkoi9g= +k8s.io/api v0.24.0 h1:J0hann2hfxWr1hinZIDefw7Q96wmCBx6SSB8IY0MdDg= +k8s.io/api v0.24.0/go.mod h1:5Jl90IUrJHUJYEMANRURMiVvJ0g7Ax7r3R1bqO8zx8I= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= @@ -1489,8 +1503,9 @@ k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswP k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/apimachinery v0.23.6 h1:RH1UweWJkWNTlFx0D8uxOpaU1tjIOvVVWV/bu5b3/NQ= k8s.io/apimachinery v0.23.6/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= +k8s.io/apimachinery v0.24.0 h1:ydFCyC/DjCvFCHK5OPMKBlxayQytB8pxy8YQInd5UyQ= +k8s.io/apimachinery v0.24.0/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= @@ -1509,8 +1524,9 @@ k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= -k8s.io/client-go v0.23.6 h1:7h4SctDVQAQbkHQnR4Kzi7EyUyvla5G1pFWf4+Od7hQ= k8s.io/client-go v0.23.6/go.mod h1:Umt5icFOMLV/+qbtZ3PR0D+JA6lvvb3syzodv4irpK4= +k8s.io/client-go v0.24.0 h1:lbE4aB1gTHvYFSwm6eD3OF14NhFDKCejlnsGYlSJe5U= +k8s.io/client-go v0.24.0/go.mod h1:VFPQET+cAFpYxh6Bq6f4xyMY80G6jKKktU6G0m00VDw= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= @@ -1543,8 +1559,9 @@ k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +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-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= @@ -1552,8 +1569,9 @@ k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= +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/kubectl v0.21.0/go.mod h1:EU37NukZRXn1TpAkMUoy8Z/B2u6wjHDS4aInsDzVvks= k8s.io/metrics v0.21.0/go.mod h1:L3Ji9EGPP1YBbfm9sPfEXSpnj8i24bfQbAFAsW0NueQ= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= @@ -1564,8 +1582,9 @@ k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= +k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= @@ -1586,8 +1605,9 @@ sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCb sigs.k8s.io/controller-runtime v0.11.2 h1:H5GTxQl0Mc9UjRJhORusqfJCIjBO8UtUxGggCwL1rLA= sigs.k8s.io/controller-runtime v0.11.2/go.mod h1:P6QCzrEjLaZGqHsfd+os7JQ+WFZhvB8MRFsn4dWF7O4= sigs.k8s.io/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I= -sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= +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/kind v0.7.0/go.mod h1:An/AbWHT6pA/Lm0Og8j3ukGhfJP3RiVN/IBU6Lo3zl8= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/kustomize/api v0.8.5/go.mod h1:M377apnKT5ZHJS++6H4rQoCHmWtt6qTpp3mbe7p6OLY= From b900f06b166957e6b232dec04e798e96a309211f Mon Sep 17 00:00:00 2001 From: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> Date: Thu, 12 May 2022 00:36:38 -0700 Subject: [PATCH 063/194] bump the build image to golang 1.18.2 in EPP (#14268) * bump build image togolang 1.18.2 * bump image --- cmd/event-publisher-proxy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/event-publisher-proxy/Dockerfile b/cmd/event-publisher-proxy/Dockerfile index b492b99..71594ef 100644 --- a/cmd/event-publisher-proxy/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.18.1-alpine3.15 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.18.2-alpine3.15 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From d41192b3573abad6fdc123ebce427f7afdd78c22 Mon Sep 17 00:00:00 2001 From: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> Date: Fri, 13 May 2022 00:41:28 -0700 Subject: [PATCH 064/194] EPP bump nats and nats server (#14206) * bump dependencies * bump image * more bumps * go mod tidy --- go.mod | 8 ++++---- go.sum | 19 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index cfd011a..05374b2 100644 --- a/go.mod +++ b/go.mod @@ -7,10 +7,10 @@ require ( github.com/cloudevents/sdk-go/v2 v2.9.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220504115926-940176391e17 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220504115926-940176391e17 - github.com/nats-io/nats-server/v2 v2.8.1 - github.com/nats-io/nats.go v1.14.0 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220506151527-6c74f7543a36 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220506151527-6c74f7543a36 + github.com/nats-io/nats-server/v2 v2.8.2 + github.com/nats-io/nats.go v1.15.0 github.com/onsi/gomega v1.19.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 diff --git a/go.sum b/go.sum index fd1211b..95f63d8 100644 --- a/go.sum +++ b/go.sum @@ -572,12 +572,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20220422083339-385009e35e7b/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220422083339-385009e35e7b/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220504115926-940176391e17 h1:R3CFQyCbq+kqEyd5dWAk6qm6xF5mD30LQgsVzcSYP1E= +github.com/kyma-project/kyma/common/logging v0.0.0-20220504115926-940176391e17/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220504115926-940176391e17/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220504115926-940176391e17 h1:QafxqYXP0L1gvW4dHhKgPX1iqoZOD9XqIQ9+xOaumRU= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220504115926-940176391e17/go.mod h1:9gmUQ/3ZGumwxryhc13h5W1ENri08rGyOLSY/17E5Mk= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220506151527-6c74f7543a36 h1:q+k+IqovbfaDXTIoxt+26RtcXwF/Ti7uuotySq3xfqM= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220506151527-6c74f7543a36/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220506151527-6c74f7543a36 h1:oV2BHVHp74rFPuQftl3GX433jtp78Nc6X17/9GWGIOo= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220506151527-6c74f7543a36/go.mod h1:94DkYRYZXDbti0DkrlkyV1ujPzkdzSZ50owpGljbV4Y= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -671,12 +671,14 @@ github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28g github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= -github.com/nats-io/nats-server/v2 v2.8.1 h1:WZ9m/d8rklkWo6opo3X927vXnuaE00VEEl5zXcpL6qw= github.com/nats-io/nats-server/v2 v2.8.1/go.mod h1:vIdpKz3OG+DCg4q/xVPdXHoztEyKDWRtykQ4N7hd7C4= +github.com/nats-io/nats-server/v2 v2.8.2 h1:5m1VytMEbZx0YINvKY+X2gXdLNwP43uLXnFRwz8j8KE= +github.com/nats-io/nats-server/v2 v2.8.2/go.mod h1:vIdpKz3OG+DCg4q/xVPdXHoztEyKDWRtykQ4N7hd7C4= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nats.go v1.14.0 h1:/QLCss4vQ6wvDpbqXucsVRDi13tFIR6kTdau+nXzKJw= github.com/nats-io/nats.go v1.14.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats.go v1.15.0 h1:3IXNBolWrwIUf2soxh6Rla8gPzYWEZQBUBK6RV21s+o= +github.com/nats-io/nats.go v1.15.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= @@ -1483,7 +1485,6 @@ k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= -k8s.io/api v0.23.6/go.mod h1:1kFaYxGCFHYp3qd6a85DAj/yW8aVD6XLZMqJclkoi9g= k8s.io/api v0.24.0 h1:J0hann2hfxWr1hinZIDefw7Q96wmCBx6SSB8IY0MdDg= k8s.io/api v0.24.0/go.mod h1:5Jl90IUrJHUJYEMANRURMiVvJ0g7Ax7r3R1bqO8zx8I= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= @@ -1503,7 +1504,6 @@ k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswP k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/apimachinery v0.23.6/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apimachinery v0.24.0 h1:ydFCyC/DjCvFCHK5OPMKBlxayQytB8pxy8YQInd5UyQ= k8s.io/apimachinery v0.24.0/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= @@ -1524,7 +1524,6 @@ k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= -k8s.io/client-go v0.23.6/go.mod h1:Umt5icFOMLV/+qbtZ3PR0D+JA6lvvb3syzodv4irpK4= k8s.io/client-go v0.24.0 h1:lbE4aB1gTHvYFSwm6eD3OF14NhFDKCejlnsGYlSJe5U= k8s.io/client-go v0.24.0/go.mod h1:VFPQET+cAFpYxh6Bq6f4xyMY80G6jKKktU6G0m00VDw= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= From 4401f46c0f2b96c65e7aa062324ba45175270f9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 May 2022 10:29:28 +0200 Subject: [PATCH 065/194] gomod(deps): bump sigs.k8s.io/controller-runtime from 0.11.2 to 0.12.0 in /components/event-publisher-proxy (#14287) * gomod(deps): bump sigs.k8s.io/controller-runtime Bumps [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) from 0.11.2 to 0.12.0. - [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases) - [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.11.2...v0.12.0) --- updated-dependencies: - dependency-name: sigs.k8s.io/controller-runtime dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * bump image Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> --- go.mod | 2 +- go.sum | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 05374b2..2195075 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( k8s.io/api v0.24.0 k8s.io/apimachinery v0.24.0 k8s.io/client-go v0.24.0 - sigs.k8s.io/controller-runtime v0.11.2 + sigs.k8s.io/controller-runtime v0.12.0 ) require ( diff --git a/go.sum b/go.sum index 95f63d8..2a173dc 100644 --- a/go.sum +++ b/go.sum @@ -132,6 +132,7 @@ github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJm github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= @@ -197,6 +198,7 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -417,6 +419,7 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/cel-go v0.9.0/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= +github.com/google/cel-go v0.10.1/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= github.com/google/cel-spec v0.6.0/go.mod h1:Nwjgxy5CbjlPrtCWjeDjUyKMl8w41YBYGjsyDdqk0xA= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= @@ -645,6 +648,7 @@ github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2J github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= +github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -709,6 +713,7 @@ github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -721,6 +726,7 @@ github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg= github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= @@ -800,6 +806,7 @@ github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE github.com/rubenv/sql-migrate v0.0.0-20200616145509-8d140a17f351/go.mod h1:DCgfY80j8GYL7MLEfvcpSFvjD0L5yZq/aZUJmhZklyg= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= @@ -835,6 +842,7 @@ github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHN github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= +github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -894,6 +902,7 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= @@ -905,9 +914,12 @@ go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= +go.etcd.io/etcd/client/v3 v3.5.1/go.mod h1:OnjH4M8OnAotwaB2l9bVgZzRFKru7/ZMoS46OtKyd3Q= go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= @@ -1006,6 +1018,7 @@ golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hM golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1062,6 +1075,7 @@ golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1182,6 +1196,7 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1286,6 +1301,7 @@ golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM= +golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1379,6 +1395,7 @@ google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1494,6 +1511,7 @@ k8s.io/apiextensions-apiserver v0.20.2/go.mod h1:F6TXp389Xntt+LUq3vw6HFOLttPa0V8 k8s.io/apiextensions-apiserver v0.21.0/go.mod h1:gsQGNtGkc/YoDG9loKI0V+oLZM4ljRPjc/sql5tmvzc= k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE= k8s.io/apiextensions-apiserver v0.23.5/go.mod h1:ntcPWNXS8ZPKN+zTXuzYMeg731CP0heCTl6gYBxLcuQ= +k8s.io/apiextensions-apiserver v0.24.0/go.mod h1:iuVe4aEpe6827lvO6yWQVxiPSpPoSKVjkq+MIdg84cM= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= k8s.io/apimachinery v0.17.8/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= k8s.io/apimachinery v0.18.1/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= @@ -1513,6 +1531,7 @@ k8s.io/apiserver v0.20.2/go.mod h1:2nKd93WyMhZx4Hp3RfgH2K5PhwyTrprrkWYnI7id7jA= k8s.io/apiserver v0.21.0/go.mod h1:w2YSn4/WIwYuxG5zJmcqtRdtqgW/J2JRgFAqps3bBpg= k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU= k8s.io/apiserver v0.23.5/go.mod h1:7wvMtGJ42VRxzgVI7jkbKvMbuCbVbgsWFT7RyXiRNTw= +k8s.io/apiserver v0.24.0/go.mod h1:WFx2yiOMawnogNToVvUYT9nn1jaIkMKj41ZYCVycsBA= k8s.io/cli-runtime v0.18.2/go.mod h1:yfFR2sQQzDsV0VEKGZtrJwEy4hLZ2oj4ZIfodgxAHWQ= k8s.io/cli-runtime v0.21.0/go.mod h1:XoaHP93mGPF37MkLbjGVYqg3S1MnsFdKtiA/RZzzxOo= k8s.io/cli-runtime v0.22.0/go.mod h1:An6zELQ7udUI0GaXvkuMqyopPA14dIgNqpH8cZu1vig= @@ -1533,6 +1552,7 @@ k8s.io/code-generator v0.20.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbW k8s.io/code-generator v0.21.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo= k8s.io/code-generator v0.23.5/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= +k8s.io/code-generator v0.24.0/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= k8s.io/component-base v0.17.8/go.mod h1:xfNNdTAMsYzdiAa8vXnqDhRVSEgkfza0iMt0FrZDY7s= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= @@ -1540,6 +1560,7 @@ k8s.io/component-base v0.20.2/go.mod h1:pzFtCiwe/ASD0iV7ySMu8SYVJjCapNM9bjvk7ptp k8s.io/component-base v0.21.0/go.mod h1:qvtjz6X0USWXbgmbfXR+Agik4RZ3jv2Bgr5QnZzdPYw= k8s.io/component-base v0.21.3/go.mod h1:kkuhtfEHeZM6LkX0saqSK8PbdO7A0HigUngmhhrwfGQ= k8s.io/component-base v0.23.5/go.mod h1:c5Nq44KZyt1aLl0IpHX82fhsn84Sb0jjzwjpcA42bY0= +k8s.io/component-base v0.24.0/go.mod h1:Dgazgon0i7KYUsS8krG8muGiMVtUZxG037l1MKyXgrA= k8s.io/component-helpers v0.21.0/go.mod h1:tezqefP7lxfvJyR+0a+6QtVrkZ/wIkyMLK4WcQ3Cj8U= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -1548,6 +1569,7 @@ k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8 k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= @@ -1601,8 +1623,9 @@ sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+a sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= -sigs.k8s.io/controller-runtime v0.11.2 h1:H5GTxQl0Mc9UjRJhORusqfJCIjBO8UtUxGggCwL1rLA= sigs.k8s.io/controller-runtime v0.11.2/go.mod h1:P6QCzrEjLaZGqHsfd+os7JQ+WFZhvB8MRFsn4dWF7O4= +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-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= From 1ff5a62bab24b818a059e22507e0ce4faff36efe Mon Sep 17 00:00:00 2001 From: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> Date: Fri, 13 May 2022 11:48:17 -0700 Subject: [PATCH 066/194] bump prometheus/client_golang to 1.12.1 in EPP (#14304) * bump prometheus/client_golang to 1.12.1 * bump image --- go.mod | 8 ++++---- go.sum | 15 +++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 2195075..c5de8ef 100644 --- a/go.mod +++ b/go.mod @@ -7,13 +7,13 @@ require ( github.com/cloudevents/sdk-go/v2 v2.9.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220506151527-6c74f7543a36 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220506151527-6c74f7543a36 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220513144018-68e48ee051c6 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220513144018-68e48ee051c6 github.com/nats-io/nats-server/v2 v2.8.2 github.com/nats-io/nats.go v1.15.0 github.com/onsi/gomega v1.19.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.12.1 + github.com/prometheus/client_golang v1.12.2 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.1 go.opencensus.io v0.23.0 @@ -90,6 +90,6 @@ replace ( github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d github.com/docker/docker => github.com/docker/docker v20.10.3+incompatible github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.0-rc93 - 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 golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 ) diff --git a/go.sum b/go.sum index 2a173dc..f83be5f 100644 --- a/go.sum +++ b/go.sum @@ -575,12 +575,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20220504115926-940176391e17/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220504115926-940176391e17/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220506151527-6c74f7543a36 h1:q+k+IqovbfaDXTIoxt+26RtcXwF/Ti7uuotySq3xfqM= +github.com/kyma-project/kyma/common/logging v0.0.0-20220506151527-6c74f7543a36/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220506151527-6c74f7543a36/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220506151527-6c74f7543a36 h1:oV2BHVHp74rFPuQftl3GX433jtp78Nc6X17/9GWGIOo= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220506151527-6c74f7543a36/go.mod h1:94DkYRYZXDbti0DkrlkyV1ujPzkdzSZ50owpGljbV4Y= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220513144018-68e48ee051c6 h1:Nyj4yFfHMdyRuz0dKwRqNAbJRlpjaYMsmjAvb6OvarM= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220513144018-68e48ee051c6/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220513144018-68e48ee051c6 h1:vrU1RbJoVDs30XgCp3tdDhzIofUtMmZUc5J6OItCuJY= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220513144018-68e48ee051c6/go.mod h1:n34qjMuhyt1cNreIZeMlMB6oY5nSMFHMD53Tsdv9u7U= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -675,7 +675,6 @@ github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28g github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= -github.com/nats-io/nats-server/v2 v2.8.1/go.mod h1:vIdpKz3OG+DCg4q/xVPdXHoztEyKDWRtykQ4N7hd7C4= github.com/nats-io/nats-server/v2 v2.8.2 h1:5m1VytMEbZx0YINvKY+X2gXdLNwP43uLXnFRwz8j8KE= github.com/nats-io/nats-server/v2 v2.8.2/go.mod h1:vIdpKz3OG+DCg4q/xVPdXHoztEyKDWRtykQ4N7hd7C4= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= @@ -772,8 +771,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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -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.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= From e7d3a0634032829b12910b0c0bc8244732147a6b Mon Sep 17 00:00:00 2001 From: Friedrich <58187735+FriedrichWilken@users.noreply.github.com> Date: Tue, 17 May 2022 12:03:04 -0700 Subject: [PATCH 067/194] bump controller-runtime v0.12.1 in Event-Publisher-Proxy (#14318) * bump controller-runtime to v0.12.1 * bump image --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index c5de8ef..ac3b580 100644 --- a/go.mod +++ b/go.mod @@ -7,8 +7,8 @@ require ( github.com/cloudevents/sdk-go/v2 v2.9.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220513144018-68e48ee051c6 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220513144018-68e48ee051c6 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220517093305-874da3685d05 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220517093305-874da3685d05 github.com/nats-io/nats-server/v2 v2.8.2 github.com/nats-io/nats.go v1.15.0 github.com/onsi/gomega v1.19.0 @@ -21,7 +21,7 @@ require ( k8s.io/api v0.24.0 k8s.io/apimachinery v0.24.0 k8s.io/client-go v0.24.0 - sigs.k8s.io/controller-runtime v0.12.0 + sigs.k8s.io/controller-runtime v0.12.1 ) require ( diff --git a/go.sum b/go.sum index f83be5f..19dab34 100644 --- a/go.sum +++ b/go.sum @@ -577,10 +577,10 @@ github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIq github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= github.com/kyma-project/kyma/common/logging v0.0.0-20220506151527-6c74f7543a36/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220506151527-6c74f7543a36/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220513144018-68e48ee051c6 h1:Nyj4yFfHMdyRuz0dKwRqNAbJRlpjaYMsmjAvb6OvarM= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220513144018-68e48ee051c6/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220513144018-68e48ee051c6 h1:vrU1RbJoVDs30XgCp3tdDhzIofUtMmZUc5J6OItCuJY= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220513144018-68e48ee051c6/go.mod h1:n34qjMuhyt1cNreIZeMlMB6oY5nSMFHMD53Tsdv9u7U= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220517093305-874da3685d05 h1:VSnXsW0Q/7rV0Qr7acJH8HEF+qBYFzn8+8MoCtlhnj4= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220517093305-874da3685d05/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220517093305-874da3685d05 h1:xR/zvL3c+YCor2kTwGytlAFrtmmcuhiqxW6KmZu/Q+k= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220517093305-874da3685d05/go.mod h1:n34qjMuhyt1cNreIZeMlMB6oY5nSMFHMD53Tsdv9u7U= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -1623,8 +1623,8 @@ sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2 sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= sigs.k8s.io/controller-runtime v0.11.2/go.mod h1:P6QCzrEjLaZGqHsfd+os7JQ+WFZhvB8MRFsn4dWF7O4= -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/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= From ecda2125107a9328c7d3c4214ecd40806ca491d4 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Thu, 19 May 2022 18:56:04 +0200 Subject: [PATCH 068/194] bump dependency cloudevents/sdk-go in EPP (#14349) * bump dependency cloudevent/sdk-go to v2.10.0 * bump image --- go.mod | 8 ++++---- go.sum | 49 +++++++++---------------------------------------- 2 files changed, 13 insertions(+), 44 deletions(-) diff --git a/go.mod b/go.mod index ac3b580..2126fb3 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,12 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy go 1.17 require ( - github.com/cloudevents/sdk-go/protocol/nats/v2 v2.9.0 - github.com/cloudevents/sdk-go/v2 v2.9.0 + github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.0 + github.com/cloudevents/sdk-go/v2 v2.10.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220517093305-874da3685d05 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220517093305-874da3685d05 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220519113004-f9d1a6ba99e7 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220519113004-f9d1a6ba99e7 github.com/nats-io/nats-server/v2 v2.8.2 github.com/nats-io/nats.go v1.15.0 github.com/onsi/gomega v1.19.0 diff --git a/go.sum b/go.sum index 19dab34..41988e2 100644 --- a/go.sum +++ b/go.sum @@ -41,7 +41,6 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= @@ -129,7 +128,6 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= @@ -157,10 +155,12 @@ github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmE github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/protocol/nats/v2 v2.9.0 h1:3d1z9UQer8v2KLxRba3tNd7M5x9Te7g9g9ZLqdzfpVc= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.9.0/go.mod h1:QJzS5Pw2lWu22wJfrq43o90Nj7xr9H8JDbd+T3IpwCE= -github.com/cloudevents/sdk-go/v2 v2.9.0 h1:StQ9q2JuGvclGFoT7kpTdQm+qjW0LQzg51CgUF4ncpY= +github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.0 h1:pFHVT5IYlsGvpAjExh+wu0Cn4Q1ErljpVViJfsyNAj8= +github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.0/go.mod h1:YImkWPX88pBfCulSbtmo40JQCYmMVufOVPlVKL4IaXY= github.com/cloudevents/sdk-go/v2 v2.9.0/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= +github.com/cloudevents/sdk-go/v2 v2.10.0 h1:sz0pbNBGh1iRspqLGe/2cXhDghZZpvNPHwKPucVbh+8= +github.com/cloudevents/sdk-go/v2 v2.10.0/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -418,7 +418,6 @@ github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA// github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/cel-go v0.9.0/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= github.com/google/cel-go v0.10.1/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= github.com/google/cel-spec v0.6.0/go.mod h1:Nwjgxy5CbjlPrtCWjeDjUyKMl8w41YBYGjsyDdqk0xA= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= @@ -575,12 +574,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20220506151527-6c74f7543a36/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220506151527-6c74f7543a36/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220517093305-874da3685d05 h1:VSnXsW0Q/7rV0Qr7acJH8HEF+qBYFzn8+8MoCtlhnj4= +github.com/kyma-project/kyma/common/logging v0.0.0-20220517093305-874da3685d05/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220517093305-874da3685d05/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220517093305-874da3685d05 h1:xR/zvL3c+YCor2kTwGytlAFrtmmcuhiqxW6KmZu/Q+k= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220517093305-874da3685d05/go.mod h1:n34qjMuhyt1cNreIZeMlMB6oY5nSMFHMD53Tsdv9u7U= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220519113004-f9d1a6ba99e7 h1:8dEMbnHkVTilorF5heR3Onpsr4IHOm2yFF+CfEB78j0= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220519113004-f9d1a6ba99e7/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220519113004-f9d1a6ba99e7 h1:tj0YS47CUZVcPcvav43TUDyDD456+5k1Az5wcuIZmS4= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220519113004-f9d1a6ba99e7/go.mod h1:YGD2/Cn4L1MRlGL1LiRjq4l/CO/paWM4gwklPjgdyBg= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -592,7 +591,6 @@ github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -647,7 +645,6 @@ github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0Gq github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= -github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -752,7 +749,6 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterbourgon/mergemap v0.0.0-20130613134717-e21c03b7a721/go.mod h1:jQyRpOpE/KbvPc0VKXjAqctYglwUO5W6zAcGcFfbvlo= @@ -783,7 +779,6 @@ github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7q github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.28.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -840,10 +835,8 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -853,7 +846,6 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -900,7 +892,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= @@ -1072,11 +1063,9 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1091,9 +1080,7 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= 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= @@ -1193,10 +1180,8 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211029165221-6e7872819dc8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1204,7 +1189,6 @@ golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIj golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1299,7 +1283,6 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM= golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1336,7 +1319,6 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1453,7 +1435,6 @@ gopkg.in/gorp.v1 v1.7.2/go.mod h1:Wo3h+DBQZIxATwftsglhdD/62zRFPhGhTiu5jUJmCaw= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -1500,7 +1481,6 @@ k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= -k8s.io/api v0.23.5/go.mod h1:Na4XuKng8PXJ2JsploYYrivXrINeTaycCGcYgF91Xm8= k8s.io/api v0.24.0 h1:J0hann2hfxWr1hinZIDefw7Q96wmCBx6SSB8IY0MdDg= k8s.io/api v0.24.0/go.mod h1:5Jl90IUrJHUJYEMANRURMiVvJ0g7Ax7r3R1bqO8zx8I= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= @@ -1509,7 +1489,6 @@ k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt k8s.io/apiextensions-apiserver v0.20.2/go.mod h1:F6TXp389Xntt+LUq3vw6HFOLttPa0V8821ogLGwb6Zs= k8s.io/apiextensions-apiserver v0.21.0/go.mod h1:gsQGNtGkc/YoDG9loKI0V+oLZM4ljRPjc/sql5tmvzc= k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE= -k8s.io/apiextensions-apiserver v0.23.5/go.mod h1:ntcPWNXS8ZPKN+zTXuzYMeg731CP0heCTl6gYBxLcuQ= k8s.io/apiextensions-apiserver v0.24.0/go.mod h1:iuVe4aEpe6827lvO6yWQVxiPSpPoSKVjkq+MIdg84cM= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= k8s.io/apimachinery v0.17.8/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= @@ -1520,7 +1499,6 @@ k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRp k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.23.5/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= k8s.io/apimachinery v0.24.0 h1:ydFCyC/DjCvFCHK5OPMKBlxayQytB8pxy8YQInd5UyQ= k8s.io/apimachinery v0.24.0/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= @@ -1529,7 +1507,6 @@ k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.2/go.mod h1:2nKd93WyMhZx4Hp3RfgH2K5PhwyTrprrkWYnI7id7jA= k8s.io/apiserver v0.21.0/go.mod h1:w2YSn4/WIwYuxG5zJmcqtRdtqgW/J2JRgFAqps3bBpg= k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU= -k8s.io/apiserver v0.23.5/go.mod h1:7wvMtGJ42VRxzgVI7jkbKvMbuCbVbgsWFT7RyXiRNTw= k8s.io/apiserver v0.24.0/go.mod h1:WFx2yiOMawnogNToVvUYT9nn1jaIkMKj41ZYCVycsBA= k8s.io/cli-runtime v0.18.2/go.mod h1:yfFR2sQQzDsV0VEKGZtrJwEy4hLZ2oj4ZIfodgxAHWQ= k8s.io/cli-runtime v0.21.0/go.mod h1:XoaHP93mGPF37MkLbjGVYqg3S1MnsFdKtiA/RZzzxOo= @@ -1541,7 +1518,6 @@ k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= -k8s.io/client-go v0.23.5/go.mod h1:flkeinTO1CirYgzMPRWxUCnV0G4Fbu2vLhYCObnt/r4= k8s.io/client-go v0.24.0 h1:lbE4aB1gTHvYFSwm6eD3OF14NhFDKCejlnsGYlSJe5U= k8s.io/client-go v0.24.0/go.mod h1:VFPQET+cAFpYxh6Bq6f4xyMY80G6jKKktU6G0m00VDw= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= @@ -1550,7 +1526,6 @@ k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbW k8s.io/code-generator v0.20.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= k8s.io/code-generator v0.21.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo= -k8s.io/code-generator v0.23.5/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= k8s.io/code-generator v0.24.0/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= k8s.io/component-base v0.17.8/go.mod h1:xfNNdTAMsYzdiAa8vXnqDhRVSEgkfza0iMt0FrZDY7s= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= @@ -1558,7 +1533,6 @@ k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeY k8s.io/component-base v0.20.2/go.mod h1:pzFtCiwe/ASD0iV7ySMu8SYVJjCapNM9bjvk7ptpKh0= k8s.io/component-base v0.21.0/go.mod h1:qvtjz6X0USWXbgmbfXR+Agik4RZ3jv2Bgr5QnZzdPYw= k8s.io/component-base v0.21.3/go.mod h1:kkuhtfEHeZM6LkX0saqSK8PbdO7A0HigUngmhhrwfGQ= -k8s.io/component-base v0.23.5/go.mod h1:c5Nq44KZyt1aLl0IpHX82fhsn84Sb0jjzwjpcA42bY0= k8s.io/component-base v0.24.0/go.mod h1:Dgazgon0i7KYUsS8krG8muGiMVtUZxG037l1MKyXgrA= k8s.io/component-helpers v0.21.0/go.mod h1:tezqefP7lxfvJyR+0a+6QtVrkZ/wIkyMLK4WcQ3Cj8U= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= @@ -1579,7 +1553,6 @@ k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= 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-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= @@ -1589,7 +1562,6 @@ k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= 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/kubectl v0.21.0/go.mod h1:EU37NukZRXn1TpAkMUoy8Z/B2u6wjHDS4aInsDzVvks= @@ -1602,7 +1574,6 @@ k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= @@ -1622,11 +1593,9 @@ sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+a sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= -sigs.k8s.io/controller-runtime v0.11.2/go.mod h1:P6QCzrEjLaZGqHsfd+os7JQ+WFZhvB8MRFsn4dWF7O4= 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/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I= -sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= 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/kind v0.7.0/go.mod h1:An/AbWHT6pA/Lm0Og8j3ukGhfJP3RiVN/IBU6Lo3zl8= From 228983040c5f3c309a71cb9a30afc777f3c94217 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Wed, 25 May 2022 09:52:29 +0200 Subject: [PATCH 069/194] bump dependency nats-io/nats-server to v2.8.3 in event-publisher-proxy (#14359) * bump image * bump application-operator * bump further * bump nats-server to v2.8.3 --- go.mod | 6 +++--- go.sum | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2126fb3..f44ff33 100644 --- a/go.mod +++ b/go.mod @@ -7,9 +7,9 @@ require ( github.com/cloudevents/sdk-go/v2 v2.10.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220519113004-f9d1a6ba99e7 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220519113004-f9d1a6ba99e7 - github.com/nats-io/nats-server/v2 v2.8.2 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220524065628-a4b532883fbe + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220524065628-a4b532883fbe + github.com/nats-io/nats-server/v2 v2.8.3 github.com/nats-io/nats.go v1.15.0 github.com/onsi/gomega v1.19.0 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 41988e2..546deb6 100644 --- a/go.sum +++ b/go.sum @@ -578,8 +578,20 @@ github.com/kyma-project/kyma/common/logging v0.0.0-20220517093305-874da3685d05/g github.com/kyma-project/kyma/components/application-operator v0.0.0-20220517093305-874da3685d05/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220519113004-f9d1a6ba99e7 h1:8dEMbnHkVTilorF5heR3Onpsr4IHOm2yFF+CfEB78j0= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220519113004-f9d1a6ba99e7/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220520125427-4dc23d902b32 h1:zgCfJsr0PTB7Pp29gwRniseOgwpfsTM4lg6WcxpKyzI= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220520125427-4dc23d902b32/go.mod h1:PV3PpVnVBfOi21hX0MsS4XYDsX+EGYUrpLC67oIjzeQ= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220523094428-f942f9739ec5 h1:APFhUe8dihsgv8wTenKh50+W4Bu5InGuJatCd66DUfQ= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220523094428-f942f9739ec5/go.mod h1:PV3PpVnVBfOi21hX0MsS4XYDsX+EGYUrpLC67oIjzeQ= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220524065628-a4b532883fbe h1:sWePpZq/9pOzjJRQtdb82ajO7R9GOKrvTkH8A4RCEVk= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220524065628-a4b532883fbe/go.mod h1:PV3PpVnVBfOi21hX0MsS4XYDsX+EGYUrpLC67oIjzeQ= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220519113004-f9d1a6ba99e7 h1:tj0YS47CUZVcPcvav43TUDyDD456+5k1Az5wcuIZmS4= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220519113004-f9d1a6ba99e7/go.mod h1:YGD2/Cn4L1MRlGL1LiRjq4l/CO/paWM4gwklPjgdyBg= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220520125427-4dc23d902b32 h1:UQ7nb034bAIg1C0g3NctjOsj+vAXoU4lylwcK2JzFJY= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220520125427-4dc23d902b32/go.mod h1:7bOfihx2BxqxdHo5IRI2n1JfEhpVRVZSKDo7yIzZ87Y= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220523094428-f942f9739ec5 h1:l9p2Rfa1EFBA0qk0YgaQZT+SL8XP3Ptn5D2+UpRBSyI= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220523094428-f942f9739ec5/go.mod h1:7bOfihx2BxqxdHo5IRI2n1JfEhpVRVZSKDo7yIzZ87Y= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220524065628-a4b532883fbe h1:4y61V20+i2grhsbl0x9gUL2XQqProSe4owhRZTB4BWU= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220524065628-a4b532883fbe/go.mod h1:7bOfihx2BxqxdHo5IRI2n1JfEhpVRVZSKDo7yIzZ87Y= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -674,6 +686,8 @@ github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= github.com/nats-io/nats-server/v2 v2.8.2 h1:5m1VytMEbZx0YINvKY+X2gXdLNwP43uLXnFRwz8j8KE= github.com/nats-io/nats-server/v2 v2.8.2/go.mod h1:vIdpKz3OG+DCg4q/xVPdXHoztEyKDWRtykQ4N7hd7C4= +github.com/nats-io/nats-server/v2 v2.8.3 h1:5jCAOZ62OeL0YSVhMotP17zk4K/N5bAHGwxyIGspjM8= +github.com/nats-io/nats-server/v2 v2.8.3/go.mod h1:8zZa+Al3WsESfmgSs98Fi06dRWLH5Bnq90m5bKD/eT4= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nats.go v1.14.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= From 7806b9c89d8ea99e625591f17bab7311819b0737 Mon Sep 17 00:00:00 2001 From: Thandayuthapani Date: Wed, 25 May 2022 16:20:31 +0200 Subject: [PATCH 070/194] Unify the usages of EVENT_TYPE_PREFIX and LEGACY_EVENT_TYPE_PREFIX (#13329) * Unify the usages of EVENT_TYPE_PREFIX and LEGACY_EVENT_TYPE_PREFIX * Address review comments * Address review comments --- cmd/event-publisher-proxy/nats/nats.go | 2 +- config/event-publisher-nats/200-deployment.yaml | 2 +- pkg/env/nats_config.go | 8 ++++---- pkg/handler/nats/mock/mock.go | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cmd/event-publisher-proxy/nats/nats.go b/cmd/event-publisher-proxy/nats/nats.go index 8c5422a..42651d3 100644 --- a/cmd/event-publisher-proxy/nats/nats.go +++ b/cmd/event-publisher-proxy/nats/nats.go @@ -115,7 +115,7 @@ func (c *Commander) Start() error { c.logger.Info("Informers are synced successfully") // configure event type cleaner - eventTypeCleaner := eventtype.NewCleaner(c.envCfg.LegacyEventTypePrefix, applicationLister, c.logger) + eventTypeCleaner := eventtype.NewCleaner(c.envCfg.EventTypePrefix, applicationLister, c.logger) // start handler which blocks until it receives a shutdown signal if err := nats.NewHandler(messageReceiver, &messageSenderToNats, c.envCfg.RequestTimeout, legacyTransformer, c.opts, diff --git a/config/event-publisher-nats/200-deployment.yaml b/config/event-publisher-nats/200-deployment.yaml index 29b5c92..1079766 100644 --- a/config/event-publisher-nats/200-deployment.yaml +++ b/config/event-publisher-nats/200-deployment.yaml @@ -35,7 +35,7 @@ spec: value: 5s - name: LEGACY_NAMESPACE value: kyma - - name: LEGACY_EVENT_TYPE_PREFIX + - name: EVENT_TYPE_PREFIX value: sap.kyma.custom image: ko://github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy imagePullPolicy: IfNotPresent diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go index 8df0f3e..a8ccfa3 100644 --- a/pkg/env/nats_config.go +++ b/pkg/env/nats_config.go @@ -19,9 +19,9 @@ type NatsConfig struct { // Legacy Namespace is used as the event source for legacy events LegacyNamespace string `envconfig:"LEGACY_NAMESPACE" default:"kyma"` - // LegacyEventTypePrefix is the prefix of each event as per the eventing specification, used for legacy events - // It follows the eventType format: ... - LegacyEventTypePrefix string `envconfig:"LEGACY_EVENT_TYPE_PREFIX" default:"kyma"` + // EventTypePrefix is the prefix of each event as per the eventing specification + // It follows the eventType format: ... + EventTypePrefix string `envconfig:"EVENT_TYPE_PREFIX" default:"kyma"` // JetStream-specific configs JSStreamName string `envconfig:"JS_STREAM_NAME" default:"kyma"` @@ -32,7 +32,7 @@ type NatsConfig struct { func (c *NatsConfig) ToConfig() *BebConfig { cfg := &BebConfig{ BEBNamespace: c.LegacyNamespace, - EventTypePrefix: c.LegacyEventTypePrefix, + EventTypePrefix: c.EventTypePrefix, } return cfg } diff --git a/pkg/handler/nats/mock/mock.go b/pkg/handler/nats/mock/mock.go index 84ff537..bf77242 100644 --- a/pkg/handler/nats/mock/mock.go +++ b/pkg/handler/nats/mock/mock.go @@ -155,7 +155,7 @@ func WithEventTypePrefix(eventTypePrefix string) NatsHandlerMockOpt { // WithSubscription returns NatsHandlerMockOpt which sets the subscribed.Processor for the given NatsHandlerMock. func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Subscription) NatsHandlerMockOpt { return func(m *NatsHandlerMock) { - m.natsConfig.LegacyEventTypePrefix = m.eventTypePrefix + m.natsConfig.EventTypePrefix = m.eventTypePrefix dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, 10*time.Second, v1.NamespaceAll, nil) genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) @@ -191,9 +191,9 @@ func WithJetstream(jsEnabled bool) NatsHandlerMockOpt { func newNatsConfig(port int) *env.NatsConfig { return &env.NatsConfig{ - Port: port, - LegacyNamespace: testingutils.MessagingNamespace, - LegacyEventTypePrefix: testingutils.MessagingEventTypePrefix, - JSStreamName: testingutils.StreamName, + Port: port, + LegacyNamespace: testingutils.MessagingNamespace, + EventTypePrefix: testingutils.MessagingEventTypePrefix, + JSStreamName: testingutils.StreamName, } } From 5f4efdb9d426d66f8f4331baab1fc2531b277875 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Thu, 26 May 2022 13:34:31 +0200 Subject: [PATCH 071/194] bump k8s.io/utils (#14414) * bump k8s.io/utils * bump images --- go.mod | 1 + go.sum | 43 ++++++++++--------------------------------- 2 files changed, 11 insertions(+), 33 deletions(-) diff --git a/go.mod b/go.mod index f44ff33..2b41bad 100644 --- a/go.mod +++ b/go.mod @@ -92,4 +92,5 @@ replace ( github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.0-rc93 github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.12.2 golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 + k8s.io/utils => k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 ) diff --git a/go.sum b/go.sum index 546deb6..10775b7 100644 --- a/go.sum +++ b/go.sum @@ -155,10 +155,8 @@ github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmE github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/protocol/nats/v2 v2.9.0/go.mod h1:QJzS5Pw2lWu22wJfrq43o90Nj7xr9H8JDbd+T3IpwCE= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.0 h1:pFHVT5IYlsGvpAjExh+wu0Cn4Q1ErljpVViJfsyNAj8= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.0/go.mod h1:YImkWPX88pBfCulSbtmo40JQCYmMVufOVPlVKL4IaXY= -github.com/cloudevents/sdk-go/v2 v2.9.0/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= github.com/cloudevents/sdk-go/v2 v2.10.0 h1:sz0pbNBGh1iRspqLGe/2cXhDghZZpvNPHwKPucVbh+8= github.com/cloudevents/sdk-go/v2 v2.10.0/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -574,22 +572,10 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20220517093305-874da3685d05/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220517093305-874da3685d05/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220519113004-f9d1a6ba99e7 h1:8dEMbnHkVTilorF5heR3Onpsr4IHOm2yFF+CfEB78j0= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220519113004-f9d1a6ba99e7/go.mod h1:9pe+mc3dOScffwfL6J24kQcU5CGZwGyl4zNm1YlRJbQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220520125427-4dc23d902b32 h1:zgCfJsr0PTB7Pp29gwRniseOgwpfsTM4lg6WcxpKyzI= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220520125427-4dc23d902b32/go.mod h1:PV3PpVnVBfOi21hX0MsS4XYDsX+EGYUrpLC67oIjzeQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220523094428-f942f9739ec5 h1:APFhUe8dihsgv8wTenKh50+W4Bu5InGuJatCd66DUfQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220523094428-f942f9739ec5/go.mod h1:PV3PpVnVBfOi21hX0MsS4XYDsX+EGYUrpLC67oIjzeQ= +github.com/kyma-project/kyma/common/logging v0.0.0-20220520105026-ab8aadd814a8/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220520105026-ab8aadd814a8/go.mod h1:PV3PpVnVBfOi21hX0MsS4XYDsX+EGYUrpLC67oIjzeQ= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220524065628-a4b532883fbe h1:sWePpZq/9pOzjJRQtdb82ajO7R9GOKrvTkH8A4RCEVk= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220524065628-a4b532883fbe/go.mod h1:PV3PpVnVBfOi21hX0MsS4XYDsX+EGYUrpLC67oIjzeQ= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220519113004-f9d1a6ba99e7 h1:tj0YS47CUZVcPcvav43TUDyDD456+5k1Az5wcuIZmS4= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220519113004-f9d1a6ba99e7/go.mod h1:YGD2/Cn4L1MRlGL1LiRjq4l/CO/paWM4gwklPjgdyBg= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220520125427-4dc23d902b32 h1:UQ7nb034bAIg1C0g3NctjOsj+vAXoU4lylwcK2JzFJY= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220520125427-4dc23d902b32/go.mod h1:7bOfihx2BxqxdHo5IRI2n1JfEhpVRVZSKDo7yIzZ87Y= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220523094428-f942f9739ec5 h1:l9p2Rfa1EFBA0qk0YgaQZT+SL8XP3Ptn5D2+UpRBSyI= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220523094428-f942f9739ec5/go.mod h1:7bOfihx2BxqxdHo5IRI2n1JfEhpVRVZSKDo7yIzZ87Y= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220524065628-a4b532883fbe h1:4y61V20+i2grhsbl0x9gUL2XQqProSe4owhRZTB4BWU= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220524065628-a4b532883fbe/go.mod h1:7bOfihx2BxqxdHo5IRI2n1JfEhpVRVZSKDo7yIzZ87Y= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= @@ -684,7 +670,6 @@ github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28g github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= -github.com/nats-io/nats-server/v2 v2.8.2 h1:5m1VytMEbZx0YINvKY+X2gXdLNwP43uLXnFRwz8j8KE= github.com/nats-io/nats-server/v2 v2.8.2/go.mod h1:vIdpKz3OG+DCg4q/xVPdXHoztEyKDWRtykQ4N7hd7C4= github.com/nats-io/nats-server/v2 v2.8.3 h1:5jCAOZ62OeL0YSVhMotP17zk4K/N5bAHGwxyIGspjM8= github.com/nats-io/nats-server/v2 v2.8.3/go.mod h1:8zZa+Al3WsESfmgSs98Fi06dRWLH5Bnq90m5bKD/eT4= @@ -1075,11 +1060,11 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1302,8 +1287,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -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.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= @@ -1494,7 +1479,7 @@ k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= -k8s.io/api v0.22.0/go.mod h1:0AoXXqst47OI/L0oGKq9DG61dvGRPXs7X4/B7KyjBCU= +k8s.io/api v0.22.9/go.mod h1:rcjO/FPOuvc3x7nQWx29UcDrFJMx82RxDob71ntNH4A= k8s.io/api v0.24.0 h1:J0hann2hfxWr1hinZIDefw7Q96wmCBx6SSB8IY0MdDg= k8s.io/api v0.24.0/go.mod h1:5Jl90IUrJHUJYEMANRURMiVvJ0g7Ax7r3R1bqO8zx8I= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= @@ -1512,7 +1497,7 @@ k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRp k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= -k8s.io/apimachinery v0.22.0/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= +k8s.io/apimachinery v0.22.9/go.mod h1:ZvVLP5iLhwVFg2Yx9Gh5W0um0DUauExbRhe+2Z8I1EU= k8s.io/apimachinery v0.24.0 h1:ydFCyC/DjCvFCHK5OPMKBlxayQytB8pxy8YQInd5UyQ= k8s.io/apimachinery v0.24.0/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= @@ -1524,14 +1509,14 @@ k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU= k8s.io/apiserver v0.24.0/go.mod h1:WFx2yiOMawnogNToVvUYT9nn1jaIkMKj41ZYCVycsBA= k8s.io/cli-runtime v0.18.2/go.mod h1:yfFR2sQQzDsV0VEKGZtrJwEy4hLZ2oj4ZIfodgxAHWQ= k8s.io/cli-runtime v0.21.0/go.mod h1:XoaHP93mGPF37MkLbjGVYqg3S1MnsFdKtiA/RZzzxOo= -k8s.io/cli-runtime v0.22.0/go.mod h1:An6zELQ7udUI0GaXvkuMqyopPA14dIgNqpH8cZu1vig= +k8s.io/cli-runtime v0.22.9/go.mod h1:HDoV4LwtOwJBfO1+pZF6ms8QMB6x4wg8QiRMkTzGknY= k8s.io/client-go v0.17.8/go.mod h1:SJsDS64AAtt9VZyeaQMb4Ck5etCitZ/FwajWdzua5eY= k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= -k8s.io/client-go v0.22.0/go.mod h1:GUjIuXR5PiEv/RVK5OODUsm6eZk7wtSWZSaSJbpFdGg= +k8s.io/client-go v0.22.9/go.mod h1:IoH7exYnoH/zgvHOuVxh2c4yJepcCBt72FzCTisOc4k= k8s.io/client-go v0.24.0 h1:lbE4aB1gTHvYFSwm6eD3OF14NhFDKCejlnsGYlSJe5U= k8s.io/client-go v0.24.0/go.mod h1:VFPQET+cAFpYxh6Bq6f4xyMY80G6jKKktU6G0m00VDw= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= @@ -1558,7 +1543,6 @@ k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAE k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= @@ -1576,18 +1560,11 @@ k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= +k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/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/kubectl v0.21.0/go.mod h1:EU37NukZRXn1TpAkMUoy8Z/B2u6wjHDS4aInsDzVvks= k8s.io/metrics v0.21.0/go.mod h1:L3Ji9EGPP1YBbfm9sPfEXSpnj8i24bfQbAFAsW0NueQ= -k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= From 7b391d51d99fac010c544bae43a58cf17a4d21e7 Mon Sep 17 00:00:00 2001 From: VladislavPaskar <15933100+VladislavPaskar@users.noreply.github.com> Date: Fri, 27 May 2022 13:17:09 +0200 Subject: [PATCH 072/194] Hardcode the JS stream prefix (#14262) * hardcode the js stream prefix, adjust the tests * improve logic --- pkg/env/nats_config.go | 5 ++-- pkg/sender/jetstream.go | 6 +--- pkg/sender/jetstream_test.go | 54 +++++------------------------------- testing/fixtures.go | 1 + 4 files changed, 12 insertions(+), 54 deletions(-) diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go index a8ccfa3..fa10e9b 100644 --- a/pkg/env/nats_config.go +++ b/pkg/env/nats_config.go @@ -8,6 +8,8 @@ import ( // compile time check var _ fmt.Stringer = &NatsConfig{} +const JetstreamSubjectPrefix = "kyma" + // NatsConfig represents the environment config for the Event Publisher to NATS. type NatsConfig struct { Port int `envconfig:"INGRESS_PORT" default:"8080"` @@ -24,8 +26,7 @@ type NatsConfig struct { EventTypePrefix string `envconfig:"EVENT_TYPE_PREFIX" default:"kyma"` // JetStream-specific configs - JSStreamName string `envconfig:"JS_STREAM_NAME" default:"kyma"` - JSStreamSubjectPrefix string `envconfig:"JS_STREAM_SUBJECT_PREFIX" required:"true"` + JSStreamName string `envconfig:"JS_STREAM_NAME" default:"kyma"` } // ToConfig converts to a default BEB BebConfig diff --git a/pkg/sender/jetstream.go b/pkg/sender/jetstream.go index a4f3123..136ea7f 100644 --- a/pkg/sender/jetstream.go +++ b/pkg/sender/jetstream.go @@ -6,7 +6,6 @@ import ( "errors" "fmt" "net/http" - "strings" "github.com/cloudevents/sdk-go/v2/event" "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" @@ -109,8 +108,5 @@ func (s *JetstreamMessageSender) eventToNatsMsg(event *event.Event) (*nats.Msg, // getJsSubjectToPublish appends stream name to subject if needed. func (s *JetstreamMessageSender) getJsSubjectToPublish(subject string) string { - if strings.HasPrefix(subject, s.envCfg.JSStreamSubjectPrefix) { - return subject - } - return fmt.Sprintf("%s.%s", s.envCfg.JSStreamSubjectPrefix, subject) + return fmt.Sprintf("%s.%s", env.JetstreamSubjectPrefix, subject) } diff --git a/pkg/sender/jetstream_test.go b/pkg/sender/jetstream_test.go index 2ce9afb..a90a603 100644 --- a/pkg/sender/jetstream_test.go +++ b/pkg/sender/jetstream_test.go @@ -80,6 +80,8 @@ func TestJetstreamMessageSender(t *testing.T) { // then status, err := sender.Send(ctx, ce) + + testEnv.Logger.Errorf("err: %v", err) assert.Equal(t, tc.wantError, err != nil) assert.Equal(t, tc.wantStatusCode, status) }) @@ -148,48 +150,6 @@ func TestStreamExists(t *testing.T) { } } -func TestJSSubjectPrefix(t *testing.T) { - - testCases := []struct { - name string - givenPrefix string - givenEventSubject string - wantSubject string - }{ - { - name: "With empty prefix", - givenEventSubject: "custom.test", - givenPrefix: "", - wantSubject: "custom.test", - }, - { - name: "With non-empty prefix", - givenEventSubject: "custom.test", - givenPrefix: "prefix", - wantSubject: "prefix.custom.test", - }, - } - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - // given - config := &env.NatsConfig{ - JSStreamSubjectPrefix: tc.givenPrefix, - } - s := JetstreamMessageSender{envCfg: config} - ce := createCloudEvent(t) - ce.SetType(tc.givenEventSubject) - - // when - subject := s.getJsSubjectToPublish(ce.Type()) - - // then - assert.Equal(t, subject, tc.wantSubject) - }) - } -} - // helper functions and structs type TestEnvironment struct { @@ -210,7 +170,7 @@ func setupTestEnvironment(t *testing.T) *TestEnvironment { require.NotNil(t, connection) require.NoError(t, err) - natsConfig := CreateNatsJsConfig(natsServer.ClientURL(), testingutils.MessagingEventTypePrefix) + natsConfig := CreateNatsJsConfig(natsServer.ClientURL()) logger := logrus.New() jsCtx, err := connection.JetStream() require.NoError(t, err) @@ -248,8 +208,8 @@ func createCloudEvent(t *testing.T) *event.Event { // getStreamConfig inits a testing stream config. func getStreamConfig() *nats.StreamConfig { return &nats.StreamConfig{ - Name: testingutils.MessagingEventTypePrefix, - Subjects: []string{fmt.Sprintf("%s.>", testingutils.MessagingEventTypePrefix)}, + Name: testingutils.StreamName, + Subjects: []string{fmt.Sprintf("%s.>", env.JetstreamSubjectPrefix)}, Storage: nats.MemoryStorage, Retention: nats.InterestPolicy, } @@ -263,9 +223,9 @@ func addStream(t *testing.T, connection *nats.Conn, config *nats.StreamConfig) { assert.NoError(t, err) } -func CreateNatsJsConfig(url string, streamName string) *env.NatsConfig { +func CreateNatsJsConfig(url string) *env.NatsConfig { return &env.NatsConfig{ - JSStreamName: streamName, + JSStreamName: testingutils.StreamName, URL: url, ReconnectWait: time.Second, } diff --git a/testing/fixtures.go b/testing/fixtures.go index e2735fb..42a26bf 100644 --- a/testing/fixtures.go +++ b/testing/fixtures.go @@ -14,6 +14,7 @@ const ( MessagingNamespace = "/messaging.namespace" MessagingEventTypePrefix = "prefix" + JSStreamPrefix = "sap.kyma.custom" MessagingEventTypePrefixEmpty = "" EventID = "8945ec08-256b-11eb-9928-acde48001122" From 59995d64b28aef676874fbef38967a60f6d3c315 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Wed, 1 Jun 2022 11:37:47 +0200 Subject: [PATCH 073/194] bump base image to alpine 3.16 in event-pubisher-proxy (#14450) * bump base image to alpine 3.16 * bump image --- cmd/event-publisher-proxy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/event-publisher-proxy/Dockerfile b/cmd/event-publisher-proxy/Dockerfile index 71594ef..269ff25 100644 --- a/cmd/event-publisher-proxy/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.18.2-alpine3.15 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.18.2-alpine3.16 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From fe3f5116aaad079e5e281c251098b88201123ee1 Mon Sep 17 00:00:00 2001 From: Kamil Kasperski Date: Tue, 7 Jun 2022 10:25:17 +0200 Subject: [PATCH 074/194] Remove license-puller usage from components (#14481) * Remove license-puller usage from components * cleanup dockerfiles * empty --- Makefile | 7 ++----- cmd/event-publisher-proxy/Dockerfile | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index c359f73..3f89c8e 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ cmds_clean = $(foreach cmd,$(cmds),$(cmd).clean) cmds_images_push = $(foreach img,$(cmds_images),$(img).push) .PHONY: clean -clean: $(cmds_clean) resolve_clean licenses_clean +clean: $(cmds_clean) resolve_clean $(cmds_clean): %.clean: rm -f $* @@ -34,9 +34,6 @@ $(cmds_clean): %.clean: resolve_clean: rm -rf vendor -licenses_clean: - rm -rf licenses - build-local: $(cmds) test-local ; .PHONY: $(cmds_images) $(cmds_images_push) @@ -57,7 +54,7 @@ $(cmds): %: # Example: # make event-publisher-proxy.image -$(cmds_images): %.image: build-local pull-licenses +$(cmds_images): %.image: build-local $(eval $@_img_name := $*) @echo "+ Building container image $($@_img_name)" docker image build -f cmd/$*/Dockerfile -t $($@_img_name) . diff --git a/cmd/event-publisher-proxy/Dockerfile b/cmd/event-publisher-proxy/Dockerfile index 269ff25..56e2819 100644 --- a/cmd/event-publisher-proxy/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -14,6 +14,5 @@ USER nonroot:nonroot WORKDIR / COPY --from=builder /go/src/github.com/kyma-project/kyma/components/event-publisher-proxy/event-publisher-proxy . -COPY licenses/ /licenses/ ENTRYPOINT ["/event-publisher-proxy"] From 9080ec7c50aa7b40ee4cba659f80887dfe207241 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Wed, 8 Jun 2022 19:15:04 +0200 Subject: [PATCH 075/194] bump the golang image to golang1.18.3:alpine3.16 in EPP (#14520) * bump the build image to golang1.18.3:alpine3.16 * bump image --- cmd/event-publisher-proxy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/event-publisher-proxy/Dockerfile b/cmd/event-publisher-proxy/Dockerfile index 56e2819..c2481b6 100644 --- a/cmd/event-publisher-proxy/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.18.2-alpine3.16 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.18.3-alpine3.16 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From 7bcbe6d16590fc3da27d5e5b38fa30a0a6e90eb1 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Thu, 9 Jun 2022 11:47:55 +0200 Subject: [PATCH 076/194] Bump dependencies in Event-Publisher-Proxy (#14502) * bump required dependencies * bump image --- go.mod | 16 ++++++++-------- go.sum | 26 ++++++++++++++++---------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 2b41bad..11e9ae7 100644 --- a/go.mod +++ b/go.mod @@ -7,20 +7,20 @@ require ( github.com/cloudevents/sdk-go/v2 v2.10.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220524065628-a4b532883fbe - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220524065628-a4b532883fbe + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220603121114-e1491c4678e0 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220603121114-e1491c4678e0 github.com/nats-io/nats-server/v2 v2.8.3 github.com/nats-io/nats.go v1.15.0 github.com/onsi/gomega v1.19.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.2 github.com/sirupsen/logrus v1.8.1 - github.com/stretchr/testify v1.7.1 + github.com/stretchr/testify v1.7.2 go.opencensus.io v0.23.0 - golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 - k8s.io/api v0.24.0 - k8s.io/apimachinery v0.24.0 - k8s.io/client-go v0.24.0 + golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 + k8s.io/api v0.24.1 + k8s.io/apimachinery v0.24.1 + k8s.io/client-go v0.24.1 sigs.k8s.io/controller-runtime v0.12.1 ) @@ -75,7 +75,7 @@ require ( google.golang.org/protobuf v1.27.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/klog/v2 v2.60.1 // indirect k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect diff --git a/go.sum b/go.sum index 10775b7..3826bfd 100644 --- a/go.sum +++ b/go.sum @@ -574,10 +574,10 @@ github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIq github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= github.com/kyma-project/kyma/common/logging v0.0.0-20220520105026-ab8aadd814a8/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220520105026-ab8aadd814a8/go.mod h1:PV3PpVnVBfOi21hX0MsS4XYDsX+EGYUrpLC67oIjzeQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220524065628-a4b532883fbe h1:sWePpZq/9pOzjJRQtdb82ajO7R9GOKrvTkH8A4RCEVk= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220524065628-a4b532883fbe/go.mod h1:PV3PpVnVBfOi21hX0MsS4XYDsX+EGYUrpLC67oIjzeQ= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220524065628-a4b532883fbe h1:4y61V20+i2grhsbl0x9gUL2XQqProSe4owhRZTB4BWU= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220524065628-a4b532883fbe/go.mod h1:7bOfihx2BxqxdHo5IRI2n1JfEhpVRVZSKDo7yIzZ87Y= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220603121114-e1491c4678e0 h1:545S2emSg8OnAS7J9p3U4vOR9ca0MuHrJBDFnNgxotI= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220603121114-e1491c4678e0/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220603121114-e1491c4678e0 h1:Rrrx5cqx4iUSiwcF4sIJp/n9sPg5AFLW3hQv+xBDIoI= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220603121114-e1491c4678e0/go.mod h1:yJRUT6jsXxG548mJsUlIPjcfJFfk/lFKJGE+hZPI7ng= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -859,8 +859,9 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -1081,8 +1082,9 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -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/oauth2 v0.0.0-20220524215830-622c5d57e401 h1:zwrSfklXn0gxyLRX/aR+q6cgHbV/ItVyzbPlbA+dkAw= +golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -1454,8 +1456,9 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= @@ -1480,8 +1483,9 @@ k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= k8s.io/api v0.22.9/go.mod h1:rcjO/FPOuvc3x7nQWx29UcDrFJMx82RxDob71ntNH4A= -k8s.io/api v0.24.0 h1:J0hann2hfxWr1hinZIDefw7Q96wmCBx6SSB8IY0MdDg= k8s.io/api v0.24.0/go.mod h1:5Jl90IUrJHUJYEMANRURMiVvJ0g7Ax7r3R1bqO8zx8I= +k8s.io/api v0.24.1 h1:BjCMRDcyEYz03joa3K1+rbshwh1Ay6oB53+iUx2H8UY= +k8s.io/api v0.24.1/go.mod h1:JhoOvNiLXKTPQ60zh2g0ewpA+bnEYf5q44Flhquh4vQ= k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= @@ -1498,8 +1502,9 @@ k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRp k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= k8s.io/apimachinery v0.22.9/go.mod h1:ZvVLP5iLhwVFg2Yx9Gh5W0um0DUauExbRhe+2Z8I1EU= -k8s.io/apimachinery v0.24.0 h1:ydFCyC/DjCvFCHK5OPMKBlxayQytB8pxy8YQInd5UyQ= k8s.io/apimachinery v0.24.0/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= +k8s.io/apimachinery v0.24.1 h1:ShD4aDxTQKN5zNf8K1RQ2u98ELLdIW7jEnlO9uAMX/I= +k8s.io/apimachinery v0.24.1/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= @@ -1517,8 +1522,9 @@ k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.9/go.mod h1:IoH7exYnoH/zgvHOuVxh2c4yJepcCBt72FzCTisOc4k= -k8s.io/client-go v0.24.0 h1:lbE4aB1gTHvYFSwm6eD3OF14NhFDKCejlnsGYlSJe5U= k8s.io/client-go v0.24.0/go.mod h1:VFPQET+cAFpYxh6Bq6f4xyMY80G6jKKktU6G0m00VDw= +k8s.io/client-go v0.24.1 h1:w1hNdI9PFrzu3OlovVeTnf4oHDt+FJLd9Ndluvnb42E= +k8s.io/client-go v0.24.1/go.mod h1:f1kIDqcEYmwXS/vTbbhopMUbhKp2JhOeVTfxgaCIlF8= k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= From 72c7a6d02891c52101cf537d67cc8568f0856b9c Mon Sep 17 00:00:00 2001 From: Friedrich Date: Tue, 14 Jun 2022 10:04:26 +0200 Subject: [PATCH 077/194] bump dependencies in EPP (#14548) * bump dependencies * go mod tidy * bump dependency nats-server * bump dependency nats * bump image --- go.mod | 10 +++++----- go.sum | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 11e9ae7..7a5cc10 100644 --- a/go.mod +++ b/go.mod @@ -7,17 +7,17 @@ require ( github.com/cloudevents/sdk-go/v2 v2.10.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220603121114-e1491c4678e0 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220603121114-e1491c4678e0 - github.com/nats-io/nats-server/v2 v2.8.3 - github.com/nats-io/nats.go v1.15.0 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220609154355-1465f7118404 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220609154355-1465f7118404 + github.com/nats-io/nats-server/v2 v2.8.4 + github.com/nats-io/nats.go v1.16.0 github.com/onsi/gomega v1.19.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.2 github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.2 go.opencensus.io v0.23.0 - golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 + golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb k8s.io/api v0.24.1 k8s.io/apimachinery v0.24.1 k8s.io/client-go v0.24.1 diff --git a/go.sum b/go.sum index 3826bfd..e58bdbb 100644 --- a/go.sum +++ b/go.sum @@ -572,12 +572,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20220520105026-ab8aadd814a8/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220520105026-ab8aadd814a8/go.mod h1:PV3PpVnVBfOi21hX0MsS4XYDsX+EGYUrpLC67oIjzeQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220603121114-e1491c4678e0 h1:545S2emSg8OnAS7J9p3U4vOR9ca0MuHrJBDFnNgxotI= +github.com/kyma-project/kyma/common/logging v0.0.0-20220603121114-e1491c4678e0/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220603121114-e1491c4678e0/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220603121114-e1491c4678e0 h1:Rrrx5cqx4iUSiwcF4sIJp/n9sPg5AFLW3hQv+xBDIoI= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220603121114-e1491c4678e0/go.mod h1:yJRUT6jsXxG548mJsUlIPjcfJFfk/lFKJGE+hZPI7ng= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220609154355-1465f7118404 h1:3aIt6UQ/MZwLdJKEbJPLPeR/gPXjrYwlPZenQfzipYU= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220609154355-1465f7118404/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220609154355-1465f7118404 h1:mOiUENqWWq0uAPzPmS867V7IfYR1VjERvjd8ZJobKmY= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220609154355-1465f7118404/go.mod h1:BvuTjzha//t300buV+qBmUWW0ymFjGP+scBqgVQstII= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -671,13 +671,14 @@ github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a/go.mod h1:0tqz9Hl github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= github.com/nats-io/nats-server/v2 v2.8.2/go.mod h1:vIdpKz3OG+DCg4q/xVPdXHoztEyKDWRtykQ4N7hd7C4= -github.com/nats-io/nats-server/v2 v2.8.3 h1:5jCAOZ62OeL0YSVhMotP17zk4K/N5bAHGwxyIGspjM8= -github.com/nats-io/nats-server/v2 v2.8.3/go.mod h1:8zZa+Al3WsESfmgSs98Fi06dRWLH5Bnq90m5bKD/eT4= +github.com/nats-io/nats-server/v2 v2.8.4 h1:0jQzze1T9mECg8YZEl8+WYUXb9JKluJfCBriPUtluB4= +github.com/nats-io/nats-server/v2 v2.8.4/go.mod h1:8zZa+Al3WsESfmgSs98Fi06dRWLH5Bnq90m5bKD/eT4= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nats.go v1.14.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nats.go v1.15.0 h1:3IXNBolWrwIUf2soxh6Rla8gPzYWEZQBUBK6RV21s+o= github.com/nats-io/nats.go v1.15.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats.go v1.16.0 h1:zvLE7fGBQYW6MWaFaRdsgm9qT39PJDQoju+DS8KsO1g= +github.com/nats-io/nats.go v1.16.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= @@ -859,7 +860,6 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= @@ -1082,9 +1082,9 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 h1:zwrSfklXn0gxyLRX/aR+q6cgHbV/ItVyzbPlbA+dkAw= golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g= +golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= From 48a6953092ed6d11b3ad55950ad43d16f9e4823c Mon Sep 17 00:00:00 2001 From: Friedrich Date: Wed, 15 Jun 2022 15:57:39 +0200 Subject: [PATCH 078/194] bump dependencies in event-publisher-proxy (#14581) * bump dependencies * bump image * go mod tidy --- go.mod | 8 ++++---- go.sum | 23 +++++++++++------------ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 7a5cc10..cad327f 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,12 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy go 1.17 require ( - github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.0 - github.com/cloudevents/sdk-go/v2 v2.10.0 + github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1 + github.com/cloudevents/sdk-go/v2 v2.10.1 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220609154355-1465f7118404 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220609154355-1465f7118404 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220614080426-0a78799492da + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220614080426-0a78799492da github.com/nats-io/nats-server/v2 v2.8.4 github.com/nats-io/nats.go v1.16.0 github.com/onsi/gomega v1.19.0 diff --git a/go.sum b/go.sum index e58bdbb..791f706 100644 --- a/go.sum +++ b/go.sum @@ -155,10 +155,12 @@ github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmE github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.0 h1:pFHVT5IYlsGvpAjExh+wu0Cn4Q1ErljpVViJfsyNAj8= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.0/go.mod h1:YImkWPX88pBfCulSbtmo40JQCYmMVufOVPlVKL4IaXY= -github.com/cloudevents/sdk-go/v2 v2.10.0 h1:sz0pbNBGh1iRspqLGe/2cXhDghZZpvNPHwKPucVbh+8= +github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1 h1:vhMEC9zc6nIw3HwxaFZF/lT/uTftXx9h++f0KyXJazM= +github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1/go.mod h1:9l2pSSkH9AvMCwK8Rscwqtsni30UIWNj/EmgtmaRMmc= github.com/cloudevents/sdk-go/v2 v2.10.0/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= +github.com/cloudevents/sdk-go/v2 v2.10.1 h1:qNFovJ18fWOd8Q9ydWJPk1oiFudXyv1GxJIP7MwPjuM= +github.com/cloudevents/sdk-go/v2 v2.10.1/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -572,12 +574,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20220603121114-e1491c4678e0/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220603121114-e1491c4678e0/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220609154355-1465f7118404 h1:3aIt6UQ/MZwLdJKEbJPLPeR/gPXjrYwlPZenQfzipYU= +github.com/kyma-project/kyma/common/logging v0.0.0-20220609154355-1465f7118404/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220609154355-1465f7118404/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220609154355-1465f7118404 h1:mOiUENqWWq0uAPzPmS867V7IfYR1VjERvjd8ZJobKmY= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220609154355-1465f7118404/go.mod h1:BvuTjzha//t300buV+qBmUWW0ymFjGP+scBqgVQstII= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220614080426-0a78799492da h1:zgHq7ALUQha/oRXQ2ybIn656OZbOcEn3rjX6Xfjexrc= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220614080426-0a78799492da/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220614080426-0a78799492da h1:r6zeeEoKewiBfy/Sxw5I4DHn1ZpaoFCx1HUqefZoWQ0= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220614080426-0a78799492da/go.mod h1:9xSQ36iDbi5/aSo1uaiCs6j0fEDxKxxwhfF2KjnnKjU= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -670,12 +672,10 @@ github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28g github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= -github.com/nats-io/nats-server/v2 v2.8.2/go.mod h1:vIdpKz3OG+DCg4q/xVPdXHoztEyKDWRtykQ4N7hd7C4= github.com/nats-io/nats-server/v2 v2.8.4 h1:0jQzze1T9mECg8YZEl8+WYUXb9JKluJfCBriPUtluB4= github.com/nats-io/nats-server/v2 v2.8.4/go.mod h1:8zZa+Al3WsESfmgSs98Fi06dRWLH5Bnq90m5bKD/eT4= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nats.go v1.14.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nats.go v1.15.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nats.go v1.16.0 h1:zvLE7fGBQYW6MWaFaRdsgm9qT39PJDQoju+DS8KsO1g= github.com/nats-io/nats.go v1.16.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= @@ -1082,7 +1082,6 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1289,8 +1288,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/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= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= From 4e4513712aeb09484529164c893074d494c35b39 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Fri, 17 Jun 2022 18:40:49 +0200 Subject: [PATCH 079/194] Add replace for k8s dependencies in epp (#14597) * add replace for k8s.io packages * bump other dependencies * go mod tidy * bump image --- go.mod | 20 ++++-- go.sum | 211 +++++++++------------------------------------------------ 2 files changed, 48 insertions(+), 183 deletions(-) diff --git a/go.mod b/go.mod index cad327f..9ef7ee5 100644 --- a/go.mod +++ b/go.mod @@ -7,8 +7,8 @@ require ( github.com/cloudevents/sdk-go/v2 v2.10.1 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220614080426-0a78799492da - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220614080426-0a78799492da + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220617084352-bf759135fe8d + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220617084352-bf759135fe8d github.com/nats-io/nats-server/v2 v2.8.4 github.com/nats-io/nats.go v1.16.0 github.com/onsi/gomega v1.19.0 @@ -18,9 +18,9 @@ require ( github.com/stretchr/testify v1.7.2 go.opencensus.io v0.23.0 golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb - k8s.io/api v0.24.1 - k8s.io/apimachinery v0.24.1 - k8s.io/client-go v0.24.1 + k8s.io/api v0.24.2 + k8s.io/apimachinery v0.24.2 + k8s.io/client-go v0.24.2 sigs.k8s.io/controller-runtime v0.12.1 ) @@ -84,6 +84,16 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) +replace ( + // keep all following packages at the same version + k8s.io/api => k8s.io/api v0.24.2 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.24.2 + k8s.io/apimachinery => k8s.io/apimachinery v0.24.2 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.24.2 + k8s.io/component-base => k8s.io/component-base v0.24.2 + k8s.io/kubectl => k8s.io/kubectl v0.24.2 +) + replace ( github.com/containerd/containerd => github.com/containerd/containerd v1.4.4 github.com/dgrijalva/jwt-go => github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 // fix CVE-2020-26160 diff --git a/go.sum b/go.sum index 791f706..daa5dbf 100644 --- a/go.sum +++ b/go.sum @@ -80,7 +80,6 @@ github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb0 github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= @@ -91,14 +90,8 @@ github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWX github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053/go.mod h1:xW8sBma2LE3QxFSzCnH9qe6gAE2yO9GvQaWwX89HxbE= -github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -109,7 +102,6 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/avast/retry-go v2.4.1+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= @@ -122,14 +114,12 @@ github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiU github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= @@ -155,10 +145,8 @@ github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmE github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.0/go.mod h1:YImkWPX88pBfCulSbtmo40JQCYmMVufOVPlVKL4IaXY= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1 h1:vhMEC9zc6nIw3HwxaFZF/lT/uTftXx9h++f0KyXJazM= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1/go.mod h1:9l2pSSkH9AvMCwK8Rscwqtsni30UIWNj/EmgtmaRMmc= -github.com/cloudevents/sdk-go/v2 v2.10.0/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= github.com/cloudevents/sdk-go/v2 v2.10.1 h1:qNFovJ18fWOd8Q9ydWJPk1oiFudXyv1GxJIP7MwPjuM= github.com/cloudevents/sdk-go/v2 v2.10.1/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= @@ -203,7 +191,6 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -219,10 +206,8 @@ github.com/docker/docker v20.10.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05b github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= -github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -230,7 +215,6 @@ github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5m github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= @@ -270,18 +254,14 @@ github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSy github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= 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-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= @@ -298,58 +278,24 @@ github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aA github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= -github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= -github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= -github.com/go-openapi/analysis v0.19.2/go.mod h1:3P1osvZa9jKjb8ed2TPng3f0i/UY9snX6gxi44djMjk= -github.com/go-openapi/analysis v0.19.5/go.mod h1:hkEAkxagaIvIP7VTn8ygJNkd4kAYON2rCu0v0ObL0AU= -github.com/go-openapi/errors v0.17.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.18.0/go.mod h1:LcZQpmvG4wyF5j4IhA73wkLFQg+QJXOQHVjmcZxhka0= -github.com/go-openapi/errors v0.19.2/go.mod h1:qX0BLWsyaKfvhluLejVpVNwNRdXZhEbTA4kxxpKBC94= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= -github.com/go-openapi/jsonpointer v0.18.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= -github.com/go-openapi/jsonreference v0.18.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/loads v0.17.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.18.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.0/go.mod h1:72tmFy5wsWx89uEVddd0RjRWPZm92WRLhf7AC+0+OOU= -github.com/go-openapi/loads v0.19.2/go.mod h1:QAskZPMX5V0C2gvfkGZzJlINuP7Hx/4+ix5jWFxsNPs= -github.com/go-openapi/loads v0.19.4/go.mod h1:zZVHonKd8DXyxyw4yfnVjPzBjIQcLt0CCsn0N0ZrQsk= -github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9/go.mod h1:6v9a6LTXWQCdL8k1AO3cvqx5OtZY/Y9wKTgaoP6YRfA= -github.com/go-openapi/runtime v0.19.0/go.mod h1:OwNfisksmmaZse4+gpV3Ne9AyMOlP1lt4sK4FXt0O64= -github.com/go-openapi/runtime v0.19.4/go.mod h1:X277bwSUBxVlCYR3r7xgZZGKVvBd/29gLDlFGtJ8NL4= github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= -github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= -github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= -github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= -github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= -github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= -github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= -github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -358,7 +304,6 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78 github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= github.com/gobuffalo/flect v0.2.2/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= -github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= @@ -368,7 +313,6 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/godror/godror v0.13.3/go.mod h1:2ouUT4kdhUBk7TAkHWD4SN0CdI0pgEQbo8FVHhbSKWg= github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -434,7 +378,6 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -537,7 +480,6 @@ github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUB github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -548,7 +490,6 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= @@ -574,12 +515,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20220609154355-1465f7118404/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220609154355-1465f7118404/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220614080426-0a78799492da h1:zgHq7ALUQha/oRXQ2ybIn656OZbOcEn3rjX6Xfjexrc= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220614080426-0a78799492da/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220614080426-0a78799492da h1:r6zeeEoKewiBfy/Sxw5I4DHn1ZpaoFCx1HUqefZoWQ0= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220614080426-0a78799492da/go.mod h1:9xSQ36iDbi5/aSo1uaiCs6j0fEDxKxxwhfF2KjnnKjU= +github.com/kyma-project/kyma/common/logging v0.0.0-20220613124224-2e8f0361bf79/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220613124224-2e8f0361bf79/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220617084352-bf759135fe8d h1:KRdKkvdA1W58yRrUrSZujSn9XCWbcWrIf0sU3TLNSDs= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220617084352-bf759135fe8d/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220617084352-bf759135fe8d h1:y7Ew/eU7NGlYcbIqynwpPMi11IRXxJ/tKpjexGZUcWQ= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220617084352-bf759135fe8d/go.mod h1:6bYLDCh+e7C7VEok6nKRlmPj9Ha3pSaGByLvP10PELE= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -591,15 +532,13 @@ github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 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/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -643,13 +582,11 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= @@ -660,7 +597,6 @@ github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2 github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -701,7 +637,6 @@ github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FW github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= @@ -714,7 +649,6 @@ github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= @@ -749,20 +683,19 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= +github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterbourgon/mergemap v0.0.0-20130613134717-e21c03b7a721/go.mod h1:jQyRpOpE/KbvPc0VKXjAqctYglwUO5W6zAcGcFfbvlo= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= @@ -770,27 +703,20 @@ github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prY 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.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 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.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -806,11 +732,9 @@ github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0 github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= @@ -835,8 +759,10 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= +github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -846,6 +772,7 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -853,7 +780,6 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -864,7 +790,6 @@ github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8 github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -875,7 +800,6 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vrischmann/envconfig v1.1.0/go.mod h1:c5DuUlkzfsnspy1g7qiqryPCsW+NjsrLsYq4zhwsoHo= @@ -913,9 +837,6 @@ go.etcd.io/etcd/client/v3 v3.5.1/go.mod h1:OnjH4M8OnAotwaB2l9bVgZzRFKru7/ZMoS46O go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -971,9 +892,7 @@ go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 h1:tkVvjkPTB7pnW3jnid7kNyAMPVWllTNOf/qKDze4p9o= golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= @@ -1004,7 +923,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -1013,7 +931,6 @@ golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1021,7 +938,6 @@ golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -1080,6 +996,7 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g= @@ -1102,7 +1019,6 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1110,7 +1026,6 @@ golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1160,7 +1075,6 @@ golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1219,8 +1133,6 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1231,7 +1143,6 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBn golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= @@ -1293,9 +1204,6 @@ golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNq gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -1319,6 +1227,7 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1435,6 +1344,7 @@ gopkg.in/gorp.v1 v1.7.2/go.mod h1:Wo3h+DBQZIxATwftsglhdD/62zRFPhGhTiu5jUJmCaw= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -1475,45 +1385,16 @@ istio.io/api v0.0.0-20210416170358-17514f58eeeb/go.mod h1:nsSFw1LIMmGL7r/+6fJI6F istio.io/client-go v1.9.2/go.mod h1:BfOsn8V/wjBKFqEheQqLqx1r3pjDeYPsQnTU5yWjb1Y= istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a/go.mod h1:OzpAts7jljZceG4Vqi5/zXy/pOg1b209T3jb7Nv5wIs= istio.io/gogo-genproto v0.0.0-20210113155706-4daf5697332f/go.mod h1:6BwTZRNbWS570wHX/uR1Wqk5e0157TofTAUMzT7N4+s= -k8s.io/api v0.17.8/go.mod h1:N++Llhs8kCixMUoCaXXAyMMPbo8dDVnh+IQ36xZV2/0= -k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= -k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= -k8s.io/api v0.20.2/go.mod h1:d7n6Ehyzx+S+cE3VhTGfVNNqtGc/oL9DCdYYahlurV8= -k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU= -k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= -k8s.io/api v0.22.9/go.mod h1:rcjO/FPOuvc3x7nQWx29UcDrFJMx82RxDob71ntNH4A= -k8s.io/api v0.24.0/go.mod h1:5Jl90IUrJHUJYEMANRURMiVvJ0g7Ax7r3R1bqO8zx8I= -k8s.io/api v0.24.1 h1:BjCMRDcyEYz03joa3K1+rbshwh1Ay6oB53+iUx2H8UY= -k8s.io/api v0.24.1/go.mod h1:JhoOvNiLXKTPQ60zh2g0ewpA+bnEYf5q44Flhquh4vQ= -k8s.io/apiextensions-apiserver v0.17.8/go.mod h1:5H/i0XiKizIE9SkoAQaU/ou31JJBIffbsT0ALA18GmE= -k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= -k8s.io/apiextensions-apiserver v0.20.1/go.mod h1:ntnrZV+6a3dB504qwC5PN/Yg9PBiDNt1EVqbW2kORVk= -k8s.io/apiextensions-apiserver v0.20.2/go.mod h1:F6TXp389Xntt+LUq3vw6HFOLttPa0V8821ogLGwb6Zs= -k8s.io/apiextensions-apiserver v0.21.0/go.mod h1:gsQGNtGkc/YoDG9loKI0V+oLZM4ljRPjc/sql5tmvzc= -k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE= -k8s.io/apiextensions-apiserver v0.24.0/go.mod h1:iuVe4aEpe6827lvO6yWQVxiPSpPoSKVjkq+MIdg84cM= -k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= -k8s.io/apimachinery v0.17.8/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= -k8s.io/apimachinery v0.18.1/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= -k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= -k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= -k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= -k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= -k8s.io/apimachinery v0.22.9/go.mod h1:ZvVLP5iLhwVFg2Yx9Gh5W0um0DUauExbRhe+2Z8I1EU= -k8s.io/apimachinery v0.24.0/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= -k8s.io/apimachinery v0.24.1 h1:ShD4aDxTQKN5zNf8K1RQ2u98ELLdIW7jEnlO9uAMX/I= -k8s.io/apimachinery v0.24.1/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= -k8s.io/apiserver v0.17.8/go.mod h1:XU2YBi1I/v/P1R5lb0lEwSQ1rnXE01k7yxVtdIWH4Lo= +k8s.io/api v0.24.2 h1:g518dPU/L7VRLxWfcadQn2OnsiGWVOadTLpdnqgY2OI= +k8s.io/api v0.24.2/go.mod h1:AHqbSkTm6YrQ0ObxjO3Pmp/ubFF/KuM7jU+3khoBsOg= +k8s.io/apiextensions-apiserver v0.24.2/go.mod h1:e5t2GMFVngUEHUd0wuCJzw8YDwZoqZfJiGOW6mm2hLQ= +k8s.io/apimachinery v0.24.2 h1:5QlH9SL2C8KMcrNJPor+LbXVTaZRReml7svPEh4OKDM= +k8s.io/apimachinery v0.24.2/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= -k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= -k8s.io/apiserver v0.20.2/go.mod h1:2nKd93WyMhZx4Hp3RfgH2K5PhwyTrprrkWYnI7id7jA= k8s.io/apiserver v0.21.0/go.mod h1:w2YSn4/WIwYuxG5zJmcqtRdtqgW/J2JRgFAqps3bBpg= k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU= -k8s.io/apiserver v0.24.0/go.mod h1:WFx2yiOMawnogNToVvUYT9nn1jaIkMKj41ZYCVycsBA= -k8s.io/cli-runtime v0.18.2/go.mod h1:yfFR2sQQzDsV0VEKGZtrJwEy4hLZ2oj4ZIfodgxAHWQ= -k8s.io/cli-runtime v0.21.0/go.mod h1:XoaHP93mGPF37MkLbjGVYqg3S1MnsFdKtiA/RZzzxOo= -k8s.io/cli-runtime v0.22.9/go.mod h1:HDoV4LwtOwJBfO1+pZF6ms8QMB6x4wg8QiRMkTzGknY= +k8s.io/apiserver v0.24.2/go.mod h1:pSuKzr3zV+L+MWqsEo0kHHYwCo77AT5qXbFXP2jbvFI= +k8s.io/cli-runtime v0.24.2/go.mod h1:1LIhKL2RblkhfG4v5lZEt7FtgFG5mVb8wqv5lE9m5qY= k8s.io/client-go v0.17.8/go.mod h1:SJsDS64AAtt9VZyeaQMb4Ck5etCitZ/FwajWdzua5eY= k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= @@ -1522,29 +1403,16 @@ k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.9/go.mod h1:IoH7exYnoH/zgvHOuVxh2c4yJepcCBt72FzCTisOc4k= k8s.io/client-go v0.24.0/go.mod h1:VFPQET+cAFpYxh6Bq6f4xyMY80G6jKKktU6G0m00VDw= -k8s.io/client-go v0.24.1 h1:w1hNdI9PFrzu3OlovVeTnf4oHDt+FJLd9Ndluvnb42E= k8s.io/client-go v0.24.1/go.mod h1:f1kIDqcEYmwXS/vTbbhopMUbhKp2JhOeVTfxgaCIlF8= -k8s.io/code-generator v0.17.8/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= +k8s.io/client-go v0.24.2 h1:CoXFSf8if+bLEbinDqN9ePIDGzcLtqhfd6jpfnwGOFA= +k8s.io/client-go v0.24.2/go.mod h1:zg4Xaoo+umDsfCWr4fCnmLEtQXyCNXCvJuSsglNcV30= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= -k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= -k8s.io/code-generator v0.20.2/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbWHJg= -k8s.io/code-generator v0.21.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= -k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo= -k8s.io/code-generator v0.24.0/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= -k8s.io/component-base v0.17.8/go.mod h1:xfNNdTAMsYzdiAa8vXnqDhRVSEgkfza0iMt0FrZDY7s= -k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= -k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= -k8s.io/component-base v0.20.2/go.mod h1:pzFtCiwe/ASD0iV7ySMu8SYVJjCapNM9bjvk7ptpKh0= -k8s.io/component-base v0.21.0/go.mod h1:qvtjz6X0USWXbgmbfXR+Agik4RZ3jv2Bgr5QnZzdPYw= -k8s.io/component-base v0.21.3/go.mod h1:kkuhtfEHeZM6LkX0saqSK8PbdO7A0HigUngmhhrwfGQ= -k8s.io/component-base v0.24.0/go.mod h1:Dgazgon0i7KYUsS8krG8muGiMVtUZxG037l1MKyXgrA= -k8s.io/component-helpers v0.21.0/go.mod h1:tezqefP7lxfvJyR+0a+6QtVrkZ/wIkyMLK4WcQ3Cj8U= +k8s.io/code-generator v0.24.2/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= +k8s.io/component-base v0.24.2/go.mod h1:ucHwW76dajvQ9B7+zecZAP3BVqvrHoOxm8olHEg0nmM= +k8s.io/component-helpers v0.24.2/go.mod h1:TRQPBQKfmqkmV6c0HAmUs8cXVNYYYLsXy4zu8eODi9g= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= @@ -1558,30 +1426,21 @@ k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= 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-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= -k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/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/kubectl v0.21.0/go.mod h1:EU37NukZRXn1TpAkMUoy8Z/B2u6wjHDS4aInsDzVvks= -k8s.io/metrics v0.21.0/go.mod h1:L3Ji9EGPP1YBbfm9sPfEXSpnj8i24bfQbAFAsW0NueQ= +k8s.io/kubectl v0.24.2/go.mod h1:+HIFJc0bA6Tzu5O/YcuUt45APAxnNL8LeMuXwoiGsPg= +k8s.io/metrics v0.24.2/go.mod h1:5NWURxZ6Lz5gj8TFU83+vdWIVASx7W8lwPpHYCqopMo= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= @@ -1595,16 +1454,12 @@ sigs.k8s.io/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUy 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/kind v0.7.0/go.mod h1:An/AbWHT6pA/Lm0Og8j3ukGhfJP3RiVN/IBU6Lo3zl8= -sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= -sigs.k8s.io/kustomize/api v0.8.5/go.mod h1:M377apnKT5ZHJS++6H4rQoCHmWtt6qTpp3mbe7p6OLY= sigs.k8s.io/kustomize/api v0.8.11/go.mod h1:a77Ls36JdfCWojpUqR6m60pdGY1AYFix4AH83nJtY1g= -sigs.k8s.io/kustomize/cmd/config v0.9.7/go.mod h1:MvXCpHs77cfyxRmCNUQjIqCmZyYsbn5PyQpWiq44nW0= -sigs.k8s.io/kustomize/kustomize/v4 v4.0.5/go.mod h1:C7rYla7sI8EnxHE/xEhRBSHMNfcL91fx0uKmUlUhrBk= -sigs.k8s.io/kustomize/kyaml v0.10.15/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg= +sigs.k8s.io/kustomize/api v0.11.4/go.mod h1:k+8RsqYbgpkIrJ4p9jcdPqe8DprLxFUUO0yNOq8C+xI= +sigs.k8s.io/kustomize/cmd/config v0.10.6/go.mod h1:/S4A4nUANUa4bZJ/Edt7ZQTyKOY9WCER0uBS1SW2Rco= +sigs.k8s.io/kustomize/kustomize/v4 v4.5.4/go.mod h1:Zo/Xc5FKD6sHl0lilbrieeGeZHVYCA4BzxeAaLI05Bg= sigs.k8s.io/kustomize/kyaml v0.11.0/go.mod h1:GNMwjim4Ypgp/MueD3zXHLRJEjz7RvtPae0AwlvEMFM= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7mRH6DGaRcixXEJXTsE= +sigs.k8s.io/kustomize/kyaml v0.13.6/go.mod h1:yHP031rn1QX1lr/Xd934Ri/xdVNG8BE2ECa78Ht/kEg= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= From 0a1909af9862f3390368d4a9318004756be81497 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Mon, 20 Jun 2022 14:34:52 +0200 Subject: [PATCH 080/194] add a replace for kube-openapi in event-publisher-proxy (#14599) * add a replace for kube-openapi in event-publisher-proxy * bump image * replace go-restful to v3.8.0 * replace k8s.io/client-go * unclutter the replaces * bump kyma components --- go.mod | 16 +++++++++++----- go.sum | 45 ++++++++++++--------------------------------- 2 files changed, 23 insertions(+), 38 deletions(-) diff --git a/go.mod b/go.mod index 9ef7ee5..f5c53d0 100644 --- a/go.mod +++ b/go.mod @@ -7,8 +7,8 @@ require ( github.com/cloudevents/sdk-go/v2 v2.10.1 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220617084352-bf759135fe8d - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220617084352-bf759135fe8d + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220620092658-f1f8e3668674 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220620092658-f1f8e3668674 github.com/nats-io/nats-server/v2 v2.8.4 github.com/nats-io/nats.go v1.16.0 github.com/onsi/gomega v1.19.0 @@ -31,7 +31,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful v2.9.5+incompatible // indirect + github.com/emicklei/go-restful/v3 v3.8.0 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect @@ -41,7 +41,7 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.5 // indirect + github.com/google/go-cmp v0.5.6 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -77,13 +77,19 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // 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-20220603121420-31174f50af60 // indirect k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) +// fix cve-2022-1996, might be okay to be removed after k8s > 1.24.2 +replace ( + github.com/emicklei/go-restful/v3 => github.com/emicklei/go-restful/v3 v3.8.0 + k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20220611174630-77c5a1ef51a0 +) + replace ( // keep all following packages at the same version k8s.io/api => k8s.io/api v0.24.2 diff --git a/go.sum b/go.sum index daa5dbf..b822291 100644 --- a/go.sum +++ b/go.sum @@ -79,10 +79,8 @@ github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2 github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= @@ -216,9 +214,10 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= +github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -252,7 +251,6 @@ github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui72 github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -278,20 +276,16 @@ github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aA github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= @@ -338,7 +332,6 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -376,8 +369,9 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -515,12 +509,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20220613124224-2e8f0361bf79/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220613124224-2e8f0361bf79/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220617084352-bf759135fe8d h1:KRdKkvdA1W58yRrUrSZujSn9XCWbcWrIf0sU3TLNSDs= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220617084352-bf759135fe8d/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220617084352-bf759135fe8d h1:y7Ew/eU7NGlYcbIqynwpPMi11IRXxJ/tKpjexGZUcWQ= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220617084352-bf759135fe8d/go.mod h1:6bYLDCh+e7C7VEok6nKRlmPj9Ha3pSaGByLvP10PELE= +github.com/kyma-project/kyma/common/logging v0.0.0-20220617175450-95d343ae2760/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220617175450-95d343ae2760/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220620092658-f1f8e3668674 h1:IykN2HIrBgDX/Wt9bsn5JqoPGMMLi01pgcA3RpKYZfQ= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220620092658-f1f8e3668674/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220620092658-f1f8e3668674 h1:jos3V3vWO5fj1lunWcJlvizWff++CBw1pACfs22Tww0= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220620092658-f1f8e3668674/go.mod h1:qlSGTMdhECYCYf3mJ8V9T2gkaDi6Vu5AfetExw2CSEQ= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -533,7 +527,6 @@ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0Q github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 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= @@ -763,7 +756,6 @@ github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t6 github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -927,7 +919,6 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1012,7 +1003,6 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1105,7 +1095,6 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1130,7 +1119,6 @@ golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1403,19 +1391,16 @@ k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.9/go.mod h1:IoH7exYnoH/zgvHOuVxh2c4yJepcCBt72FzCTisOc4k= k8s.io/client-go v0.24.0/go.mod h1:VFPQET+cAFpYxh6Bq6f4xyMY80G6jKKktU6G0m00VDw= -k8s.io/client-go v0.24.1/go.mod h1:f1kIDqcEYmwXS/vTbbhopMUbhKp2JhOeVTfxgaCIlF8= k8s.io/client-go v0.24.2 h1:CoXFSf8if+bLEbinDqN9ePIDGzcLtqhfd6jpfnwGOFA= k8s.io/client-go v0.24.2/go.mod h1:zg4Xaoo+umDsfCWr4fCnmLEtQXyCNXCvJuSsglNcV30= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.24.2/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= k8s.io/component-base v0.24.2/go.mod h1:ucHwW76dajvQ9B7+zecZAP3BVqvrHoOxm8olHEg0nmM= k8s.io/component-helpers v0.24.2/go.mod h1:TRQPBQKfmqkmV6c0HAmUs8cXVNYYYLsXy4zu8eODi9g= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= @@ -1426,13 +1411,8 @@ k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= 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-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= -k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/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-20220611174630-77c5a1ef51a0 h1:eCVtCjJ9F4VFEJYuJk0VmgRHbaSy2YrNSPx+xDGjP/c= +k8s.io/kube-openapi v0.0.0-20220611174630-77c5a1ef51a0/go.mod h1:guXtiQW/y/AWAfPSOaI/1eY0TGBAmL5OygiIyUOKDRc= k8s.io/kubectl v0.24.2/go.mod h1:+HIFJc0bA6Tzu5O/YcuUt45APAxnNL8LeMuXwoiGsPg= k8s.io/metrics v0.24.2/go.mod h1:5NWURxZ6Lz5gj8TFU83+vdWIVASx7W8lwPpHYCqopMo= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= @@ -1460,7 +1440,6 @@ sigs.k8s.io/kustomize/cmd/config v0.10.6/go.mod h1:/S4A4nUANUa4bZJ/Edt7ZQTyKOY9W sigs.k8s.io/kustomize/kustomize/v4 v4.5.4/go.mod h1:Zo/Xc5FKD6sHl0lilbrieeGeZHVYCA4BzxeAaLI05Bg= sigs.k8s.io/kustomize/kyaml v0.11.0/go.mod h1:GNMwjim4Ypgp/MueD3zXHLRJEjz7RvtPae0AwlvEMFM= sigs.k8s.io/kustomize/kyaml v0.13.6/go.mod h1:yHP031rn1QX1lr/Xd934Ri/xdVNG8BE2ECa78Ht/kEg= -sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= From 9cebfad1f0ed1402e1946449d51d6231462816b9 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Thu, 23 Jun 2022 14:24:08 +0200 Subject: [PATCH 081/194] add a replace and exclude for emicklei/go-restful < 3 in event-publisher-proxy (#14667) * add a replace and exclude for emicklei/go-restful < 3 * bump image --- go.mod | 16 ++++++++++------ go.sum | 29 +++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index f5c53d0..8db7c27 100644 --- a/go.mod +++ b/go.mod @@ -84,12 +84,6 @@ require ( sigs.k8s.io/yaml v1.3.0 // indirect ) -// fix cve-2022-1996, might be okay to be removed after k8s > 1.24.2 -replace ( - github.com/emicklei/go-restful/v3 => github.com/emicklei/go-restful/v3 v3.8.0 - k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20220611174630-77c5a1ef51a0 -) - replace ( // keep all following packages at the same version k8s.io/api => k8s.io/api v0.24.2 @@ -110,3 +104,13 @@ replace ( golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 k8s.io/utils => k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 ) + +replace ( + github.com/emicklei/go-restful => github.com/emicklei/go-restful/v3 v3.8.0 + github.com/emicklei/go-restful/v3 => github.com/emicklei/go-restful/v3 v3.8.0 +) // fix cve-2022-1996, might be okay to be removed after k8s > 1.24.2 + +exclude ( + github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 + github.com/emicklei/go-restful v2.9.5+incompatible +) // fix cve-2022-1996, might be okay to be removed after k8s > 1.24.2 diff --git a/go.sum b/go.sum index b822291..0b11797 100644 --- a/go.sum +++ b/go.sum @@ -79,8 +79,10 @@ github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2 github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= @@ -214,8 +216,6 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= -github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= @@ -251,6 +251,7 @@ github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui72 github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -276,16 +277,20 @@ github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aA github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= @@ -332,6 +337,7 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -527,6 +533,7 @@ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0Q github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 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= @@ -756,6 +763,7 @@ github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t6 github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -919,6 +927,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1003,6 +1012,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1095,6 +1105,7 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1119,6 +1130,7 @@ golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1397,10 +1409,12 @@ k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRV k8s.io/code-generator v0.24.2/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= k8s.io/component-base v0.24.2/go.mod h1:ucHwW76dajvQ9B7+zecZAP3BVqvrHoOxm8olHEg0nmM= k8s.io/component-helpers v0.24.2/go.mod h1:TRQPBQKfmqkmV6c0HAmUs8cXVNYYYLsXy4zu8eODi9g= +k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= @@ -1411,8 +1425,14 @@ k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= 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-20220611174630-77c5a1ef51a0 h1:eCVtCjJ9F4VFEJYuJk0VmgRHbaSy2YrNSPx+xDGjP/c= -k8s.io/kube-openapi v0.0.0-20220611174630-77c5a1ef51a0/go.mod h1:guXtiQW/y/AWAfPSOaI/1eY0TGBAmL5OygiIyUOKDRc= +k8s.io/kube-openapi v0.0.0-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= +k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= +k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= +k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= +k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= +k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= +k8s.io/kube-openapi v0.0.0-20220603121420-31174f50af60 h1:cE/M8rmDQgibspuSm+X1iW16ByTImtEaapgaHoVSLX4= +k8s.io/kube-openapi v0.0.0-20220603121420-31174f50af60/go.mod h1:ouUzE1U2mEv//HRoBwYLFE5pdqjIebvtX361vtEIlBI= k8s.io/kubectl v0.24.2/go.mod h1:+HIFJc0bA6Tzu5O/YcuUt45APAxnNL8LeMuXwoiGsPg= k8s.io/metrics v0.24.2/go.mod h1:5NWURxZ6Lz5gj8TFU83+vdWIVASx7W8lwPpHYCqopMo= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= @@ -1440,6 +1460,7 @@ sigs.k8s.io/kustomize/cmd/config v0.10.6/go.mod h1:/S4A4nUANUa4bZJ/Edt7ZQTyKOY9W sigs.k8s.io/kustomize/kustomize/v4 v4.5.4/go.mod h1:Zo/Xc5FKD6sHl0lilbrieeGeZHVYCA4BzxeAaLI05Bg= sigs.k8s.io/kustomize/kyaml v0.11.0/go.mod h1:GNMwjim4Ypgp/MueD3zXHLRJEjz7RvtPae0AwlvEMFM= sigs.k8s.io/kustomize/kyaml v0.13.6/go.mod h1:yHP031rn1QX1lr/Xd934Ri/xdVNG8BE2ECa78Ht/kEg= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= From c426c9461b6ce0d37d593ea8325eb8639d0e87e5 Mon Sep 17 00:00:00 2001 From: Raymond Pinto <45314732+raypinto@users.noreply.github.com> Date: Fri, 24 Jun 2022 08:33:00 +0200 Subject: [PATCH 082/194] emit event_type_published and event_type_subscribed metrics (#14672) * emit event_type_published and event_type_subscribed metrics * Updated dashboard and queries --- pkg/handler/nats/handler.go | 1 + pkg/handler/nats/handler_integration_test.go | 7 +++++- pkg/metrics/collector.go | 23 ++++++++++++++++++-- pkg/metrics/metricstest/metricstest.go | 5 +++++ testing/utils.go | 4 ++++ 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index e06e0ab..d413ce3 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -219,6 +219,7 @@ func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.D start := time.Now() s := *h.Sender resp, err := s.Send(ctx, event) + h.collector.RecordEventType(event.Type(), event.Source()) dispatchTime := time.Since(start) if err != nil { h.collector.RecordError() diff --git a/pkg/handler/nats/handler_integration_test.go b/pkg/handler/nats/handler_integration_test.go index c40216a..96784d9 100644 --- a/pkg/handler/nats/handler_integration_test.go +++ b/pkg/handler/nats/handler_integration_test.go @@ -129,6 +129,9 @@ func TestHandlerForCloudEvents(t *testing.T) { assert.NoError(t, err) assert.NoError(t, resp.Body.Close()) assert.Equal(t, testCase.WantStatusCode, resp.StatusCode) + if testingutils.IsNot4XX(resp.StatusCode) { + metricstest.EnsureMetricEventTypePublished(t, handlerMock.GetMetricsCollector()) + } if testingutils.Is2XX(resp.StatusCode) { metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*3)) @@ -252,7 +255,9 @@ func TestHandlerForLegacyEvents(t *testing.T) { } else { handlertest.ValidateLegacyErrorResponse(t, *resp, &testCase.WantResponse) } - + if testingutils.IsNot4XX(resp.StatusCode) { + metricstest.EnsureMetricEventTypePublished(t, handlerMock.GetMetricsCollector()) + } if testingutils.Is2XX(resp.StatusCode) { metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*3)) diff --git a/pkg/metrics/collector.go b/pkg/metrics/collector.go index 01e9c96..11eef5e 100644 --- a/pkg/metrics/collector.go +++ b/pkg/metrics/collector.go @@ -11,16 +11,21 @@ const ( Errors = "event_publish_to_messaging_server_errors_total" // Latency name of the latency metric Latency = "event_publish_to_messaging_server_latency" + // EventTypePublishedMetricKey name of the eventType metric + EventTypePublishedMetricKey = "event_type_published" // errorsHelp help for the errors metric errorsHelp = "The total number of errors while sending Events to the messaging server" // latencyHelp help for the latency metric latencyHelp = "The duration of sending Events to the messaging server" + // EventTypePublishedMetricHelp help for the eventType metric + EventTypePublishedMetricHelp = "The total number of events published for a given eventType" ) // Collector implements the prometheus.Collector interface type Collector struct { - errors *prometheus.CounterVec - latency *prometheus.HistogramVec + errors *prometheus.CounterVec + latency *prometheus.HistogramVec + eventType *prometheus.CounterVec } // NewCollector a new instance of Collector @@ -40,6 +45,13 @@ func NewCollector() *Collector { }, []string{}, ), + eventType: prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: EventTypePublishedMetricKey, + Help: EventTypePublishedMetricHelp, + }, + []string{"event_type", "event_source"}, + ), } } @@ -47,12 +59,14 @@ func NewCollector() *Collector { func (c *Collector) Describe(ch chan<- *prometheus.Desc) { c.errors.Describe(ch) c.latency.Describe(ch) + c.eventType.Describe(ch) } // Collect implements the prometheus.Collector interface Collect method func (c *Collector) Collect(ch chan<- prometheus.Metric) { c.errors.Collect(ch) c.latency.Collect(ch) + c.eventType.Collect(ch) } // RecordError records an error metric @@ -64,3 +78,8 @@ func (c *Collector) RecordError() { func (c *Collector) RecordLatency(duration time.Duration) { c.latency.WithLabelValues().Observe(duration.Seconds()) } + +// RecordEventType records a eventType metric +func (c *Collector) RecordEventType(eventType, eventSource string) { + c.eventType.WithLabelValues(eventType, eventSource).Inc() +} diff --git a/pkg/metrics/metricstest/metricstest.go b/pkg/metrics/metricstest/metricstest.go index 4f12527..09cbc3f 100644 --- a/pkg/metrics/metricstest/metricstest.go +++ b/pkg/metrics/metricstest/metricstest.go @@ -18,6 +18,11 @@ func EnsureMetricLatency(t *testing.T, collector *metrics.Collector) { ensureMetricCount(t, collector, metrics.Latency, 1) } +// EnsureMetricEventTypePublished ensures metric eventType exists +func EnsureMetricEventTypePublished(t *testing.T, collector *metrics.Collector) { + ensureMetricCount(t, collector, metrics.EventTypePublishedMetricKey, 1) +} + func ensureMetricCount(t *testing.T, collector *metrics.Collector, metric string, expectedCount int) { if count := testutil.CollectAndCount(collector, metric); count != expectedCount { t.Fatalf("invalid count for metric:%s, want:%d, got:%d", metric, expectedCount, count) diff --git a/testing/utils.go b/testing/utils.go index 90688a5..a565382 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -208,6 +208,10 @@ func Is2XX(statusCode int) bool { return statusCode/100 == 2 } +func IsNot4XX(statusCode int) bool { + return statusCode/100 != 4 +} + // isPortAvailable returns true if the port is available for use, otherwise returns false func isPortAvailable(port int) bool { address := fmt.Sprintf(":%d", port) From 96d16738b1ff213b04d0607f23bc0c394efa0702 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Jun 2022 17:15:08 +0200 Subject: [PATCH 083/194] gomod(deps): bump sigs.k8s.io/controller-runtime from 0.12.1 to 0.12.2 in /components/event-publisher-proxy (#14676) * gomod(deps): bump sigs.k8s.io/controller-runtime Bumps [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) from 0.12.1 to 0.12.2. - [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases) - [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/master/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.12.1...v0.12.2) --- updated-dependencies: - dependency-name: sigs.k8s.io/controller-runtime dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump image Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raymond Co-authored-by: Raymond Pinto <45314732+raypinto@users.noreply.github.com> --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 8db7c27..75c8215 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( k8s.io/api v0.24.2 k8s.io/apimachinery v0.24.2 k8s.io/client-go v0.24.2 - sigs.k8s.io/controller-runtime v0.12.1 + sigs.k8s.io/controller-runtime v0.12.2 ) require ( diff --git a/go.sum b/go.sum index 0b11797..537796b 100644 --- a/go.sum +++ b/go.sum @@ -1448,8 +1448,9 @@ sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+a sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= -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/controller-runtime v0.12.2 h1:nqV02cvhbAj7tbt21bpPpTByrXGn2INHRsi39lXy9sE= +sigs.k8s.io/controller-runtime v0.12.2/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0= sigs.k8s.io/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I= 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= From b67e5eb34ab666f2ce5aed9a64fb96194bba01c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Jun 2022 18:51:01 +0200 Subject: [PATCH 084/194] gomod(deps): bump github.com/stretchr/testify from 1.7.2 to 1.7.5 in /components/event-publisher-proxy (#14688) * gomod(deps): bump github.com/stretchr/testify Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.2 to 1.7.5. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.7.2...v1.7.5) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump image Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raymond Co-authored-by: Raymond Pinto <45314732+raypinto@users.noreply.github.com> --- go.mod | 2 +- go.sum | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 75c8215..c110401 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.2 github.com/sirupsen/logrus v1.8.1 - github.com/stretchr/testify v1.7.2 + github.com/stretchr/testify v1.7.5 go.opencensus.io v0.23.0 golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb k8s.io/api v0.24.2 diff --git a/go.sum b/go.sum index 537796b..694e7a0 100644 --- a/go.sum +++ b/go.sum @@ -780,14 +780,17 @@ github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5J github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q= +github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= From 1e7b2df60ff37b217017a79cdc72ca174ec045d4 Mon Sep 17 00:00:00 2001 From: VladislavPaskar <15933100+VladislavPaskar@users.noreply.github.com> Date: Fri, 1 Jul 2022 10:27:51 +0200 Subject: [PATCH 085/194] Standardize logging in the EPP (#14712) * use only zap logger in epp * bump images * remove unused code --- cmd/event-publisher-proxy/beb/beb.go | 30 +++++--- cmd/event-publisher-proxy/main.go | 41 ++++++---- cmd/event-publisher-proxy/nats/nats.go | 36 +++++---- .../event-publisher-nats/200-deployment.yaml | 4 + .../event-publisher-proxy/300-deployment.yaml | 4 + go.mod | 7 +- go.sum | 12 +-- pkg/application/lister.go | 5 +- pkg/cloudevents/eventtype/clean.go | 27 +++---- pkg/cloudevents/eventtype/clean_test.go | 8 +- pkg/handler/beb/handler.go | 76 ++++++++++--------- pkg/handler/beb/mock/mock.go | 13 +++- pkg/handler/nats/handler.go | 67 ++++++++-------- pkg/handler/nats/health.go | 4 +- pkg/handler/nats/mock/mock.go | 14 +++- pkg/informers/sync.go | 7 +- pkg/legacy-events/helpers.go | 10 ++- pkg/legacy-events/legacy.go | 2 +- pkg/metrics/server.go | 17 +++-- pkg/receiver/receiver.go | 12 ++- pkg/receiver/receiver_test.go | 6 +- pkg/sender/jetstream.go | 25 ++++-- pkg/sender/jetstream_test.go | 20 +++-- pkg/sender/nats.go | 7 +- pkg/sender/nats_test.go | 7 +- pkg/subscribed/processor.go | 16 +++- pkg/subscribed/response.go | 18 +++-- testing/nats.go | 9 ++- 28 files changed, 311 insertions(+), 193 deletions(-) diff --git a/cmd/event-publisher-proxy/beb/beb.go b/cmd/event-publisher-proxy/beb/beb.go index 81f169d..de86bb7 100644 --- a/cmd/event-publisher-proxy/beb/beb.go +++ b/cmd/event-publisher-proxy/beb/beb.go @@ -3,12 +3,13 @@ package beb import ( "context" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "go.uber.org/zap" "k8s.io/client-go/dynamic" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only used in a development setup "sigs.k8s.io/controller-runtime/pkg/client/config" "github.com/kelseyhightower/envconfig" - "github.com/sirupsen/logrus" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" @@ -25,17 +26,22 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" ) +const ( + bebBackend = "beb" + bebCommanderName = bebBackend + "-commander" +) + // Commander implements the Commander interface. type Commander struct { cancel context.CancelFunc envCfg *env.BebConfig - logger *logrus.Logger + logger *logger.Logger metricsCollector *metrics.Collector opts *options.Options } // NewCommander creates the Commander for publisher to BEB. -func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, logger *logrus.Logger) *Commander { +func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, logger *logger.Logger) *Commander { return &Commander{ metricsCollector: metricsCollector, logger: logger, @@ -47,7 +53,7 @@ func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, lo // Init implements the Commander interface and initializes the publisher to BEB. func (c *Commander) Init() error { if err := envconfig.Process("", c.envCfg); err != nil { - c.logger.Errorf("Read BEB configuration failed with error: %s", err) + c.namedLogger().Errorw("Failed to read configuration", "error", err) return err } return nil @@ -55,7 +61,7 @@ func (c *Commander) Init() error { // Start implements the Commander interface and starts the publisher. func (c *Commander) Start() error { - c.logger.Infof("Starting Event Publisher to BEB, envCfg: %v; opts: %#v", c.envCfg.String(), c.opts) + c.namedLogger().Infow("Starting Event Publisher", "configuration", c.envCfg.String(), "startup arguments", c.opts) // configure message receiver messageReceiver := receiver.NewHTTPMessageReceiver(c.envCfg.Port) @@ -94,9 +100,9 @@ func (c *Commander) Start() error { Logger: c.logger, } // Sync informer cache or die - c.logger.Info("Waiting for informers caches to sync") - informers.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory) - c.logger.Info("Informers are synced successfully") + c.namedLogger().Info("Waiting for informers caches to sync") + informers.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory, c.logger) + c.namedLogger().Info("Informers were successfully synced") // configure event type cleaner eventTypeCleaner := eventtype.NewCleaner(c.envCfg.EventTypePrefix, applicationLister, c.logger) @@ -104,10 +110,10 @@ func (c *Commander) Start() error { // start handler which blocks until it receives a shutdown signal if err := beb.NewHandler(messageReceiver, messageSender, c.envCfg.RequestTimeout, legacyTransformer, c.opts, subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleaner).Start(ctx); err != nil { - c.logger.Errorf("Start handler failed with error: %s", err) + c.namedLogger().Errorw("Failed to start handler", "error", err) return err } - c.logger.Info("Shutdown the Event Publisher Proxy") + c.namedLogger().Info("Event Publisher was shut down") return nil } @@ -116,3 +122,7 @@ func (c *Commander) Stop() error { c.cancel() return nil } + +func (c *Commander) namedLogger() *zap.SugaredLogger { + return c.logger.WithContext().Named(bebCommanderName).With("backend", bebBackend) +} diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index 87b4396..98fc407 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -1,13 +1,15 @@ package main import ( + golog "log" + "github.com/kelseyhightower/envconfig" "github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy/beb" "github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" "github.com/prometheus/client_golang/prometheus" - "github.com/sirupsen/logrus" ) const ( @@ -21,6 +23,12 @@ type Config struct { // JetstreamModeEnabled indicates whether NATS backend will be used in default or jetstream mode. JetstreamModeEnabled bool `envconfig:"ENABLE_JETSTREAM_BACKEND" default:"false"` + + // AppLogFormat defines the log format. + AppLogFormat string `envconfig:"APP_LOG_FORMAT" default:"json"` + + // AppLogLevel defines the log level. + AppLogLevel string `envconfig:"APP_LOG_LEVEL" default:"info"` } // Commander defines the interface of different implementations @@ -36,15 +44,26 @@ type Commander interface { } func main() { - logger := logrus.New() opts := options.ParseArgs() // parse the config for main: cfg := new(Config) if err := envconfig.Process("", cfg); err != nil { - logger.Fatalf("Read configuration failed with error: %s", err) + golog.Fatalf("Failed to read configuration, error: %v", err) } + // init the logger + logger, err := kymalogger.New(cfg.AppLogFormat, cfg.AppLogLevel) + if err != nil { + golog.Fatalf("Failed to initialize logger, error: %v", err) + } + defer func() { + if err := logger.WithContext().Sync(); err != nil { + golog.Fatalf("Failed to flush logger, error: %v", err) + } + }() + setupLogger := logger.WithContext().With("backend", cfg.Backend, "jetstream mode", cfg.JetstreamModeEnabled) + // metrics collector metricsCollector := metrics.NewCollector() prometheus.MustRegister(metricsCollector) @@ -57,31 +76,27 @@ func main() { case backendNATS: commander = nats.NewCommander(opts, metricsCollector, logger, cfg.JetstreamModeEnabled) default: - logger.Fatalf("Invalid publisher backend: %v", cfg.Backend) + setupLogger.Fatalf("Invalid publisher backend: %v", cfg.Backend) } // Init the commander. if err := commander.Init(); err != nil { - logger.Fatalf("Initialization failed: %s", err) + setupLogger.Fatalw("Commander initialization failed", "error", err) } // Start the metrics server. metricsServer := metrics.NewServer(logger) defer metricsServer.Stop() if err := metricsServer.Start(opts.MetricsAddress); err != nil { - logger.Infof("Metrics server failed to start with error: %v", err) + setupLogger.Infow("Failed to start metrics server", "error", err) } - if cfg.JetstreamModeEnabled { - logger.Infof("Starting publisher to: %v in the Jetstream mode", cfg.Backend) - } else { - logger.Infof("Starting publisher to: %v", cfg.Backend) - } + setupLogger.Infof("Starting publisher to: %v", cfg.Backend) // Start the commander. if err := commander.Start(); err != nil { - logger.Fatalf("Unable to start publisher: %s", err) + setupLogger.Fatalw("Failed to to start publisher", "error", err) } - logger.Info("Shutdown the Event Publisher Proxy") + setupLogger.Info("Shutdown the Event Publisher") } diff --git a/cmd/event-publisher-proxy/nats/nats.go b/cmd/event-publisher-proxy/nats/nats.go index 42651d3..07c03c6 100644 --- a/cmd/event-publisher-proxy/nats/nats.go +++ b/cmd/event-publisher-proxy/nats/nats.go @@ -3,12 +3,14 @@ package nats import ( "context" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "go.uber.org/zap" + "k8s.io/client-go/dynamic" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only required in a dev setup "sigs.k8s.io/controller-runtime/pkg/client/config" "github.com/kelseyhightower/envconfig" - "github.com/sirupsen/logrus" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" @@ -25,18 +27,23 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" ) +const ( + natsBackend = "nats" + natsCommanderName = natsBackend + "-commander" +) + // Commander implements the Commander interface. type Commander struct { cancel context.CancelFunc metricsCollector *metrics.Collector - logger *logrus.Logger + logger *logger.Logger envCfg *env.NatsConfig opts *options.Options jetstreamMode bool } // NewCommander creates the Commander for publisher to NATS. -func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, logger *logrus.Logger, jetstreamMode bool) *Commander { +func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, logger *logger.Logger, jetstreamMode bool) *Commander { return &Commander{ envCfg: new(env.NatsConfig), logger: logger, @@ -49,7 +56,7 @@ func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, lo // Init implements the Commander interface and initializes the publisher to NATS. func (c *Commander) Init() error { if err := envconfig.Process("", c.envCfg); err != nil { - c.logger.Errorf("Read %s configuration failed with error: %s", c.getBackendName(), err) + c.namedLogger().Errorw("Failed to read configuration", "error", err) return err } return nil @@ -57,7 +64,7 @@ func (c *Commander) Init() error { // Start implements the Commander interface and starts the publisher. func (c *Commander) Start() error { - c.logger.Infof("Starting Event Publisher to %s, envCfg: %v; opts: %#v", c.getBackendName(), c.envCfg.String(), c.opts) + c.namedLogger().Infow("Starting Event Publisher", "configuration", c.envCfg.String(), "startup arguments", c.opts) // assure uniqueness var ctx context.Context @@ -73,7 +80,7 @@ func (c *Commander) Start() error { pkgnats.WithReconnectWait(c.envCfg.ReconnectWait), ) if err != nil { - c.logger.Errorf("Failed to connect to %s server with error: %s", c.getBackendName(), err) + c.namedLogger().Errorw("Failed to connect to backend server", "error", err) return err } defer connection.Close() @@ -110,9 +117,9 @@ func (c *Commander) Start() error { } // sync informer cache or die - c.logger.Info("Waiting for informers caches to sync") - informers.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory) - c.logger.Info("Informers are synced successfully") + c.namedLogger().Info("Waiting for informers caches to sync") + informers.WaitForCacheSyncOrDie(ctx, subDynamicSharedInfFactory, c.logger) + c.namedLogger().Info("Informers are synced successfully") // configure event type cleaner eventTypeCleaner := eventtype.NewCleaner(c.envCfg.EventTypePrefix, applicationLister, c.logger) @@ -120,11 +127,11 @@ func (c *Commander) Start() error { // start handler which blocks until it receives a shutdown signal if err := nats.NewHandler(messageReceiver, &messageSenderToNats, c.envCfg.RequestTimeout, legacyTransformer, c.opts, subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleaner).Start(ctx); err != nil { - c.logger.Errorf("Start handler failed with error: %s", err) + c.namedLogger().Errorw("Failed to start handler", "error", err) return err } - c.logger.Infof("Event Publisher %s shutdown", c.getBackendName()) + c.namedLogger().Infof("Event Publisher was shut down") return nil } @@ -135,9 +142,6 @@ func (c *Commander) Stop() error { return nil } -func (c *Commander) getBackendName() string { - if c.jetstreamMode { - return "NATS in Jetstream mode" - } - return "NATS" +func (c *Commander) namedLogger() *zap.SugaredLogger { + return c.logger.WithContext().Named(natsCommanderName).With("backend", natsBackend, "jestream mode", c.jetstreamMode) } diff --git a/config/event-publisher-nats/200-deployment.yaml b/config/event-publisher-nats/200-deployment.yaml index 1079766..b1a58e8 100644 --- a/config/event-publisher-nats/200-deployment.yaml +++ b/config/event-publisher-nats/200-deployment.yaml @@ -37,6 +37,10 @@ spec: value: kyma - name: EVENT_TYPE_PREFIX value: sap.kyma.custom + - name: APP_LOG_FORMAT + value: "json" + - name: APP_LOG_LEVEL + value: "info" image: ko://github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy imagePullPolicy: IfNotPresent name: event-publisher-proxy diff --git a/config/event-publisher-proxy/300-deployment.yaml b/config/event-publisher-proxy/300-deployment.yaml index 9c34fe6..1c1782b 100644 --- a/config/event-publisher-proxy/300-deployment.yaml +++ b/config/event-publisher-proxy/300-deployment.yaml @@ -40,6 +40,10 @@ spec: secretKeyRef: name: event-publisher-proxy key: ems-publish-url + - name: APP_LOG_FORMAT + value: "json" + - name: APP_LOG_LEVEL + value: "info" image: ko://github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy imagePullPolicy: IfNotPresent name: event-publisher-proxy diff --git a/go.mod b/go.mod index c110401..c35d1ce 100644 --- a/go.mod +++ b/go.mod @@ -7,16 +7,17 @@ require ( github.com/cloudevents/sdk-go/v2 v2.10.1 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 + github.com/kyma-project/kyma/common/logging v0.0.0-20220628153305-4e32e8abea0f github.com/kyma-project/kyma/components/application-operator v0.0.0-20220620092658-f1f8e3668674 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220620092658-f1f8e3668674 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220629063704-83cc2f69ed02 github.com/nats-io/nats-server/v2 v2.8.4 github.com/nats-io/nats.go v1.16.0 github.com/onsi/gomega v1.19.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.2 - github.com/sirupsen/logrus v1.8.1 github.com/stretchr/testify v1.7.5 go.opencensus.io v0.23.0 + go.uber.org/zap v1.21.0 golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb k8s.io/api v0.24.2 k8s.io/apimachinery v0.24.2 @@ -34,6 +35,7 @@ require ( github.com/emicklei/go-restful/v3 v3.8.0 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/zapr v1.2.3 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.19.5 // indirect github.com/go-openapi/swag v0.19.14 // indirect @@ -64,7 +66,6 @@ require ( github.com/spf13/pflag v1.0.5 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.21.0 // indirect golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect diff --git a/go.sum b/go.sum index 694e7a0..fac264d 100644 --- a/go.sum +++ b/go.sum @@ -121,6 +121,7 @@ github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngE github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= @@ -506,6 +507,7 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv 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 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= @@ -516,11 +518,13 @@ github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4 github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= github.com/kyma-project/kyma/common/logging v0.0.0-20220617175450-95d343ae2760/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= +github.com/kyma-project/kyma/common/logging v0.0.0-20220628153305-4e32e8abea0f h1:fn0t/cGeKkLnnwzOfRsjRWuOR3p5wROX7D8hT1yqff0= +github.com/kyma-project/kyma/common/logging v0.0.0-20220628153305-4e32e8abea0f/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220617175450-95d343ae2760/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220620092658-f1f8e3668674 h1:IykN2HIrBgDX/Wt9bsn5JqoPGMMLi01pgcA3RpKYZfQ= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220620092658-f1f8e3668674/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220620092658-f1f8e3668674 h1:jos3V3vWO5fj1lunWcJlvizWff++CBw1pACfs22Tww0= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220620092658-f1f8e3668674/go.mod h1:qlSGTMdhECYCYf3mJ8V9T2gkaDi6Vu5AfetExw2CSEQ= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220629063704-83cc2f69ed02 h1:NAOwgzmxux3i5fmfEbG15q6ZRd5vx7opu88mR8LktJw= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220629063704-83cc2f69ed02/go.mod h1:ys6m65CYDhSwFymBd6OLUW0ZgAZowD+Y6oUzXF+o6X0= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -739,7 +743,6 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= @@ -788,7 +791,6 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q= github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= @@ -1405,7 +1407,6 @@ k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.9/go.mod h1:IoH7exYnoH/zgvHOuVxh2c4yJepcCBt72FzCTisOc4k= -k8s.io/client-go v0.24.0/go.mod h1:VFPQET+cAFpYxh6Bq6f4xyMY80G6jKKktU6G0m00VDw= k8s.io/client-go v0.24.2 h1:CoXFSf8if+bLEbinDqN9ePIDGzcLtqhfd6jpfnwGOFA= k8s.io/client-go v0.24.2/go.mod h1:zg4Xaoo+umDsfCWr4fCnmLEtQXyCNXCvJuSsglNcV30= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= @@ -1451,7 +1452,6 @@ sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+a sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= -sigs.k8s.io/controller-runtime v0.12.1/go.mod h1:BKhxlA4l7FPK4AQcsuL4X6vZeWnKDXez/vp1Y8dxTU0= sigs.k8s.io/controller-runtime v0.12.2 h1:nqV02cvhbAj7tbt21bpPpTByrXGn2INHRsi39lXy9sE= sigs.k8s.io/controller-runtime v0.12.2/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0= sigs.k8s.io/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I= diff --git a/pkg/application/lister.go b/pkg/application/lister.go index 22e2879..0f5260c 100644 --- a/pkg/application/lister.go +++ b/pkg/application/lister.go @@ -5,6 +5,8 @@ import ( "errors" "time" + kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" @@ -27,7 +29,8 @@ func NewLister(ctx context.Context, client dynamic.Interface) *Lister { factory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(client, defaultResync, v1.NamespaceAll, nil) factory.ForResource(gvr) lister := factory.ForResource(gvr).Lister() - informers.WaitForCacheSyncOrDie(ctx, factory) + logger, _ := kymalogger.New("json", "error") + informers.WaitForCacheSyncOrDie(ctx, factory, logger) return &Lister{lister: lister} } diff --git a/pkg/cloudevents/eventtype/clean.go b/pkg/cloudevents/eventtype/clean.go index c7d9fd2..d9c9cb3 100644 --- a/pkg/cloudevents/eventtype/clean.go +++ b/pkg/cloudevents/eventtype/clean.go @@ -3,7 +3,8 @@ package eventtype import ( "regexp" - "github.com/sirupsen/logrus" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "go.uber.org/zap" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" ) @@ -24,13 +25,13 @@ type Cleaner interface { type cleaner struct { eventTypePrefix string applicationLister *application.Lister - logger *logrus.Logger + logger *logger.Logger } // compile-time check var _ Cleaner = &cleaner{} -func NewCleaner(eventTypePrefix string, applicationLister *application.Lister, logger *logrus.Logger) Cleaner { +func NewCleaner(eventTypePrefix string, applicationLister *application.Lister, logger *logger.Logger) Cleaner { return &cleaner{eventTypePrefix: eventTypePrefix, applicationLister: applicationLister, logger: logger} } @@ -38,21 +39,18 @@ func NewCleaner(eventTypePrefix string, applicationLister *application.Lister, l // or returns an error if the event-type parsing failed. func (c *cleaner) Clean(eventType string) (string, error) { // format logger - log := c.namedLogger().WithFields(logrus.Fields{ - "prefix": c.eventTypePrefix, - "type": eventType, - }) + namedLogger := c.namedLogger(eventType) appName, event, version, err := parse(eventType, c.eventTypePrefix) if err != nil { - log.WithField("error", err).Error("parse event-type failed") + namedLogger.Errorw("Failed to parse event-type", "error", err) return "", err } // clean the application name var eventTypeClean string if appObj, err := c.applicationLister.Get(appName); err != nil { - log.WithField("application", appName).Debug("cannot find application") + namedLogger.With("application", appName).Debug("Cannot find application") eventTypeClean = build(c.eventTypePrefix, application.GetCleanName(appName), event, version) } else { eventTypeClean = build(c.eventTypePrefix, application.GetCleanTypeOrName(appObj), event, version) @@ -60,18 +58,13 @@ func (c *cleaner) Clean(eventType string) (string, error) { // clean the event-type segments eventTypeClean = cleanEventType(eventTypeClean) - log.WithFields( - logrus.Fields{ - "before": eventType, - "after": eventTypeClean, - }, - ).Debug("clean event-type") + namedLogger.With("before", eventType, "after", eventTypeClean).Debug("Clean event-type") return eventTypeClean, nil } -func (c *cleaner) namedLogger() *logrus.Logger { - return c.logger.WithField("name", cleanerName).Logger +func (c *cleaner) namedLogger(eventType string) *zap.SugaredLogger { + return c.logger.WithContext().Named(cleanerName).With("prefix", c.eventTypePrefix, "type", eventType) } func cleanEventType(eventType string) string { diff --git a/pkg/cloudevents/eventtype/clean_test.go b/pkg/cloudevents/eventtype/clean_test.go index 5ecc69c..832dc0d 100644 --- a/pkg/cloudevents/eventtype/clean_test.go +++ b/pkg/cloudevents/eventtype/clean_test.go @@ -4,7 +4,8 @@ import ( "context" "testing" - "github.com/sirupsen/logrus" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/stretchr/testify/require" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" @@ -157,7 +158,8 @@ func TestCleaner(t *testing.T) { }, } - logger := logrus.New() + mockedLogger, err := logger.New("json", "info") + require.NoError(t, err) for _, tc := range testCases { tc := tc @@ -165,7 +167,7 @@ func TestCleaner(t *testing.T) { t.Parallel() app := applicationtest.NewApplication(tc.givenApplicationName, tc.givenApplicationLabels) appLister := fake.NewApplicationListerOrDie(context.Background(), app) - cleaner := NewCleaner(tc.givenEventTypePrefix, appLister, logger) + cleaner := NewCleaner(tc.givenEventTypePrefix, appLister, mockedLogger) eventType, err := cleaner.Clean(tc.givenEventType) require.Equal(t, tc.wantError, err != nil) if !tc.wantError { diff --git a/pkg/handler/beb/handler.go b/pkg/handler/beb/handler.go index a61f0bd..7092556 100644 --- a/pkg/handler/beb/handler.go +++ b/pkg/handler/beb/handler.go @@ -6,12 +6,13 @@ import ( "net/http" "time" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "go.uber.org/zap" + "github.com/cloudevents/sdk-go/v2/binding" cev2client "github.com/cloudevents/sdk-go/v2/client" cev2event "github.com/cloudevents/sdk-go/v2/event" cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" - "github.com/sirupsen/logrus" - "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" cloudevents "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" @@ -29,6 +30,8 @@ import ( const ( // noDuration signals that the dispatch step has not started yet. noDuration = -1 + + bebCommanderName = "beb-commander" ) var ( @@ -56,7 +59,7 @@ type Handler struct { //SubscribedProcessor processes requests for /:app/v1/events/subscribed endpoint SubscribedProcessor *subscribed.Processor // Logger default logger - Logger *logrus.Logger + Logger *logger.Logger // Options configures HTTP server Options *options.Options // collector collects metrics @@ -68,7 +71,7 @@ type Handler struct { // NewHandler returns a new HTTP Handler instance. func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.BebMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, - logger *logrus.Logger, collector *metrics.Collector, eventTypeCleaner eventtype.Cleaner) *Handler { + logger *logger.Logger, collector *metrics.Collector, eventTypeCleaner eventtype.Cleaner) *Handler { return &Handler{ Receiver: receiver, Sender: sender, @@ -85,7 +88,7 @@ func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.BebMessag // Start starts the Handler with the given context. func (h *Handler) Start(ctx context.Context) error { healthChecker := health.NewChecker() - return h.Receiver.StartListen(ctx, healthChecker.Check(h)) + return h.Receiver.StartListen(ctx, healthChecker.Check(h), h.Logger) } // ServeHTTP serves an HTTP request and returns an HTTP response. @@ -94,7 +97,7 @@ func (h *Handler) Start(ctx context.Context) error { func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { // validate request method if request.Method != http.MethodPost && request.Method != http.MethodGet { - h.Logger.Warnf("Unexpected request method: %s", request.Method) + h.namedLogger().Warnf("Unexpected request method: %s", request.Method) h.writeResponse(writer, http.StatusMethodNotAllowed, nil) return } @@ -129,7 +132,7 @@ func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { event, eventTypeOriginal := h.LegacyTransformer.TransformLegacyRequestsToCE(writer, request) if event == nil { - h.Logger.Debug("failed to transform legacy event to CE, event is nil") + h.namedLogger().Debug("Failed to transform legacy event to CloudEvent, event is nil") return } @@ -141,16 +144,15 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h // Change response as per old error codes h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, statusCode, event, string(respBody)) - h.Logger.WithFields( - logrus.Fields{ - "id": event.ID(), - "source": event.Source(), - "before": eventTypeOriginal, - "after": event.Type(), - "statusCode": statusCode, - "duration": dispatchTime, - "responseBody": string(respBody), - }).Info("Event dispatched") + h.namedLogger().With( + "id", event.ID(), + "source", event.Source(), + "before", eventTypeOriginal, + "after", event.Type(), + "statusCode", statusCode, + "duration", dispatchTime, + "responseBody", string(respBody), + ).Info("Event dispatched") } func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.Request) { @@ -162,7 +164,7 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R event, err := binding.ToEvent(ctx, message) if err != nil { - h.Logger.Errorf("Failed to extract event from request with error: %s", err) + h.namedLogger().Errorw("Failed to extract event from request", "error", err) h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) return } @@ -170,14 +172,13 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R eventTypeOriginal := event.Type() eventTypeClean, err := h.eventTypeCleaner.Clean(eventTypeOriginal) if err != nil { - h.Logger.Errorf("Failed to clean event type with error: %s", err) h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) return } event.SetType(eventTypeClean) if err := event.Validate(); err != nil { - h.Logger.Errorf("Request is invalid as per CE spec with error: %s", err) + h.namedLogger().Errorw("Request doesn't correspond to CloudEvent spec", "error", err) h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) return } @@ -192,16 +193,15 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R statusCode, dispatchTime, respBody := h.send(ctx, event) h.writeResponse(writer, statusCode, respBody) - h.Logger.WithFields( - logrus.Fields{ - "id": event.ID(), - "source": event.Source(), - "before": eventTypeOriginal, - "after": eventTypeClean, - "statusCode": statusCode, - "duration": dispatchTime, - "responseBody": string(respBody), - }).Info("Event dispatched") + h.namedLogger().With( + "id", event.ID(), + "source", event.Source(), + "before", eventTypeOriginal, + "after", eventTypeClean, + "statusCode", statusCode, + "duration", dispatchTime, + "responseBody", string(respBody), + ).Info("Event dispatched") } // writeResponse writes the HTTP response given the status code and response body. @@ -212,7 +212,7 @@ func (h *Handler) writeResponse(writer http.ResponseWriter, statusCode int, resp return } if _, err := writer.Write(respBody); err != nil { - h.Logger.Errorf("Failed to write response body with error: %s", err) + h.namedLogger().Errorw("Failed to write response body", "error", err) } } @@ -223,14 +223,14 @@ func (h *Handler) receive(ctx context.Context, event *cev2event.Event) { event = &newEvent } - h.Logger.Infof("Event received id:[%s]", event.ID()) + h.namedLogger().Infof("CloudEvent received id:[%s]", event.ID()) } // send dispatches the given Cloud Event to the EMS gateway and returns the response details and dispatch time. func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.Duration, []byte) { request, err := h.Sender.NewRequestWithTarget(ctx, h.Sender.Target) if err != nil { - h.Logger.Errorf("failed to prepare a cloudevent request with error: %s", err) + h.namedLogger().Errorw("Failed to prepare a CloudEvent request", "error", err) return http.StatusInternalServerError, noDuration, []byte{} } @@ -239,13 +239,13 @@ func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.D err = cloudevents.WriteRequestWithHeaders(ctx, message, request, additionalHeaders) if err != nil { - h.Logger.Errorf("failed to add additional headers to the request with error: %s", err) + h.namedLogger().Errorw("Failed to add additional headers to the request", "error", err) return http.StatusInternalServerError, noDuration, []byte{} } resp, dispatchTime, err := h.sendAndRecordDispatchTime(request) if err != nil { - h.Logger.Errorf("failed to send event and record dispatch time with error: %s", err) + h.namedLogger().Errorw("Failed to send CloudEvent and record dispatch time", "error", err) h.collector.RecordError() return http.StatusInternalServerError, dispatchTime, []byte{} } @@ -254,7 +254,7 @@ func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.D body, err := ioutil.ReadAll(resp.Body) if err != nil { - h.Logger.Errorf("failed to read response body with error: %s", err) + h.namedLogger().Errorw("Failed to read response body", "error", err) return http.StatusInternalServerError, dispatchTime, []byte{} } @@ -268,3 +268,7 @@ func (h *Handler) sendAndRecordDispatchTime(request *http.Request) (*http.Respon dispatchTime := time.Since(start) return resp, dispatchTime, err } + +func (h *Handler) namedLogger() *zap.SugaredLogger { + return h.Logger.WithContext().Named(bebCommanderName) +} diff --git a/pkg/handler/beb/mock/mock.go b/pkg/handler/beb/mock/mock.go index 87aeb5b..4408f9c 100644 --- a/pkg/handler/beb/mock/mock.go +++ b/pkg/handler/beb/mock/mock.go @@ -9,6 +9,8 @@ import ( "testing" "time" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/dynamic/dynamicinformer" @@ -17,7 +19,6 @@ import ( "github.com/cloudevents/sdk-go/v2/binding" cev2event "github.com/cloudevents/sdk-go/v2/event" cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" - "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" @@ -48,7 +49,7 @@ const ( type BebHandlerMock struct { ctx context.Context cfg *env.BebConfig - logger *logrus.Logger + logger *logger.Logger collector *metrics.Collector livenessEndpoint string readinessEndpoint string @@ -102,10 +103,13 @@ func StartOrDie(ctx context.Context, t *testing.T, requestSize int, eventTypePre testingutils.WithEventTypePrefix(eventTypePrefix), ) + mockedLogger, err := logger.New("json", "info") + require.NoError(t, err) + mock := &BebHandlerMock{ ctx: ctx, cfg: cfg, - logger: logrus.New(), + logger: mockedLogger, collector: metrics.NewCollector(), livenessEndpoint: fmt.Sprintf("http://localhost:%d%s", cfg.Port, health.LivenessURI), readinessEndpoint: fmt.Sprintf("http://localhost:%d%s", cfg.Port, health.ReadinessURI), @@ -203,7 +207,8 @@ func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Sub dynamicClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) informerFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicClient, time.Second, v1.NamespaceAll, nil) genericInformer := informerFactory.ForResource(subscribed.GVR) - informers.WaitForCacheSyncOrDie(m.ctx, informerFactory) + mockedLogger, _ := logger.New("json", "info") + informers.WaitForCacheSyncOrDie(m.ctx, informerFactory, mockedLogger) subscriptionLister := genericInformer.Lister() m.subscribedProcessor = &subscribed.Processor{SubscriptionLister: &subscriptionLister, Config: m.cfg, Logger: m.logger} } diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index d413ce3..b945422 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -5,11 +5,13 @@ import ( "net/http" "time" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "go.uber.org/zap" + "github.com/cloudevents/sdk-go/v2/binding" cev2client "github.com/cloudevents/sdk-go/v2/client" cev2event "github.com/cloudevents/sdk-go/v2/event" cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" - "github.com/sirupsen/logrus" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" @@ -23,6 +25,8 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing" ) +const natsHandlerName = "nats-handler" + // Handler is responsible for receiving HTTP requests and dispatching them to NATS. // It also assures that the messages received are compliant with the Cloud Events spec. type Handler struct { @@ -39,7 +43,7 @@ type Handler struct { //SubscribedProcessor processes requests for /:app/v1/events/subscribed endpoint SubscribedProcessor *subscribed.Processor // Logger default logger - Logger *logrus.Logger + Logger *logger.Logger // Options configures HTTP server Options *options.Options // collector collects metrics @@ -51,7 +55,7 @@ type Handler struct { // NewHandler returns a new NATS Handler instance. func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.GenericSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, - logger *logrus.Logger, collector *metrics.Collector, eventTypeCleaner eventtype.Cleaner) *Handler { + logger *logger.Logger, collector *metrics.Collector, eventTypeCleaner eventtype.Cleaner) *Handler { return &Handler{ Receiver: receiver, Sender: sender, @@ -70,7 +74,7 @@ func (h *Handler) Start(ctx context.Context) error { healthChecker := health.NewChecker( health.WithReadinessCheck(ReadinessCheck(h)), ) - return h.Receiver.StartListen(ctx, healthChecker.Check(h)) + return h.Receiver.StartListen(ctx, healthChecker.Check(h), h.Logger) } // ServeHTTP serves an HTTP request and returns an HTTP response. @@ -79,7 +83,7 @@ func (h *Handler) Start(ctx context.Context) error { func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { // validate request method if request.Method != http.MethodPost && request.Method != http.MethodGet { - h.Logger.Warnf("Unexpected request method: %s", request.Method) + h.namedLogger().Warnf("Unexpected request method: %s", request.Method) h.writeResponse(writer, http.StatusMethodNotAllowed, nil) return } @@ -114,7 +118,7 @@ func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { event, eventTypeOriginal := h.LegacyTransformer.TransformLegacyRequestsToCE(writer, request) if event == nil { - h.Logger.Debug("failed to transform legacy event to CE, event is nil") + h.namedLogger().Debug("Failed to transform legacy event to CloudEvent, event is nil") return } ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) @@ -125,16 +129,15 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h // Change response as per old error codes h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, statusCode, event, string(respBody)) - h.Logger.WithFields( - logrus.Fields{ - "id": event.ID(), - "source": event.Source(), - "before": eventTypeOriginal, - "after": event.Type(), - "statusCode": statusCode, - "duration": dispatchTime, - "responseBody": string(respBody), - }).Info("Event dispatched") + h.namedLogger().With( + "id", event.ID(), + "source", event.Source(), + "before", eventTypeOriginal, + "after", event.Type(), + "statusCode", statusCode, + "duration", dispatchTime, + "responseBody", string(respBody), + ).Info("Event dispatched") } func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.Request) { @@ -146,7 +149,7 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R event, err := binding.ToEvent(ctx, message) if err != nil { - h.Logger.Errorf("Failed to extract event from request with error: %s", err) + h.namedLogger().Errorw("Failed to extract CloudEvent from request", "error", err) h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) return } @@ -154,14 +157,13 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R eventTypeOriginal := event.Type() eventTypeClean, err := h.eventTypeCleaner.Clean(eventTypeOriginal) if err != nil { - h.Logger.Errorf("Failed to clean event type with error: %s", err) h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) return } event.SetType(eventTypeClean) if err := event.Validate(); err != nil { - h.Logger.Errorf("Request is invalid as per CE spec with error: %s", err) + h.namedLogger().Errorw("Request doesn't correspond to CloudEvent spec", "error", err) h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) return } @@ -180,16 +182,15 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R statusCode, dispatchTime, respBody := h.send(ctx, event) h.writeResponse(writer, statusCode, respBody) - h.Logger.WithFields( - logrus.Fields{ - "id": event.ID(), - "source": event.Source(), - "before": eventTypeOriginal, - "after": eventTypeClean, - "statusCode": statusCode, - "duration": dispatchTime, - "responseBody": string(respBody), - }).Info("Event dispatched") + h.namedLogger().With( + "id", event.ID(), + "source", event.Source(), + "before", eventTypeOriginal, + "after", eventTypeClean, + "statusCode", statusCode, + "duration", dispatchTime, + "responseBody", string(respBody), + ).Info("Event dispatched") } // writeResponse writes the HTTP response given the status code and response body. @@ -200,7 +201,7 @@ func (h *Handler) writeResponse(writer http.ResponseWriter, statusCode int, resp return } if _, err := writer.Write(respBody); err != nil { - h.Logger.Errorf("Failed to write response body with error: %s", err) + h.namedLogger().Errorw("Failed to write response body", "error", err) } } @@ -211,7 +212,7 @@ func (h *Handler) receive(ctx context.Context, event *cev2event.Event) { event = &newEvent } - h.Logger.Infof("Event received id:[%s]", event.ID()) + h.namedLogger().Infof("CloudEvent received id:[%s]", event.ID()) } // send dispatches the given Cloud Event to NATS and returns the response details and dispatch time. @@ -228,3 +229,7 @@ func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.D h.collector.RecordLatency(dispatchTime) return resp, dispatchTime, []byte{} } + +func (h *Handler) namedLogger() *zap.SugaredLogger { + return h.Logger.WithContext().Named(natsHandlerName) +} diff --git a/pkg/handler/nats/health.go b/pkg/handler/nats/health.go index f5cdc2d..505b522 100644 --- a/pkg/handler/nats/health.go +++ b/pkg/handler/nats/health.go @@ -8,6 +8,8 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" ) +const healthCheckName = "health-check" + // ReadinessCheck returns an instance of http.HandlerFunc that checks the readiness of the given NATS Handler. // It checks the NATS server connection status and reports 2XX if connected, otherwise reports 5XX. // It panics if the given NATS Handler is nil. @@ -19,7 +21,7 @@ func ReadinessCheck(h *Handler) http.HandlerFunc { return func(w http.ResponseWriter, _ *http.Request) { s := *h.Sender if status := s.ConnectionStatus(); status != nats.CONNECTED { - h.Logger.WithField("connection-status", status).Info("Disconnected from NATS server") + h.Logger.WithContext().Named(healthCheckName).With("connection-status", status).Info("Disconnected from NATS server") w.WriteHeader(health.StatusCodeNotHealthy) return } diff --git a/pkg/handler/nats/mock/mock.go b/pkg/handler/nats/mock/mock.go index bf77242..1c36dc8 100644 --- a/pkg/handler/nats/mock/mock.go +++ b/pkg/handler/nats/mock/mock.go @@ -6,6 +6,8 @@ import ( "testing" "time" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/dynamic/dynamicinformer" @@ -13,7 +15,6 @@ import ( "github.com/nats-io/nats-server/v2/server" natsio "github.com/nats-io/nats.go" - "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" @@ -40,7 +41,7 @@ type NatsHandlerMock struct { livenessEndpoint string readinessEndpoint string eventTypePrefix string - logger *logrus.Logger + logger *logger.Logger natsServer *server.Server jetstreamMode bool natsConfig *env.NatsConfig @@ -58,11 +59,15 @@ type NatsHandlerMockOpt func(*NatsHandlerMock) // Preconditions: 1) NATS connection and 2) nats.Handler started without errors. func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) *NatsHandlerMock { port := testingutils.GeneratePortOrDie() + + mockedLogger, err := logger.New("json", "info") + require.NoError(t, err) + mock := &NatsHandlerMock{ ctx: ctx, livenessEndpoint: fmt.Sprintf("http://localhost:%d%s", port, health.LivenessURI), readinessEndpoint: fmt.Sprintf("http://localhost:%d%s", port, health.ReadinessURI), - logger: logrus.New(), + logger: mockedLogger, natsConfig: newNatsConfig(port), collector: metrics.NewCollector(), legacyTransformer: &legacy.Transformer{}, @@ -159,7 +164,8 @@ func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Sub dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, 10*time.Second, v1.NamespaceAll, nil) genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) - informers.WaitForCacheSyncOrDie(m.ctx, dFilteredSharedInfFactory) + mockedLogger, _ := logger.New("json", "info") + informers.WaitForCacheSyncOrDie(m.ctx, dFilteredSharedInfFactory, mockedLogger) subLister := genericInf.Lister() m.subscribedProcessor = &subscribed.Processor{ SubscriptionLister: &subLister, diff --git a/pkg/informers/sync.go b/pkg/informers/sync.go index 96bd13a..a6f27b6 100644 --- a/pkg/informers/sync.go +++ b/pkg/informers/sync.go @@ -2,9 +2,10 @@ package informers import ( "context" - "log" "time" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic/dynamicinformer" ) @@ -16,7 +17,7 @@ const ( type waitForCacheSyncFunc func(stopCh <-chan struct{}) map[schema.GroupVersionResource]bool // WaitForCacheSyncOrDie waits for the cache to sync. If sync fails everything stops -func WaitForCacheSyncOrDie(ctx context.Context, dc dynamicinformer.DynamicSharedInformerFactory) { +func WaitForCacheSyncOrDie(ctx context.Context, dc dynamicinformer.DynamicSharedInformerFactory, logger *logger.Logger) { dc.Start(ctx.Done()) ctx, cancel := context.WithTimeout(context.Background(), DefaultResyncPeriod) @@ -24,7 +25,7 @@ func WaitForCacheSyncOrDie(ctx context.Context, dc dynamicinformer.DynamicShared err := hasSynced(ctx, dc.WaitForCacheSync) if err != nil { - log.Fatalf("Failed to sync informer caches: %v", err) + logger.WithContext().Fatalw("Failed to sync informer caches", "error", err) } } diff --git a/pkg/legacy-events/helpers.go b/pkg/legacy-events/helpers.go index 595effb..954d6ff 100644 --- a/pkg/legacy-events/helpers.go +++ b/pkg/legacy-events/helpers.go @@ -6,7 +6,7 @@ import ( "net/http" "strings" - log "github.com/sirupsen/logrus" + kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" @@ -21,6 +21,8 @@ const ( // eventTypeFormatWithoutPrefix must have at least 3 segments separated by dots in the form of: // .. eventTypeFormatWithoutPrefix = "%s.%s.%s" + + legacyEventsName = "legacy-events" ) // ParseApplicationNameFromPath returns application name from the URL. @@ -58,7 +60,11 @@ func writeJSONResponse(w http.ResponseWriter, resp *api.PublishEventResponses) { return } - log.Errorf("received an empty response") + // init the contexted logger + logger, _ := kymalogger.New("json", "error") + namedLogger := logger.WithContext().Named(legacyEventsName) + + namedLogger.Error("Received an empty response") } // formatEventType joins the given prefix, application, eventType and version with a "." as a separator. diff --git a/pkg/legacy-events/legacy.go b/pkg/legacy-events/legacy.go index 3e56d0c..b5724b0 100644 --- a/pkg/legacy-events/legacy.go +++ b/pkg/legacy-events/legacy.go @@ -165,7 +165,7 @@ func (t *Transformer) convertPublishRequestToCloudEvent(appName string, publishR event.SetTime(evTime) if err := event.SetData(internal.ContentTypeApplicationJSON, publishRequest.PublishrequestV1.Data); err != nil { - return nil, errors.Wrap(err, "failed to set data to CE data field") + return nil, errors.Wrap(err, "failed to set data to CloudEvent data field") } // set the event id from the request if it is available diff --git a/pkg/metrics/server.go b/pkg/metrics/server.go index 496f08a..900c479 100644 --- a/pkg/metrics/server.go +++ b/pkg/metrics/server.go @@ -6,16 +6,20 @@ import ( "net/http" "strings" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "go.uber.org/zap" + "github.com/prometheus/client_golang/prometheus/promhttp" - "github.com/sirupsen/logrus" ) +const metricsServerLoggerName = "metrics-server" + type Server struct { srv http.Server - logger *logrus.Logger + logger *logger.Logger } -func NewServer(logger *logrus.Logger) *Server { +func NewServer(logger *logger.Logger) *Server { return &Server{logger: logger} } @@ -28,7 +32,7 @@ func (s *Server) Start(address string) error { return err } - s.logger.Infof("Metrics server started on %v", address) + s.namedLogger().Infof("Metrics server started on %v", address) go s.srv.Serve(listener) //nolint:errcheck } @@ -37,6 +41,9 @@ func (s *Server) Start(address string) error { func (s *Server) Stop() { if err := s.srv.Shutdown(context.Background()); err != nil { - s.logger.Infof("Metrics server failed to shutdown with error: %v", err) + s.namedLogger().Warnw("Failed to shutdown metrics server", "error", err) } } +func (s *Server) namedLogger() *zap.SugaredLogger { + return s.logger.WithContext().Named(metricsServerLoggerName) +} diff --git a/pkg/receiver/receiver.go b/pkg/receiver/receiver.go index a00155d..88f8ec5 100644 --- a/pkg/receiver/receiver.go +++ b/pkg/receiver/receiver.go @@ -7,7 +7,7 @@ import ( "net/http" "time" - "github.com/sirupsen/logrus" + kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" "go.opencensus.io/plugin/ochttp" ) @@ -15,6 +15,8 @@ import ( const ( // defaultShutdownTimeout is the default timeout for the receiver to shutdown. defaultShutdownTimeout = time.Minute * 1 + + receiverName = "receiver" ) // HTTPMessageReceiver is responsible for receiving messages over HTTP. @@ -31,7 +33,7 @@ func NewHTTPMessageReceiver(port int) *HTTPMessageReceiver { } // StartListen starts the HTTP message receiver and blocks until it receives a shutdown signal. -func (recv *HTTPMessageReceiver) StartListen(ctx context.Context, handler http.Handler) error { +func (recv *HTTPMessageReceiver) StartListen(ctx context.Context, handler http.Handler, logger *kymalogger.Logger) error { var err error if recv.listener, err = net.Listen("tcp", fmt.Sprintf(":%d", recv.port)); err != nil { return err @@ -47,7 +49,11 @@ func (recv *HTTPMessageReceiver) StartListen(ctx context.Context, handler http.H go func() { errChan <- recv.server.Serve(recv.listener) }() - logrus.Info("Event Publisher Receiver has started.") + + // init the contexted logger + namedLogger := logger.WithContext().Named(receiverName) + + namedLogger.Info("Event Publisher Receiver has started.") // wait for the server to return or ctx.Done(). select { diff --git a/pkg/receiver/receiver_test.go b/pkg/receiver/receiver_test.go index 7d59a5f..abbc7cc 100644 --- a/pkg/receiver/receiver_test.go +++ b/pkg/receiver/receiver_test.go @@ -7,6 +7,8 @@ import ( "testing" "time" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) @@ -32,7 +34,7 @@ func TestNewHttpMessageReceiver(t *testing.T) { func TestStartListener(t *testing.T) { timeout := time.Second * 10 r := fixtureReceiver() - + mockedLogger, _ := logger.New("json", "info") ctx := context.Background() // used to simulate sending a stop signal @@ -47,7 +49,7 @@ func TestStartListener(t *testing.T) { defer wg.Done() start <- true t.Log("starting receiver in goroutine") - if err := r.StartListen(ctx, &testHandler{}); err != nil { + if err := r.StartListen(ctx, &testHandler{}, mockedLogger); err != nil { t.Errorf("error while starting HTTPMessageReceiver: %v", err) } t.Log("receiver goroutine ends here") diff --git a/pkg/sender/jetstream.go b/pkg/sender/jetstream.go index 136ea7f..328bab0 100644 --- a/pkg/sender/jetstream.go +++ b/pkg/sender/jetstream.go @@ -7,11 +7,18 @@ import ( "fmt" "net/http" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "go.uber.org/zap" + "github.com/cloudevents/sdk-go/v2/event" "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/nats-io/nats.go" - "github.com/sirupsen/logrus" +) + +const ( + natsBackend = "nats" + jestreamHandlerName = "jetstream-handler" ) // compile time check @@ -20,13 +27,13 @@ var _ GenericSender = &JetstreamMessageSender{} // JetstreamMessageSender is responsible for sending messages over HTTP. type JetstreamMessageSender struct { ctx context.Context - logger *logrus.Logger + logger *logger.Logger connection *nats.Conn envCfg *env.NatsConfig } // NewJetstreamMessageSender returns a new NewJetstreamMessageSender instance with the given nats connection. -func NewJetstreamMessageSender(ctx context.Context, connection *nats.Conn, envCfg *env.NatsConfig, logger *logrus.Logger) *JetstreamMessageSender { +func NewJetstreamMessageSender(ctx context.Context, connection *nats.Conn, envCfg *env.NatsConfig, logger *logger.Logger) *JetstreamMessageSender { return &JetstreamMessageSender{ctx: ctx, connection: connection, envCfg: envCfg, logger: logger} } @@ -60,10 +67,10 @@ func (s *JetstreamMessageSender) Send(_ context.Context, event *event.Event) (in } // send the event - s.logger.Infof("Sending to NATS in Jetstream mode: %v, stream name: %s", event, s.envCfg.JSStreamName) + s.namedLogger().Infof("Sending event:%v to backend, stream name:%s", event, s.envCfg.JSStreamName) _, err = jsCtx.PublishMsg(msg) if err != nil { - s.logger.Errorf("Cannot send event to NATS Jetsteram: %v", err) + s.namedLogger().Errorw("Cannot send event to backend", "error", err) return http.StatusInternalServerError, err } return http.StatusNoContent, nil @@ -76,10 +83,10 @@ func (s *JetstreamMessageSender) streamExists(connection *nats.Conn) (bool, erro return false, err } if info, err := jsCtx.StreamInfo(s.envCfg.JSStreamName); err == nil { - s.logger.Infof("Stream %s exists, using it for publishing", info.Config.Name) + s.namedLogger().Infof("Stream %s exists, using it for publishing", info.Config.Name) return true, nil } else if err != nats.ErrStreamNotFound { - s.logger.Debug("The connection to NATs server is not established!") + s.namedLogger().Debug("The connection to NATS server is not established!") return false, err } return false, nats.ErrStreamNotFound @@ -110,3 +117,7 @@ func (s *JetstreamMessageSender) eventToNatsMsg(event *event.Event) (*nats.Msg, func (s *JetstreamMessageSender) getJsSubjectToPublish(subject string) string { return fmt.Sprintf("%s.%s", env.JetstreamSubjectPrefix, subject) } + +func (s *JetstreamMessageSender) namedLogger() *zap.SugaredLogger { + return s.logger.WithContext().Named(jestreamHandlerName).With("backend", natsBackend, "jetstream enabled", true) +} diff --git a/pkg/sender/jetstream_test.go b/pkg/sender/jetstream_test.go index a90a603..e356253 100644 --- a/pkg/sender/jetstream_test.go +++ b/pkg/sender/jetstream_test.go @@ -8,6 +8,8 @@ import ( "testing" "time" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/stretchr/testify/require" "github.com/cloudevents/sdk-go/v2/event" @@ -18,7 +20,6 @@ import ( testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" "github.com/nats-io/nats-server/v2/server" "github.com/nats-io/nats.go" - "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" ) @@ -57,7 +58,7 @@ func TestJetstreamMessageSender(t *testing.T) { t.Run(tc.name, func(t *testing.T) { // given testEnv := setupTestEnvironment(t) - natsServer, connection := testEnv.Server, testEnv.Connection + natsServer, connection, mockedLogger := testEnv.Server, testEnv.Connection, testEnv.Logger defer func() { natsServer.Shutdown() @@ -72,7 +73,7 @@ func TestJetstreamMessageSender(t *testing.T) { // when ctx := context.Background() - sender := NewJetstreamMessageSender(context.Background(), connection, testEnv.Config, logrus.New()) + sender := NewJetstreamMessageSender(context.Background(), connection, testEnv.Config, mockedLogger) if tc.givenNatsConnectionClosed { connection.Close() @@ -81,7 +82,7 @@ func TestJetstreamMessageSender(t *testing.T) { // then status, err := sender.Send(ctx, ce) - testEnv.Logger.Errorf("err: %v", err) + testEnv.Logger.WithContext().Errorf("err: %v", err) assert.Equal(t, tc.wantError, err != nil) assert.Equal(t, tc.wantStatusCode, status) }) @@ -155,7 +156,7 @@ func TestStreamExists(t *testing.T) { type TestEnvironment struct { Connection *nats.Conn Config *env.NatsConfig - Logger *logrus.Logger + Logger *logger.Logger Sender *JetstreamMessageSender Server *server.Server JsContext *nats.JetStreamContext @@ -171,20 +172,23 @@ func setupTestEnvironment(t *testing.T) *TestEnvironment { require.NoError(t, err) natsConfig := CreateNatsJsConfig(natsServer.ClientURL()) - logger := logrus.New() + + mockedLogger, err := logger.New("json", "info") + require.NoError(t, err) + jsCtx, err := connection.JetStream() require.NoError(t, err) sender := &JetstreamMessageSender{ connection: connection, envCfg: natsConfig, - logger: logger, + logger: mockedLogger, } return &TestEnvironment{ Connection: connection, Config: natsConfig, - Logger: logger, + Logger: mockedLogger, Sender: sender, Server: natsServer, JsContext: &jsCtx, diff --git a/pkg/sender/nats.go b/pkg/sender/nats.go index cd54a4e..47b23e6 100644 --- a/pkg/sender/nats.go +++ b/pkg/sender/nats.go @@ -5,11 +5,12 @@ import ( "errors" "net/http" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + cenats "github.com/cloudevents/sdk-go/protocol/nats/v2" cev2 "github.com/cloudevents/sdk-go/v2" "github.com/cloudevents/sdk-go/v2/event" "github.com/nats-io/nats.go" - "github.com/sirupsen/logrus" ) // compile time check @@ -23,12 +24,12 @@ type GenericSender interface { // NatsMessageSender is responsible for sending messages over HTTP. type NatsMessageSender struct { ctx context.Context - logger *logrus.Logger + logger *logger.Logger connection *nats.Conn } // NewNatsMessageSender returns a new NewNatsMessageSender instance with the given nats connection. -func NewNatsMessageSender(ctx context.Context, connection *nats.Conn, logger *logrus.Logger) *NatsMessageSender { +func NewNatsMessageSender(ctx context.Context, connection *nats.Conn, logger *logger.Logger) *NatsMessageSender { return &NatsMessageSender{ctx: ctx, connection: connection, logger: logger} } diff --git a/pkg/sender/nats_test.go b/pkg/sender/nats_test.go index 80971f6..ffdf222 100644 --- a/pkg/sender/nats_test.go +++ b/pkg/sender/nats_test.go @@ -7,7 +7,8 @@ import ( "testing" "time" - "github.com/sirupsen/logrus" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/stretchr/testify/assert" pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" @@ -60,8 +61,10 @@ func TestNatsMessageSender(t *testing.T) { ce := createCloudEvent(t) + mockedLogger, _ := logger.New("json", "info") + ctx := context.Background() - sender := NewNatsMessageSender(context.Background(), connection, logrus.New()) + sender := NewNatsMessageSender(context.Background(), connection, mockedLogger) if tc.givenNatsConnectionClosed { connection.Close() diff --git a/pkg/subscribed/processor.go b/pkg/subscribed/processor.go index bee6bd2..bd6f7ae 100644 --- a/pkg/subscribed/processor.go +++ b/pkg/subscribed/processor.go @@ -3,24 +3,28 @@ package subscribed import ( "net/http" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "go.uber.org/zap" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" ) +const processorName = "processor" + type Processor struct { SubscriptionLister *cache.GenericLister Config *env.BebConfig - Logger *logrus.Logger + Logger *logger.Logger } func (p Processor) ExtractEventsFromSubscriptions(writer http.ResponseWriter, request *http.Request) { eventsMap := make(map[Event]bool) subsList, err := (*p.SubscriptionLister).List(labels.Everything()) if err != nil { - p.Logger.Errorf("failed to fetch subscriptions: %v", err) + p.namedLogger().Errorw("Failed to fetch subscriptions", "error", err) RespondWithErrorAndLog(err, writer) return } @@ -29,7 +33,7 @@ func (p Processor) ExtractEventsFromSubscriptions(writer http.ResponseWriter, re for _, sObj := range subsList { sub, err := ConvertRuntimeObjToSubscription(sObj) if err != nil { - p.Logger.Errorf("failed to convert a runtime obj to a Subscription: %v", err) + p.namedLogger().Errorw("Failed to convert a runtime obj to a Subscription", "error", err) continue } if sub.Spec.Filter != nil { @@ -42,3 +46,7 @@ func (p Processor) ExtractEventsFromSubscriptions(writer http.ResponseWriter, re EventsInfo: events, }, http.StatusOK) } + +func (p Processor) namedLogger() *zap.SugaredLogger { + return p.Logger.WithContext().Named(processorName) +} diff --git a/pkg/subscribed/response.go b/pkg/subscribed/response.go index 855c59e..43cc085 100644 --- a/pkg/subscribed/response.go +++ b/pkg/subscribed/response.go @@ -4,37 +4,40 @@ import ( "encoding/json" "net/http" - "github.com/sirupsen/logrus" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "go.uber.org/zap" "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" ) +const responseName = "response" + // RespondWithBody sends http response with json body func RespondWithBody(w http.ResponseWriter, events Events, httpCode int) { respond(w, httpCode) if err := json.NewEncoder(w).Encode(events); err != nil { - logrus.Errorln(err) + namedLogger().Error(err) } } // RespondWithErrorAndLog logs error and sends http response with error json body func RespondWithErrorAndLog(e error, w http.ResponseWriter) { - logrus.Errorln(e.Error()) + namedLogger().Error(e.Error()) respond(w, http.StatusInternalServerError) err := json.NewEncoder(w).Encode(legacy.HTTPErrorResponse{ Code: http.StatusInternalServerError, Error: e.Error(), }) if err != nil { - logrus.Errorln(err) + namedLogger().Error(err) } } func respond(w http.ResponseWriter, httpCode int) { w.Header().Set(internal.HeaderContentType, internal.ContentTypeApplicationJSON) w.WriteHeader(httpCode) - logrus.Infof("Response code from \"subscribed\" request: HTTP %d", httpCode) + namedLogger().Infof("Response code from \"subscribed\" request: HTTP %d", httpCode) } // Events represents collection of all events with subscriptions @@ -47,3 +50,8 @@ type Event struct { Name string `json:"name"` Version string `json:"version"` } + +func namedLogger() *zap.SugaredLogger { + log, _ := logger.New("json", "info") + return log.WithContext().Named(responseName) +} diff --git a/testing/nats.go b/testing/nats.go index 66e673f..bc93d5b 100644 --- a/testing/nats.go +++ b/testing/nats.go @@ -6,8 +6,9 @@ import ( "testing" "time" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" - "github.com/sirupsen/logrus" cev2 "github.com/cloudevents/sdk-go/v2/event" "github.com/nats-io/nats-server/v2/server" @@ -37,10 +38,12 @@ func StartNatsServer(enableJetstream bool) *server.Server { opts := test.DefaultTestOptions opts.Port = server.RANDOM_PORT opts.JetStream = enableJetstream + + log, _ := logger.New("json", "info") if enableJetstream { - logrus.New().Info("Starting test NATS Server in Jetstream mode") + log.WithContext().Info("Starting test NATS Server in Jetstream mode") } else { - logrus.New().Info("Starting test NATS Server in default mode") + log.WithContext().Info("Starting test NATS Server in default mode") } return test.RunServer(&opts) } From 25c57c6afae6dd15db8cbe1c7050f3a808970826 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Jul 2022 11:45:45 +0200 Subject: [PATCH 086/194] gomod(deps): bump github.com/stretchr/testify from 1.7.5 to 1.8.0 in /components/event-publisher-proxy (#14711) * gomod(deps): bump github.com/stretchr/testify Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.7.5 to 1.8.0. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.7.5...v1.8.0) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump image Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raymond --- go.mod | 4 ++-- go.sum | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c35d1ce..71489a6 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,6 @@ require ( github.com/cloudevents/sdk-go/v2 v2.10.1 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/common/logging v0.0.0-20220628153305-4e32e8abea0f github.com/kyma-project/kyma/components/application-operator v0.0.0-20220620092658-f1f8e3668674 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220629063704-83cc2f69ed02 github.com/nats-io/nats-server/v2 v2.8.4 @@ -15,7 +14,7 @@ require ( github.com/onsi/gomega v1.19.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.2 - github.com/stretchr/testify v1.7.5 + github.com/stretchr/testify v1.8.0 go.opencensus.io v0.23.0 go.uber.org/zap v1.21.0 golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb @@ -49,6 +48,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.14.4 // indirect + github.com/kyma-project/kyma/common/logging v0.0.0-20220628153305-4e32e8abea0f // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/minio/highwayhash v1.0.2 // indirect diff --git a/go.sum b/go.sum index fac264d..83e8af2 100644 --- a/go.sum +++ b/go.sum @@ -791,8 +791,9 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q= github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= From 24c9dd8916a2303bfe47622c48ee9b113a69e7f7 Mon Sep 17 00:00:00 2001 From: VladislavPaskar <15933100+VladislavPaskar@users.noreply.github.com> Date: Mon, 4 Jul 2022 09:03:47 +0200 Subject: [PATCH 087/194] Standardize the logs in the eventing controller (#14725) * standardize the logs, fix some error messages, remove redundant logs * remove todo --- cmd/event-publisher-proxy/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index 98fc407..96cf626 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -59,7 +59,7 @@ func main() { } defer func() { if err := logger.WithContext().Sync(); err != nil { - golog.Fatalf("Failed to flush logger, error: %v", err) + golog.Printf("Failed to flush logger, error: %v", err) } }() setupLogger := logger.WithContext().With("backend", cfg.Backend, "jetstream mode", cfg.JetstreamModeEnabled) From 9d131f639f1a3e617e7ce1683a3495fd0b200a83 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Jul 2022 16:51:05 +0200 Subject: [PATCH 088/194] gomod(deps): bump sigs.k8s.io/controller-runtime from 0.12.2 to 0.12.3 in /components/event-publisher-proxy (#14771) * gomod(deps): bump sigs.k8s.io/controller-runtime Bumps [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) from 0.12.2 to 0.12.3. - [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases) - [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/master/RELEASE.md) - [Commits](https://github.com/kubernetes-sigs/controller-runtime/compare/v0.12.2...v0.12.3) --- updated-dependencies: - dependency-name: sigs.k8s.io/controller-runtime dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump image Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raymond --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 71489a6..566c23d 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( k8s.io/api v0.24.2 k8s.io/apimachinery v0.24.2 k8s.io/client-go v0.24.2 - sigs.k8s.io/controller-runtime v0.12.2 + sigs.k8s.io/controller-runtime v0.12.3 ) require ( diff --git a/go.sum b/go.sum index 83e8af2..dc55ce3 100644 --- a/go.sum +++ b/go.sum @@ -1453,8 +1453,9 @@ sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+a sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= -sigs.k8s.io/controller-runtime v0.12.2 h1:nqV02cvhbAj7tbt21bpPpTByrXGn2INHRsi39lXy9sE= sigs.k8s.io/controller-runtime v0.12.2/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0= +sigs.k8s.io/controller-runtime v0.12.3 h1:FCM8xeY/FI8hoAfh/V4XbbYMY20gElh9yh+A98usMio= +sigs.k8s.io/controller-runtime v0.12.3/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0= sigs.k8s.io/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I= 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= From 1d2821e5319b67c932701cde2167ccac52c9ab35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Jul 2022 13:59:38 +0200 Subject: [PATCH 089/194] gomod(deps): bump k8s.io/client-go from 0.24.2 to 0.24.3 in /components/event-publisher-proxy (#14816) * gomod(deps): bump k8s.io/client-go in /components/event-publisher-proxy Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.24.2 to 0.24.3. - [Release notes](https://github.com/kubernetes/client-go/releases) - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes/client-go/compare/v0.24.2...v0.24.3) --- updated-dependencies: - dependency-name: k8s.io/client-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * bump image * retrigger jobs Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raymond --- go.mod | 6 +++--- go.sum | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 566c23d..3e208bc 100644 --- a/go.mod +++ b/go.mod @@ -18,9 +18,9 @@ require ( go.opencensus.io v0.23.0 go.uber.org/zap v1.21.0 golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb - k8s.io/api v0.24.2 - k8s.io/apimachinery v0.24.2 - k8s.io/client-go v0.24.2 + k8s.io/api v0.24.3 + k8s.io/apimachinery v0.24.3 + k8s.io/client-go v0.24.3 sigs.k8s.io/controller-runtime v0.12.3 ) diff --git a/go.sum b/go.sum index dc55ce3..fc57584 100644 --- a/go.sum +++ b/go.sum @@ -1408,8 +1408,9 @@ k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.9/go.mod h1:IoH7exYnoH/zgvHOuVxh2c4yJepcCBt72FzCTisOc4k= -k8s.io/client-go v0.24.2 h1:CoXFSf8if+bLEbinDqN9ePIDGzcLtqhfd6jpfnwGOFA= k8s.io/client-go v0.24.2/go.mod h1:zg4Xaoo+umDsfCWr4fCnmLEtQXyCNXCvJuSsglNcV30= +k8s.io/client-go v0.24.3 h1:Nl1840+6p4JqkFWEW2LnMKU667BUxw03REfLAVhuKQY= +k8s.io/client-go v0.24.3/go.mod h1:AAovolf5Z9bY1wIg2FZ8LPQlEdKHjLI7ZD4rw920BJw= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.24.2/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= k8s.io/component-base v0.24.2/go.mod h1:ucHwW76dajvQ9B7+zecZAP3BVqvrHoOxm8olHEg0nmM= From b9a6287a06f0b134199741d9361932da4b9af96d Mon Sep 17 00:00:00 2001 From: Friedrich Date: Fri, 22 Jul 2022 16:05:38 +0200 Subject: [PATCH 090/194] bump golang version and dependencies in `eventing-publisher-proxy` (#14840) * bump golang version and k8s packages version * bump image --- go.mod | 14 +- go.sum | 738 +-------------------------------------------------------- 2 files changed, 11 insertions(+), 741 deletions(-) diff --git a/go.mod b/go.mod index 3e208bc..03f4cd9 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy -go 1.17 +go 1.18 require ( github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1 @@ -87,12 +87,12 @@ require ( replace ( // keep all following packages at the same version - k8s.io/api => k8s.io/api v0.24.2 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.24.2 - k8s.io/apimachinery => k8s.io/apimachinery v0.24.2 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.24.2 - k8s.io/component-base => k8s.io/component-base v0.24.2 - k8s.io/kubectl => k8s.io/kubectl v0.24.2 + k8s.io/api => k8s.io/api v0.24.3 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.24.3 + k8s.io/apimachinery => k8s.io/apimachinery v0.24.3 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.24.3 + k8s.io/component-base => k8s.io/component-base v0.24.3 + k8s.io/kubectl => k8s.io/kubectl v0.24.3 ) replace ( diff --git a/go.sum b/go.sum index fc57584..0b6c06c 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -28,7 +27,6 @@ cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4g cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -39,112 +37,34 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= -github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= -github.com/Masterminds/squirrel v1.5.0/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= -github.com/Masterminds/vcs v1.13.1/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA= -github.com/Microsoft/go-winio v0.4.16-0.20201130162521-d1ffc52c7331/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= -github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053/go.mod h1:xW8sBma2LE3QxFSzCnH9qe6gAE2yO9GvQaWwX89HxbE= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= -github.com/avast/retry-go v2.4.1+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= -github.com/avast/retry-go/v3 v3.1.1/go.mod h1:6cXRK369RpzFL3UQGqIUp9Q7GDrams+KsYWrfNA1/nQ= -github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= -github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= -github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= -github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= -github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= -github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= -github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1 h1:vhMEC9zc6nIw3HwxaFZF/lT/uTftXx9h++f0KyXJazM= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1/go.mod h1:9l2pSSkH9AvMCwK8Rscwqtsni30UIWNj/EmgtmaRMmc= @@ -153,178 +73,57 @@ github.com/cloudevents/sdk-go/v2 v2.10.1/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8 github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= -github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= -github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= -github.com/containerd/containerd v1.4.4/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= -github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= -github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR3BEg7bDFaEddKm54WSmrol1fKWDU1nKYkgrcgZT7Y= -github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= -github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= -github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= -github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= -github.com/deislabs/oras v0.11.1/go.mod h1:39lCtf8Q6WDC7ul9cnyWXONNzKvabEKk+AX+L0ImnQk= -github.com/denisenkom/go-mssqldb v0.0.0-20191001013358-cfbb681360f0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= -github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= -github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/cli v20.10.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v0.0.0-20191216044856-a8371794149d/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= -github.com/docker/docker v20.10.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= -github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= -github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= -github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= -github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= -github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -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-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.3.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v0.2.0/go.mod h1:qhKdvif7YF5GI9NWEpyxTSSBdGmzkNguibrdCNVPunU= github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= -github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= -github.com/gobuffalo/flect v0.2.2/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= -github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= -github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= -github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godror/godror v0.13.3/go.mod h1:2ouUT4kdhUBk7TAkHWD4SN0CdI0pgEQbo8FVHhbSKWg= -github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -338,7 +137,6 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -357,13 +155,9 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/cel-go v0.10.1/go.mod h1:U7ayypeSkw23szu4GaQTPJGx66c20mx8JklMSxrmI1w= -github.com/google/cel-spec v0.6.0/go.mod h1:Nwjgxy5CbjlPrtCWjeDjUyKMl8w41YBYGjsyDdqk0xA= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -396,198 +190,67 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= -github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= -github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= -github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= -github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmoiron/sqlx v1.3.1/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4= github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -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 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubernetes-sigs/go-open-service-broker-client v0.0.0-20200527163240-4406bd2cb6b8/go.mod h1:5VFrdwwxqkzCF3pL7MY5Om1btQ6UsxO87DyjZFO0s5M= -github.com/kubernetes-sigs/service-catalog v0.3.1/go.mod h1:MUAf+rdT06kiNpLXRAIqtPHC3Kgkw63YziVj1VMu3HM= -github.com/kyma-incubator/api-gateway v0.0.0-20220318061314-9fd030a8cbd1/go.mod h1:2UUHTqQkCTzi+og/+EV6lPKxFAnKl36ogWCQOxDIVUg= -github.com/kyma-project/kyma/common/logging v0.0.0-20220617175450-95d343ae2760/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= github.com/kyma-project/kyma/common/logging v0.0.0-20220628153305-4e32e8abea0f h1:fn0t/cGeKkLnnwzOfRsjRWuOR3p5wROX7D8hT1yqff0= github.com/kyma-project/kyma/common/logging v0.0.0-20220628153305-4e32e8abea0f/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220617175450-95d343ae2760/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220620092658-f1f8e3668674 h1:IykN2HIrBgDX/Wt9bsn5JqoPGMMLi01pgcA3RpKYZfQ= github.com/kyma-project/kyma/components/application-operator v0.0.0-20220620092658-f1f8e3668674/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220629063704-83cc2f69ed02 h1:NAOwgzmxux3i5fmfEbG15q6ZRd5vx7opu88mR8LktJw= github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220629063704-83cc2f69ed02/go.mod h1:ys6m65CYDhSwFymBd6OLUW0ZgAZowD+Y6oUzXF+o6X0= -github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= -github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= -github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= -github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= -github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= 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/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-oci8 v0.0.7/go.mod h1:wjDx6Xm9q7dFtHJvIlrI99JytznLw5wQ4R+9mNXJwGI= -github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-shellwords v1.0.11/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= -github.com/mattn/go-sqlite3 v1.12.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/copystructure v1.1.1/go.mod h1:EBArHfARyrSWO/+Wyr9zwEkc6XMFB9XyNgFNmRkZZU4= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/sys/mountinfo v0.4.0/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -595,256 +258,78 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/jwt v1.2.2 h1:w3GMTO969dFg+UOKTmmyuu7IGdusK+7Ytlt//OYH/uU= github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28gth9P+wV2K/zYUUAkJ+55U8cpS0p5I= github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= -github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= github.com/nats-io/nats-server/v2 v2.8.4 h1:0jQzze1T9mECg8YZEl8+WYUXb9JKluJfCBriPUtluB4= github.com/nats-io/nats-server/v2 v2.8.4/go.mod h1:8zZa+Al3WsESfmgSs98Fi06dRWLH5Bnq90m5bKD/eT4= -github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nats.go v1.15.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nats.go v1.16.0 h1:zvLE7fGBQYW6MWaFaRdsgm9qT39PJDQoju+DS8KsO1g= github.com/nats-io/nats.go v1.16.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= -github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= -github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= -github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg= -github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= -github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= -github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= -github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= -github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= -github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= -github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/ory/oathkeeper-maester v0.1.0/go.mod h1:O692MD+MJP3dx0QUV1iOcSPxczdRZEj5WauFaD1vy7U= -github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= -github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/peterbourgon/mergemap v0.0.0-20130613134717-e21c03b7a721/go.mod h1:jQyRpOpE/KbvPc0VKXjAqctYglwUO5W6zAcGcFfbvlo= -github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= -github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= -github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= 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.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= 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.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rubenv/sql-migrate v0.0.0-20200616145509-8d140a17f351/go.mod h1:DCgfY80j8GYL7MLEfvcpSFvjD0L5yZq/aZUJmhZklyg= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= -github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= -github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= -github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/vrischmann/envconfig v1.1.0/go.mod h1:c5DuUlkzfsnspy1g7qiqryPCsW+NjsrLsYq4zhwsoHo= -github.com/vrischmann/envconfig v1.3.0/go.mod h1:bbvxFYJdRSpXrhS63mBFtKJzkDiNkyArOLXtY6q0kuI= -github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= -github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= -github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= -github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= -go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.etcd.io/etcd/client/v3 v3.5.1/go.mod h1:OnjH4M8OnAotwaB2l9bVgZzRFKru7/ZMoS46OtKyd3Q= -go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -853,46 +338,22 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= -go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= -go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 h1:tkVvjkPTB7pnW3jnid7kNyAMPVWllTNOf/qKDze4p9o= @@ -920,7 +381,6 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -932,30 +392,19 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -974,20 +423,13 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -1002,7 +444,6 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g= @@ -1018,49 +459,25 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190602015325-4c4f7f33c9ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1068,50 +485,33 @@ golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200509044756-6aff5f38e54f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1122,45 +522,31 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1168,7 +554,6 @@ golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1184,7 +569,6 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -1194,24 +578,15 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.10-0.20220218145154-897bd77cd717/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= -gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= -gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= -google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -1233,9 +608,7 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -1243,13 +616,11 @@ google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= 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/cloud v0.0.0-20151119220103-975617b05ea8/go.mod h1:0H1ncTHf11KCFhTc/+EFRbzSCOZx+VUbRMk55Yv5MYk= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= @@ -1266,10 +637,8 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -1278,9 +647,7 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201102152239-715cce707fb0/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1289,38 +656,24 @@ google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.28.1/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1337,48 +690,28 @@ google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+Rur google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/gorp.v1 v1.7.2/go.mod h1:Wo3h+DBQZIxATwftsglhdD/62zRFPhGhTiu5jUJmCaw= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -helm.sh/helm/v3 v3.6.3/go.mod h1:mIIus8EOqj+obtycw3sidsR4ORr2aFDmXMSI3k+oeVY= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1386,96 +719,33 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -istio.io/api v0.0.0-20210318170531-e6e017e575c5/go.mod h1:88HN3o1fSD1jo+Z1WTLlJfMm9biopur6Ct9BFKjiB64= -istio.io/api v0.0.0-20210416170358-17514f58eeeb/go.mod h1:nsSFw1LIMmGL7r/+6fJI6FxeG/UGlLxRK8bkojIvBVs= -istio.io/client-go v1.9.2/go.mod h1:BfOsn8V/wjBKFqEheQqLqx1r3pjDeYPsQnTU5yWjb1Y= -istio.io/gogo-genproto v0.0.0-20190930162913-45029607206a/go.mod h1:OzpAts7jljZceG4Vqi5/zXy/pOg1b209T3jb7Nv5wIs= -istio.io/gogo-genproto v0.0.0-20210113155706-4daf5697332f/go.mod h1:6BwTZRNbWS570wHX/uR1Wqk5e0157TofTAUMzT7N4+s= -k8s.io/api v0.24.2 h1:g518dPU/L7VRLxWfcadQn2OnsiGWVOadTLpdnqgY2OI= -k8s.io/api v0.24.2/go.mod h1:AHqbSkTm6YrQ0ObxjO3Pmp/ubFF/KuM7jU+3khoBsOg= -k8s.io/apiextensions-apiserver v0.24.2/go.mod h1:e5t2GMFVngUEHUd0wuCJzw8YDwZoqZfJiGOW6mm2hLQ= -k8s.io/apimachinery v0.24.2 h1:5QlH9SL2C8KMcrNJPor+LbXVTaZRReml7svPEh4OKDM= -k8s.io/apimachinery v0.24.2/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= -k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= -k8s.io/apiserver v0.21.0/go.mod h1:w2YSn4/WIwYuxG5zJmcqtRdtqgW/J2JRgFAqps3bBpg= -k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU= -k8s.io/apiserver v0.24.2/go.mod h1:pSuKzr3zV+L+MWqsEo0kHHYwCo77AT5qXbFXP2jbvFI= -k8s.io/cli-runtime v0.24.2/go.mod h1:1LIhKL2RblkhfG4v5lZEt7FtgFG5mVb8wqv5lE9m5qY= -k8s.io/client-go v0.17.8/go.mod h1:SJsDS64AAtt9VZyeaQMb4Ck5etCitZ/FwajWdzua5eY= -k8s.io/client-go v0.18.2/go.mod h1:Xcm5wVGXX9HAA2JJ2sSBUn3tCJ+4SVlCbl2MNNv+CIU= -k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= -k8s.io/client-go v0.20.2/go.mod h1:kH5brqWqp7HDxUFKoEgiI4v8G1xzbe9giaCenUWJzgE= -k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA= -k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= -k8s.io/client-go v0.22.9/go.mod h1:IoH7exYnoH/zgvHOuVxh2c4yJepcCBt72FzCTisOc4k= -k8s.io/client-go v0.24.2/go.mod h1:zg4Xaoo+umDsfCWr4fCnmLEtQXyCNXCvJuSsglNcV30= +k8s.io/api v0.24.3 h1:tt55QEmKd6L2k5DP6G/ZzdMQKvG5ro4H4teClqm0sTY= +k8s.io/api v0.24.3/go.mod h1:elGR/XSZrS7z7cSZPzVWaycpJuGIw57j9b95/1PdJNI= +k8s.io/apimachinery v0.24.3 h1:hrFiNSA2cBZqllakVYyH/VyEh4B581bQRmqATJSeQTg= +k8s.io/apimachinery v0.24.3/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= k8s.io/client-go v0.24.3 h1:Nl1840+6p4JqkFWEW2LnMKU667BUxw03REfLAVhuKQY= k8s.io/client-go v0.24.3/go.mod h1:AAovolf5Z9bY1wIg2FZ8LPQlEdKHjLI7ZD4rw920BJw= -k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= -k8s.io/code-generator v0.24.2/go.mod h1:dpVhs00hTuTdTY6jvVxvTFCk6gSMrtfRydbhZwHI15w= -k8s.io/component-base v0.24.2/go.mod h1:ucHwW76dajvQ9B7+zecZAP3BVqvrHoOxm8olHEg0nmM= -k8s.io/component-helpers v0.24.2/go.mod h1:TRQPBQKfmqkmV6c0HAmUs8cXVNYYYLsXy4zu8eODi9g= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/gengo v0.0.0-20211129171323-c02415ce4185/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= 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-20200121204235-bf4fb3bd569c/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= -k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= k8s.io/kube-openapi v0.0.0-20220603121420-31174f50af60 h1:cE/M8rmDQgibspuSm+X1iW16ByTImtEaapgaHoVSLX4= k8s.io/kube-openapi v0.0.0-20220603121420-31174f50af60/go.mod h1:ouUzE1U2mEv//HRoBwYLFE5pdqjIebvtX361vtEIlBI= -k8s.io/kubectl v0.24.2/go.mod h1:+HIFJc0bA6Tzu5O/YcuUt45APAxnNL8LeMuXwoiGsPg= -k8s.io/metrics v0.24.2/go.mod h1:5NWURxZ6Lz5gj8TFU83+vdWIVASx7W8lwPpHYCqopMo= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw= -sigs.k8s.io/controller-runtime v0.5.8/go.mod h1:UI/unU7Q+mo/rWBrND0NAaVNj/Xjh/+aqSv/M3njpmo= -sigs.k8s.io/controller-runtime v0.6.0/go.mod h1:CpYf5pdNY/B352A1TFLAS2JVSlnGQ5O2cftPHndTroo= -sigs.k8s.io/controller-runtime v0.8.3/go.mod h1:U/l+DUopBc1ecfRZ5aviA9JDmGFQKvLf5YkZNx2e0sU= -sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= -sigs.k8s.io/controller-runtime v0.12.2/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0= sigs.k8s.io/controller-runtime v0.12.3 h1:FCM8xeY/FI8hoAfh/V4XbbYMY20gElh9yh+A98usMio= sigs.k8s.io/controller-runtime v0.12.3/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0= -sigs.k8s.io/controller-tools v0.5.0/go.mod h1:JTsstrMpxs+9BUj6eGuAaEb6SDSPTeVtUyp0jmnAM/I= 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/kind v0.7.0/go.mod h1:An/AbWHT6pA/Lm0Og8j3ukGhfJP3RiVN/IBU6Lo3zl8= -sigs.k8s.io/kustomize/api v0.8.11/go.mod h1:a77Ls36JdfCWojpUqR6m60pdGY1AYFix4AH83nJtY1g= -sigs.k8s.io/kustomize/api v0.11.4/go.mod h1:k+8RsqYbgpkIrJ4p9jcdPqe8DprLxFUUO0yNOq8C+xI= -sigs.k8s.io/kustomize/cmd/config v0.10.6/go.mod h1:/S4A4nUANUa4bZJ/Edt7ZQTyKOY9WCER0uBS1SW2Rco= -sigs.k8s.io/kustomize/kustomize/v4 v4.5.4/go.mod h1:Zo/Xc5FKD6sHl0lilbrieeGeZHVYCA4BzxeAaLI05Bg= -sigs.k8s.io/kustomize/kyaml v0.11.0/go.mod h1:GNMwjim4Ypgp/MueD3zXHLRJEjz7RvtPae0AwlvEMFM= -sigs.k8s.io/kustomize/kyaml v0.13.6/go.mod h1:yHP031rn1QX1lr/Xd934Ri/xdVNG8BE2ECa78Ht/kEg= -sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= -sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= 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.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= -sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= From 606dfb7661225f0d74fd9998d67974a107bf4dae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Jul 2022 09:16:48 +0200 Subject: [PATCH 091/194] gomod(deps): bump github.com/onsi/gomega from 1.19.0 to 1.20.0 in /components/event-publisher-proxy (#14879) * gomod(deps): bump github.com/onsi/gomega Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.19.0 to 1.20.0. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.19.0...v1.20.0) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 10 +++++----- go.sum | 21 +++++++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 03f4cd9..144522a 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220629063704-83cc2f69ed02 github.com/nats-io/nats-server/v2 v2.8.4 github.com/nats-io/nats.go v1.16.0 - github.com/onsi/gomega v1.19.0 + github.com/onsi/gomega v1.20.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.2 github.com/stretchr/testify v1.8.0 @@ -42,7 +42,7 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.6 // indirect + github.com/google/go-cmp v0.5.8 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -67,13 +67,13 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.6.0 // indirect golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect - golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect - golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect + golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect + golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.27.1 // indirect + google.golang.org/protobuf v1.28.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 0b6c06c..339ccbe 100644 --- a/go.sum +++ b/go.sum @@ -171,8 +171,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -287,12 +287,12 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.1.3 h1:e/3Cwtogj0HA+25nMP1jCMDIf8RtRYbGwGGuBIFztkc= +github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= +github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -431,8 +431,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +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/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -507,8 +507,9 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc= +golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -586,7 +587,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -686,8 +686,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +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/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 59521b658c60f99603471fa870d2f663414b1743 Mon Sep 17 00:00:00 2001 From: VladislavPaskar <15933100+VladislavPaskar@users.noreply.github.com> Date: Fri, 29 Jul 2022 11:02:53 +0200 Subject: [PATCH 092/194] Add troubleshooting guide for how to free JS storage (#14908) * add troubleshooting guide for how to free JS storage, enhance EPP response in case of full storage * bump the image * apply review comments * add note message * Update docs/04-operation-guides/troubleshooting/eventing/evnt-04-free-jetstream-storage.md apply suggestion Co-authored-by: Nina Hingerl <76950046+NHingerl@users.noreply.github.com> Co-authored-by: Nina Hingerl <76950046+NHingerl@users.noreply.github.com> --- pkg/sender/jetstream.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/sender/jetstream.go b/pkg/sender/jetstream.go index 328bab0..f7bdba0 100644 --- a/pkg/sender/jetstream.go +++ b/pkg/sender/jetstream.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "net/http" + "strings" "github.com/kyma-project/kyma/components/eventing-controller/logger" "go.uber.org/zap" @@ -17,8 +18,9 @@ import ( ) const ( - natsBackend = "nats" - jestreamHandlerName = "jetstream-handler" + natsBackend = "nats" + jestreamHandlerName = "jetstream-handler" + noSpaceLeftErrMessage = "no space left on device" ) // compile time check @@ -71,6 +73,9 @@ func (s *JetstreamMessageSender) Send(_ context.Context, event *event.Event) (in _, err = jsCtx.PublishMsg(msg) if err != nil { s.namedLogger().Errorw("Cannot send event to backend", "error", err) + if strings.Contains(err.Error(), noSpaceLeftErrMessage) { + return http.StatusInsufficientStorage, err + } return http.StatusInternalServerError, err } return http.StatusNoContent, nil From 3cd602d45c55f16b1360627d39a3ce158a449e1e Mon Sep 17 00:00:00 2001 From: Friedrich Date: Mon, 1 Aug 2022 15:12:51 +0200 Subject: [PATCH 093/194] Add custom metrics to epp (#14936) * add status code and destination service to latency metric format * fix string conversion * extend destination service name * add request counter metric * fix mock temp * add comments * change method of calculating delay in ms * fix calculation of ms * bump image * undo changes on charts * adjust name of response code * obtain the destination service from the sender in nats and jetstream * add missing comments --- pkg/handler/beb/handler.go | 4 ++-- pkg/handler/nats/handler.go | 7 +++++-- pkg/metrics/collector.go | 30 +++++++++++++++++++++++++++--- pkg/sender/jetstream.go | 5 +++++ pkg/sender/nats.go | 6 ++++++ 5 files changed, 45 insertions(+), 7 deletions(-) diff --git a/pkg/handler/beb/handler.go b/pkg/handler/beb/handler.go index 7092556..6c561df 100644 --- a/pkg/handler/beb/handler.go +++ b/pkg/handler/beb/handler.go @@ -250,8 +250,8 @@ func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.D return http.StatusInternalServerError, dispatchTime, []byte{} } defer func() { _ = resp.Body.Close() }() - h.collector.RecordLatency(dispatchTime) - + h.collector.RecordLatency(dispatchTime, resp.StatusCode, request.URL.Host) + h.collector.RecordRequests(resp.StatusCode, request.URL.Host) body, err := ioutil.ReadAll(resp.Body) if err != nil { h.namedLogger().Errorw("Failed to read response body", "error", err) diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index b945422..d9aa836 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -25,7 +25,9 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing" ) -const natsHandlerName = "nats-handler" +const ( + natsHandlerName = "nats-handler" +) // Handler is responsible for receiving HTTP requests and dispatching them to NATS. // It also assures that the messages received are compliant with the Cloud Events spec. @@ -226,7 +228,8 @@ func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.D h.collector.RecordError() return resp, dispatchTime, []byte(err.Error()) } - h.collector.RecordLatency(dispatchTime) + h.collector.RecordLatency(dispatchTime, resp, s.URL()) + h.collector.RecordRequests(resp, s.URL()) return resp, dispatchTime, []byte{} } diff --git a/pkg/metrics/collector.go b/pkg/metrics/collector.go index 11eef5e..572ae37 100644 --- a/pkg/metrics/collector.go +++ b/pkg/metrics/collector.go @@ -1,6 +1,7 @@ package metrics import ( + "fmt" "time" "github.com/prometheus/client_golang/prometheus" @@ -13,12 +14,20 @@ const ( Latency = "event_publish_to_messaging_server_latency" // EventTypePublishedMetricKey name of the eventType metric EventTypePublishedMetricKey = "event_type_published" + //EventRequests name if the eventRequests metric + EventRequests = "event_requests" // errorsHelp help for the errors metric errorsHelp = "The total number of errors while sending Events to the messaging server" // latencyHelp help for the latency metric latencyHelp = "The duration of sending Events to the messaging server" // EventTypePublishedMetricHelp help for the eventType metric EventTypePublishedMetricHelp = "The total number of events published for a given eventType" + // EventRequestsHelp help for event requests metric + EventRequestsHelp = "The total number of event requests" + //responseCode is the name of the status code labels used by multiple metrics + responseCode = "response_code" + //destSvc is the name of the destination service label used by multiple metrics + destSvc = "destination_service" ) // Collector implements the prometheus.Collector interface @@ -26,6 +35,7 @@ type Collector struct { errors *prometheus.CounterVec latency *prometheus.HistogramVec eventType *prometheus.CounterVec + requests *prometheus.CounterVec } // NewCollector a new instance of Collector @@ -43,7 +53,7 @@ func NewCollector() *Collector { Name: Latency, Help: latencyHelp, }, - []string{}, + []string{responseCode, destSvc}, ), eventType: prometheus.NewCounterVec( prometheus.CounterOpts{ @@ -52,6 +62,13 @@ func NewCollector() *Collector { }, []string{"event_type", "event_source"}, ), + requests: prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: EventRequests, + Help: EventRequestsHelp, + }, + []string{responseCode, destSvc}, + ), } } @@ -60,6 +77,7 @@ func (c *Collector) Describe(ch chan<- *prometheus.Desc) { c.errors.Describe(ch) c.latency.Describe(ch) c.eventType.Describe(ch) + c.requests.Describe(ch) } // Collect implements the prometheus.Collector interface Collect method @@ -67,6 +85,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) { c.errors.Collect(ch) c.latency.Collect(ch) c.eventType.Collect(ch) + c.requests.Collect(ch) } // RecordError records an error metric @@ -75,11 +94,16 @@ func (c *Collector) RecordError() { } // RecordLatency records a latency metric -func (c *Collector) RecordLatency(duration time.Duration) { - c.latency.WithLabelValues().Observe(duration.Seconds()) +func (c *Collector) RecordLatency(duration time.Duration, statusCode int, destSvc string) { + c.latency.WithLabelValues(fmt.Sprint(statusCode), destSvc).Observe(float64(duration.Milliseconds())) } // RecordEventType records a eventType metric func (c *Collector) RecordEventType(eventType, eventSource string) { c.eventType.WithLabelValues(eventType, eventSource).Inc() } + +// RecordRequests records the eventRequests metric +func (c *Collector) RecordRequests(statusCode int, destSvc string) { + c.requests.WithLabelValues(fmt.Sprint(statusCode), destSvc).Inc() +} diff --git a/pkg/sender/jetstream.go b/pkg/sender/jetstream.go index f7bdba0..353e7c6 100644 --- a/pkg/sender/jetstream.go +++ b/pkg/sender/jetstream.go @@ -39,6 +39,11 @@ func NewJetstreamMessageSender(ctx context.Context, connection *nats.Conn, envCf return &JetstreamMessageSender{ctx: ctx, connection: connection, envCfg: envCfg, logger: logger} } +// URL returns the URL of the Sender's connection. +func (s *JetstreamMessageSender) URL() string { + return s.connection.ConnectedUrl() +} + // ConnectionStatus returns nats.Status for the NATS connection used by the JetstreamMessageSender. func (s *JetstreamMessageSender) ConnectionStatus() nats.Status { return s.connection.Status() diff --git a/pkg/sender/nats.go b/pkg/sender/nats.go index 47b23e6..4c7af9b 100644 --- a/pkg/sender/nats.go +++ b/pkg/sender/nats.go @@ -19,6 +19,7 @@ var _ GenericSender = &NatsMessageSender{} type GenericSender interface { Send(context.Context, *event.Event) (int, error) ConnectionStatus() nats.Status + URL() string } // NatsMessageSender is responsible for sending messages over HTTP. @@ -33,6 +34,11 @@ func NewNatsMessageSender(ctx context.Context, connection *nats.Conn, logger *lo return &NatsMessageSender{ctx: ctx, connection: connection, logger: logger} } +// URL returns the URL of the Sender's connection. +func (s *NatsMessageSender) URL() string { + return s.connection.ConnectedUrl() +} + // ConnectionStatus returns nats.Status for the NATS connection used by the NatsMessageSender. func (s *NatsMessageSender) ConnectionStatus() nats.Status { return s.connection.Status() From cdc102449443378967c034b06dee465dcd4e7d9a Mon Sep 17 00:00:00 2001 From: Nina Hingerl <76950046+NHingerl@users.noreply.github.com> Date: Thu, 4 Aug 2022 18:50:51 +0200 Subject: [PATCH 094/194] adjust resources to CamelCase (#14991) * adjust resources to CamelCase * Apply Maja's suggestion Co-authored-by: Maja Szostok * adjust resources to CamelCase * found another "Config Map" * review Eventing capitalization * Open Service Broker without camel case Co-authored-by: Maja Szostok --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6b403b2..3a6f149 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ $ ko apply -f config/event-publisher-proxy/ ### Send Events -This command supports **cloud events**: +This command supports **CloudEvents**: ```bash curl -v -X POST \ -H "Content-Type: application/cloudevents+json" \ @@ -87,14 +87,14 @@ curl -v -X GET \ | Environment Variable | Default Value | Description | | ----------------------- | ------------- |------------------------------------------------------------------------------------------- | -| INGRESS_PORT | 8080 | The ingress port for the Cloud Events Gateway Proxy. | +| INGRESS_PORT | 8080 | The ingress port for the CloudEvents Gateway Proxy. | | MAX_IDLE_CONNS | 100 | The maximum number of idle (keep-alive) connections across all hosts. Zero means no limit. | | MAX_IDLE_CONNS_PER_HOST | 2 | The maximum idle (keep-alive) connections to keep per-host. Zero means the default value. | | REQUEST_TIMEOUT | 5s | The timeout for the outgoing requests to the Messaging server. | | CLIENT_ID | | The Client ID used to acquire Access Tokens from the Authentication server. | | CLIENT_SECRET | | The Client Secret used to acquire Access Tokens from the Authentication server. | | TOKEN_ENDPOINT | | The Authentication Server Endpoint to provide Access Tokens. | -| EMS_PUBLISH_URL | | The Messaging Server Endpoint that accepts publishing Cloud Events to it. | +| EMS_PUBLISH_URL | | The Messaging Server Endpoint that accepts publishing CloudEvents to it. | | BEB_NAMESPACE | | The name of the namespace in BEB. | | EVENT_TYPE_PREFIX | | The prefix of the eventType as per the BEB event specification. | From 77653cb704936b3a47e761ce8a21b13ad2f86fa1 Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Fri, 12 Aug 2022 18:51:12 +0200 Subject: [PATCH 095/194] Bump lib versions in eventing components (#15095) * Bump lib versions in eventing components * Image bump * Image bump --- cmd/event-publisher-proxy/Dockerfile | 2 +- go.mod | 2 +- go.sum | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/event-publisher-proxy/Dockerfile b/cmd/event-publisher-proxy/Dockerfile index c2481b6..a500ad1 100644 --- a/cmd/event-publisher-proxy/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.18.3-alpine3.16 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.19.0-alpine3.16 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy diff --git a/go.mod b/go.mod index 144522a..df09068 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/prometheus/client_golang v1.12.2 github.com/stretchr/testify v1.8.0 go.opencensus.io v0.23.0 - go.uber.org/zap v1.21.0 + go.uber.org/zap v1.22.0 golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb k8s.io/api v0.24.3 k8s.io/apimachinery v0.24.3 diff --git a/go.sum b/go.sum index 339ccbe..20f2752 100644 --- a/go.sum +++ b/go.sum @@ -344,7 +344,6 @@ go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= @@ -354,8 +353,8 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= +go.uber.org/zap v1.22.0 h1:Zcye5DUgBloQ9BaT4qc9BnjOFog5TvBSAGkJ3Nf70c0= +go.uber.org/zap v1.22.0/go.mod h1:H4siCOZOrAolnUPJEkfaSjDqyP+BDS0DdDWzwcgt3+U= golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 h1:tkVvjkPTB7pnW3jnid7kNyAMPVWllTNOf/qKDze4p9o= golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= From cbb45b539a593a17522f10824b73cb1376ff7516 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Aug 2022 16:19:11 +0200 Subject: [PATCH 096/194] gomod(deps): bump github.com/cloudevents/sdk-go/v2 from 2.10.1 to 2.11.0 in /components/event-publisher-proxy (#15107) * gomod(deps): bump github.com/cloudevents/sdk-go/v2 Bumps [github.com/cloudevents/sdk-go/v2](https://github.com/cloudevents/sdk-go) from 2.10.1 to 2.11.0. - [Release notes](https://github.com/cloudevents/sdk-go/releases) - [Commits](https://github.com/cloudevents/sdk-go/compare/v2.10.1...v2.11.0) --- updated-dependencies: - dependency-name: github.com/cloudevents/sdk-go/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump image Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raymond --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index df09068..5947a90 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1 - github.com/cloudevents/sdk-go/v2 v2.10.1 + github.com/cloudevents/sdk-go/v2 v2.11.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20220620092658-f1f8e3668674 diff --git a/go.sum b/go.sum index 20f2752..106b215 100644 --- a/go.sum +++ b/go.sum @@ -68,8 +68,9 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1 h1:vhMEC9zc6nIw3HwxaFZF/lT/uTftXx9h++f0KyXJazM= github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1/go.mod h1:9l2pSSkH9AvMCwK8Rscwqtsni30UIWNj/EmgtmaRMmc= -github.com/cloudevents/sdk-go/v2 v2.10.1 h1:qNFovJ18fWOd8Q9ydWJPk1oiFudXyv1GxJIP7MwPjuM= github.com/cloudevents/sdk-go/v2 v2.10.1/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= +github.com/cloudevents/sdk-go/v2 v2.11.0 h1:pCb7Cdkb8XpUoil+miuw6PEzuCG9cc8Erj8y1/q3odo= +github.com/cloudevents/sdk-go/v2 v2.11.0/go.mod h1:xDmKfzNjM8gBvjaF8ijFjM1VYOVUEeUfapHMUX1T5To= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= From 81bd0411c307b91fc74b45d5e2961f57ffcbaf86 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Fri, 19 Aug 2022 15:04:49 +0200 Subject: [PATCH 097/194] bump dependencies in `event-publisher-proxy` (#15156) * bump deps * bump image * go mod tidy --- go.mod | 22 +++++++++++----------- go.sum | 32 ++++++++++++++++---------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index 5947a90..ba726ed 100644 --- a/go.mod +++ b/go.mod @@ -7,20 +7,20 @@ require ( github.com/cloudevents/sdk-go/v2 v2.11.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220620092658-f1f8e3668674 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220629063704-83cc2f69ed02 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220819055141-a1d6848eb9b8 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220819055141-a1d6848eb9b8 github.com/nats-io/nats-server/v2 v2.8.4 github.com/nats-io/nats.go v1.16.0 github.com/onsi/gomega v1.20.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.12.2 + github.com/prometheus/client_golang v1.13.0 github.com/stretchr/testify v1.8.0 go.opencensus.io v0.23.0 go.uber.org/zap v1.22.0 - golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb - k8s.io/api v0.24.3 - k8s.io/apimachinery v0.24.3 - k8s.io/client-go v0.24.3 + golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7 + k8s.io/api v0.24.4 + k8s.io/apimachinery v0.24.4 + k8s.io/client-go v0.24.4 sigs.k8s.io/controller-runtime v0.12.3 ) @@ -48,7 +48,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.14.4 // indirect - github.com/kyma-project/kyma/common/logging v0.0.0-20220628153305-4e32e8abea0f // indirect + github.com/kyma-project/kyma/common/logging v0.0.0-20220722140538-3e9ad3ed2f7d // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/minio/highwayhash v1.0.2 // indirect @@ -64,11 +64,11 @@ require ( github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/spf13/pflag v1.0.5 // indirect - go.uber.org/atomic v1.9.0 // indirect + go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.6.0 // indirect golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect - golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 // indirect + golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect diff --git a/go.sum b/go.sum index 106b215..1f52806 100644 --- a/go.sum +++ b/go.sum @@ -232,12 +232,12 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kyma-project/kyma/common/logging v0.0.0-20220628153305-4e32e8abea0f h1:fn0t/cGeKkLnnwzOfRsjRWuOR3p5wROX7D8hT1yqff0= -github.com/kyma-project/kyma/common/logging v0.0.0-20220628153305-4e32e8abea0f/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220620092658-f1f8e3668674 h1:IykN2HIrBgDX/Wt9bsn5JqoPGMMLi01pgcA3RpKYZfQ= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220620092658-f1f8e3668674/go.mod h1:ZxFl/3FFFydQsfWBxqbGCWkBzfN4ttiEa84O6mHsEkk= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220629063704-83cc2f69ed02 h1:NAOwgzmxux3i5fmfEbG15q6ZRd5vx7opu88mR8LktJw= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220629063704-83cc2f69ed02/go.mod h1:ys6m65CYDhSwFymBd6OLUW0ZgAZowD+Y6oUzXF+o6X0= +github.com/kyma-project/kyma/common/logging v0.0.0-20220722140538-3e9ad3ed2f7d h1:6PKslsQ1Dmqo2uvkZKfJz1v+1ZHiOxuhIJ7d6Abxb4s= +github.com/kyma-project/kyma/common/logging v0.0.0-20220722140538-3e9ad3ed2f7d/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220819055141-a1d6848eb9b8 h1:6EWFE9KlC3Bt/2bO8cJbbtkBkO+oQMrXzd4DuCN4nrY= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220819055141-a1d6848eb9b8/go.mod h1:4jh1Qn1DLbQRdCHqEdHsV4Tk9b6L4i9nhgGdEc2XaIg= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220819055141-a1d6848eb9b8 h1:F2GdfgPVrLbC2dtOz5DSGGMfK0iF59QC4+8Gvt6NGLU= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220819055141-a1d6848eb9b8/go.mod h1:0/fB3etKv3/uJlR/ccAT+4vu0lGx3NCZFeDQ4Yt8Y0c= 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.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= @@ -342,8 +342,8 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -431,8 +431,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -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-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= +golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -446,8 +446,8 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb h1:8tDJ3aechhddbdPAxpycgXHJRMLpk/Ab+aa4OgdN5/g= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7 h1:dtndE8FcEta75/4kHF3AbpuWzV6f1LjnLrM4pe2SZrw= +golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -508,8 +508,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220422013727-9388b58f7150 h1:xHms4gcpe1YE7A3yIllJXP16CMAGuqwO2lX1mTyyRRc= -golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +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-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -724,8 +724,8 @@ k8s.io/api v0.24.3 h1:tt55QEmKd6L2k5DP6G/ZzdMQKvG5ro4H4teClqm0sTY= k8s.io/api v0.24.3/go.mod h1:elGR/XSZrS7z7cSZPzVWaycpJuGIw57j9b95/1PdJNI= k8s.io/apimachinery v0.24.3 h1:hrFiNSA2cBZqllakVYyH/VyEh4B581bQRmqATJSeQTg= k8s.io/apimachinery v0.24.3/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= -k8s.io/client-go v0.24.3 h1:Nl1840+6p4JqkFWEW2LnMKU667BUxw03REfLAVhuKQY= -k8s.io/client-go v0.24.3/go.mod h1:AAovolf5Z9bY1wIg2FZ8LPQlEdKHjLI7ZD4rw920BJw= +k8s.io/client-go v0.24.4 h1:hIAIJZIPyaw46AkxwyR0FRfM/pRxpUNTd3ysYu9vyRg= +k8s.io/client-go v0.24.4/go.mod h1:+AxlPWw/H6f+EJhRSjIeALaJT4tbeB/8g9BNvXGPd0Y= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= From b7094e34380c9c59cf5c13e4f79fab5c4a3e152e Mon Sep 17 00:00:00 2001 From: Raymond Pinto <45314732+raypinto@users.noreply.github.com> Date: Mon, 22 Aug 2022 13:41:30 +0200 Subject: [PATCH 098/194] Add a new consolidated eventing dashboard (#15147) * Added a new consolidated dashboard * Bump img * Update titles * Addressed feedback * Address feedback --- pkg/handler/nats/handler.go | 2 +- pkg/metrics/collector.go | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index d9aa836..49c3c9e 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -222,7 +222,7 @@ func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.D start := time.Now() s := *h.Sender resp, err := s.Send(ctx, event) - h.collector.RecordEventType(event.Type(), event.Source()) + h.collector.RecordEventType(event.Type(), event.Source(), resp) dispatchTime := time.Since(start) if err != nil { h.collector.RecordError() diff --git a/pkg/metrics/collector.go b/pkg/metrics/collector.go index 572ae37..64d09ba 100644 --- a/pkg/metrics/collector.go +++ b/pkg/metrics/collector.go @@ -28,6 +28,10 @@ const ( responseCode = "response_code" //destSvc is the name of the destination service label used by multiple metrics destSvc = "destination_service" + // eventType is the name of the event type label used by metrics + eventType = "event_type" + // eventSource is the name of the event source label used by metrics + eventSource = "event_source" ) // Collector implements the prometheus.Collector interface @@ -60,7 +64,7 @@ func NewCollector() *Collector { Name: EventTypePublishedMetricKey, Help: EventTypePublishedMetricHelp, }, - []string{"event_type", "event_source"}, + []string{eventType, eventSource, responseCode}, ), requests: prometheus.NewCounterVec( prometheus.CounterOpts{ @@ -99,8 +103,8 @@ func (c *Collector) RecordLatency(duration time.Duration, statusCode int, destSv } // RecordEventType records a eventType metric -func (c *Collector) RecordEventType(eventType, eventSource string) { - c.eventType.WithLabelValues(eventType, eventSource).Inc() +func (c *Collector) RecordEventType(eventType, eventSource string, statusCode int) { + c.eventType.WithLabelValues(eventType, eventSource, fmt.Sprint(statusCode)).Inc() } // RecordRequests records the eventRequests metric From b37337fba831cdef16d8265d253c2d3b3d7a5051 Mon Sep 17 00:00:00 2001 From: VladislavPaskar <15933100+VladislavPaskar@users.noreply.github.com> Date: Thu, 25 Aug 2022 13:48:02 +0200 Subject: [PATCH 099/194] Remove log that exposes the event internals (#15209) * remove logs, which exposes the event internals * bump the image Co-authored-by: Nils Seip --- pkg/sender/jetstream.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/sender/jetstream.go b/pkg/sender/jetstream.go index 353e7c6..8796907 100644 --- a/pkg/sender/jetstream.go +++ b/pkg/sender/jetstream.go @@ -74,7 +74,6 @@ func (s *JetstreamMessageSender) Send(_ context.Context, event *event.Event) (in } // send the event - s.namedLogger().Infof("Sending event:%v to backend, stream name:%s", event, s.envCfg.JSStreamName) _, err = jsCtx.PublishMsg(msg) if err != nil { s.namedLogger().Errorw("Cannot send event to backend", "error", err) From dd43e64059e0000321bca288a26b78e0dfc0fc54 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Fri, 26 Aug 2022 10:11:56 +0200 Subject: [PATCH 100/194] bump dependencies in `event-publisher-proxy` (#15297) * bump deps * bump image --- go.mod | 14 +++++++------- go.sum | 37 ++++++++++++++----------------------- 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/go.mod b/go.mod index ba726ed..f97d4c3 100644 --- a/go.mod +++ b/go.mod @@ -7,8 +7,8 @@ require ( github.com/cloudevents/sdk-go/v2 v2.11.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220819055141-a1d6848eb9b8 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220819055141-a1d6848eb9b8 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220826051949-4ed4d5883dce + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220826051949-4ed4d5883dce github.com/nats-io/nats-server/v2 v2.8.4 github.com/nats-io/nats.go v1.16.0 github.com/onsi/gomega v1.20.0 @@ -16,8 +16,8 @@ require ( github.com/prometheus/client_golang v1.13.0 github.com/stretchr/testify v1.8.0 go.opencensus.io v0.23.0 - go.uber.org/zap v1.22.0 - golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7 + go.uber.org/zap v1.23.0 + golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 k8s.io/api v0.24.4 k8s.io/apimachinery v0.24.4 k8s.io/client-go v0.24.4 @@ -48,7 +48,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.14.4 // indirect - github.com/kyma-project/kyma/common/logging v0.0.0-20220722140538-3e9ad3ed2f7d // indirect + github.com/kyma-project/kyma/common/logging v0.0.0-20220818120541-277787e6c2ec // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/minio/highwayhash v1.0.2 // indirect @@ -65,10 +65,10 @@ require ( github.com/prometheus/procfs v0.7.3 // indirect github.com/spf13/pflag v1.0.5 // indirect go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.6.0 // indirect + go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect diff --git a/go.sum b/go.sum index 1f52806..4208153 100644 --- a/go.sum +++ b/go.sum @@ -58,7 +58,6 @@ github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZx github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= -github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -104,12 +103,10 @@ github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vb github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -232,12 +229,12 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kyma-project/kyma/common/logging v0.0.0-20220722140538-3e9ad3ed2f7d h1:6PKslsQ1Dmqo2uvkZKfJz1v+1ZHiOxuhIJ7d6Abxb4s= -github.com/kyma-project/kyma/common/logging v0.0.0-20220722140538-3e9ad3ed2f7d/go.mod h1:7FWH0Lyls2xumj836aa+LVP8jhnJSv6wSlxC+2HAJ1s= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220819055141-a1d6848eb9b8 h1:6EWFE9KlC3Bt/2bO8cJbbtkBkO+oQMrXzd4DuCN4nrY= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220819055141-a1d6848eb9b8/go.mod h1:4jh1Qn1DLbQRdCHqEdHsV4Tk9b6L4i9nhgGdEc2XaIg= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220819055141-a1d6848eb9b8 h1:F2GdfgPVrLbC2dtOz5DSGGMfK0iF59QC4+8Gvt6NGLU= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220819055141-a1d6848eb9b8/go.mod h1:0/fB3etKv3/uJlR/ccAT+4vu0lGx3NCZFeDQ4Yt8Y0c= +github.com/kyma-project/kyma/common/logging v0.0.0-20220818120541-277787e6c2ec h1:mjgYZgrzd2fmhSpe0n9uhiLPJGvOkNmHv1HThcSNVr0= +github.com/kyma-project/kyma/common/logging v0.0.0-20220818120541-277787e6c2ec/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220826051949-4ed4d5883dce h1:vyTOTFdYNafKF/XLELD3Hz/2DylbbNCtwAxlPM7s+3g= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220826051949-4ed4d5883dce/go.mod h1:4jh1Qn1DLbQRdCHqEdHsV4Tk9b6L4i9nhgGdEc2XaIg= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220826051949-4ed4d5883dce h1:nS8dROJPi4IMaO0/slGJ800cENpP0LJJWxS9W38ZNws= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220826051949-4ed4d5883dce/go.mod h1:T3kKlsfZCHDdzJ5eQPCT6btniJcorLf+8O6bJObXUtk= 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.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= @@ -340,22 +337,19 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= +go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.22.0 h1:Zcye5DUgBloQ9BaT4qc9BnjOFog5TvBSAGkJ3Nf70c0= -go.uber.org/zap v1.22.0/go.mod h1:H4siCOZOrAolnUPJEkfaSjDqyP+BDS0DdDWzwcgt3+U= +go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= +go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 h1:tkVvjkPTB7pnW3jnid7kNyAMPVWllTNOf/qKDze4p9o= golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -446,8 +440,8 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7 h1:dtndE8FcEta75/4kHF3AbpuWzV6f1LjnLrM4pe2SZrw= -golang.org/x/oauth2 v0.0.0-20220808172628-8227340efae7/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 h1:2o1E+E8TpNLklK9nHiPiK1uzIYrIHt+cQx3ynCwq9V8= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -508,8 +502,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -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/sys v0.0.0-20220627191245-f75cf1eec38b h1:2n253B2r0pYSmEV+UNCQoPfU/FiaizQEK5Gu4Bq4JE8= +golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -545,8 +539,6 @@ golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -729,7 +721,6 @@ k8s.io/client-go v0.24.4/go.mod h1:+AxlPWw/H6f+EJhRSjIeALaJT4tbeB/8g9BNvXGPd0Y= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= 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-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= From 0fcf8b27df7148bd487cc292ec518bc6568c9a35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Sep 2022 13:47:53 +0200 Subject: [PATCH 101/194] gomod(deps): bump github.com/onsi/gomega from 1.20.0 to 1.20.2 in /components/event-publisher-proxy (#15343) * gomod(deps): bump github.com/onsi/gomega Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.20.0 to 1.20.2. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.20.0...v1.20.2) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update the publisher image Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marco Bebway --- go.mod | 6 +++--- go.sum | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index f97d4c3..d399112 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220826051949-4ed4d5883dce github.com/nats-io/nats-server/v2 v2.8.4 github.com/nats-io/nats.go v1.16.0 - github.com/onsi/gomega v1.20.0 + github.com/onsi/gomega v1.20.2 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.13.0 github.com/stretchr/testify v1.8.0 @@ -67,8 +67,8 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect - golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect - golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b // indirect + golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect + golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect diff --git a/go.sum b/go.sum index 4208153..30ccdbd 100644 --- a/go.sum +++ b/go.sum @@ -285,12 +285,12 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.1.4 h1:GNapqRSid3zijZ9H77KrgVG4/8KqiyRsxcSxe+7ApXY= +github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= -github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +github.com/onsi/gomega v1.20.2 h1:8uQq0zMgLEfa0vRrrBgaJF2gyW9Da9BmfGV+OyUzfkY= +github.com/onsi/gomega v1.20.2/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -425,8 +425,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -502,8 +502,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b h1:2n253B2r0pYSmEV+UNCQoPfU/FiaizQEK5Gu4Bq4JE8= -golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= From ed4a14e4f73ed4286948a72ed1227610806391d3 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Tue, 6 Sep 2022 16:52:41 +0200 Subject: [PATCH 102/194] bump dependencies in `event-publisher-proxy` (#15361) * bump dependencies * bump image --- go.mod | 40 ++++++------- go.sum | 185 ++++++++++++++++++++++++++++++--------------------------- 2 files changed, 119 insertions(+), 106 deletions(-) diff --git a/go.mod b/go.mod index d399112..1612933 100644 --- a/go.mod +++ b/go.mod @@ -7,8 +7,8 @@ require ( github.com/cloudevents/sdk-go/v2 v2.11.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220826051949-4ed4d5883dce - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220826051949-4ed4d5883dce + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220903121145-690b76935712 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220903121145-690b76935712 github.com/nats-io/nats-server/v2 v2.8.4 github.com/nats-io/nats.go v1.16.0 github.com/onsi/gomega v1.20.2 @@ -18,14 +18,14 @@ require ( go.opencensus.io v0.23.0 go.uber.org/zap v1.23.0 golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 - k8s.io/api v0.24.4 - k8s.io/apimachinery v0.24.4 - k8s.io/client-go v0.24.4 - sigs.k8s.io/controller-runtime v0.12.3 + k8s.io/api v0.25.0 + k8s.io/apimachinery v0.25.0 + k8s.io/client-go v0.25.0 + sigs.k8s.io/controller-runtime v0.13.0 ) require ( - cloud.google.com/go v0.81.0 // indirect + cloud.google.com/go v0.97.0 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -48,7 +48,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.14.4 // indirect - github.com/kyma-project/kyma/common/logging v0.0.0-20220818120541-277787e6c2ec // indirect + github.com/kyma-project/kyma/common/logging v0.0.0-20220826051949-4ed4d5883dce // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/minio/highwayhash v1.0.2 // indirect @@ -71,28 +71,28 @@ require ( golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect + golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/klog/v2 v2.60.1 // indirect - k8s.io/kube-openapi v0.0.0-20220603121420-31174f50af60 // indirect - k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect - sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect + k8s.io/klog/v2 v2.70.1 // indirect + k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect + k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect + sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) replace ( // keep all following packages at the same version - k8s.io/api => k8s.io/api v0.24.3 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.24.3 - k8s.io/apimachinery => k8s.io/apimachinery v0.24.3 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.24.3 - k8s.io/component-base => k8s.io/component-base v0.24.3 - k8s.io/kubectl => k8s.io/kubectl v0.24.3 + k8s.io/api => k8s.io/api v0.25.0 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.0 + k8s.io/apimachinery => k8s.io/apimachinery v0.25.0 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.0 + k8s.io/component-base => k8s.io/component-base v0.25.0 + k8s.io/kubectl => k8s.io/kubectl v0.25.0 ) replace ( diff --git a/go.sum b/go.sum index 30ccdbd..80013ea 100644 --- a/go.sum +++ b/go.sum @@ -17,8 +17,15 @@ cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKP cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0 h1:at8Tk2zUz63cLPR0JPWm5vp77pEZmzxEQBEfRKn1VV8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0 h1:3DXvAyifywvq64LfkKaMOmkWPS1CikIQdMe2lY9vxU8= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -37,28 +44,21 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -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/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -73,12 +73,12 @@ github.com/cloudevents/sdk-go/v2 v2.11.0/go.mod h1:xDmKfzNjM8gBvjaF8ijFjM1VYOVUE github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -86,15 +86,12 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= -github.com/getkin/kin-openapi v0.76.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -102,7 +99,6 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= @@ -112,7 +108,6 @@ github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= @@ -135,6 +130,7 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -153,9 +149,9 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -169,6 +165,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -177,6 +174,7 @@ github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -188,6 +186,9 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -195,20 +196,16 @@ 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/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -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= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= @@ -229,12 +226,12 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kyma-project/kyma/common/logging v0.0.0-20220818120541-277787e6c2ec h1:mjgYZgrzd2fmhSpe0n9uhiLPJGvOkNmHv1HThcSNVr0= -github.com/kyma-project/kyma/common/logging v0.0.0-20220818120541-277787e6c2ec/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220826051949-4ed4d5883dce h1:vyTOTFdYNafKF/XLELD3Hz/2DylbbNCtwAxlPM7s+3g= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220826051949-4ed4d5883dce/go.mod h1:4jh1Qn1DLbQRdCHqEdHsV4Tk9b6L4i9nhgGdEc2XaIg= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220826051949-4ed4d5883dce h1:nS8dROJPi4IMaO0/slGJ800cENpP0LJJWxS9W38ZNws= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220826051949-4ed4d5883dce/go.mod h1:T3kKlsfZCHDdzJ5eQPCT6btniJcorLf+8O6bJObXUtk= +github.com/kyma-project/kyma/common/logging v0.0.0-20220826051949-4ed4d5883dce h1:oh/arOxvNmkKhGHuKkVnBZvDH4BB8+z1R7L9yoHsIsM= +github.com/kyma-project/kyma/common/logging v0.0.0-20220826051949-4ed4d5883dce/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220903121145-690b76935712 h1:6kqIT5t6sw3RDB8lJhFAf8xzWWPFQTgGm6Es5ZhSgjY= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220903121145-690b76935712/go.mod h1:4jh1Qn1DLbQRdCHqEdHsV4Tk9b6L4i9nhgGdEc2XaIg= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220903121145-690b76935712 h1:ld6tIS2EJ9T3dPGjTqBLJHYB3lru7JUL96CSRdAtSvA= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220903121145-690b76935712/go.mod h1:U56ezWFTgAH8y/643MTRDUClm3xs+E5GfZ2WaXmzeTI= 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.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= @@ -247,20 +244,15 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28gth9P+wV2K/zYUUAkJ+55U8cpS0p5I= @@ -278,20 +270,11 @@ github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.20.2 h1:8uQq0zMgLEfa0vRrrBgaJF2gyW9Da9BmfGV+OyUzfkY= github.com/onsi/gomega v1.20.2/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -306,7 +289,9 @@ github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuI github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -336,6 +321,7 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= @@ -375,6 +361,7 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -388,7 +375,6 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -409,7 +395,6 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= @@ -422,9 +407,9 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -439,7 +424,9 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 h1:2o1E+E8TpNLklK9nHiPiK1uzIYrIHt+cQx3ynCwq9V8= golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -454,7 +441,6 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -464,10 +450,7 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -481,7 +464,6 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -498,10 +480,15 @@ golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -522,8 +509,8 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U= +golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -559,7 +546,6 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -574,6 +560,10 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -600,6 +590,13 @@ google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34q google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -631,6 +628,7 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= @@ -648,6 +646,21 @@ google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -661,11 +674,19 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -688,14 +709,11 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= @@ -712,32 +730,27 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.24.3 h1:tt55QEmKd6L2k5DP6G/ZzdMQKvG5ro4H4teClqm0sTY= -k8s.io/api v0.24.3/go.mod h1:elGR/XSZrS7z7cSZPzVWaycpJuGIw57j9b95/1PdJNI= -k8s.io/apimachinery v0.24.3 h1:hrFiNSA2cBZqllakVYyH/VyEh4B581bQRmqATJSeQTg= -k8s.io/apimachinery v0.24.3/go.mod h1:82Bi4sCzVBdpYjyI4jY6aHX+YCUchUIrZrXKedjd2UM= -k8s.io/client-go v0.24.4 h1:hIAIJZIPyaw46AkxwyR0FRfM/pRxpUNTd3ysYu9vyRg= -k8s.io/client-go v0.24.4/go.mod h1:+AxlPWw/H6f+EJhRSjIeALaJT4tbeB/8g9BNvXGPd0Y= -k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/api v0.25.0 h1:H+Q4ma2U/ww0iGB78ijZx6DRByPz6/733jIuFpX70e0= +k8s.io/api v0.25.0/go.mod h1:ttceV1GyV1i1rnmvzT3BST08N6nGt+dudGrquzVQWPk= +k8s.io/apimachinery v0.25.0 h1:MlP0r6+3XbkUG2itd6vp3oxbtdQLQI94fD5gCS+gnoU= +k8s.io/apimachinery v0.25.0/go.mod h1:qMx9eAk0sZQGsXGu86fab8tZdffHbwUfsvzqKn4mfB0= +k8s.io/client-go v0.25.0 h1:CVWIaCETLMBNiTUta3d5nzRbXvY5Hy9Dpl+VvREpu5E= +k8s.io/client-go v0.25.0/go.mod h1:lxykvypVfKilxhTklov0wz1FoaUZ8X4EwbhS6rpRfN8= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -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-20220328201542-3ee0da9b0b42/go.mod h1:Z/45zLw8lUo4wdiUkI+v/ImEGAvu3WatcZl3lPMR4Rk= -k8s.io/kube-openapi v0.0.0-20220603121420-31174f50af60 h1:cE/M8rmDQgibspuSm+X1iW16ByTImtEaapgaHoVSLX4= -k8s.io/kube-openapi v0.0.0-20220603121420-31174f50af60/go.mod h1:ouUzE1U2mEv//HRoBwYLFE5pdqjIebvtX361vtEIlBI= +k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= +k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= +k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/controller-runtime v0.12.3 h1:FCM8xeY/FI8hoAfh/V4XbbYMY20gElh9yh+A98usMio= -sigs.k8s.io/controller-runtime v0.12.3/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0= -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/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -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.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/controller-runtime v0.13.0 h1:iqa5RNciy7ADWnIc8QxCbOX5FEKVR3uxVxKHRMc2WIQ= +sigs.k8s.io/controller-runtime v0.13.0/go.mod h1:Zbz+el8Yg31jubvAEyglRZGdLAjplZl+PgtYNI6WNTI= +sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= +sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= From 72c8ae59c3a264adb5a70723247ae90bf13fe36a Mon Sep 17 00:00:00 2001 From: Mansur Uralov Date: Wed, 7 Sep 2022 13:01:51 +0200 Subject: [PATCH 103/194] Improve eventing log (#15335) * Delete Duplicate Errors from Logs * Delete EC and EPP duplicate error message in the logs * Adapt the unit and integration tests * Add more info to error logs * Add more information to the error logs --- cmd/event-publisher-proxy/beb/beb.go | 11 +++++------ cmd/event-publisher-proxy/nats/nats.go | 14 ++++++-------- go.mod | 1 + go.sum | 2 ++ pkg/cloudevents/eventtype/clean.go | 5 +++-- pkg/handler/beb/mock/mock.go | 4 +++- pkg/legacy-events/error_responses.go | 4 ++-- 7 files changed, 22 insertions(+), 19 deletions(-) diff --git a/cmd/event-publisher-proxy/beb/beb.go b/cmd/event-publisher-proxy/beb/beb.go index de86bb7..ff8eb04 100644 --- a/cmd/event-publisher-proxy/beb/beb.go +++ b/cmd/event-publisher-proxy/beb/beb.go @@ -3,14 +3,15 @@ package beb import ( "context" + "github.com/kelseyhightower/envconfig" + "golang.org/x/xerrors" + "github.com/kyma-project/kyma/components/eventing-controller/logger" "go.uber.org/zap" "k8s.io/client-go/dynamic" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only used in a development setup "sigs.k8s.io/controller-runtime/pkg/client/config" - "github.com/kelseyhightower/envconfig" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" @@ -53,8 +54,7 @@ func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, lo // Init implements the Commander interface and initializes the publisher to BEB. func (c *Commander) Init() error { if err := envconfig.Process("", c.envCfg); err != nil { - c.namedLogger().Errorw("Failed to read configuration", "error", err) - return err + return xerrors.Errorf("failed to read configuration for %s : %v", bebCommanderName, err) } return nil } @@ -110,8 +110,7 @@ func (c *Commander) Start() error { // start handler which blocks until it receives a shutdown signal if err := beb.NewHandler(messageReceiver, messageSender, c.envCfg.RequestTimeout, legacyTransformer, c.opts, subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleaner).Start(ctx); err != nil { - c.namedLogger().Errorw("Failed to start handler", "error", err) - return err + return xerrors.Errorf("failed to start handler for %s : %v", bebCommanderName, err) } c.namedLogger().Info("Event Publisher was shut down") return nil diff --git a/cmd/event-publisher-proxy/nats/nats.go b/cmd/event-publisher-proxy/nats/nats.go index 07c03c6..9fa547c 100644 --- a/cmd/event-publisher-proxy/nats/nats.go +++ b/cmd/event-publisher-proxy/nats/nats.go @@ -3,6 +3,9 @@ package nats import ( "context" + "github.com/kelseyhightower/envconfig" + "golang.org/x/xerrors" + "github.com/kyma-project/kyma/components/eventing-controller/logger" "go.uber.org/zap" @@ -10,8 +13,6 @@ import ( _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only required in a dev setup "sigs.k8s.io/controller-runtime/pkg/client/config" - "github.com/kelseyhightower/envconfig" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" @@ -56,8 +57,7 @@ func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, lo // Init implements the Commander interface and initializes the publisher to NATS. func (c *Commander) Init() error { if err := envconfig.Process("", c.envCfg); err != nil { - c.namedLogger().Errorw("Failed to read configuration", "error", err) - return err + return xerrors.Errorf("failed to read configuration for %s : %v", natsCommanderName, err) } return nil } @@ -80,8 +80,7 @@ func (c *Commander) Start() error { pkgnats.WithReconnectWait(c.envCfg.ReconnectWait), ) if err != nil { - c.namedLogger().Errorw("Failed to connect to backend server", "error", err) - return err + return xerrors.Errorf("failed to connect to backend server for %s : %v", natsCommanderName, err) } defer connection.Close() @@ -127,8 +126,7 @@ func (c *Commander) Start() error { // start handler which blocks until it receives a shutdown signal if err := nats.NewHandler(messageReceiver, &messageSenderToNats, c.envCfg.RequestTimeout, legacyTransformer, c.opts, subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleaner).Start(ctx); err != nil { - c.namedLogger().Errorw("Failed to start handler", "error", err) - return err + return xerrors.Errorf("failed to start handler for %s : %v", natsCommanderName, err) } c.namedLogger().Infof("Event Publisher was shut down") diff --git a/go.mod b/go.mod index 1612933..81e035e 100644 --- a/go.mod +++ b/go.mod @@ -72,6 +72,7 @@ require ( golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect + golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index 80013ea..3199ca9 100644 --- a/go.sum +++ b/go.sum @@ -569,6 +569,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= +golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= diff --git a/pkg/cloudevents/eventtype/clean.go b/pkg/cloudevents/eventtype/clean.go index d9c9cb3..c17080e 100644 --- a/pkg/cloudevents/eventtype/clean.go +++ b/pkg/cloudevents/eventtype/clean.go @@ -3,6 +3,8 @@ package eventtype import ( "regexp" + "golang.org/x/xerrors" + "github.com/kyma-project/kyma/components/eventing-controller/logger" "go.uber.org/zap" @@ -43,8 +45,7 @@ func (c *cleaner) Clean(eventType string) (string, error) { appName, event, version, err := parse(eventType, c.eventTypePrefix) if err != nil { - namedLogger.Errorw("Failed to parse event-type", "error", err) - return "", err + return "", xerrors.Errorf("failed to parse event-type=%s with prefix=%s: %v", eventType, c.eventTypePrefix, err) } // clean the application name diff --git a/pkg/handler/beb/mock/mock.go b/pkg/handler/beb/mock/mock.go index 4408f9c..1aeeac3 100644 --- a/pkg/handler/beb/mock/mock.go +++ b/pkg/handler/beb/mock/mock.go @@ -9,6 +9,8 @@ import ( "testing" "time" + "golang.org/x/xerrors" + "github.com/kyma-project/kyma/components/eventing-controller/logger" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -156,7 +158,7 @@ func validateEventTypeContainsApplicationName(name string) testingutils.Validato return err } if !strings.Contains(eventType, name) { - return fmt.Errorf("event-type:%s does not contain application name:%s", eventType, name) + return xerrors.Errorf("event-type:%s does not contain application name:%s", eventType, name) } return nil } diff --git a/pkg/legacy-events/error_responses.go b/pkg/legacy-events/error_responses.go index 5ade8e8..ec69452 100644 --- a/pkg/legacy-events/error_responses.go +++ b/pkg/legacy-events/error_responses.go @@ -66,7 +66,7 @@ func ErrorResponse(status int, err error) *api.PublishEventResponses { return &api.PublishEventResponses{Error: &api.Error{Status: status, Message: err.Error()}} } -//CreateMissingFieldError create an error for a missing field +// CreateMissingFieldError create an error for a missing field func CreateMissingFieldError(field interface{}) (response *api.PublishEventResponses) { apiErrorDetail := api.ErrorDetail{Field: field.(string), Type: ErrorTypeMissingField, Message: ErrorMessageMissingField, MoreInfo: ""} details := []api.ErrorDetail{apiErrorDetail} @@ -74,7 +74,7 @@ func CreateMissingFieldError(field interface{}) (response *api.PublishEventRespo return &api.PublishEventResponses{Ok: nil, Error: &apiError} } -//CreateInvalidFieldError creates an error for an invalid field +// CreateInvalidFieldError creates an error for an invalid field func CreateInvalidFieldError(field interface{}) (response *api.PublishEventResponses) { apiErrorDetail := api.ErrorDetail{Field: field.(string), Type: ErrorTypeInvalidField, Message: ErrorMessageInvalidField, MoreInfo: ""} details := []api.ErrorDetail{apiErrorDetail} From 12a0ce0f8b2c48397bb1eba27d7cb9b2ee572ddd Mon Sep 17 00:00:00 2001 From: Carina Kothe <69976260+grischperl@users.noreply.github.com> Date: Mon, 12 Sep 2022 10:53:59 +0200 Subject: [PATCH 104/194] Rename metrics according to Prometheus guidelines (#15308) * Rename metrics according to Prometheus guidelines * Fix small changes * Small changes * Fix import * Update dependencies * Add review comments * Fix typo * Fix review comment changes --- pkg/metrics/collector.go | 68 +++++++++++++------------- pkg/metrics/metricstest/metricstest.go | 4 +- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/pkg/metrics/collector.go b/pkg/metrics/collector.go index 64d09ba..0ee865a 100644 --- a/pkg/metrics/collector.go +++ b/pkg/metrics/collector.go @@ -8,30 +8,30 @@ import ( ) const ( - // Errors name of the errors metric - Errors = "event_publish_to_messaging_server_errors_total" - // Latency name of the latency metric - Latency = "event_publish_to_messaging_server_latency" - // EventTypePublishedMetricKey name of the eventType metric - EventTypePublishedMetricKey = "event_type_published" - //EventRequests name if the eventRequests metric - EventRequests = "event_requests" - // errorsHelp help for the errors metric - errorsHelp = "The total number of errors while sending Events to the messaging server" - // latencyHelp help for the latency metric - latencyHelp = "The duration of sending Events to the messaging server" - // EventTypePublishedMetricHelp help for the eventType metric - EventTypePublishedMetricHelp = "The total number of events published for a given eventType" - // EventRequestsHelp help for event requests metric - EventRequestsHelp = "The total number of event requests" - //responseCode is the name of the status code labels used by multiple metrics - responseCode = "response_code" - //destSvc is the name of the destination service label used by multiple metrics - destSvc = "destination_service" - // eventType is the name of the event type label used by metrics - eventType = "event_type" - // eventSource is the name of the event source label used by metrics - eventSource = "event_source" + // ErrorsKey name of the errors metric + ErrorsKey = "eventing_epp_errors_total" + // LatencyKey name of the latency metric + LatencyKey = "eventing_epp_messaging_server_latency_duration_milliseconds" + // EventTypePublishedMetricKey name of the eventTypeLabel metric + EventTypePublishedMetricKey = "nats_epp_event_type_published_total" + //EventRequestsKey name of the eventRequests metric + EventRequestsKey = "eventing_epp_requests_total" + // errorsHelp help text for the errors metric + errorsHelp = "The total number of errors while sending events to the messaging server" + // latencyHelp help text for the latency metric + latencyHelp = "The duration of sending events to the messaging server in milliseconds" + // eventTypePublishedMetricHelp help text for the eventTypeLabel metric + eventTypePublishedMetricHelp = "The total number of events published for a given eventTypeLabel" + // eventRequestsHelp help text for event requests metric + eventRequestsHelp = "The total number of event requests" + //responseCodeLabel name of the status code labels used by multiple metrics + responseCodeLabel = "response_code" + //destSvcLabel name of the destination service label used by multiple metrics + destSvcLabel = "destination_service" + // eventTypeLabel name of the event type label used by metrics + eventTypeLabel = "event_type" + // eventSourceLabel name of the event source label used by metrics + eventSourceLabel = "event_source" ) // Collector implements the prometheus.Collector interface @@ -47,31 +47,31 @@ func NewCollector() *Collector { return &Collector{ errors: prometheus.NewCounterVec( prometheus.CounterOpts{ - Name: Errors, + Name: ErrorsKey, Help: errorsHelp, }, []string{}, ), latency: prometheus.NewHistogramVec( prometheus.HistogramOpts{ - Name: Latency, + Name: LatencyKey, Help: latencyHelp, }, - []string{responseCode, destSvc}, + []string{responseCodeLabel, destSvcLabel}, ), eventType: prometheus.NewCounterVec( prometheus.CounterOpts{ Name: EventTypePublishedMetricKey, - Help: EventTypePublishedMetricHelp, + Help: eventTypePublishedMetricHelp, }, - []string{eventType, eventSource, responseCode}, + []string{eventTypeLabel, eventSourceLabel, responseCodeLabel}, ), requests: prometheus.NewCounterVec( prometheus.CounterOpts{ - Name: EventRequests, - Help: EventRequestsHelp, + Name: EventRequestsKey, + Help: eventRequestsHelp, }, - []string{responseCode, destSvc}, + []string{responseCodeLabel, destSvcLabel}, ), } } @@ -102,12 +102,12 @@ func (c *Collector) RecordLatency(duration time.Duration, statusCode int, destSv c.latency.WithLabelValues(fmt.Sprint(statusCode), destSvc).Observe(float64(duration.Milliseconds())) } -// RecordEventType records a eventType metric +// RecordEventType records an eventType metric func (c *Collector) RecordEventType(eventType, eventSource string, statusCode int) { c.eventType.WithLabelValues(eventType, eventSource, fmt.Sprint(statusCode)).Inc() } -// RecordRequests records the eventRequests metric +// RecordRequests records an eventRequests metric func (c *Collector) RecordRequests(statusCode int, destSvc string) { c.requests.WithLabelValues(fmt.Sprint(statusCode), destSvc).Inc() } diff --git a/pkg/metrics/metricstest/metricstest.go b/pkg/metrics/metricstest/metricstest.go index 09cbc3f..d6d5b57 100644 --- a/pkg/metrics/metricstest/metricstest.go +++ b/pkg/metrics/metricstest/metricstest.go @@ -10,12 +10,12 @@ import ( // EnsureMetricErrors ensures metric errors exists func EnsureMetricErrors(t *testing.T, collector *metrics.Collector) { - ensureMetricCount(t, collector, metrics.Errors, 1) + ensureMetricCount(t, collector, metrics.ErrorsKey, 1) } // EnsureMetricLatency ensures metric latency exists func EnsureMetricLatency(t *testing.T, collector *metrics.Collector) { - ensureMetricCount(t, collector, metrics.Latency, 1) + ensureMetricCount(t, collector, metrics.LatencyKey, 1) } // EnsureMetricEventTypePublished ensures metric eventType exists From cbd4b55b017fd42a006a7c5c9c7bc24b12feb441 Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Mon, 12 Sep 2022 16:06:40 +0200 Subject: [PATCH 105/194] Bump GOLANG to 1.19 for eventing (#15454) * Bump GOLANG to 1.19 for eventing * bump EPP and EC images --- cmd/event-publisher-proxy/Dockerfile | 2 +- go.mod | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/event-publisher-proxy/Dockerfile b/cmd/event-publisher-proxy/Dockerfile index a500ad1..2a72558 100644 --- a/cmd/event-publisher-proxy/Dockerfile +++ b/cmd/event-publisher-proxy/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.19.0-alpine3.16 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.19.1-alpine3.16 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy diff --git a/go.mod b/go.mod index 81e035e..792393e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy -go 1.18 +go 1.19 require ( github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1 @@ -18,6 +18,7 @@ require ( go.opencensus.io v0.23.0 go.uber.org/zap v1.23.0 golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 + golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f k8s.io/api v0.25.0 k8s.io/apimachinery v0.25.0 k8s.io/client-go v0.25.0 @@ -72,7 +73,6 @@ require ( golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect - golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect From 015e64a6e3929aa5dfa7e18702ab902afbde772e Mon Sep 17 00:00:00 2001 From: Friedrich Date: Fri, 16 Sep 2022 08:58:01 +0200 Subject: [PATCH 106/194] consistent naming in epp (#15500) * rename wantBebNs to wantBEBNamespace more * rename BebConfig tp BEBConfig * rename NewBebMessageSender to NewBEBMessageSender * rename BebMessageSender to BEBMessageSender * rename JetsreamSubjectPrefix to JetStreamSubjectPrefix * rename BebHandlerMock to BEBHandlerMock * rename BEBHandlerMockOpt * replaced Beb with BEB in comments * rename NatsServerModes to NATSServerModes * rename StartNatsServer to StartNATSServer * rename ConnectToNatsServer ConnectToNATSServer * rename NatsMessageSender to NATSMessageSender * rename ValidateNatsSubjectOrFail to ...NATS... * rename NatsConfig to NATS... * rename NewNatsMessageSender to ...NATS... * rename ValidateNatsMessageDataOrFail to ...NATS... * rename messageSenderToNats to ...NATS * rename newNatsConfig to ...NATS... * rename TestNatsMessageSender to ...NATS... * rename givenNatsConnectionClosed to ...NATS... * rename givenNatsConnectionClosed to ...NATS... * rename NatsHandlerMock to ...NATS... * rename givenNatsConnectionClosed to ...NATS... * rename NatsHandlerMockOpt to NATS... * rename CreateNatsJsConfig to ...NATS... * rename GetNatsConfig to ...NATS... * rename eventToNatsMsg to ...NATS... * rename givenNatsServerShutdown to ...NATS... * rename ShutdownNatsServerAndWait to ...NATS... * rename GetNatsUrl to ...NATS... * rename Nats to NATS * rename JetstreamEnabled to JetStream... * rename Jetstream to JetStream * rename TestJetstreamMessageSender to JetStream * rename WithJetStream * rename NewJetStreamMessageSender * rename JetsStreamMessageSender * rename JetStreamModeEnabled * bump image --- cmd/event-publisher-proxy/beb/beb.go | 6 +- cmd/event-publisher-proxy/main.go | 8 +- cmd/event-publisher-proxy/nats/nats.go | 12 +-- pkg/env/beb_config.go | 12 +-- pkg/env/beb_config_test.go | 2 +- pkg/env/nats_config.go | 16 ++-- pkg/handler/beb/handler.go | 4 +- pkg/handler/beb/mock/mock.go | 56 ++++++------- pkg/handler/nats/handler_health_test.go | 14 ++-- pkg/handler/nats/handler_integration_test.go | 26 +++--- pkg/handler/nats/health_test.go | 4 +- pkg/handler/nats/mock/mock.go | 86 ++++++++++---------- pkg/legacy-events/legacy_test.go | 6 +- pkg/nats/connect_test.go | 4 +- pkg/oauth/client.go | 2 +- pkg/oauth/client_test.go | 2 +- pkg/oauth/config.go | 2 +- pkg/oauth/config_test.go | 2 +- pkg/sender/beb.go | 14 ++-- pkg/sender/beb_test.go | 10 +-- pkg/sender/jetstream.go | 40 ++++----- pkg/sender/jetstream_test.go | 42 +++++----- pkg/sender/nats.go | 20 ++--- pkg/sender/nats_test.go | 16 ++-- pkg/subscribed/processor.go | 2 +- testing/env_config.go | 18 ++-- testing/nats.go | 24 +++--- 27 files changed, 225 insertions(+), 225 deletions(-) diff --git a/cmd/event-publisher-proxy/beb/beb.go b/cmd/event-publisher-proxy/beb/beb.go index ff8eb04..74b1f3b 100644 --- a/cmd/event-publisher-proxy/beb/beb.go +++ b/cmd/event-publisher-proxy/beb/beb.go @@ -35,7 +35,7 @@ const ( // Commander implements the Commander interface. type Commander struct { cancel context.CancelFunc - envCfg *env.BebConfig + envCfg *env.BEBConfig logger *logger.Logger metricsCollector *metrics.Collector opts *options.Options @@ -46,7 +46,7 @@ func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, lo return &Commander{ metricsCollector: metricsCollector, logger: logger, - envCfg: new(env.BebConfig), + envCfg: new(env.BEBConfig), opts: opts, } } @@ -75,7 +75,7 @@ func (c *Commander) Start() error { defer client.CloseIdleConnections() // configure message sender - messageSender := sender.NewBebMessageSender(c.envCfg.EmsPublishURL, client) + messageSender := sender.NewBEBMessageSender(c.envCfg.EmsPublishURL, client) // cluster config k8sConfig := config.GetConfigOrDie() diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index 96cf626..9462a3d 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -21,8 +21,8 @@ type Config struct { // Backend used for Eventing. It could be "nats" or "beb". Backend string `envconfig:"BACKEND" required:"true"` - // JetstreamModeEnabled indicates whether NATS backend will be used in default or jetstream mode. - JetstreamModeEnabled bool `envconfig:"ENABLE_JETSTREAM_BACKEND" default:"false"` + // JetStreamModeEnabled indicates whether NATS backend will be used in default or jetstream mode. + JetStreamModeEnabled bool `envconfig:"ENABLE_JETSTREAM_BACKEND" default:"false"` // AppLogFormat defines the log format. AppLogFormat string `envconfig:"APP_LOG_FORMAT" default:"json"` @@ -62,7 +62,7 @@ func main() { golog.Printf("Failed to flush logger, error: %v", err) } }() - setupLogger := logger.WithContext().With("backend", cfg.Backend, "jetstream mode", cfg.JetstreamModeEnabled) + setupLogger := logger.WithContext().With("backend", cfg.Backend, "jetstream mode", cfg.JetStreamModeEnabled) // metrics collector metricsCollector := metrics.NewCollector() @@ -74,7 +74,7 @@ func main() { case backendBEB: commander = beb.NewCommander(opts, metricsCollector, logger) case backendNATS: - commander = nats.NewCommander(opts, metricsCollector, logger, cfg.JetstreamModeEnabled) + commander = nats.NewCommander(opts, metricsCollector, logger, cfg.JetStreamModeEnabled) default: setupLogger.Fatalf("Invalid publisher backend: %v", cfg.Backend) } diff --git a/cmd/event-publisher-proxy/nats/nats.go b/cmd/event-publisher-proxy/nats/nats.go index 9fa547c..265261d 100644 --- a/cmd/event-publisher-proxy/nats/nats.go +++ b/cmd/event-publisher-proxy/nats/nats.go @@ -38,7 +38,7 @@ type Commander struct { cancel context.CancelFunc metricsCollector *metrics.Collector logger *logger.Logger - envCfg *env.NatsConfig + envCfg *env.NATSConfig opts *options.Options jetstreamMode bool } @@ -46,7 +46,7 @@ type Commander struct { // NewCommander creates the Commander for publisher to NATS. func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, logger *logger.Logger, jetstreamMode bool) *Commander { return &Commander{ - envCfg: new(env.NatsConfig), + envCfg: new(env.NATSConfig), logger: logger, metricsCollector: metricsCollector, opts: opts, @@ -85,11 +85,11 @@ func (c *Commander) Start() error { defer connection.Close() // configure the message sender - var messageSenderToNats sender.GenericSender + var messageSenderToNATS sender.GenericSender if c.jetstreamMode { - messageSenderToNats = sender.NewJetstreamMessageSender(ctx, connection, c.envCfg, c.logger) + messageSenderToNATS = sender.NewJetStreamMessageSender(ctx, connection, c.envCfg, c.logger) } else { - messageSenderToNats = sender.NewNatsMessageSender(ctx, connection, c.logger) + messageSenderToNATS = sender.NewNATSMessageSender(ctx, connection, c.logger) } // cluster config @@ -124,7 +124,7 @@ func (c *Commander) Start() error { eventTypeCleaner := eventtype.NewCleaner(c.envCfg.EventTypePrefix, applicationLister, c.logger) // start handler which blocks until it receives a shutdown signal - if err := nats.NewHandler(messageReceiver, &messageSenderToNats, c.envCfg.RequestTimeout, legacyTransformer, c.opts, + if err := nats.NewHandler(messageReceiver, &messageSenderToNATS, c.envCfg.RequestTimeout, legacyTransformer, c.opts, subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleaner).Start(ctx); err != nil { return xerrors.Errorf("failed to start handler for %s : %v", natsCommanderName, err) } diff --git a/pkg/env/beb_config.go b/pkg/env/beb_config.go index 0cdbf1f..19471c7 100644 --- a/pkg/env/beb_config.go +++ b/pkg/env/beb_config.go @@ -7,10 +7,10 @@ import ( ) // compile time check -var _ fmt.Stringer = &BebConfig{} +var _ fmt.Stringer = &BEBConfig{} -// BebConfig represents the environment config for the Event Publisher to BEB. -type BebConfig struct { +// BEBConfig represents the environment config for the Event Publisher to BEB. +type BEBConfig struct { Port int `envconfig:"INGRESS_PORT" default:"8080"` ClientID string `envconfig:"CLIENT_ID" required:"true"` ClientSecret string `envconfig:"CLIENT_SECRET" required:"true"` @@ -27,14 +27,14 @@ type BebConfig struct { } // ConfigureTransport receives an HTTP transport and configure its max idle connection properties. -func (c *BebConfig) ConfigureTransport(transport *http.Transport) { +func (c *BEBConfig) ConfigureTransport(transport *http.Transport) { transport.MaxIdleConns = c.MaxIdleConns transport.MaxIdleConnsPerHost = c.MaxIdleConnsPerHost } // String implements the fmt.Stringer interface -func (c *BebConfig) String() string { - return fmt.Sprintf("BebConfig{ Port: %v; TokenEndPoint: %v; EmsPublishURL: %v; "+ +func (c *BEBConfig) String() string { + return fmt.Sprintf("BEBConfig{ Port: %v; TokenEndPoint: %v; EmsPublishURL: %v; "+ "MaxIdleConns: %v; MaxIdleConnsPerHost: %v; RequestTimeout: %v; BEBNamespace: %v; EventTypePrefix: %v }", c.Port, c.TokenEndpoint, c.EmsPublishURL, c.MaxIdleConns, c.MaxIdleConnsPerHost, c.RequestTimeout, c.BEBNamespace, c.EventTypePrefix) } diff --git a/pkg/env/beb_config_test.go b/pkg/env/beb_config_test.go index 72deed5..276a7b9 100644 --- a/pkg/env/beb_config_test.go +++ b/pkg/env/beb_config_test.go @@ -14,7 +14,7 @@ func TestConfigureTransport(t *testing.T) { ) transport := &http.Transport{} - cfg := BebConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost} + cfg := BEBConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost} cfg.ConfigureTransport(transport) if transport.MaxIdleConns != maxIdleConns { diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go index fa10e9b..0c5411d 100644 --- a/pkg/env/nats_config.go +++ b/pkg/env/nats_config.go @@ -6,12 +6,12 @@ import ( ) // compile time check -var _ fmt.Stringer = &NatsConfig{} +var _ fmt.Stringer = &NATSConfig{} -const JetstreamSubjectPrefix = "kyma" +const JetStreamSubjectPrefix = "kyma" -// NatsConfig represents the environment config for the Event Publisher to NATS. -type NatsConfig struct { +// NATSConfig represents the environment config for the Event Publisher to NATS. +type NATSConfig struct { Port int `envconfig:"INGRESS_PORT" default:"8080"` URL string `envconfig:"NATS_URL" default:"nats.nats.svc.cluster.local"` RetryOnFailedConnect bool `envconfig:"RETRY_ON_FAILED_CONNECT" default:"true"` @@ -29,9 +29,9 @@ type NatsConfig struct { JSStreamName string `envconfig:"JS_STREAM_NAME" default:"kyma"` } -// ToConfig converts to a default BEB BebConfig -func (c *NatsConfig) ToConfig() *BebConfig { - cfg := &BebConfig{ +// ToConfig converts to a default BEB BEBConfig +func (c *NATSConfig) ToConfig() *BEBConfig { + cfg := &BEBConfig{ BEBNamespace: c.LegacyNamespace, EventTypePrefix: c.EventTypePrefix, } @@ -39,6 +39,6 @@ func (c *NatsConfig) ToConfig() *BebConfig { } // String implements the fmt.Stringer interface -func (c *NatsConfig) String() string { +func (c *NATSConfig) String() string { return fmt.Sprintf("%#v", c) } diff --git a/pkg/handler/beb/handler.go b/pkg/handler/beb/handler.go index 6c561df..7fab4b7 100644 --- a/pkg/handler/beb/handler.go +++ b/pkg/handler/beb/handler.go @@ -49,7 +49,7 @@ type Handler struct { // Receiver receives incoming HTTP requests Receiver *receiver.HTTPMessageReceiver // Sender sends requests to the broker - Sender *sender.BebMessageSender + Sender *sender.BEBMessageSender // Defaulter sets default values to incoming events Defaulter cev2client.EventDefaulter // LegacyTransformer handles transformations needed to handle legacy events @@ -69,7 +69,7 @@ type Handler struct { } // NewHandler returns a new HTTP Handler instance. -func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.BebMessageSender, requestTimeout time.Duration, +func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.BEBMessageSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logger.Logger, collector *metrics.Collector, eventTypeCleaner eventtype.Cleaner) *Handler { return &Handler{ diff --git a/pkg/handler/beb/mock/mock.go b/pkg/handler/beb/mock/mock.go index 1aeeac3..9475f78 100644 --- a/pkg/handler/beb/mock/mock.go +++ b/pkg/handler/beb/mock/mock.go @@ -47,10 +47,10 @@ const ( defaultEventsHTTP400Endpoint = "/events400" ) -// BebHandlerMock represents a mock for the beb.Handler. -type BebHandlerMock struct { +// BEBHandlerMock represents a mock for the beb.Handler. +type BEBHandlerMock struct { ctx context.Context - cfg *env.BebConfig + cfg *env.BEBConfig logger *logger.Logger collector *metrics.Collector livenessEndpoint string @@ -61,38 +61,38 @@ type BebHandlerMock struct { eventTypeCleaner eventtype.Cleaner } -// BebHandlerMockOpt represents a BebHandlerMock option. -type BebHandlerMockOpt func(*BebHandlerMock) +// BEBHandlerMockOpt represents a BEBHandlerMock option. +type BEBHandlerMockOpt func(*BEBHandlerMock) -// GetPort returns the port used by the BebHandlerMock. -func (m *BebHandlerMock) GetPort() int { +// GetPort returns the port used by the BEBHandlerMock. +func (m *BEBHandlerMock) GetPort() int { return m.cfg.Port } -// GetMetricsCollector returns the metrics.Collector used by the BebHandlerMock. -func (m *BebHandlerMock) GetMetricsCollector() *metrics.Collector { +// GetMetricsCollector returns the metrics.Collector used by the BEBHandlerMock. +func (m *BEBHandlerMock) GetMetricsCollector() *metrics.Collector { return m.collector } -// Close closes the testing.MockServer used by the BebHandlerMock. -func (m *BebHandlerMock) Close() { +// Close closes the testing.MockServer used by the BEBHandlerMock. +func (m *BEBHandlerMock) Close() { m.mockServer.Close() } -// GetLivenessEndpoint returns the liveness endpoint used by the BebHandlerMock. -func (m *BebHandlerMock) GetLivenessEndpoint() string { +// GetLivenessEndpoint returns the liveness endpoint used by the BEBHandlerMock. +func (m *BEBHandlerMock) GetLivenessEndpoint() string { return m.livenessEndpoint } -// GetReadinessEndpoint returns the readiness endpoint used by the BebHandlerMock. -func (m *BebHandlerMock) GetReadinessEndpoint() string { +// GetReadinessEndpoint returns the readiness endpoint used by the BEBHandlerMock. +func (m *BEBHandlerMock) GetReadinessEndpoint() string { return m.readinessEndpoint } -// StartOrDie starts a new BebHandlerMock instance or die if a precondition fails. +// StartOrDie starts a new BEBHandlerMock instance or die if a precondition fails. // Preconditions: 1) beb.Handler started without errors. func StartOrDie(ctx context.Context, t *testing.T, requestSize int, eventTypePrefix, eventsEndpoint string, - requestTimeout, serverResponseTime time.Duration, opts ...BebHandlerMockOpt) *BebHandlerMock { + requestTimeout, serverResponseTime time.Duration, opts ...BEBHandlerMockOpt) *BEBHandlerMock { mockServer := testingutils.NewMockServer(testingutils.WithResponseTime(serverResponseTime)) mockServer.Start(t, defaultTokenEndpoint, defaultEventsEndpoint, defaultEventsHTTP400Endpoint) @@ -108,7 +108,7 @@ func StartOrDie(ctx context.Context, t *testing.T, requestSize int, eventTypePre mockedLogger, err := logger.New("json", "info") require.NoError(t, err) - mock := &BebHandlerMock{ + mock := &BEBHandlerMock{ ctx: ctx, cfg: cfg, logger: mockedLogger, @@ -129,7 +129,7 @@ func StartOrDie(ctx context.Context, t *testing.T, requestSize int, eventTypePre defer client.CloseIdleConnections() msgReceiver := receiver.NewHTTPMessageReceiver(mock.cfg.Port) - msgSender := sender.NewBebMessageSender(mock.cfg.EmsPublishURL, client) + msgSender := sender.NewBEBMessageSender(mock.cfg.EmsPublishURL, client) msgHandlerOpts := &options.Options{MaxRequestSize: int64(requestSize)} msgHandler := beb.NewHandler( msgReceiver, @@ -185,16 +185,16 @@ func extractEventTypeFromRequest(r *http.Request) (string, error) { return eventType, nil } -// WithEventTypePrefix returns BebHandlerMockOpt which sets the eventTypePrefix for the given BebHandlerMock. -func WithEventTypePrefix(eventTypePrefix string) BebHandlerMockOpt { - return func(m *BebHandlerMock) { +// WithEventTypePrefix returns BEBHandlerMockOpt which sets the eventTypePrefix for the given BEBHandlerMock. +func WithEventTypePrefix(eventTypePrefix string) BEBHandlerMockOpt { + return func(m *BEBHandlerMock) { m.cfg.EventTypePrefix = eventTypePrefix } } -// WithApplication returns BebHandlerMockOpt which sets the subscribed.Processor for the given BebHandlerMock. -func WithApplication(applicationNameToCreate, applicationNameToValidate string) BebHandlerMockOpt { - return func(m *BebHandlerMock) { +// WithApplication returns BEBHandlerMockOpt which sets the subscribed.Processor for the given BEBHandlerMock. +func WithApplication(applicationNameToCreate, applicationNameToValidate string) BEBHandlerMockOpt { + return func(m *BEBHandlerMock) { applicationLister := handlertest.NewApplicationListerOrDie(m.ctx, applicationNameToCreate) m.legacyTransformer = legacy.NewTransformer(m.cfg.BEBNamespace, m.cfg.EventTypePrefix, applicationLister) validator := validateEventTypeContainsApplicationName(applicationNameToValidate) @@ -203,9 +203,9 @@ func WithApplication(applicationNameToCreate, applicationNameToValidate string) } } -// WithSubscription returns BebHandlerMockOpt which sets the subscribed.Processor for the given BebHandlerMock. -func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Subscription) BebHandlerMockOpt { - return func(m *BebHandlerMock) { +// WithSubscription returns BEBHandlerMockOpt which sets the subscribed.Processor for the given BEBHandlerMock. +func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Subscription) BEBHandlerMockOpt { + return func(m *BEBHandlerMock) { dynamicClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) informerFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicClient, time.Second, v1.NamespaceAll, nil) genericInformer := informerFactory.ForResource(subscribed.GVR) diff --git a/pkg/handler/nats/handler_health_test.go b/pkg/handler/nats/handler_health_test.go index 990d188..3099e47 100644 --- a/pkg/handler/nats/handler_health_test.go +++ b/pkg/handler/nats/handler_health_test.go @@ -12,19 +12,19 @@ import ( func TestHandlerHealth(t *testing.T) { testCases := []struct { name string - givenNatsServerShutdown bool + givenNATSServerShutdown bool wantLivenessStatusCode int wantReadinessStatusCode int }{ { name: "NATS handler is healthy", - givenNatsServerShutdown: false, + givenNATSServerShutdown: false, wantLivenessStatusCode: health.StatusCodeHealthy, wantReadinessStatusCode: health.StatusCodeHealthy, }, { name: "NATS handler is unhealthy", - givenNatsServerShutdown: true, + givenNATSServerShutdown: true, wantLivenessStatusCode: health.StatusCodeHealthy, wantReadinessStatusCode: health.StatusCodeNotHealthy, }, @@ -34,13 +34,13 @@ func TestHandlerHealth(t *testing.T) { tc := tc t.Run(tc.name, func(t *testing.T) { // test in both default and jetstream NATS modes - for _, serverMode := range testingutils.NatsServerModes { + for _, serverMode := range testingutils.NATSServerModes { t.Run(serverMode.Name, func(t *testing.T) { - handlerMock := mock.StartOrDie(context.TODO(), t, mock.WithJetstream(serverMode.JetstreamEnabled)) + handlerMock := mock.StartOrDie(context.TODO(), t, mock.WithJetStream(serverMode.JetStreamEnabled)) defer handlerMock.Stop() - if tc.givenNatsServerShutdown { - handlerMock.ShutdownNatsServerAndWait() + if tc.givenNATSServerShutdown { + handlerMock.ShutdownNATSServerAndWait() } testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetLivenessEndpoint(), tc.wantLivenessStatusCode) diff --git a/pkg/handler/nats/handler_integration_test.go b/pkg/handler/nats/handler_integration_test.go index 96784d9..0976c1c 100644 --- a/pkg/handler/nats/handler_integration_test.go +++ b/pkg/handler/nats/handler_integration_test.go @@ -98,22 +98,22 @@ func TestHandlerForCloudEvents(t *testing.T) { defer cancel() // test in both default and jetstream NATS modes - for _, serverMode := range testingutils.NatsServerModes { + for _, serverMode := range testingutils.NATSServerModes { t.Run(serverMode.Name, func(t *testing.T) { handlerMock := mock.StartOrDie(ctx, t, mock.WithEventTypePrefix(tc.givenEventTypePrefix), mock.WithApplication(tc.givenApplicationName), - mock.WithJetstream(serverMode.JetstreamEnabled), + mock.WithJetStream(serverMode.JetStreamEnabled), ) defer handlerMock.Stop() // run the tests for publishing cloudevents - publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", handlerMock.GetNatsConfig().Port) + publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", handlerMock.GetNATSConfig().Port) for _, testCase := range handlertest.TestCasesForCloudEvents { testCase := testCase t.Run(testCase.Name, func(t *testing.T) { // connect to nats - connection, err := testingutils.ConnectToNatsServer(handlerMock.GetNatsURL()) + connection, err := testingutils.ConnectToNATSServer(handlerMock.GetNATSURL()) assert.Nil(t, err) assert.NotNil(t, connection) defer connection.Close() @@ -121,7 +121,7 @@ func TestHandlerForCloudEvents(t *testing.T) { // validator to check NATS received events notify := make(chan bool) defer close(notify) - validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantEventType, notify) + validator := testingutils.ValidateNATSSubjectOrFail(t, tc.wantEventType, notify) testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) body, headers := testCase.ProvideMessage(tc.wantEventType) @@ -219,22 +219,22 @@ func TestHandlerForLegacyEvents(t *testing.T) { defer cancel() // test in both default and jetstream NATS modes - for _, serverMode := range testingutils.NatsServerModes { + for _, serverMode := range testingutils.NATSServerModes { t.Run(serverMode.Name, func(t *testing.T) { handlerMock := mock.StartOrDie(ctx, t, mock.WithEventTypePrefix(tc.givenEventTypePrefix), mock.WithApplication(tc.givenApplicationName), - mock.WithJetstream(serverMode.JetstreamEnabled), + mock.WithJetStream(serverMode.JetStreamEnabled), ) defer handlerMock.Stop() // run the tests for publishing legacy events - publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/%s/v1/events", handlerMock.GetNatsConfig().Port, tc.givenApplicationName) + publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/%s/v1/events", handlerMock.GetNATSConfig().Port, tc.givenApplicationName) for _, testCase := range handlertest.TestCasesForLegacyEvents { testCase := testCase t.Run(testCase.Name, func(t *testing.T) { // connect to nats - connection, err := testingutils.ConnectToNatsServer(handlerMock.GetNatsURL()) + connection, err := testingutils.ConnectToNATSServer(handlerMock.GetNATSURL()) assert.Nil(t, err) assert.NotNil(t, connection) defer connection.Close() @@ -242,7 +242,7 @@ func TestHandlerForLegacyEvents(t *testing.T) { // publish a message to NATS and validate it notify := make(chan bool) defer close(notify) - validator := testingutils.ValidateNatsSubjectOrFail(t, tc.wantEventType, notify) + validator := testingutils.ValidateNATSSubjectOrFail(t, tc.wantEventType, notify) testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) body, headers := testCase.ProvideMessage() @@ -305,13 +305,13 @@ func TestHandlerForSubscribedEndpoint(t *testing.T) { ) // test in both default and jetstream NATS modes - for _, serverMode := range testingutils.NatsServerModes { + for _, serverMode := range testingutils.NATSServerModes { t.Run(serverMode.Name, func(t *testing.T) { handlerMock := mock.StartOrDie(ctx, t, mock.WithEventTypePrefix(tc.givenEventTypePrefix), mock.WithSubscription(scheme, subscription), mock.WithApplication(testingutils.ApplicationName), - mock.WithJetstream(serverMode.JetstreamEnabled), + mock.WithJetStream(serverMode.JetStreamEnabled), ) defer handlerMock.Stop() @@ -319,7 +319,7 @@ func TestHandlerForSubscribedEndpoint(t *testing.T) { for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { testCase := testCase t.Run(testCase.Name, func(t *testing.T) { - subscribedURL := fmt.Sprintf(subscribedEndpointFormat, handlerMock.GetNatsConfig().Port, testCase.AppName) + subscribedURL := fmt.Sprintf(subscribedEndpointFormat, handlerMock.GetNATSConfig().Port, testCase.AppName) resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) require.NoError(t, err) require.Equal(t, testCase.WantStatusCode, resp.StatusCode) diff --git a/pkg/handler/nats/health_test.go b/pkg/handler/nats/health_test.go index ff1d373..a9f16aa 100644 --- a/pkg/handler/nats/health_test.go +++ b/pkg/handler/nats/health_test.go @@ -41,7 +41,7 @@ func TestReadinessCheck(t *testing.T) { t.Run(tc.name, func(t *testing.T) { // test in both default and jetstream NATS modes - for _, serverMode := range testingutils.NatsServerModes { + for _, serverMode := range testingutils.NATSServerModes { t.Run(serverMode.Name, func(t *testing.T) { defer func() { r := recover() @@ -50,7 +50,7 @@ func TestReadinessCheck(t *testing.T) { } }() - handlerMock := mock.StartOrDie(context.TODO(), t, mock.WithJetstream(serverMode.JetstreamEnabled)) + handlerMock := mock.StartOrDie(context.TODO(), t, mock.WithJetStream(serverMode.JetStreamEnabled)) defer handlerMock.Stop() var handler http.HandlerFunc diff --git a/pkg/handler/nats/mock/mock.go b/pkg/handler/nats/mock/mock.go index 1c36dc8..44e8dac 100644 --- a/pkg/handler/nats/mock/mock.go +++ b/pkg/handler/nats/mock/mock.go @@ -34,8 +34,8 @@ import ( eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) -// NatsHandlerMock represents a mock for the nats.Handler. -type NatsHandlerMock struct { +// NATSHandlerMock represents a mock for the nats.Handler. +type NATSHandlerMock struct { ctx context.Context handler *nats.Handler livenessEndpoint string @@ -44,7 +44,7 @@ type NatsHandlerMock struct { logger *logger.Logger natsServer *server.Server jetstreamMode bool - natsConfig *env.NatsConfig + natsConfig *env.NATSConfig collector *metrics.Collector legacyTransformer *legacy.Transformer subscribedProcessor *subscribed.Processor @@ -52,23 +52,23 @@ type NatsHandlerMock struct { connection *natsio.Conn } -// NatsHandlerMockOpt represents a NatsHandlerMock option. -type NatsHandlerMockOpt func(*NatsHandlerMock) +// NATSHandlerMockOpt represents a NATSHandlerMock option. +type NATSHandlerMockOpt func(*NATSHandlerMock) -// StartOrDie starts a new NatsHandlerMock instance or die if a precondition fails. +// StartOrDie starts a new NATSHandlerMock instance or die if a precondition fails. // Preconditions: 1) NATS connection and 2) nats.Handler started without errors. -func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) *NatsHandlerMock { +func StartOrDie(ctx context.Context, t *testing.T, opts ...NATSHandlerMockOpt) *NATSHandlerMock { port := testingutils.GeneratePortOrDie() mockedLogger, err := logger.New("json", "info") require.NoError(t, err) - mock := &NatsHandlerMock{ + mock := &NATSHandlerMock{ ctx: ctx, livenessEndpoint: fmt.Sprintf("http://localhost:%d%s", port, health.LivenessURI), readinessEndpoint: fmt.Sprintf("http://localhost:%d%s", port, health.ReadinessURI), logger: mockedLogger, - natsConfig: newNatsConfig(port), + natsConfig: newNATSConfig(port), collector: metrics.NewCollector(), legacyTransformer: &legacy.Transformer{}, subscribedProcessor: &subscribed.Processor{}, @@ -78,17 +78,17 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) * for _, opt := range opts { opt(mock) } - mock.natsServer = testingutils.StartNatsServer(mock.jetstreamMode) + mock.natsServer = testingutils.StartNATSServer(mock.jetstreamMode) msgReceiver := receiver.NewHTTPMessageReceiver(mock.natsConfig.Port) - connection, err := testingutils.ConnectToNatsServer(mock.GetNatsURL()) + connection, err := testingutils.ConnectToNATSServer(mock.GetNATSURL()) require.NoError(t, err) mock.connection = connection //nolint:gosimple var msgSender sender.GenericSender - msgSender = sender.NewNatsMessageSender(ctx, mock.connection, mock.logger) + msgSender = sender.NewNATSMessageSender(ctx, mock.connection, mock.logger) mock.handler = nats.NewHandler( msgReceiver, @@ -108,58 +108,58 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NatsHandlerMockOpt) * return mock } -// Stop closes the sender.NatsMessageSender connection and calls the NatsHandlerMock.ShutdownNatsServerAndWait. -func (m *NatsHandlerMock) Stop() { +// Stop closes the sender.NATSMessageSender connection and calls the NATSHandlerMock.ShutdownNATSServerAndWait. +func (m *NATSHandlerMock) Stop() { m.connection.Close() - m.ShutdownNatsServerAndWait() + m.ShutdownNATSServerAndWait() } -// ShutdownNatsServerAndWait shuts down the NATS server used by the NatsHandlerMock and waits for the shutdown. -func (m *NatsHandlerMock) ShutdownNatsServerAndWait() { +// ShutdownNATSServerAndWait shuts down the NATS server used by the NATSHandlerMock and waits for the shutdown. +func (m *NATSHandlerMock) ShutdownNATSServerAndWait() { m.natsServer.Shutdown() m.natsServer.WaitForShutdown() } -// GetNatsURL returns the NATS server URL used by the NatsHandlerMock. -func (m *NatsHandlerMock) GetNatsURL() string { +// GetNATSURL returns the NATS server URL used by the NATSHandlerMock. +func (m *NATSHandlerMock) GetNATSURL() string { return m.natsServer.ClientURL() } -// GetLivenessEndpoint returns the liveness endpoint used by the NatsHandlerMock. -func (m *NatsHandlerMock) GetLivenessEndpoint() string { +// GetLivenessEndpoint returns the liveness endpoint used by the NATSHandlerMock. +func (m *NATSHandlerMock) GetLivenessEndpoint() string { return m.livenessEndpoint } -// GetReadinessEndpoint returns the readiness endpoint used by the NatsHandlerMock. -func (m *NatsHandlerMock) GetReadinessEndpoint() string { +// GetReadinessEndpoint returns the readiness endpoint used by the NATSHandlerMock. +func (m *NATSHandlerMock) GetReadinessEndpoint() string { return m.readinessEndpoint } -// GetHandler returns the nats.Handler used by the NatsHandlerMock. -func (m *NatsHandlerMock) GetHandler() *nats.Handler { +// GetHandler returns the nats.Handler used by the NATSHandlerMock. +func (m *NATSHandlerMock) GetHandler() *nats.Handler { return m.handler } -// GetMetricsCollector returns the metrics.Collector used by the NatsHandlerMock. -func (m *NatsHandlerMock) GetMetricsCollector() *metrics.Collector { +// GetMetricsCollector returns the metrics.Collector used by the NATSHandlerMock. +func (m *NATSHandlerMock) GetMetricsCollector() *metrics.Collector { return m.collector } -// GetNatsConfig returns the env.NatsConfig used by the NatsHandlerMock. -func (m *NatsHandlerMock) GetNatsConfig() *env.NatsConfig { +// GetNATSConfig returns the env.NATSConfig used by the NATSHandlerMock. +func (m *NATSHandlerMock) GetNATSConfig() *env.NATSConfig { return m.natsConfig } -// WithEventTypePrefix returns NatsHandlerMockOpt which sets the eventTypePrefix for the given NatsHandlerMock. -func WithEventTypePrefix(eventTypePrefix string) NatsHandlerMockOpt { - return func(m *NatsHandlerMock) { +// WithEventTypePrefix returns NATSHandlerMockOpt which sets the eventTypePrefix for the given NATSHandlerMock. +func WithEventTypePrefix(eventTypePrefix string) NATSHandlerMockOpt { + return func(m *NATSHandlerMock) { m.eventTypePrefix = eventTypePrefix } } -// WithSubscription returns NatsHandlerMockOpt which sets the subscribed.Processor for the given NatsHandlerMock. -func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Subscription) NatsHandlerMockOpt { - return func(m *NatsHandlerMock) { +// WithSubscription returns NATSHandlerMockOpt which sets the subscribed.Processor for the given NATSHandlerMock. +func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Subscription) NATSHandlerMockOpt { + return func(m *NATSHandlerMock) { m.natsConfig.EventTypePrefix = m.eventTypePrefix dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, 10*time.Second, v1.NamespaceAll, nil) @@ -175,9 +175,9 @@ func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Sub } } -// WithApplication returns NatsHandlerMockOpt which sets the legacy.Transformer for the given NatsHandlerMock. -func WithApplication(applicationName string) NatsHandlerMockOpt { - return func(m *NatsHandlerMock) { +// WithApplication returns NATSHandlerMockOpt which sets the legacy.Transformer for the given NATSHandlerMock. +func WithApplication(applicationName string) NATSHandlerMockOpt { + return func(m *NATSHandlerMock) { applicationLister := handlertest.NewApplicationListerOrDie(m.ctx, applicationName) m.legacyTransformer = legacy.NewTransformer( m.natsConfig.ToConfig().BEBNamespace, @@ -188,15 +188,15 @@ func WithApplication(applicationName string) NatsHandlerMockOpt { } } -// WithJetstream returns NatsHandlerMockOpt which starts the NATS server in the jetstream mode for the given NatsHandlerMock. -func WithJetstream(jsEnabled bool) NatsHandlerMockOpt { - return func(m *NatsHandlerMock) { +// WithJetStream returns NATSHandlerMockOpt which starts the NATS server in the jetstream mode for the given NATSHandlerMock. +func WithJetStream(jsEnabled bool) NATSHandlerMockOpt { + return func(m *NATSHandlerMock) { m.jetstreamMode = jsEnabled } } -func newNatsConfig(port int) *env.NatsConfig { - return &env.NatsConfig{ +func newNATSConfig(port int) *env.NATSConfig { + return &env.NATSConfig{ Port: port, LegacyNamespace: testingutils.MessagingNamespace, EventTypePrefix: testingutils.MessagingEventTypePrefix, diff --git a/pkg/legacy-events/legacy_test.go b/pkg/legacy-events/legacy_test.go index 85b0a8f..5cb4878 100644 --- a/pkg/legacy-events/legacy_test.go +++ b/pkg/legacy-events/legacy_test.go @@ -162,16 +162,16 @@ func TestConvertPublishRequestToCloudEvent(t *testing.T) { }, } - wantBebNs := MessagingNamespace + wantBEBNamespace := MessagingNamespace wantEventID := givenEventID wantEventType := formatEventType(givenEventTypePrefix, givenApplicationName, eventTypeMultiSegmentCombined, givenLegacyEventVersion) wantTimeNowFormatted, _ := time.Parse(time.RFC3339, givenTimeNow) wantDataContentType := internal.ContentTypeApplicationJSON - legacyTransformer := NewTransformer(wantBebNs, givenEventTypePrefix, nil) + legacyTransformer := NewTransformer(wantBEBNamespace, givenEventTypePrefix, nil) gotEvent, err := legacyTransformer.convertPublishRequestToCloudEvent(givenApplicationName, givenPublishReqParams) require.NoError(t, err) - assert.Equal(t, wantBebNs, gotEvent.Context.GetSource()) + assert.Equal(t, wantBEBNamespace, gotEvent.Context.GetSource()) assert.Equal(t, wantEventID, gotEvent.Context.GetID()) assert.Equal(t, wantEventType, gotEvent.Context.GetType()) assert.Equal(t, wantTimeNowFormatted, gotEvent.Context.GetTime()) diff --git a/pkg/nats/connect_test.go b/pkg/nats/connect_test.go index d4a141d..4a872b8 100644 --- a/pkg/nats/connect_test.go +++ b/pkg/nats/connect_test.go @@ -37,11 +37,11 @@ func TestConnect(t *testing.T) { t.Run(tc.name, func(t *testing.T) { // test in both default and jetstream NATS modes - for _, serverMode := range publishertesting.NatsServerModes { + for _, serverMode := range publishertesting.NATSServerModes { t.Run(serverMode.Name, func(t *testing.T) { tc := tc // given - natsServer := publishertesting.StartNatsServer(serverMode.JetstreamEnabled) + natsServer := publishertesting.StartNATSServer(serverMode.JetStreamEnabled) assert.NotNil(t, natsServer) defer natsServer.Shutdown() diff --git a/pkg/oauth/client.go b/pkg/oauth/client.go index ce06880..0c07a2b 100644 --- a/pkg/oauth/client.go +++ b/pkg/oauth/client.go @@ -12,7 +12,7 @@ import ( ) // NewClient returns a new HTTP client which have nested transports for handling oauth2 security, HTTP connection pooling, and tracing. -func NewClient(ctx context.Context, cfg *env.BebConfig) *http.Client { +func NewClient(ctx context.Context, cfg *env.BEBConfig) *http.Client { // configure auth client config := Config(cfg) client := config.Client(ctx) diff --git a/pkg/oauth/client_test.go b/pkg/oauth/client_test.go index 52ac10f..4d829f9 100644 --- a/pkg/oauth/client_test.go +++ b/pkg/oauth/client_test.go @@ -22,7 +22,7 @@ func TestNewClient(t *testing.T) { maxIdleConnsPerHost = 200 ) - client := NewClient(context.Background(), &env.BebConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) + client := NewClient(context.Background(), &env.BEBConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) defer client.CloseIdleConnections() ocTransport, ok := client.Transport.(*ochttp.Transport) diff --git a/pkg/oauth/config.go b/pkg/oauth/config.go index 55445ff..3360949 100644 --- a/pkg/oauth/config.go +++ b/pkg/oauth/config.go @@ -7,7 +7,7 @@ import ( ) // Config returns a new oauth2 client credentials config instance. -func Config(cfg *env.BebConfig) clientcredentials.Config { +func Config(cfg *env.BEBConfig) clientcredentials.Config { return clientcredentials.Config{ ClientID: cfg.ClientID, ClientSecret: cfg.ClientSecret, diff --git a/pkg/oauth/config_test.go b/pkg/oauth/config_test.go index e417abf..503f80d 100644 --- a/pkg/oauth/config_test.go +++ b/pkg/oauth/config_test.go @@ -9,7 +9,7 @@ import ( func TestConfig(t *testing.T) { t.Parallel() - cfg := &env.BebConfig{ClientID: "someID", ClientSecret: "someSecret", TokenEndpoint: "someEndpoint"} + cfg := &env.BEBConfig{ClientID: "someID", ClientSecret: "someSecret", TokenEndpoint: "someEndpoint"} conf := Config(cfg) if cfg.ClientID != conf.ClientID { diff --git a/pkg/sender/beb.go b/pkg/sender/beb.go index 3528322..a4a50ad 100644 --- a/pkg/sender/beb.go +++ b/pkg/sender/beb.go @@ -5,23 +5,23 @@ import ( "net/http" ) -// BebMessageSender is responsible for sending messages over HTTP. -type BebMessageSender struct { +// BEBMessageSender is responsible for sending messages over HTTP. +type BEBMessageSender struct { Client *http.Client Target string } -// NewBebMessageSender returns a new BebMessageSender instance with the given target and client. -func NewBebMessageSender(target string, client *http.Client) *BebMessageSender { - return &BebMessageSender{Client: client, Target: target} +// NewBEBMessageSender returns a new BEBMessageSender instance with the given target and client. +func NewBEBMessageSender(target string, client *http.Client) *BEBMessageSender { + return &BEBMessageSender{Client: client, Target: target} } // NewRequestWithTarget returns a new HTTP POST request with the given context and target. -func (s *BebMessageSender) NewRequestWithTarget(ctx context.Context, target string) (*http.Request, error) { +func (s *BEBMessageSender) NewRequestWithTarget(ctx context.Context, target string) (*http.Request, error) { return http.NewRequestWithContext(ctx, http.MethodPost, target, nil) } // Send sends the given HTTP request and returns the HTTP response back. -func (s *BebMessageSender) Send(req *http.Request) (*http.Response, error) { +func (s *BEBMessageSender) Send(req *http.Request) (*http.Response, error) { return s.Client.Do(req) } diff --git a/pkg/sender/beb_test.go b/pkg/sender/beb_test.go index 46f9d6c..782e76e 100644 --- a/pkg/sender/beb_test.go +++ b/pkg/sender/beb_test.go @@ -25,10 +25,10 @@ const ( func TestNewHttpMessageSender(t *testing.T) { t.Parallel() - client := oauth.NewClient(context.Background(), &env.BebConfig{}) + client := oauth.NewClient(context.Background(), &env.BEBConfig{}) defer client.CloseIdleConnections() - msgSender := NewBebMessageSender(eventsEndpoint, client) + msgSender := NewBEBMessageSender(eventsEndpoint, client) if msgSender.Target != eventsEndpoint { t.Errorf("Message sender target is misconfigured want: %s but got: %s", eventsEndpoint, msgSender.Target) } @@ -40,10 +40,10 @@ func TestNewHttpMessageSender(t *testing.T) { func TestNewRequestWithTarget(t *testing.T) { t.Parallel() - client := oauth.NewClient(context.Background(), &env.BebConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) + client := oauth.NewClient(context.Background(), &env.BEBConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) defer client.CloseIdleConnections() - msgSender := NewBebMessageSender(eventsEndpoint, client) + msgSender := NewBEBMessageSender(eventsEndpoint, client) type ctxKey struct{} const ctxValue = "testValue" @@ -91,7 +91,7 @@ func TestSend(t *testing.T) { client := oauth.NewClient(ctx, cfg) defer client.CloseIdleConnections() - msgSender := NewBebMessageSender(emsCEURL, client) + msgSender := NewBEBMessageSender(emsCEURL, client) request, err := msgSender.NewRequestWithTarget(ctx, msgSender.Target) if err != nil { diff --git a/pkg/sender/jetstream.go b/pkg/sender/jetstream.go index 8796907..deb1407 100644 --- a/pkg/sender/jetstream.go +++ b/pkg/sender/jetstream.go @@ -24,36 +24,36 @@ const ( ) // compile time check -var _ GenericSender = &JetstreamMessageSender{} +var _ GenericSender = &JetStreamMessageSender{} -// JetstreamMessageSender is responsible for sending messages over HTTP. -type JetstreamMessageSender struct { +// JetStreamMessageSender is responsible for sending messages over HTTP. +type JetStreamMessageSender struct { ctx context.Context logger *logger.Logger connection *nats.Conn - envCfg *env.NatsConfig + envCfg *env.NATSConfig } -// NewJetstreamMessageSender returns a new NewJetstreamMessageSender instance with the given nats connection. -func NewJetstreamMessageSender(ctx context.Context, connection *nats.Conn, envCfg *env.NatsConfig, logger *logger.Logger) *JetstreamMessageSender { - return &JetstreamMessageSender{ctx: ctx, connection: connection, envCfg: envCfg, logger: logger} +// NewJetStreamMessageSender returns a new NewJetStreamMessageSender instance with the given nats connection. +func NewJetStreamMessageSender(ctx context.Context, connection *nats.Conn, envCfg *env.NATSConfig, logger *logger.Logger) *JetStreamMessageSender { + return &JetStreamMessageSender{ctx: ctx, connection: connection, envCfg: envCfg, logger: logger} } // URL returns the URL of the Sender's connection. -func (s *JetstreamMessageSender) URL() string { +func (s *JetStreamMessageSender) URL() string { return s.connection.ConnectedUrl() } -// ConnectionStatus returns nats.Status for the NATS connection used by the JetstreamMessageSender. -func (s *JetstreamMessageSender) ConnectionStatus() nats.Status { +// ConnectionStatus returns nats.Status for the NATS connection used by the JetStreamMessageSender. +func (s *JetStreamMessageSender) ConnectionStatus() nats.Status { return s.connection.Status() } -// Send dispatches the event to the NATS backend in Jetstream mode. +// Send dispatches the event to the NATS backend in JetStream mode. // If the NATS connection is not open, it returns an error. -func (s *JetstreamMessageSender) Send(_ context.Context, event *event.Event) (int, error) { +func (s *JetStreamMessageSender) Send(_ context.Context, event *event.Event) (int, error) { if s.ConnectionStatus() != nats.CONNECTED { - return http.StatusBadGateway, errors.New("connection status: no connection to NATS Jetstream server") + return http.StatusBadGateway, errors.New("connection status: no connection to NATS JetStream server") } // ensure the stream exists streamExists, err := s.streamExists(s.connection) @@ -68,7 +68,7 @@ func (s *JetstreamMessageSender) Send(_ context.Context, event *event.Event) (in if jsError != nil { return http.StatusInternalServerError, jsError } - msg, err := s.eventToNatsMsg(event) + msg, err := s.eventToNATSMsg(event) if err != nil { return http.StatusUnprocessableEntity, err } @@ -86,7 +86,7 @@ func (s *JetstreamMessageSender) Send(_ context.Context, event *event.Event) (in } // streamExists checks if the stream with the expected name exists. -func (s *JetstreamMessageSender) streamExists(connection *nats.Conn) (bool, error) { +func (s *JetStreamMessageSender) streamExists(connection *nats.Conn) (bool, error) { jsCtx, err := connection.JetStream() if err != nil { return false, err @@ -101,8 +101,8 @@ func (s *JetstreamMessageSender) streamExists(connection *nats.Conn) (bool, erro return false, nats.ErrStreamNotFound } -// eventToNatsMsg translates cloud event into the NATS Msg. -func (s *JetstreamMessageSender) eventToNatsMsg(event *event.Event) (*nats.Msg, error) { +// eventToNATSMsg translates cloud event into the NATS Msg. +func (s *JetStreamMessageSender) eventToNATSMsg(event *event.Event) (*nats.Msg, error) { header := make(nats.Header) header.Set(internal.HeaderContentType, event.DataContentType()) header.Set(internal.CeSpecVersionHeader, event.SpecVersion()) @@ -123,10 +123,10 @@ func (s *JetstreamMessageSender) eventToNatsMsg(event *event.Event) (*nats.Msg, } // getJsSubjectToPublish appends stream name to subject if needed. -func (s *JetstreamMessageSender) getJsSubjectToPublish(subject string) string { - return fmt.Sprintf("%s.%s", env.JetstreamSubjectPrefix, subject) +func (s *JetStreamMessageSender) getJsSubjectToPublish(subject string) string { + return fmt.Sprintf("%s.%s", env.JetStreamSubjectPrefix, subject) } -func (s *JetstreamMessageSender) namedLogger() *zap.SugaredLogger { +func (s *JetStreamMessageSender) namedLogger() *zap.SugaredLogger { return s.logger.WithContext().Named(jestreamHandlerName).With("backend", natsBackend, "jetstream enabled", true) } diff --git a/pkg/sender/jetstream_test.go b/pkg/sender/jetstream_test.go index e356253..14a3d69 100644 --- a/pkg/sender/jetstream_test.go +++ b/pkg/sender/jetstream_test.go @@ -23,31 +23,31 @@ import ( "github.com/stretchr/testify/assert" ) -func TestJetstreamMessageSender(t *testing.T) { +func TestJetStreamMessageSender(t *testing.T) { testCases := []struct { name string givenStream bool - givenNatsConnectionClosed bool + givenNATSConnectionClosed bool wantError bool wantStatusCode int }{ { name: "send in jetstream mode should not succeed if stream doesn't exist", givenStream: false, - givenNatsConnectionClosed: false, + givenNATSConnectionClosed: false, wantError: true, wantStatusCode: http.StatusNotFound, }, { name: "send in jetstream mode should succeed if NATS connection is open and the stream exists", givenStream: true, - givenNatsConnectionClosed: false, + givenNATSConnectionClosed: false, wantError: false, wantStatusCode: http.StatusNoContent, }, { name: "send in jetstream mode should fail if NATS connection is not open", - givenNatsConnectionClosed: true, + givenNATSConnectionClosed: true, wantError: true, wantStatusCode: http.StatusBadGateway, }, @@ -73,9 +73,9 @@ func TestJetstreamMessageSender(t *testing.T) { // when ctx := context.Background() - sender := NewJetstreamMessageSender(context.Background(), connection, testEnv.Config, mockedLogger) + sender := NewJetStreamMessageSender(context.Background(), connection, testEnv.Config, mockedLogger) - if tc.givenNatsConnectionClosed { + if tc.givenNATSConnectionClosed { connection.Close() } @@ -93,28 +93,28 @@ func TestStreamExists(t *testing.T) { testCases := []struct { name string givenStream bool - givenNatsConnectionClosed bool + givenNATSConnectionClosed bool wantResult bool wantError error }{ { name: "Stream doesn't exist and should return false", givenStream: false, - givenNatsConnectionClosed: false, + givenNATSConnectionClosed: false, wantResult: false, wantError: nats.ErrStreamNotFound, }, { name: "Stream exists and should return true", givenStream: true, - givenNatsConnectionClosed: false, + givenNATSConnectionClosed: false, wantResult: true, wantError: nil, }, { name: "Connection closed and error should happen", givenStream: true, - givenNatsConnectionClosed: true, + givenNATSConnectionClosed: true, wantResult: false, wantError: nats.ErrConnectionClosed, }, @@ -137,7 +137,7 @@ func TestStreamExists(t *testing.T) { } // close the connection to provoke the error - if tc.givenNatsConnectionClosed { + if tc.givenNATSConnectionClosed { connection.Close() } @@ -155,23 +155,23 @@ func TestStreamExists(t *testing.T) { type TestEnvironment struct { Connection *nats.Conn - Config *env.NatsConfig + Config *env.NATSConfig Logger *logger.Logger - Sender *JetstreamMessageSender + Sender *JetStreamMessageSender Server *server.Server JsContext *nats.JetStreamContext } // setupTestEnvironment sets up the resources and mocks required for testing. func setupTestEnvironment(t *testing.T) *TestEnvironment { - natsServer := testingutils.StartNatsServer(true) + natsServer := testingutils.StartNATSServer(true) require.NotNil(t, natsServer) - connection, err := testingutils.ConnectToNatsServer(natsServer.ClientURL()) + connection, err := testingutils.ConnectToNATSServer(natsServer.ClientURL()) require.NotNil(t, connection) require.NoError(t, err) - natsConfig := CreateNatsJsConfig(natsServer.ClientURL()) + natsConfig := CreateNATSJsConfig(natsServer.ClientURL()) mockedLogger, err := logger.New("json", "info") require.NoError(t, err) @@ -179,7 +179,7 @@ func setupTestEnvironment(t *testing.T) *TestEnvironment { jsCtx, err := connection.JetStream() require.NoError(t, err) - sender := &JetstreamMessageSender{ + sender := &JetStreamMessageSender{ connection: connection, envCfg: natsConfig, logger: mockedLogger, @@ -213,7 +213,7 @@ func createCloudEvent(t *testing.T) *event.Event { func getStreamConfig() *nats.StreamConfig { return &nats.StreamConfig{ Name: testingutils.StreamName, - Subjects: []string{fmt.Sprintf("%s.>", env.JetstreamSubjectPrefix)}, + Subjects: []string{fmt.Sprintf("%s.>", env.JetStreamSubjectPrefix)}, Storage: nats.MemoryStorage, Retention: nats.InterestPolicy, } @@ -227,8 +227,8 @@ func addStream(t *testing.T, connection *nats.Conn, config *nats.StreamConfig) { assert.NoError(t, err) } -func CreateNatsJsConfig(url string) *env.NatsConfig { - return &env.NatsConfig{ +func CreateNATSJsConfig(url string) *env.NATSConfig { + return &env.NATSConfig{ JSStreamName: testingutils.StreamName, URL: url, ReconnectWait: time.Second, diff --git a/pkg/sender/nats.go b/pkg/sender/nats.go index 4c7af9b..348519c 100644 --- a/pkg/sender/nats.go +++ b/pkg/sender/nats.go @@ -14,7 +14,7 @@ import ( ) // compile time check -var _ GenericSender = &NatsMessageSender{} +var _ GenericSender = &NATSMessageSender{} type GenericSender interface { Send(context.Context, *event.Event) (int, error) @@ -22,31 +22,31 @@ type GenericSender interface { URL() string } -// NatsMessageSender is responsible for sending messages over HTTP. -type NatsMessageSender struct { +// NATSMessageSender is responsible for sending messages over HTTP. +type NATSMessageSender struct { ctx context.Context logger *logger.Logger connection *nats.Conn } -// NewNatsMessageSender returns a new NewNatsMessageSender instance with the given nats connection. -func NewNatsMessageSender(ctx context.Context, connection *nats.Conn, logger *logger.Logger) *NatsMessageSender { - return &NatsMessageSender{ctx: ctx, connection: connection, logger: logger} +// NewNATSMessageSender returns a new NewNATSMessageSender instance with the given nats connection. +func NewNATSMessageSender(ctx context.Context, connection *nats.Conn, logger *logger.Logger) *NATSMessageSender { + return &NATSMessageSender{ctx: ctx, connection: connection, logger: logger} } // URL returns the URL of the Sender's connection. -func (s *NatsMessageSender) URL() string { +func (s *NATSMessageSender) URL() string { return s.connection.ConnectedUrl() } -// ConnectionStatus returns nats.Status for the NATS connection used by the NatsMessageSender. -func (s *NatsMessageSender) ConnectionStatus() nats.Status { +// ConnectionStatus returns nats.Status for the NATS connection used by the NATSMessageSender. +func (s *NATSMessageSender) ConnectionStatus() nats.Status { return s.connection.Status() } // Send dispatches the event.Event to NATS server. // If the NATS connection is not open, it returns an error. -func (s *NatsMessageSender) Send(ctx context.Context, event *event.Event) (int, error) { +func (s *NATSMessageSender) Send(ctx context.Context, event *event.Event) (int, error) { if s.ConnectionStatus() != nats.CONNECTED { return http.StatusBadGateway, errors.New("connection status: no connection to NATS server") } diff --git a/pkg/sender/nats_test.go b/pkg/sender/nats_test.go index ffdf222..9fe0040 100644 --- a/pkg/sender/nats_test.go +++ b/pkg/sender/nats_test.go @@ -15,24 +15,24 @@ import ( testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) -func TestNatsMessageSender(t *testing.T) { +func TestNATSMessageSender(t *testing.T) { t.Parallel() testCases := []struct { name string - givenNatsConnectionClosed bool + givenNATSConnectionClosed bool wantError bool wantStatusCode int }{ { name: "send should succeed if NATS connection is open", - givenNatsConnectionClosed: false, + givenNATSConnectionClosed: false, wantError: false, wantStatusCode: http.StatusNoContent, }, { name: "send should fail if NATS connection is not open", - givenNatsConnectionClosed: true, + givenNATSConnectionClosed: true, wantError: true, wantStatusCode: http.StatusBadGateway, }, @@ -42,7 +42,7 @@ func TestNatsMessageSender(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() - natsServer := testingutils.StartNatsServer(false) + natsServer := testingutils.StartNATSServer(false) assert.NotNil(t, natsServer) defer natsServer.Shutdown() @@ -56,7 +56,7 @@ func TestNatsMessageSender(t *testing.T) { defer func() { connection.Close() }() receive := make(chan bool, 1) - validator := testingutils.ValidateNatsMessageDataOrFail(t, fmt.Sprintf(`"%s"`, testingutils.EventData), receive) + validator := testingutils.ValidateNATSMessageDataOrFail(t, fmt.Sprintf(`"%s"`, testingutils.EventData), receive) testingutils.SubscribeToEventOrFail(t, connection, testingutils.CloudEventType, validator) ce := createCloudEvent(t) @@ -64,9 +64,9 @@ func TestNatsMessageSender(t *testing.T) { mockedLogger, _ := logger.New("json", "info") ctx := context.Background() - sender := NewNatsMessageSender(context.Background(), connection, mockedLogger) + sender := NewNATSMessageSender(context.Background(), connection, mockedLogger) - if tc.givenNatsConnectionClosed { + if tc.givenNATSConnectionClosed { connection.Close() } diff --git a/pkg/subscribed/processor.go b/pkg/subscribed/processor.go index bd6f7ae..2738958 100644 --- a/pkg/subscribed/processor.go +++ b/pkg/subscribed/processor.go @@ -16,7 +16,7 @@ const processorName = "processor" type Processor struct { SubscriptionLister *cache.GenericLister - Config *env.BebConfig + Config *env.BEBConfig Logger *logger.Logger } diff --git a/testing/env_config.go b/testing/env_config.go index f67f3c0..af33876 100644 --- a/testing/env_config.go +++ b/testing/env_config.go @@ -6,48 +6,48 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" ) -func NewEnvConfig(emsCEURL, authURL string, opts ...EnvConfigOption) *env.BebConfig { - envConfig := &env.BebConfig{Port: 8080, EmsPublishURL: emsCEURL, TokenEndpoint: authURL, RequestTimeout: time.Minute} +func NewEnvConfig(emsCEURL, authURL string, opts ...EnvConfigOption) *env.BEBConfig { + envConfig := &env.BEBConfig{Port: 8080, EmsPublishURL: emsCEURL, TokenEndpoint: authURL, RequestTimeout: time.Minute} for _, opt := range opts { opt(envConfig) } return envConfig } -type EnvConfigOption func(e *env.BebConfig) +type EnvConfigOption func(e *env.BEBConfig) func WithPort(port int) EnvConfigOption { - return func(e *env.BebConfig) { + return func(e *env.BEBConfig) { e.Port = port } } func WithMaxIdleConns(maxIdleConns int) EnvConfigOption { - return func(e *env.BebConfig) { + return func(e *env.BEBConfig) { e.MaxIdleConns = maxIdleConns } } func WithMaxIdleConnsPerHost(maxIdleConnsPerHost int) EnvConfigOption { - return func(e *env.BebConfig) { + return func(e *env.BEBConfig) { e.MaxIdleConnsPerHost = maxIdleConnsPerHost } } func WithRequestTimeout(requestTimeout time.Duration) EnvConfigOption { - return func(e *env.BebConfig) { + return func(e *env.BEBConfig) { e.RequestTimeout = requestTimeout } } func WithBEBNamespace(bebNs string) EnvConfigOption { - return func(e *env.BebConfig) { + return func(e *env.BEBConfig) { e.BEBNamespace = bebNs } } func WithEventTypePrefix(eventTypePrefix string) EnvConfigOption { - return func(e *env.BebConfig) { + return func(e *env.BEBConfig) { e.EventTypePrefix = eventTypePrefix } } diff --git a/testing/nats.go b/testing/nats.go index bc93d5b..209c320 100644 --- a/testing/nats.go +++ b/testing/nats.go @@ -20,35 +20,35 @@ const ( StreamName = "kyma" ) -var NatsServerModes = []struct { +var NATSServerModes = []struct { Name string - JetstreamEnabled bool + JetStreamEnabled bool }{ { Name: "jetstream disabled", - JetstreamEnabled: false, + JetStreamEnabled: false, }, { Name: "jetstream enabled", - JetstreamEnabled: true, + JetStreamEnabled: true, }, } -func StartNatsServer(enableJetstream bool) *server.Server { +func StartNATSServer(enableJetStream bool) *server.Server { opts := test.DefaultTestOptions opts.Port = server.RANDOM_PORT - opts.JetStream = enableJetstream + opts.JetStream = enableJetStream log, _ := logger.New("json", "info") - if enableJetstream { - log.WithContext().Info("Starting test NATS Server in Jetstream mode") + if enableJetStream { + log.WithContext().Info("Starting test NATS Server in JetStream mode") } else { log.WithContext().Info("Starting test NATS Server in default mode") } return test.RunServer(&opts) } -func ConnectToNatsServer(url string) (*nats.Conn, error) { +func ConnectToNATSServer(url string) (*nats.Conn, error) { return pkgnats.Connect(url, pkgnats.WithRetryOnFailedConnect(true), pkgnats.WithMaxReconnects(3), @@ -64,7 +64,7 @@ func SubscribeToEventOrFail(t *testing.T, connection *nats.Conn, eventType strin } } -func ValidateNatsSubjectOrFail(t *testing.T, subject string, notify ...chan bool) nats.MsgHandler { +func ValidateNATSSubjectOrFail(t *testing.T, subject string, notify ...chan bool) nats.MsgHandler { return func(msg *nats.Msg) { for _, n := range notify { n <- true @@ -75,10 +75,10 @@ func ValidateNatsSubjectOrFail(t *testing.T, subject string, notify ...chan bool } } -// ValidateNatsMessageDataOrFail returns a function which can be used to validate a nats.Msg. +// ValidateNATSMessageDataOrFail returns a function which can be used to validate a nats.Msg. // It reads the data from nats.Msg and unmarshalls it as a CloudEvent. // The data section of the CloudEvent is then checked against the value provided in data. -func ValidateNatsMessageDataOrFail(t *testing.T, data string, notify ...chan bool) nats.MsgHandler { +func ValidateNATSMessageDataOrFail(t *testing.T, data string, notify ...chan bool) nats.MsgHandler { return func(msg *nats.Msg) { for _, n := range notify { n <- true From 1b130a0c149c1e298970b20174d98d70b2c11053 Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Fri, 23 Sep 2022 09:48:10 +0200 Subject: [PATCH 107/194] Fix the Eventing publisher proxy lint issues (#15609) * Fix the Eventing publisher proxy lint issues * Update image --- pkg/handler/beb/handler.go | 4 ++-- pkg/handler/beb/handler_integration_test.go | 4 ++-- pkg/handler/handlertest/handlertest.go | 6 +++--- pkg/handler/nats/handler_integration_test.go | 4 ++-- pkg/metrics/server.go | 15 +++++++++++---- pkg/receiver/receiver.go | 11 +++++++---- 6 files changed, 27 insertions(+), 17 deletions(-) diff --git a/pkg/handler/beb/handler.go b/pkg/handler/beb/handler.go index 7fab4b7..ae2d299 100644 --- a/pkg/handler/beb/handler.go +++ b/pkg/handler/beb/handler.go @@ -2,7 +2,7 @@ package beb import ( "context" - "io/ioutil" + "io" "net/http" "time" @@ -252,7 +252,7 @@ func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.D defer func() { _ = resp.Body.Close() }() h.collector.RecordLatency(dispatchTime, resp.StatusCode, request.URL.Host) h.collector.RecordRequests(resp.StatusCode, request.URL.Host) - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { h.namedLogger().Errorw("Failed to read response body", "error", err) return http.StatusInternalServerError, dispatchTime, []byte{} diff --git a/pkg/handler/beb/handler_integration_test.go b/pkg/handler/beb/handler_integration_test.go index 8fe0655..208bcd0 100644 --- a/pkg/handler/beb/handler_integration_test.go +++ b/pkg/handler/beb/handler_integration_test.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "testing" "time" @@ -429,7 +429,7 @@ func TestHandlerForSubscribedEndpoint(t *testing.T) { require.NoError(t, err) require.Equal(t, testCase.WantStatusCode, resp.StatusCode) defer func() { require.NoError(t, resp.Body.Close()) }() - respBodyBytes, err := ioutil.ReadAll(resp.Body) + respBodyBytes, err := io.ReadAll(resp.Body) require.NoError(t, err) gotEventsResponse := subscribed.Events{} err = json.Unmarshal(respBodyBytes, &gotEventsResponse) diff --git a/pkg/handler/handlertest/handlertest.go b/pkg/handler/handlertest/handlertest.go index 3c733f8..7da5bfc 100644 --- a/pkg/handler/handlertest/handlertest.go +++ b/pkg/handler/handlertest/handlertest.go @@ -4,7 +4,7 @@ package handlertest import ( "context" "encoding/json" - "io/ioutil" + "io" "net/http" "testing" @@ -23,7 +23,7 @@ import ( func ValidateLegacyErrorResponse(t *testing.T, resp http.Response, wantResponse *legacyapi.PublishEventResponses) { legacyResponse := legacyapi.PublishEventResponses{} legacyErrorResponse := legacyapi.Error{} - bodyBytes, err := ioutil.ReadAll(resp.Body) + bodyBytes, err := io.ReadAll(resp.Body) require.NoError(t, err) err = json.Unmarshal(bodyBytes, &legacyErrorResponse) require.NoError(t, err) @@ -37,7 +37,7 @@ func ValidateLegacyErrorResponse(t *testing.T, resp http.Response, wantResponse func ValidateLegacyOkResponse(t *testing.T, resp http.Response, wantResponse *legacyapi.PublishEventResponses) { legacyResponse := legacyapi.PublishEventResponses{} legacyOkResponse := legacyapi.PublishResponse{} - bodyBytes, err := ioutil.ReadAll(resp.Body) + bodyBytes, err := io.ReadAll(resp.Body) require.NoError(t, err) err = json.Unmarshal(bodyBytes, &legacyOkResponse) require.NoError(t, err) diff --git a/pkg/handler/nats/handler_integration_test.go b/pkg/handler/nats/handler_integration_test.go index 0976c1c..c8097a2 100644 --- a/pkg/handler/nats/handler_integration_test.go +++ b/pkg/handler/nats/handler_integration_test.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "testing" "time" @@ -324,7 +324,7 @@ func TestHandlerForSubscribedEndpoint(t *testing.T) { require.NoError(t, err) require.Equal(t, testCase.WantStatusCode, resp.StatusCode) - respBodyBytes, err := ioutil.ReadAll(resp.Body) + respBodyBytes, err := io.ReadAll(resp.Body) require.NoError(t, err) require.NoError(t, resp.Body.Close()) diff --git a/pkg/metrics/server.go b/pkg/metrics/server.go index 900c479..ce85485 100644 --- a/pkg/metrics/server.go +++ b/pkg/metrics/server.go @@ -5,14 +5,18 @@ import ( "net" "net/http" "strings" + "time" - "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/prometheus/client_golang/prometheus/promhttp" "go.uber.org/zap" - "github.com/prometheus/client_golang/prometheus/promhttp" + "github.com/kyma-project/kyma/components/eventing-controller/logger" ) -const metricsServerLoggerName = "metrics-server" +const ( + readHeaderTimeout = time.Second * 5 + metricsServerLoggerName = "metrics-server" +) type Server struct { srv http.Server @@ -25,7 +29,10 @@ func NewServer(logger *logger.Logger) *Server { func (s *Server) Start(address string) error { if len(strings.TrimSpace(address)) > 0 { - s.srv = http.Server{Handler: promhttp.Handler()} + s.srv = http.Server{ + ReadHeaderTimeout: readHeaderTimeout, + Handler: promhttp.Handler(), + } listener, err := net.Listen("tcp", address) if err != nil { diff --git a/pkg/receiver/receiver.go b/pkg/receiver/receiver.go index 88f8ec5..4264b87 100644 --- a/pkg/receiver/receiver.go +++ b/pkg/receiver/receiver.go @@ -7,9 +7,9 @@ import ( "net/http" "time" - kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" - "go.opencensus.io/plugin/ochttp" + + kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" ) const ( @@ -17,6 +17,8 @@ const ( defaultShutdownTimeout = time.Minute * 1 receiverName = "receiver" + + readHeaderTimeout = time.Second * 5 ) // HTTPMessageReceiver is responsible for receiving messages over HTTP. @@ -41,8 +43,9 @@ func (recv *HTTPMessageReceiver) StartListen(ctx context.Context, handler http.H recv.handler = createHandler(handler) recv.server = &http.Server{ - Addr: recv.listener.Addr().String(), - Handler: recv.handler, + ReadHeaderTimeout: readHeaderTimeout, + Addr: recv.listener.Addr().String(), + Handler: recv.handler, } errChan := make(chan error, 1) From ad4fc59020ce1fa6f2564923ee56233c79e60fbf Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Tue, 27 Sep 2022 11:02:46 +0200 Subject: [PATCH 108/194] remove dead code (unused nats core) (#15560) * initial naive removal of nats core * remove nats-core from epp * image bump * fix lint issues * fix formatting * fix unreachable code * fix test * fix review issues * remove jetstream.enabled flag * fix linting and fast-integration * fix shadowing lint issues --- cmd/event-publisher-proxy/main.go | 12 +- cmd/event-publisher-proxy/nats/nats.go | 15 +- pkg/handler/beb/handler.go | 3 +- pkg/handler/beb/handler_integration_test.go | 3 +- pkg/handler/handlertest/handlertest.go | 2 +- pkg/handler/nats/handler.go | 8 +- pkg/handler/nats/handler_health_test.go | 19 +- pkg/handler/nats/handler_integration_test.go | 198 +++++++++---------- pkg/handler/nats/health.go | 2 +- pkg/handler/nats/health_test.go | 37 ++-- pkg/handler/nats/mock/mock.go | 33 ++-- pkg/metrics/server.go | 4 +- pkg/nats/connect_test.go | 49 ++--- pkg/receiver/receiver.go | 7 +- pkg/sender/jetstream.go | 9 +- pkg/sender/jetstream_test.go | 5 +- pkg/sender/nats.go | 69 ------- pkg/sender/nats_test.go | 81 -------- testing/nats.go | 35 ++-- 19 files changed, 198 insertions(+), 393 deletions(-) delete mode 100644 pkg/sender/nats.go delete mode 100644 pkg/sender/nats_test.go diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index 9462a3d..4571d6f 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -4,12 +4,13 @@ import ( golog "log" "github.com/kelseyhightower/envconfig" + kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/prometheus/client_golang/prometheus" + "github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy/beb" "github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" - "github.com/prometheus/client_golang/prometheus" ) const ( @@ -21,9 +22,6 @@ type Config struct { // Backend used for Eventing. It could be "nats" or "beb". Backend string `envconfig:"BACKEND" required:"true"` - // JetStreamModeEnabled indicates whether NATS backend will be used in default or jetstream mode. - JetStreamModeEnabled bool `envconfig:"ENABLE_JETSTREAM_BACKEND" default:"false"` - // AppLogFormat defines the log format. AppLogFormat string `envconfig:"APP_LOG_FORMAT" default:"json"` @@ -62,7 +60,7 @@ func main() { golog.Printf("Failed to flush logger, error: %v", err) } }() - setupLogger := logger.WithContext().With("backend", cfg.Backend, "jetstream mode", cfg.JetStreamModeEnabled) + setupLogger := logger.WithContext().With("backend", cfg.Backend) // metrics collector metricsCollector := metrics.NewCollector() @@ -74,7 +72,7 @@ func main() { case backendBEB: commander = beb.NewCommander(opts, metricsCollector, logger) case backendNATS: - commander = nats.NewCommander(opts, metricsCollector, logger, cfg.JetStreamModeEnabled) + commander = nats.NewCommander(opts, metricsCollector, logger) default: setupLogger.Fatalf("Invalid publisher backend: %v", cfg.Backend) } diff --git a/cmd/event-publisher-proxy/nats/nats.go b/cmd/event-publisher-proxy/nats/nats.go index 265261d..9b2c1bd 100644 --- a/cmd/event-publisher-proxy/nats/nats.go +++ b/cmd/event-publisher-proxy/nats/nats.go @@ -40,17 +40,15 @@ type Commander struct { logger *logger.Logger envCfg *env.NATSConfig opts *options.Options - jetstreamMode bool } // NewCommander creates the Commander for publisher to NATS. -func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, logger *logger.Logger, jetstreamMode bool) *Commander { +func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, logger *logger.Logger) *Commander { return &Commander{ envCfg: new(env.NATSConfig), logger: logger, metricsCollector: metricsCollector, opts: opts, - jetstreamMode: jetstreamMode, } } @@ -85,12 +83,7 @@ func (c *Commander) Start() error { defer connection.Close() // configure the message sender - var messageSenderToNATS sender.GenericSender - if c.jetstreamMode { - messageSenderToNATS = sender.NewJetStreamMessageSender(ctx, connection, c.envCfg, c.logger) - } else { - messageSenderToNATS = sender.NewNATSMessageSender(ctx, connection, c.logger) - } + messageSender := sender.NewJetStreamMessageSender(ctx, connection, c.envCfg, c.logger) // cluster config k8sConfig := config.GetConfigOrDie() @@ -124,7 +117,7 @@ func (c *Commander) Start() error { eventTypeCleaner := eventtype.NewCleaner(c.envCfg.EventTypePrefix, applicationLister, c.logger) // start handler which blocks until it receives a shutdown signal - if err := nats.NewHandler(messageReceiver, &messageSenderToNATS, c.envCfg.RequestTimeout, legacyTransformer, c.opts, + if err := nats.NewHandler(messageReceiver, messageSender, c.envCfg.RequestTimeout, legacyTransformer, c.opts, subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleaner).Start(ctx); err != nil { return xerrors.Errorf("failed to start handler for %s : %v", natsCommanderName, err) } @@ -141,5 +134,5 @@ func (c *Commander) Stop() error { } func (c *Commander) namedLogger() *zap.SugaredLogger { - return c.logger.WithContext().Named(natsCommanderName).With("backend", natsBackend, "jestream mode", c.jetstreamMode) + return c.logger.WithContext().Named(natsCommanderName).With("backend", natsBackend) } diff --git a/pkg/handler/beb/handler.go b/pkg/handler/beb/handler.go index ae2d299..b1407db 100644 --- a/pkg/handler/beb/handler.go +++ b/pkg/handler/beb/handler.go @@ -13,6 +13,7 @@ import ( cev2client "github.com/cloudevents/sdk-go/v2/client" cev2event "github.com/cloudevents/sdk-go/v2/event" cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" + "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" cloudevents "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" @@ -56,7 +57,7 @@ type Handler struct { LegacyTransformer *legacy.Transformer // RequestTimeout timeout for outgoing requests RequestTimeout time.Duration - //SubscribedProcessor processes requests for /:app/v1/events/subscribed endpoint + // SubscribedProcessor processes requests for /:app/v1/events/subscribed endpoint SubscribedProcessor *subscribed.Processor // Logger default logger Logger *logger.Logger diff --git a/pkg/handler/beb/handler_integration_test.go b/pkg/handler/beb/handler_integration_test.go index 208bcd0..2f6ddef 100644 --- a/pkg/handler/beb/handler_integration_test.go +++ b/pkg/handler/beb/handler_integration_test.go @@ -14,6 +14,8 @@ import ( "github.com/stretchr/testify/require" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/beb/mock" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" @@ -21,7 +23,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) const ( diff --git a/pkg/handler/handlertest/handlertest.go b/pkg/handler/handlertest/handlertest.go index 7da5bfc..5fc0440 100644 --- a/pkg/handler/handlertest/handlertest.go +++ b/pkg/handler/handlertest/handlertest.go @@ -8,6 +8,7 @@ import ( "net/http" "testing" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" "github.com/stretchr/testify/require" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" @@ -16,7 +17,6 @@ import ( legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) // ValidateLegacyErrorResponse validates error responses for the legacy events endpoint. diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go index 49c3c9e..1fcdf4b 100644 --- a/pkg/handler/nats/handler.go +++ b/pkg/handler/nats/handler.go @@ -35,14 +35,14 @@ type Handler struct { // Receiver receives incoming HTTP requests Receiver *receiver.HTTPMessageReceiver // Sender sends requests to the broker - Sender *sender.GenericSender + Sender sender.GenericSender // Defaulter sets default values to incoming events Defaulter cev2client.EventDefaulter // LegacyTransformer handles transformations needed to handle legacy events LegacyTransformer *legacy.Transformer // RequestTimeout timeout for outgoing requests RequestTimeout time.Duration - //SubscribedProcessor processes requests for /:app/v1/events/subscribed endpoint + // SubscribedProcessor processes requests for /:app/v1/events/subscribed endpoint SubscribedProcessor *subscribed.Processor // Logger default logger Logger *logger.Logger @@ -55,7 +55,7 @@ type Handler struct { } // NewHandler returns a new NATS Handler instance. -func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.GenericSender, requestTimeout time.Duration, +func NewHandler(receiver *receiver.HTTPMessageReceiver, sender sender.GenericSender, requestTimeout time.Duration, legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logger.Logger, collector *metrics.Collector, eventTypeCleaner eventtype.Cleaner) *Handler { return &Handler{ @@ -220,7 +220,7 @@ func (h *Handler) receive(ctx context.Context, event *cev2event.Event) { // send dispatches the given Cloud Event to NATS and returns the response details and dispatch time. func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.Duration, []byte) { start := time.Now() - s := *h.Sender + s := h.Sender resp, err := s.Send(ctx, event) h.collector.RecordEventType(event.Type(), event.Source(), resp) dispatchTime := time.Since(start) diff --git a/pkg/handler/nats/handler_health_test.go b/pkg/handler/nats/handler_health_test.go index 3099e47..4a6a82c 100644 --- a/pkg/handler/nats/handler_health_test.go +++ b/pkg/handler/nats/handler_health_test.go @@ -33,20 +33,15 @@ func TestHandlerHealth(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - // test in both default and jetstream NATS modes - for _, serverMode := range testingutils.NATSServerModes { - t.Run(serverMode.Name, func(t *testing.T) { - handlerMock := mock.StartOrDie(context.TODO(), t, mock.WithJetStream(serverMode.JetStreamEnabled)) - defer handlerMock.Stop() + handlerMock := mock.StartOrDie(context.TODO(), t) + defer handlerMock.Stop() - if tc.givenNATSServerShutdown { - handlerMock.ShutdownNATSServerAndWait() - } - - testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetLivenessEndpoint(), tc.wantLivenessStatusCode) - testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetReadinessEndpoint(), tc.wantReadinessStatusCode) - }) + if tc.givenNATSServerShutdown { + handlerMock.ShutdownNATSServerAndWait() } + + testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetLivenessEndpoint(), tc.wantLivenessStatusCode) + testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetReadinessEndpoint(), tc.wantReadinessStatusCode) }) } } diff --git a/pkg/handler/nats/handler_integration_test.go b/pkg/handler/nats/handler_integration_test.go index c8097a2..43ad710 100644 --- a/pkg/handler/nats/handler_integration_test.go +++ b/pkg/handler/nats/handler_integration_test.go @@ -9,18 +9,17 @@ import ( "testing" "time" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime" - + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats/mock" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) func TestHandlerForCloudEvents(t *testing.T) { @@ -97,46 +96,40 @@ func TestHandlerForCloudEvents(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - // test in both default and jetstream NATS modes - for _, serverMode := range testingutils.NATSServerModes { - t.Run(serverMode.Name, func(t *testing.T) { - handlerMock := mock.StartOrDie(ctx, t, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithApplication(tc.givenApplicationName), - mock.WithJetStream(serverMode.JetStreamEnabled), - ) - defer handlerMock.Stop() + handlerMock := mock.StartOrDie(ctx, t, + mock.WithEventTypePrefix(tc.givenEventTypePrefix), + mock.WithApplication(tc.givenApplicationName), + ) + defer handlerMock.Stop() - // run the tests for publishing cloudevents - publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", handlerMock.GetNATSConfig().Port) - for _, testCase := range handlertest.TestCasesForCloudEvents { - testCase := testCase - t.Run(testCase.Name, func(t *testing.T) { - // connect to nats - connection, err := testingutils.ConnectToNATSServer(handlerMock.GetNATSURL()) - assert.Nil(t, err) - assert.NotNil(t, connection) - defer connection.Close() + // run the tests for publishing cloudevents + publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", handlerMock.GetNATSConfig().Port) + for _, testCase := range handlertest.TestCasesForCloudEvents { + testCase := testCase + t.Run(testCase.Name, func(t *testing.T) { + // connect to nats + connection, err := testingutils.ConnectToNATSServer(handlerMock.GetNATSURL()) + assert.Nil(t, err) + assert.NotNil(t, connection) + defer connection.Close() - // validator to check NATS received events - notify := make(chan bool) - defer close(notify) - validator := testingutils.ValidateNATSSubjectOrFail(t, tc.wantEventType, notify) - testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) + // validator to check NATS received events + notify := make(chan bool) + defer close(notify) + validator := testingutils.ValidateNATSSubjectOrFail(t, tc.wantEventType, notify) + testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) - body, headers := testCase.ProvideMessage(tc.wantEventType) - resp, err := testingutils.SendEvent(publishEndpoint, body, headers) - assert.NoError(t, err) - assert.NoError(t, resp.Body.Close()) - assert.Equal(t, testCase.WantStatusCode, resp.StatusCode) - if testingutils.IsNot4XX(resp.StatusCode) { - metricstest.EnsureMetricEventTypePublished(t, handlerMock.GetMetricsCollector()) - } - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) - assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*3)) - } - }) + body, headers := testCase.ProvideMessage(tc.wantEventType) + resp, err := testingutils.SendEvent(publishEndpoint, body, headers) + assert.NoError(t, err) + assert.NoError(t, resp.Body.Close()) + assert.Equal(t, testCase.WantStatusCode, resp.StatusCode) + if testingutils.IsNot4XX(resp.StatusCode) { + metricstest.EnsureMetricEventTypePublished(t, handlerMock.GetMetricsCollector()) + } + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) + assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*3)) } }) } @@ -218,51 +211,45 @@ func TestHandlerForLegacyEvents(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - // test in both default and jetstream NATS modes - for _, serverMode := range testingutils.NATSServerModes { - t.Run(serverMode.Name, func(t *testing.T) { - handlerMock := mock.StartOrDie(ctx, t, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithApplication(tc.givenApplicationName), - mock.WithJetStream(serverMode.JetStreamEnabled), - ) - defer handlerMock.Stop() + handlerMock := mock.StartOrDie(ctx, t, + mock.WithEventTypePrefix(tc.givenEventTypePrefix), + mock.WithApplication(tc.givenApplicationName), + ) + defer handlerMock.Stop() - // run the tests for publishing legacy events - publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/%s/v1/events", handlerMock.GetNATSConfig().Port, tc.givenApplicationName) - for _, testCase := range handlertest.TestCasesForLegacyEvents { - testCase := testCase - t.Run(testCase.Name, func(t *testing.T) { - // connect to nats - connection, err := testingutils.ConnectToNATSServer(handlerMock.GetNATSURL()) - assert.Nil(t, err) - assert.NotNil(t, connection) - defer connection.Close() + // run the tests for publishing legacy events + publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/%s/v1/events", handlerMock.GetNATSConfig().Port, tc.givenApplicationName) + for _, testCase := range handlertest.TestCasesForLegacyEvents { + testCase := testCase + t.Run(testCase.Name, func(t *testing.T) { + // connect to nats + connection, err := testingutils.ConnectToNATSServer(handlerMock.GetNATSURL()) + assert.Nil(t, err) + assert.NotNil(t, connection) + defer connection.Close() - // publish a message to NATS and validate it - notify := make(chan bool) - defer close(notify) - validator := testingutils.ValidateNATSSubjectOrFail(t, tc.wantEventType, notify) - testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) + // publish a message to NATS and validate it + notify := make(chan bool) + defer close(notify) + validator := testingutils.ValidateNATSSubjectOrFail(t, tc.wantEventType, notify) + testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) - body, headers := testCase.ProvideMessage() - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - require.NoError(t, err) - require.Equal(t, testCase.WantStatusCode, resp.StatusCode) + body, headers := testCase.ProvideMessage() + resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) + require.NoError(t, err) + require.Equal(t, testCase.WantStatusCode, resp.StatusCode) - if testCase.WantStatusCode == http.StatusOK { - handlertest.ValidateLegacyOkResponse(t, *resp, &testCase.WantResponse) - } else { - handlertest.ValidateLegacyErrorResponse(t, *resp, &testCase.WantResponse) - } - if testingutils.IsNot4XX(resp.StatusCode) { - metricstest.EnsureMetricEventTypePublished(t, handlerMock.GetMetricsCollector()) - } - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) - assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*3)) - } - }) + if testCase.WantStatusCode == http.StatusOK { + handlertest.ValidateLegacyOkResponse(t, *resp, &testCase.WantResponse) + } else { + handlertest.ValidateLegacyErrorResponse(t, *resp, &testCase.WantResponse) + } + if testingutils.IsNot4XX(resp.StatusCode) { + metricstest.EnsureMetricEventTypePublished(t, handlerMock.GetMetricsCollector()) + } + if testingutils.Is2XX(resp.StatusCode) { + metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) + assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*10)) } }) } @@ -304,36 +291,29 @@ func TestHandlerForSubscribedEndpoint(t *testing.T) { testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, tc.givenEventType), ) - // test in both default and jetstream NATS modes - for _, serverMode := range testingutils.NATSServerModes { - t.Run(serverMode.Name, func(t *testing.T) { - handlerMock := mock.StartOrDie(ctx, t, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithSubscription(scheme, subscription), - mock.WithApplication(testingutils.ApplicationName), - mock.WithJetStream(serverMode.JetStreamEnabled), - ) - defer handlerMock.Stop() + handlerMock := mock.StartOrDie(ctx, t, + mock.WithEventTypePrefix(tc.givenEventTypePrefix), + mock.WithSubscription(scheme, subscription), + mock.WithApplication(testingutils.ApplicationName), + ) + defer handlerMock.Stop() - // run the tests for subscribed endpoint - for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { - testCase := testCase - t.Run(testCase.Name, func(t *testing.T) { - subscribedURL := fmt.Sprintf(subscribedEndpointFormat, handlerMock.GetNATSConfig().Port, testCase.AppName) - resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) - require.NoError(t, err) - require.Equal(t, testCase.WantStatusCode, resp.StatusCode) + for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { + testCase := testCase + t.Run(testCase.Name, func(t *testing.T) { + subscribedURL := fmt.Sprintf(subscribedEndpointFormat, handlerMock.GetNATSConfig().Port, testCase.AppName) + resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) + require.NoError(t, err) + require.Equal(t, testCase.WantStatusCode, resp.StatusCode) - respBodyBytes, err := io.ReadAll(resp.Body) - require.NoError(t, err) - require.NoError(t, resp.Body.Close()) + respBodyBytes, err := io.ReadAll(resp.Body) + require.NoError(t, err) + require.NoError(t, resp.Body.Close()) - gotEventsResponse := subscribed.Events{} - err = json.Unmarshal(respBodyBytes, &gotEventsResponse) - require.NoError(t, err) - require.Equal(t, testCase.WantResponse, gotEventsResponse) - }) - } + gotEventsResponse := subscribed.Events{} + err = json.Unmarshal(respBodyBytes, &gotEventsResponse) + require.NoError(t, err) + require.Equal(t, testCase.WantResponse, gotEventsResponse) }) } }) diff --git a/pkg/handler/nats/health.go b/pkg/handler/nats/health.go index 505b522..e00af09 100644 --- a/pkg/handler/nats/health.go +++ b/pkg/handler/nats/health.go @@ -19,7 +19,7 @@ func ReadinessCheck(h *Handler) http.HandlerFunc { } return func(w http.ResponseWriter, _ *http.Request) { - s := *h.Sender + s := h.Sender if status := s.ConnectionStatus(); status != nats.CONNECTED { h.Logger.WithContext().Named(healthCheckName).With("connection-status", status).Info("Disconnected from NATS server") w.WriteHeader(health.StatusCodeNotHealthy) diff --git a/pkg/handler/nats/health_test.go b/pkg/handler/nats/health_test.go index a9f16aa..3c42444 100644 --- a/pkg/handler/nats/health_test.go +++ b/pkg/handler/nats/health_test.go @@ -8,8 +8,6 @@ import ( "github.com/stretchr/testify/assert" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" - "github.com/stretchr/testify/require" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" @@ -40,29 +38,24 @@ func TestReadinessCheck(t *testing.T) { tc := tc t.Run(tc.name, func(t *testing.T) { - // test in both default and jetstream NATS modes - for _, serverMode := range testingutils.NATSServerModes { - t.Run(serverMode.Name, func(t *testing.T) { - defer func() { - r := recover() - if !assert.Equal(t, tc.wantPanicForNilHandler, r != nil) { - t.Log(r) - } - }() - - handlerMock := mock.StartOrDie(context.TODO(), t, mock.WithJetStream(serverMode.JetStreamEnabled)) - defer handlerMock.Stop() + defer func() { + r := recover() + if !assert.Equal(t, tc.wantPanicForNilHandler, r != nil) { + t.Log(r) + } + }() - var handler http.HandlerFunc - if tc.wantPanicForNilHandler { - handler = nats.ReadinessCheck(nil) - } else { - handler = nats.ReadinessCheck(handlerMock.GetHandler()) - } + handlerMock := mock.StartOrDie(context.TODO(), t) + defer handlerMock.Stop() - assertResponseStatusCode(t, tc.givenHandlerEndpoint, handler, tc.wantHandlerStatusCode) - }) + var handler http.HandlerFunc + if tc.wantPanicForNilHandler { + handler = nats.ReadinessCheck(nil) + } else { + handler = nats.ReadinessCheck(handlerMock.GetHandler()) } + + assertResponseStatusCode(t, tc.givenHandlerEndpoint, handler, tc.wantHandlerStatusCode) }) } } diff --git a/pkg/handler/nats/mock/mock.go b/pkg/handler/nats/mock/mock.go index 44e8dac..f8ed5ba 100644 --- a/pkg/handler/nats/mock/mock.go +++ b/pkg/handler/nats/mock/mock.go @@ -17,6 +17,8 @@ import ( natsio "github.com/nats-io/nats.go" "github.com/stretchr/testify/require" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype/eventtypetest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" @@ -31,7 +33,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) // NATSHandlerMock represents a mock for the nats.Handler. @@ -43,7 +44,6 @@ type NATSHandlerMock struct { eventTypePrefix string logger *logger.Logger natsServer *server.Server - jetstreamMode bool natsConfig *env.NATSConfig collector *metrics.Collector legacyTransformer *legacy.Transformer @@ -78,21 +78,23 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NATSHandlerMockOpt) * for _, opt := range opts { opt(mock) } - mock.natsServer = testingutils.StartNATSServer(mock.jetstreamMode) + mock.natsServer = testingutils.StartNATSServer() msgReceiver := receiver.NewHTTPMessageReceiver(mock.natsConfig.Port) connection, err := testingutils.ConnectToNATSServer(mock.GetNATSURL()) require.NoError(t, err) mock.connection = connection + js, err := connection.JetStream() + require.NoError(t, err) + _, err = js.AddStream(getStreamConfig()) + require.NoError(t, err) - //nolint:gosimple - var msgSender sender.GenericSender - msgSender = sender.NewNATSMessageSender(ctx, mock.connection, mock.logger) + msgSender := sender.NewJetStreamMessageSender(ctx, mock.connection, mock.natsConfig, mock.logger) mock.handler = nats.NewHandler( msgReceiver, - &msgSender, + msgSender, mock.natsConfig.RequestTimeout, mock.legacyTransformer, &options.Options{MaxRequestSize: 65536}, @@ -188,13 +190,6 @@ func WithApplication(applicationName string) NATSHandlerMockOpt { } } -// WithJetStream returns NATSHandlerMockOpt which starts the NATS server in the jetstream mode for the given NATSHandlerMock. -func WithJetStream(jsEnabled bool) NATSHandlerMockOpt { - return func(m *NATSHandlerMock) { - m.jetstreamMode = jsEnabled - } -} - func newNATSConfig(port int) *env.NATSConfig { return &env.NATSConfig{ Port: port, @@ -203,3 +198,13 @@ func newNATSConfig(port int) *env.NATSConfig { JSStreamName: testingutils.StreamName, } } + +// getStreamConfig inits a testing stream config. +func getStreamConfig() *natsio.StreamConfig { + return &natsio.StreamConfig{ + Name: testingutils.StreamName, + Subjects: []string{fmt.Sprintf("%s.>", env.JetStreamSubjectPrefix)}, + Storage: natsio.MemoryStorage, + Retention: natsio.InterestPolicy, + } +} diff --git a/pkg/metrics/server.go b/pkg/metrics/server.go index ce85485..5c149e6 100644 --- a/pkg/metrics/server.go +++ b/pkg/metrics/server.go @@ -14,8 +14,8 @@ import ( ) const ( - readHeaderTimeout = time.Second * 5 metricsServerLoggerName = "metrics-server" + readHeaderTimeout = 5 * time.Second ) type Server struct { @@ -30,8 +30,8 @@ func NewServer(logger *logger.Logger) *Server { func (s *Server) Start(address string) error { if len(strings.TrimSpace(address)) > 0 { s.srv = http.Server{ - ReadHeaderTimeout: readHeaderTimeout, Handler: promhttp.Handler(), + ReadHeaderTimeout: readHeaderTimeout, } listener, err := net.Listen("tcp", address) diff --git a/pkg/nats/connect_test.go b/pkg/nats/connect_test.go index 4a872b8..95069e0 100644 --- a/pkg/nats/connect_test.go +++ b/pkg/nats/connect_test.go @@ -35,37 +35,30 @@ func TestConnect(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { + // given + natsServer := publishertesting.StartNATSServer() + assert.NotNil(t, natsServer) + defer natsServer.Shutdown() - // test in both default and jetstream NATS modes - for _, serverMode := range publishertesting.NATSServerModes { - t.Run(serverMode.Name, func(t *testing.T) { - tc := tc - // given - natsServer := publishertesting.StartNATSServer(serverMode.JetStreamEnabled) - assert.NotNil(t, natsServer) - defer natsServer.Shutdown() + clientURL := natsServer.ClientURL() + assert.NotEmpty(t, clientURL) - clientURL := natsServer.ClientURL() - assert.NotEmpty(t, clientURL) + // when + connection, err := pkgnats.Connect(clientURL, + pkgnats.WithRetryOnFailedConnect(tc.givenRetryOnFailedConnect), + pkgnats.WithMaxReconnects(tc.givenMaxReconnect), + pkgnats.WithReconnectWait(tc.givenReconnectWait), + ) + assert.Nil(t, err) + assert.NotNil(t, connection) + defer func() { connection.Close() }() - // when - connection, err := pkgnats.Connect(clientURL, - pkgnats.WithRetryOnFailedConnect(tc.givenRetryOnFailedConnect), - pkgnats.WithMaxReconnects(tc.givenMaxReconnect), - pkgnats.WithReconnectWait(tc.givenReconnectWait), - ) - assert.Nil(t, err) - assert.NotNil(t, connection) - defer func() { connection.Close() }() - - // then - assert.Equal(t, connection.Status(), nats.CONNECTED) - assert.Equal(t, clientURL, connection.Opts.Servers[0]) - assert.Equal(t, tc.givenRetryOnFailedConnect, connection.Opts.RetryOnFailedConnect) - assert.Equal(t, tc.givenMaxReconnect, connection.Opts.MaxReconnect) - assert.Equal(t, tc.givenReconnectWait, connection.Opts.ReconnectWait) - }) - } + // then + assert.Equal(t, connection.Status(), nats.CONNECTED) + assert.Equal(t, clientURL, connection.Opts.Servers[0]) + assert.Equal(t, tc.givenRetryOnFailedConnect, connection.Opts.RetryOnFailedConnect) + assert.Equal(t, tc.givenMaxReconnect, connection.Opts.MaxReconnect) + assert.Equal(t, tc.givenReconnectWait, connection.Opts.ReconnectWait) }) } } diff --git a/pkg/receiver/receiver.go b/pkg/receiver/receiver.go index 4264b87..4a26361 100644 --- a/pkg/receiver/receiver.go +++ b/pkg/receiver/receiver.go @@ -14,11 +14,10 @@ import ( const ( // defaultShutdownTimeout is the default timeout for the receiver to shutdown. - defaultShutdownTimeout = time.Minute * 1 + defaultShutdownTimeout = 1 * time.Minute + readHeaderTimeout = 5 * time.Second receiverName = "receiver" - - readHeaderTimeout = time.Second * 5 ) // HTTPMessageReceiver is responsible for receiving messages over HTTP. @@ -43,9 +42,9 @@ func (recv *HTTPMessageReceiver) StartListen(ctx context.Context, handler http.H recv.handler = createHandler(handler) recv.server = &http.Server{ - ReadHeaderTimeout: readHeaderTimeout, Addr: recv.listener.Addr().String(), Handler: recv.handler, + ReadHeaderTimeout: readHeaderTimeout, } errChan := make(chan error, 1) diff --git a/pkg/sender/jetstream.go b/pkg/sender/jetstream.go index deb1407..ce750b6 100644 --- a/pkg/sender/jetstream.go +++ b/pkg/sender/jetstream.go @@ -12,9 +12,10 @@ import ( "go.uber.org/zap" "github.com/cloudevents/sdk-go/v2/event" + "github.com/nats-io/nats.go" + "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/nats-io/nats.go" ) const ( @@ -26,6 +27,12 @@ const ( // compile time check var _ GenericSender = &JetStreamMessageSender{} +type GenericSender interface { + Send(context.Context, *event.Event) (int, error) + ConnectionStatus() nats.Status + URL() string +} + // JetStreamMessageSender is responsible for sending messages over HTTP. type JetStreamMessageSender struct { ctx context.Context diff --git a/pkg/sender/jetstream_test.go b/pkg/sender/jetstream_test.go index 14a3d69..29b264c 100644 --- a/pkg/sender/jetstream_test.go +++ b/pkg/sender/jetstream_test.go @@ -17,10 +17,11 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" cloudevents "github.com/cloudevents/sdk-go/v2" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" "github.com/nats-io/nats-server/v2/server" "github.com/nats-io/nats.go" "github.com/stretchr/testify/assert" + + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) func TestJetStreamMessageSender(t *testing.T) { @@ -164,7 +165,7 @@ type TestEnvironment struct { // setupTestEnvironment sets up the resources and mocks required for testing. func setupTestEnvironment(t *testing.T) *TestEnvironment { - natsServer := testingutils.StartNATSServer(true) + natsServer := testingutils.StartNATSServer() require.NotNil(t, natsServer) connection, err := testingutils.ConnectToNATSServer(natsServer.ClientURL()) diff --git a/pkg/sender/nats.go b/pkg/sender/nats.go deleted file mode 100644 index 348519c..0000000 --- a/pkg/sender/nats.go +++ /dev/null @@ -1,69 +0,0 @@ -package sender - -import ( - "context" - "errors" - "net/http" - - "github.com/kyma-project/kyma/components/eventing-controller/logger" - - cenats "github.com/cloudevents/sdk-go/protocol/nats/v2" - cev2 "github.com/cloudevents/sdk-go/v2" - "github.com/cloudevents/sdk-go/v2/event" - "github.com/nats-io/nats.go" -) - -// compile time check -var _ GenericSender = &NATSMessageSender{} - -type GenericSender interface { - Send(context.Context, *event.Event) (int, error) - ConnectionStatus() nats.Status - URL() string -} - -// NATSMessageSender is responsible for sending messages over HTTP. -type NATSMessageSender struct { - ctx context.Context - logger *logger.Logger - connection *nats.Conn -} - -// NewNATSMessageSender returns a new NewNATSMessageSender instance with the given nats connection. -func NewNATSMessageSender(ctx context.Context, connection *nats.Conn, logger *logger.Logger) *NATSMessageSender { - return &NATSMessageSender{ctx: ctx, connection: connection, logger: logger} -} - -// URL returns the URL of the Sender's connection. -func (s *NATSMessageSender) URL() string { - return s.connection.ConnectedUrl() -} - -// ConnectionStatus returns nats.Status for the NATS connection used by the NATSMessageSender. -func (s *NATSMessageSender) ConnectionStatus() nats.Status { - return s.connection.Status() -} - -// Send dispatches the event.Event to NATS server. -// If the NATS connection is not open, it returns an error. -func (s *NATSMessageSender) Send(ctx context.Context, event *event.Event) (int, error) { - if s.ConnectionStatus() != nats.CONNECTED { - return http.StatusBadGateway, errors.New("connection status: no connection to NATS server") - } - - sender, err := cenats.NewSenderFromConn(s.connection, event.Type()) - if err != nil { - return http.StatusInternalServerError, err - } - - client, err := cev2.NewClient(sender) - if err != nil { - return http.StatusInternalServerError, err - } - - if err := client.Send(ctx, *event); cev2.IsUndelivered(err) { - return http.StatusBadGateway, err - } - - return http.StatusNoContent, nil -} diff --git a/pkg/sender/nats_test.go b/pkg/sender/nats_test.go deleted file mode 100644 index 9fe0040..0000000 --- a/pkg/sender/nats_test.go +++ /dev/null @@ -1,81 +0,0 @@ -package sender - -import ( - "context" - "fmt" - "net/http" - "testing" - "time" - - "github.com/kyma-project/kyma/components/eventing-controller/logger" - - "github.com/stretchr/testify/assert" - - pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" -) - -func TestNATSMessageSender(t *testing.T) { - t.Parallel() - - testCases := []struct { - name string - givenNATSConnectionClosed bool - wantError bool - wantStatusCode int - }{ - { - name: "send should succeed if NATS connection is open", - givenNATSConnectionClosed: false, - wantError: false, - wantStatusCode: http.StatusNoContent, - }, - { - name: "send should fail if NATS connection is not open", - givenNATSConnectionClosed: true, - wantError: true, - wantStatusCode: http.StatusBadGateway, - }, - } - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - - natsServer := testingutils.StartNATSServer(false) - assert.NotNil(t, natsServer) - defer natsServer.Shutdown() - - connection, err := pkgnats.Connect(natsServer.ClientURL(), - pkgnats.WithRetryOnFailedConnect(true), - pkgnats.WithMaxReconnects(1), - pkgnats.WithReconnectWait(time.Second), - ) - assert.NoError(t, err) - assert.NotNil(t, connection) - defer func() { connection.Close() }() - - receive := make(chan bool, 1) - validator := testingutils.ValidateNATSMessageDataOrFail(t, fmt.Sprintf(`"%s"`, testingutils.EventData), receive) - testingutils.SubscribeToEventOrFail(t, connection, testingutils.CloudEventType, validator) - - ce := createCloudEvent(t) - - mockedLogger, _ := logger.New("json", "info") - - ctx := context.Background() - sender := NewNATSMessageSender(context.Background(), connection, mockedLogger) - - if tc.givenNATSConnectionClosed { - connection.Close() - } - - status, err := sender.Send(ctx, ce) - assert.Equal(t, tc.wantError, err != nil) - assert.Equal(t, tc.wantStatusCode, status) - - err = testingutils.WaitForChannelOrTimeout(receive, time.Millisecond*5) - assert.Equal(t, tc.wantError, err != nil) - }) - } -} diff --git a/testing/nats.go b/testing/nats.go index 209c320..8c32aed 100644 --- a/testing/nats.go +++ b/testing/nats.go @@ -20,31 +20,13 @@ const ( StreamName = "kyma" ) -var NATSServerModes = []struct { - Name string - JetStreamEnabled bool -}{ - { - Name: "jetstream disabled", - JetStreamEnabled: false, - }, - { - Name: "jetstream enabled", - JetStreamEnabled: true, - }, -} - -func StartNATSServer(enableJetStream bool) *server.Server { +func StartNATSServer() *server.Server { opts := test.DefaultTestOptions opts.Port = server.RANDOM_PORT - opts.JetStream = enableJetStream + opts.JetStream = true log, _ := logger.New("json", "info") - if enableJetStream { - log.WithContext().Info("Starting test NATS Server in JetStream mode") - } else { - log.WithContext().Info("Starting test NATS Server in default mode") - } + log.WithContext().Info("Starting test NATS Server in JetStream mode") return test.RunServer(&opts) } @@ -59,17 +41,24 @@ func ConnectToNATSServer(url string) (*nats.Conn, error) { // SubscribeToEventOrFail subscribes to the given eventType using the given NATS connection. // The received messages are then validated using the given validator. func SubscribeToEventOrFail(t *testing.T, connection *nats.Conn, eventType string, validator nats.MsgHandler) { - if _, err := connection.Subscribe(eventType, validator); err != nil { + if _, err := connection.Subscribe(GetStreamSubject(eventType), validator); err != nil { t.Fatalf("Failed to subscribe to event with error: %v", err) } } +func GetStreamSubject(eventType string) string { + return fmt.Sprintf("%v.%v", StreamName, eventType) +} + func ValidateNATSSubjectOrFail(t *testing.T, subject string, notify ...chan bool) nats.MsgHandler { return func(msg *nats.Msg) { + if msg == nil { + return + } for _, n := range notify { n <- true } - if msg != nil && msg.Subject != subject { + if msg.Subject != GetStreamSubject(subject) { t.Errorf("invalid NATS subject, expected [%s] but found [%s]", subject, msg.Subject) } } From 9b14df3c0c212a922dcb64373d0b76bb6d279575 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Sep 2022 12:14:49 +0200 Subject: [PATCH 109/194] gomod(deps): bump github.com/nats-io/nats-server/v2 from 2.8.4 to 2.9.1 in /components/event-publisher-proxy (#15627) * gomod(deps): bump github.com/nats-io/nats-server/v2 Bumps [github.com/nats-io/nats-server/v2](https://github.com/nats-io/nats-server) from 2.8.4 to 2.9.1. - [Release notes](https://github.com/nats-io/nats-server/releases) - [Changelog](https://github.com/nats-io/nats-server/blob/main/.goreleaser.yml) - [Commits](https://github.com/nats-io/nats-server/compare/v2.8.4...v2.9.1) --- updated-dependencies: - dependency-name: github.com/nats-io/nats-server/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump img Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raymond Co-authored-by: Raymond Pinto <45314732+raypinto@users.noreply.github.com> --- go.mod | 14 +++++++------- go.sum | 24 ++++++++++++------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 792393e..7991afb 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20220903121145-690b76935712 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220903121145-690b76935712 - github.com/nats-io/nats-server/v2 v2.8.4 - github.com/nats-io/nats.go v1.16.0 + github.com/nats-io/nats-server/v2 v2.9.1 + github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0 github.com/onsi/gomega v1.20.2 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.13.0 @@ -48,7 +48,7 @@ require ( github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.14.4 // indirect + github.com/klauspost/compress v1.15.10 // indirect github.com/kyma-project/kyma/common/logging v0.0.0-20220826051949-4ed4d5883dce // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect @@ -57,7 +57,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a // indirect + github.com/nats-io/jwt/v2 v2.3.0 // indirect github.com/nats-io/nkeys v0.3.0 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -67,12 +67,12 @@ require ( github.com/spf13/pflag v1.0.5 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 // indirect + golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0 // indirect golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect - golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect + golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect + golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/go.sum b/go.sum index 3199ca9..c571029 100644 --- a/go.sum +++ b/go.sum @@ -217,8 +217,8 @@ github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4= -github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.10 h1:Ai8UzuomSCDw90e1qNMtb15msBXsNpH6gzkkENQNcJo= +github.com/klauspost/compress v1.15.10/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -255,14 +255,14 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= -github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a h1:lem6QCvxR0Y28gth9P+wV2K/zYUUAkJ+55U8cpS0p5I= -github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= +github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= +github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= -github.com/nats-io/nats-server/v2 v2.8.4 h1:0jQzze1T9mECg8YZEl8+WYUXb9JKluJfCBriPUtluB4= -github.com/nats-io/nats-server/v2 v2.8.4/go.mod h1:8zZa+Al3WsESfmgSs98Fi06dRWLH5Bnq90m5bKD/eT4= +github.com/nats-io/nats-server/v2 v2.9.1 h1:JaP6NpCVmSu0AXgbnOkGtJovOxuf8mjNjlX3H+tSpyI= +github.com/nats-io/nats-server/v2 v2.9.1/go.mod h1:T5AEyzrnDGaseK/Y0G6e2IA5tLrHyjLOeGUALq+A8XE= github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nats.go v1.16.0 h1:zvLE7fGBQYW6MWaFaRdsgm9qT39PJDQoju+DS8KsO1g= -github.com/nats-io/nats.go v1.16.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0 h1:dPUKD6Iv8M1y9MU8PK6H4a4/12yx5/CbaYWz/Z1arY8= +github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= @@ -489,8 +489,8 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc= +golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -509,8 +509,8 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45 h1:yuLAip3bfURHClMG9VBdzPrQvCWjWiWUTBGV+/fCbUs= +golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= From 685dbe5f6ea1ab594f0cbeafca10540c33ea83bd Mon Sep 17 00:00:00 2001 From: Friedrich Date: Fri, 30 Sep 2022 14:19:43 +0200 Subject: [PATCH 110/194] bump dependencies in `event-publisher-proxy` (#15689) * bump k8s.io packages * bump image * bump cloud events sdk patch level * bump xerror and oauth2 * bump kyma components * remove old replace from mod file * bump k8s patch level --- go.mod | 46 +++++++++++++++++---------------------- go.sum | 69 +++++++++++++++++++++++++++------------------------------- 2 files changed, 52 insertions(+), 63 deletions(-) diff --git a/go.mod b/go.mod index 7991afb..5eea093 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,11 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy go 1.19 require ( - github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1 - github.com/cloudevents/sdk-go/v2 v2.11.0 + github.com/cloudevents/sdk-go/v2 v2.12.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220903121145-690b76935712 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220903121145-690b76935712 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20220930074158-ab54b86ee597 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220930074158-ab54b86ee597 github.com/nats-io/nats-server/v2 v2.9.1 github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0 github.com/onsi/gomega v1.20.2 @@ -17,11 +16,11 @@ require ( github.com/stretchr/testify v1.8.0 go.opencensus.io v0.23.0 go.uber.org/zap v1.23.0 - golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 - golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f - k8s.io/api v0.25.0 - k8s.io/apimachinery v0.25.0 - k8s.io/client-go v0.25.0 + golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 + golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 + k8s.io/api v0.25.2 + k8s.io/apimachinery v0.25.2 + k8s.io/client-go v0.25.2 sigs.k8s.io/controller-runtime v0.13.0 ) @@ -34,6 +33,8 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/emicklei/go-restful/v3 v3.8.0 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect + github.com/evanphx/json-patch/v5 v5.6.0 // indirect + github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/zapr v1.2.3 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect @@ -49,7 +50,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.15.10 // indirect - github.com/kyma-project/kyma/common/logging v0.0.0-20220826051949-4ed4d5883dce // indirect + github.com/kyma-project/kyma/common/logging v0.0.0-20220903121145-690b76935712 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/minio/highwayhash v1.0.2 // indirect @@ -73,11 +74,14 @@ require ( golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45 // indirect + gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/apiextensions-apiserver v0.25.0 // indirect + k8s.io/component-base v0.25.2 // indirect k8s.io/klog/v2 v2.70.1 // indirect k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect @@ -88,12 +92,12 @@ require ( replace ( // keep all following packages at the same version - k8s.io/api => k8s.io/api v0.25.0 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.0 - k8s.io/apimachinery => k8s.io/apimachinery v0.25.0 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.0 - k8s.io/component-base => k8s.io/component-base v0.25.0 - k8s.io/kubectl => k8s.io/kubectl v0.25.0 + k8s.io/api => k8s.io/api v0.25.2 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.2 + k8s.io/apimachinery => k8s.io/apimachinery v0.25.2 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.2 + k8s.io/component-base => k8s.io/component-base v0.25.2 + k8s.io/kubectl => k8s.io/kubectl v0.25.2 ) replace ( @@ -106,13 +110,3 @@ replace ( golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 k8s.io/utils => k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 ) - -replace ( - github.com/emicklei/go-restful => github.com/emicklei/go-restful/v3 v3.8.0 - github.com/emicklei/go-restful/v3 => github.com/emicklei/go-restful/v3 v3.8.0 -) // fix cve-2022-1996, might be okay to be removed after k8s > 1.24.2 - -exclude ( - github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 - github.com/emicklei/go-restful v2.9.5+incompatible -) // fix cve-2022-1996, might be okay to be removed after k8s > 1.24.2 diff --git a/go.sum b/go.sum index c571029..edec3c4 100644 --- a/go.sum +++ b/go.sum @@ -52,6 +52,7 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/avast/retry-go/v3 v3.1.1 h1:49Scxf4v8PmiQ/nY0aY3p0hDueqSmc7++cBbtiDGu2g= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -65,11 +66,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1 h1:vhMEC9zc6nIw3HwxaFZF/lT/uTftXx9h++f0KyXJazM= -github.com/cloudevents/sdk-go/protocol/nats/v2 v2.10.1/go.mod h1:9l2pSSkH9AvMCwK8Rscwqtsni30UIWNj/EmgtmaRMmc= -github.com/cloudevents/sdk-go/v2 v2.10.1/go.mod h1:GpCBmUj7DIRiDhVvsK5d6WCbgTWs8DxAWTRtAwQmIXs= -github.com/cloudevents/sdk-go/v2 v2.11.0 h1:pCb7Cdkb8XpUoil+miuw6PEzuCG9cc8Erj8y1/q3odo= -github.com/cloudevents/sdk-go/v2 v2.11.0/go.mod h1:xDmKfzNjM8gBvjaF8ijFjM1VYOVUEeUfapHMUX1T5To= +github.com/cloudevents/sdk-go/v2 v2.12.0 h1:p1k+ysVOZtNiXfijnwB3WqZNA3y2cGOiKQygWkUHCEI= +github.com/cloudevents/sdk-go/v2 v2.12.0/go.mod h1:xDmKfzNjM8gBvjaF8ijFjM1VYOVUEeUfapHMUX1T5To= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -89,9 +87,13 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= +github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -190,7 +192,6 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -204,9 +205,9 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -216,7 +217,6 @@ github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dv github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.15.10 h1:Ai8UzuomSCDw90e1qNMtb15msBXsNpH6gzkkENQNcJo= github.com/klauspost/compress v1.15.10/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -226,12 +226,13 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kyma-project/kyma/common/logging v0.0.0-20220826051949-4ed4d5883dce h1:oh/arOxvNmkKhGHuKkVnBZvDH4BB8+z1R7L9yoHsIsM= -github.com/kyma-project/kyma/common/logging v0.0.0-20220826051949-4ed4d5883dce/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220903121145-690b76935712 h1:6kqIT5t6sw3RDB8lJhFAf8xzWWPFQTgGm6Es5ZhSgjY= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220903121145-690b76935712/go.mod h1:4jh1Qn1DLbQRdCHqEdHsV4Tk9b6L4i9nhgGdEc2XaIg= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220903121145-690b76935712 h1:ld6tIS2EJ9T3dPGjTqBLJHYB3lru7JUL96CSRdAtSvA= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220903121145-690b76935712/go.mod h1:U56ezWFTgAH8y/643MTRDUClm3xs+E5GfZ2WaXmzeTI= +github.com/kyma-incubator/api-gateway v0.0.0-20220819093753-296e6704d413 h1:Np4jOrlYMJcgklgrvVwXWfFMCtlg06SDAaxk9SIX7xE= +github.com/kyma-project/kyma/common/logging v0.0.0-20220903121145-690b76935712 h1:f+GRwlfq/PFnvWcI5MNVOdaefTu88RwYMMigoFVFZDE= +github.com/kyma-project/kyma/common/logging v0.0.0-20220903121145-690b76935712/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220930074158-ab54b86ee597 h1:Oar+M7CAWZYb8mu+ISE74cU8XxKzRoiD9EBarLQ/mDE= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20220930074158-ab54b86ee597/go.mod h1:4jh1Qn1DLbQRdCHqEdHsV4Tk9b6L4i9nhgGdEc2XaIg= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220930074158-ab54b86ee597 h1:unBQE6wCBia1GPuffpEHnZ/t6qstovB7r5r15z0KX44= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220930074158-ab54b86ee597/go.mod h1:PfPweLv+tK/gI4dCyfXEd4V8Ebyb2/oXM1cDaYS3Jcg= 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.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= @@ -239,7 +240,6 @@ github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= @@ -247,23 +247,17 @@ github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/z github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= -github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= -github.com/nats-io/nats-server/v2 v2.3.4/go.mod h1:3mtbaN5GkCo/Z5T3nNj0I0/W1fPkKzLiDC6jjWJKp98= github.com/nats-io/nats-server/v2 v2.9.1 h1:JaP6NpCVmSu0AXgbnOkGtJovOxuf8mjNjlX3H+tSpyI= github.com/nats-io/nats-server/v2 v2.9.1/go.mod h1:T5AEyzrnDGaseK/Y0G6e2IA5tLrHyjLOeGUALq+A8XE= -github.com/nats-io/nats.go v1.11.1-0.20210623165838-4b75fc59ae30/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0 h1:dPUKD6Iv8M1y9MU8PK6H4a4/12yx5/CbaYWz/Z1arY8= github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -307,7 +301,6 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -322,17 +315,14 @@ go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= @@ -427,8 +417,8 @@ golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 h1:2o1E+E8TpNLklK9nHiPiK1uzIYrIHt+cQx3ynCwq9V8= -golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= +golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -489,6 +479,7 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc= golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -507,8 +498,6 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45 h1:yuLAip3bfURHClMG9VBdzPrQvCWjWiWUTBGV+/fCbUs= golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -569,8 +558,10 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f h1:uF6paiQQebLeSXkrTqHqz0MXhXXS1KgF41eUdBNvxK0= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/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= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -732,12 +723,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.0 h1:H+Q4ma2U/ww0iGB78ijZx6DRByPz6/733jIuFpX70e0= -k8s.io/api v0.25.0/go.mod h1:ttceV1GyV1i1rnmvzT3BST08N6nGt+dudGrquzVQWPk= -k8s.io/apimachinery v0.25.0 h1:MlP0r6+3XbkUG2itd6vp3oxbtdQLQI94fD5gCS+gnoU= -k8s.io/apimachinery v0.25.0/go.mod h1:qMx9eAk0sZQGsXGu86fab8tZdffHbwUfsvzqKn4mfB0= -k8s.io/client-go v0.25.0 h1:CVWIaCETLMBNiTUta3d5nzRbXvY5Hy9Dpl+VvREpu5E= -k8s.io/client-go v0.25.0/go.mod h1:lxykvypVfKilxhTklov0wz1FoaUZ8X4EwbhS6rpRfN8= +k8s.io/api v0.25.2 h1:v6G8RyFcwf0HR5jQGIAYlvtRNrxMJQG1xJzaSeVnIS8= +k8s.io/api v0.25.2/go.mod h1:qP1Rn4sCVFwx/xIhe+we2cwBLTXNcheRyYXwajonhy0= +k8s.io/apiextensions-apiserver v0.25.2 h1:8uOQX17RE7XL02ngtnh3TgifY7EhekpK+/piwzQNnBo= +k8s.io/apiextensions-apiserver v0.25.2/go.mod h1:iRwwRDlWPfaHhuBfQ0WMa5skdQfrE18QXJaJvIDLvE8= +k8s.io/apimachinery v0.25.2 h1:WbxfAjCx+AeN8Ilp9joWnyJ6xu9OMeS/fsfjK/5zaQs= +k8s.io/apimachinery v0.25.2/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA= +k8s.io/client-go v0.25.2 h1:SUPp9p5CwM0yXGQrwYurw9LWz+YtMwhWd0GqOsSiefo= +k8s.io/client-go v0.25.2/go.mod h1:i7cNU7N+yGQmJkewcRD2+Vuj4iz7b30kI8OcL3horQ4= +k8s.io/component-base v0.25.2 h1:Nve/ZyHLUBHz1rqwkjXm/Re6IniNa5k7KgzxZpTfSQY= +k8s.io/component-base v0.25.2/go.mod h1:90W21YMr+Yjg7MX+DohmZLzjsBtaxQDDwaX4YxDkl60= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= From 5d00be80b41b06630638eb8500e1b58ce43955c1 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Wed, 5 Oct 2022 09:21:32 +0200 Subject: [PATCH 111/194] Move Dockerfile of `event-publisher-proxy` to base dir (#15711) * remove cmds targets * mv Dockerfile to epp/ * bump image --- .../Dockerfile => Dockerfile | 0 Makefile | 45 +------------------ 2 files changed, 2 insertions(+), 43 deletions(-) rename cmd/event-publisher-proxy/Dockerfile => Dockerfile (100%) diff --git a/cmd/event-publisher-proxy/Dockerfile b/Dockerfile similarity index 100% rename from cmd/event-publisher-proxy/Dockerfile rename to Dockerfile diff --git a/Makefile b/Makefile index 3f89c8e..829ab54 100644 --- a/Makefile +++ b/Makefile @@ -17,52 +17,11 @@ release: path-to-referenced-charts: @echo "resources/event-publisher-proxy" -# produce goals for each cmd program ("bin1 bin2 ...") -cmds := $(foreach dir,$(wildcard cmd/*),$(notdir $(dir))) -# produce goals to build images for each cmd program ("bin1.image bin2.image ...") -cmds_images = $(foreach cmd,$(cmds),$(cmd).image) -cmds_clean = $(foreach cmd,$(cmds),$(cmd).clean) -# produce goals to push images for each cmd program ("bin1.image.push bin2.image.push ...") -cmds_images_push = $(foreach img,$(cmds_images),$(img).push) - .PHONY: clean -clean: $(cmds_clean) resolve_clean - -$(cmds_clean): %.clean: - rm -f $* +clean: resolve_clean resolve_clean: rm -rf vendor -build-local: $(cmds) test-local ; - -.PHONY: $(cmds_images) $(cmds_images_push) - -# override image goals from common Makefile because we need to build several images -build-image: $(cmds_images) ; -push-image: $(cmds_images_push) ; - -# Example: -# make event-publisher-proxy -GOBUILD_FLAGS := -v -PKG := github.com/kyma-project/kyma/components/event-publisher-proxy -$(cmds): %: - @echo "+ Building $*" - @CGO_ENABLED=0 go build -o $* \ - $(GOBUILD_FLAGS) \ - $(PKG)/cmd/$* - -# Example: -# make event-publisher-proxy.image -$(cmds_images): %.image: build-local - $(eval $@_img_name := $*) - @echo "+ Building container image $($@_img_name)" - docker image build -f cmd/$*/Dockerfile -t $($@_img_name) . +build-local: test-local -# Example: -# make event-publisher-proxy.image.push -$(cmds_images_push): %.push: % - $(eval $@_img_name := $(subst .image,,$*)) - @echo "+ Pushing container image $($@_img_name)" - docker image tag $($@_img_name) $(DOCKER_PUSH_REPOSITORY)$(DOCKER_PUSH_DIRECTORY)/$($@_img_name):$(TAG) - docker image push $(DOCKER_PUSH_REPOSITORY)$(DOCKER_PUSH_DIRECTORY)/$($@_img_name):$(TAG) From 04cc4054e8f9506a88e8c28fcf6f2737e5921247 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Tue, 11 Oct 2022 08:12:05 +0200 Subject: [PATCH 112/194] bump dependencies in `event-publisher-proxy` (#15713) * bump dependencies * bump image --- go.mod | 16 ++++++++-------- go.sum | 28 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 5eea093..987af6e 100644 --- a/go.mod +++ b/go.mod @@ -6,10 +6,10 @@ require ( github.com/cloudevents/sdk-go/v2 v2.12.0 github.com/google/uuid v1.3.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20220930074158-ab54b86ee597 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220930074158-ab54b86ee597 - github.com/nats-io/nats-server/v2 v2.9.1 - github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20221004144139-b69aea381b88 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221004144139-b69aea381b88 + github.com/nats-io/nats-server/v2 v2.9.2 + github.com/nats-io/nats.go v1.17.0 github.com/onsi/gomega v1.20.2 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.13.0 @@ -49,7 +49,7 @@ require ( github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.10 // indirect + github.com/klauspost/compress v1.15.11 // indirect github.com/kyma-project/kyma/common/logging v0.0.0-20220903121145-690b76935712 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect @@ -68,12 +68,12 @@ require ( github.com/spf13/pflag v1.0.5 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.0.0-20220919173607-35f4265a4bc0 // indirect + golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect - golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect + golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45 // indirect + golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.0 // indirect diff --git a/go.sum b/go.sum index edec3c4..5b1fe21 100644 --- a/go.sum +++ b/go.sum @@ -217,8 +217,8 @@ github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dv github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.10 h1:Ai8UzuomSCDw90e1qNMtb15msBXsNpH6gzkkENQNcJo= -github.com/klauspost/compress v1.15.10/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= +github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -229,10 +229,10 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kyma-incubator/api-gateway v0.0.0-20220819093753-296e6704d413 h1:Np4jOrlYMJcgklgrvVwXWfFMCtlg06SDAaxk9SIX7xE= github.com/kyma-project/kyma/common/logging v0.0.0-20220903121145-690b76935712 h1:f+GRwlfq/PFnvWcI5MNVOdaefTu88RwYMMigoFVFZDE= github.com/kyma-project/kyma/common/logging v0.0.0-20220903121145-690b76935712/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220930074158-ab54b86ee597 h1:Oar+M7CAWZYb8mu+ISE74cU8XxKzRoiD9EBarLQ/mDE= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20220930074158-ab54b86ee597/go.mod h1:4jh1Qn1DLbQRdCHqEdHsV4Tk9b6L4i9nhgGdEc2XaIg= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220930074158-ab54b86ee597 h1:unBQE6wCBia1GPuffpEHnZ/t6qstovB7r5r15z0KX44= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20220930074158-ab54b86ee597/go.mod h1:PfPweLv+tK/gI4dCyfXEd4V8Ebyb2/oXM1cDaYS3Jcg= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20221004144139-b69aea381b88 h1:BCjnfGDRolGbuKcX962OSZJfyEJzqhDb2yQIDdzH2nk= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20221004144139-b69aea381b88/go.mod h1:4jh1Qn1DLbQRdCHqEdHsV4Tk9b6L4i9nhgGdEc2XaIg= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221004144139-b69aea381b88 h1:pehPxhpC28OpnLrWKgLTLv25/UFM8DcTZTBYOBziqok= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221004144139-b69aea381b88/go.mod h1:PfPweLv+tK/gI4dCyfXEd4V8Ebyb2/oXM1cDaYS3Jcg= 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.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= @@ -254,10 +254,10 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= -github.com/nats-io/nats-server/v2 v2.9.1 h1:JaP6NpCVmSu0AXgbnOkGtJovOxuf8mjNjlX3H+tSpyI= -github.com/nats-io/nats-server/v2 v2.9.1/go.mod h1:T5AEyzrnDGaseK/Y0G6e2IA5tLrHyjLOeGUALq+A8XE= -github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0 h1:dPUKD6Iv8M1y9MU8PK6H4a4/12yx5/CbaYWz/Z1arY8= -github.com/nats-io/nats.go v1.16.1-0.20220906180156-a1017eec10b0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats-server/v2 v2.9.2 h1:XNDgJgOYYaYlquLdbSHI3xssLipfKUOq3EmYIMNCOsE= +github.com/nats-io/nats-server/v2 v2.9.2/go.mod h1:4sq8wvrpbvSzL1n3ZfEYnH4qeUuIl5W990j3kw13rRk= +github.com/nats-io/nats.go v1.17.0 h1:1jp5BThsdGlN91hW0k3YEfJbfACjiOYtUiLXG0RL4IE= +github.com/nats-io/nats.go v1.17.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -480,8 +480,8 @@ golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc= -golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI= +golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -498,8 +498,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45 h1:yuLAip3bfURHClMG9VBdzPrQvCWjWiWUTBGV+/fCbUs= -golang.org/x/time v0.0.0-20220920022843-2ce7c2934d45/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af h1:Yx9k8YCG3dvF87UAn2tu2HQLf2dt/eR1bXxpLMWeH+Y= +golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= From 1d9d1134c7a83f98c428fb4d8f55c21c680b76c9 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Tue, 18 Oct 2022 13:56:54 +0200 Subject: [PATCH 113/194] bump build image in Dockerfile to golang1.19.2-alpine3.16 in event-publisher-proxy (#15734) * bump build image in Dockerfile to golang1.19.2-alpine3.16 * bump epp image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2a72558..04b6979 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.19.1-alpine3.16 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.19.2-alpine3.16 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From b5dae0c7f9a99388dec4e78aaa5580b4ca7abfce Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Wed, 19 Oct 2022 12:41:52 +0200 Subject: [PATCH 114/194] Use the configured NATS URL as the destination service value for the Eventing publisher proxy custom metrics (#15608) * Use the configured NATS URL as the destination service value for the Eventing publisher proxy custom metrics * Update Eventing images * Fix tests --- pkg/env/nats_config.go | 2 +- pkg/sender/jetstream.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go index 0c5411d..459c9be 100644 --- a/pkg/env/nats_config.go +++ b/pkg/env/nats_config.go @@ -13,7 +13,7 @@ const JetStreamSubjectPrefix = "kyma" // NATSConfig represents the environment config for the Event Publisher to NATS. type NATSConfig struct { Port int `envconfig:"INGRESS_PORT" default:"8080"` - URL string `envconfig:"NATS_URL" default:"nats.nats.svc.cluster.local"` + URL string `envconfig:"NATS_URL" required:"true"` RetryOnFailedConnect bool `envconfig:"RETRY_ON_FAILED_CONNECT" default:"true"` MaxReconnects int `envconfig:"MAX_RECONNECTS" default:"-1"` // Negative means keep try reconnecting. ReconnectWait time.Duration `envconfig:"RECONNECT_WAIT" default:"5s"` diff --git a/pkg/sender/jetstream.go b/pkg/sender/jetstream.go index ce750b6..ced97c1 100644 --- a/pkg/sender/jetstream.go +++ b/pkg/sender/jetstream.go @@ -48,7 +48,7 @@ func NewJetStreamMessageSender(ctx context.Context, connection *nats.Conn, envCf // URL returns the URL of the Sender's connection. func (s *JetStreamMessageSender) URL() string { - return s.connection.ConnectedUrl() + return s.envCfg.URL } // ConnectionStatus returns nats.Status for the NATS connection used by the JetStreamMessageSender. From 6c039b41913bd4fe3f2fe52c3fc0202bb998401f Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Fri, 21 Oct 2022 09:26:55 +0200 Subject: [PATCH 115/194] Add exponential buckets for the Event publisher proxy latency histogram (#15643) * Add exponential buckets for the Event publisher proxy latency histogram * Update image * Remove extra lines --- Makefile | 5 +- cmd/event-publisher-proxy/main.go | 5 +- go.mod | 1 + go.sum | 1 + pkg/handler/beb/mock/mock.go | 16 ++--- pkg/handler/nats/mock/mock.go | 16 ++--- pkg/metrics/collector.go | 9 ++- pkg/metrics/collector_test.go | 34 ++++++++++ pkg/metrics/histogram/buckets.go | 6 ++ .../histogram/mocks/BucketsProvider.go | 26 ++++++++ pkg/metrics/latency/latency.go | 26 ++++++++ pkg/metrics/latency/latency_test.go | 66 +++++++++++++++++++ 12 files changed, 187 insertions(+), 24 deletions(-) create mode 100644 pkg/metrics/collector_test.go create mode 100644 pkg/metrics/histogram/buckets.go create mode 100644 pkg/metrics/histogram/mocks/BucketsProvider.go create mode 100644 pkg/metrics/latency/latency.go create mode 100644 pkg/metrics/latency/latency_test.go diff --git a/Makefile b/Makefile index 829ab54..6969685 100644 --- a/Makefile +++ b/Makefile @@ -23,5 +23,8 @@ clean: resolve_clean resolve_clean: rm -rf vendor -build-local: test-local +build-local: test-local +.PHONY: generate +generate: + go generate ./... diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index 4571d6f..71b175d 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -4,13 +4,14 @@ import ( golog "log" "github.com/kelseyhightower/envconfig" - kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" "github.com/prometheus/client_golang/prometheus" "github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy/beb" "github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/latency" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" ) const ( @@ -63,7 +64,7 @@ func main() { setupLogger := logger.WithContext().With("backend", cfg.Backend) // metrics collector - metricsCollector := metrics.NewCollector() + metricsCollector := metrics.NewCollector(latency.NewBucketsProvider()) prometheus.MustRegister(metricsCollector) // Instantiate configured commander. diff --git a/go.mod b/go.mod index 987af6e..0db2f5d 100644 --- a/go.mod +++ b/go.mod @@ -66,6 +66,7 @@ require ( github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/objx v0.4.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect diff --git a/go.sum b/go.sum index 5b1fe21..a0d7336 100644 --- a/go.sum +++ b/go.sum @@ -291,6 +291,7 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= diff --git a/pkg/handler/beb/mock/mock.go b/pkg/handler/beb/mock/mock.go index 9475f78..209092a 100644 --- a/pkg/handler/beb/mock/mock.go +++ b/pkg/handler/beb/mock/mock.go @@ -9,20 +9,16 @@ import ( "testing" "time" + "github.com/cloudevents/sdk-go/v2/binding" + cev2event "github.com/cloudevents/sdk-go/v2/event" + cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" + "github.com/stretchr/testify/require" "golang.org/x/xerrors" - - "github.com/kyma-project/kyma/components/eventing-controller/logger" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/dynamic/dynamicinformer" dynamicfake "k8s.io/client-go/dynamic/fake" - "github.com/cloudevents/sdk-go/v2/binding" - cev2event "github.com/cloudevents/sdk-go/v2/event" - cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" - "github.com/stretchr/testify/require" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype/eventtypetest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" @@ -32,6 +28,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/latency" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" @@ -39,6 +36,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" + "github.com/kyma-project/kyma/components/eventing-controller/logger" ) const ( @@ -112,7 +110,7 @@ func StartOrDie(ctx context.Context, t *testing.T, requestSize int, eventTypePre ctx: ctx, cfg: cfg, logger: mockedLogger, - collector: metrics.NewCollector(), + collector: metrics.NewCollector(latency.NewBucketsProvider()), livenessEndpoint: fmt.Sprintf("http://localhost:%d%s", cfg.Port, health.LivenessURI), readinessEndpoint: fmt.Sprintf("http://localhost:%d%s", cfg.Port, health.ReadinessURI), legacyTransformer: &legacy.Transformer{}, diff --git a/pkg/handler/nats/mock/mock.go b/pkg/handler/nats/mock/mock.go index f8ed5ba..2071add 100644 --- a/pkg/handler/nats/mock/mock.go +++ b/pkg/handler/nats/mock/mock.go @@ -6,19 +6,14 @@ import ( "testing" "time" - "github.com/kyma-project/kyma/components/eventing-controller/logger" - + "github.com/nats-io/nats-server/v2/server" + natsio "github.com/nats-io/nats.go" + "github.com/stretchr/testify/require" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/dynamic/dynamicinformer" dynamicfake "k8s.io/client-go/dynamic/fake" - "github.com/nats-io/nats-server/v2/server" - natsio "github.com/nats-io/nats.go" - "github.com/stretchr/testify/require" - - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype/eventtypetest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" @@ -28,11 +23,14 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/latency" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" + "github.com/kyma-project/kyma/components/eventing-controller/logger" ) // NATSHandlerMock represents a mock for the nats.Handler. @@ -69,7 +67,7 @@ func StartOrDie(ctx context.Context, t *testing.T, opts ...NATSHandlerMockOpt) * readinessEndpoint: fmt.Sprintf("http://localhost:%d%s", port, health.ReadinessURI), logger: mockedLogger, natsConfig: newNATSConfig(port), - collector: metrics.NewCollector(), + collector: metrics.NewCollector(latency.NewBucketsProvider()), legacyTransformer: &legacy.Transformer{}, subscribedProcessor: &subscribed.Processor{}, eventTypeCleaner: eventtypetest.CleanerFunc(eventtypetest.DefaultCleaner), diff --git a/pkg/metrics/collector.go b/pkg/metrics/collector.go index 0ee865a..9cc2ee2 100644 --- a/pkg/metrics/collector.go +++ b/pkg/metrics/collector.go @@ -5,6 +5,8 @@ import ( "time" "github.com/prometheus/client_golang/prometheus" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/histogram" ) const ( @@ -43,7 +45,7 @@ type Collector struct { } // NewCollector a new instance of Collector -func NewCollector() *Collector { +func NewCollector(latency histogram.BucketsProvider) *Collector { return &Collector{ errors: prometheus.NewCounterVec( prometheus.CounterOpts{ @@ -54,8 +56,9 @@ func NewCollector() *Collector { ), latency: prometheus.NewHistogramVec( prometheus.HistogramOpts{ - Name: LatencyKey, - Help: latencyHelp, + Name: LatencyKey, + Help: latencyHelp, + Buckets: latency.Buckets(), }, []string{responseCodeLabel, destSvcLabel}, ), diff --git a/pkg/metrics/collector_test.go b/pkg/metrics/collector_test.go new file mode 100644 index 0000000..d8d5504 --- /dev/null +++ b/pkg/metrics/collector_test.go @@ -0,0 +1,34 @@ +package metrics + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/histogram/mocks" +) + +func TestNewCollector(t *testing.T) { + // given + const bucketsFunc = "Buckets" + latency := new(mocks.BucketsProvider) + latency.On(bucketsFunc).Return(nil) + latency.Test(t) + + // when + collector := NewCollector(latency) + + // then + assert.NotNil(t, collector) + assert.NotNil(t, collector.errors) + assert.NotNil(t, collector.errors.MetricVec) + assert.NotNil(t, collector.latency) + assert.NotNil(t, collector.latency.MetricVec) + assert.NotNil(t, collector.eventType) + assert.NotNil(t, collector.eventType.MetricVec) + assert.NotNil(t, collector.requests) + assert.NotNil(t, collector.requests.MetricVec) + latency.AssertCalled(t, bucketsFunc) + latency.AssertNumberOfCalls(t, bucketsFunc, 1) + latency.AssertExpectations(t) +} diff --git a/pkg/metrics/histogram/buckets.go b/pkg/metrics/histogram/buckets.go new file mode 100644 index 0000000..89d729e --- /dev/null +++ b/pkg/metrics/histogram/buckets.go @@ -0,0 +1,6 @@ +package histogram + +//go:generate mockery --name BucketsProvider +type BucketsProvider interface { + Buckets() []float64 +} diff --git a/pkg/metrics/histogram/mocks/BucketsProvider.go b/pkg/metrics/histogram/mocks/BucketsProvider.go new file mode 100644 index 0000000..7efa77e --- /dev/null +++ b/pkg/metrics/histogram/mocks/BucketsProvider.go @@ -0,0 +1,26 @@ +// Code generated by mockery v1.0.0. DO NOT EDIT. + +package mocks + +import mock "github.com/stretchr/testify/mock" + +// BucketsProvider is an autogenerated mock type for the BucketsProvider type +type BucketsProvider struct { + mock.Mock +} + +// Buckets provides a mock function with given fields: +func (_m *BucketsProvider) Buckets() []float64 { + ret := _m.Called() + + var r0 []float64 + if rf, ok := ret.Get(0).(func() []float64); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]float64) + } + } + + return r0 +} diff --git a/pkg/metrics/latency/latency.go b/pkg/metrics/latency/latency.go new file mode 100644 index 0000000..94c58a3 --- /dev/null +++ b/pkg/metrics/latency/latency.go @@ -0,0 +1,26 @@ +package latency + +import "github.com/prometheus/client_golang/prometheus" + +const ( + // Note: The following configuration generates the histogram buckets [2 4 8 16 32 64 128 256 512 1024]. + + // start value of the prometheus.ExponentialBuckets start parameter. + start float64 = 2.0 + // factor value of the prometheus.ExponentialBuckets factor parameter. + factor float64 = 2.0 + // count value of the prometheus.ExponentialBuckets count parameter. + count int = 10 +) + +type BucketsProvider struct { + buckets []float64 +} + +func NewBucketsProvider() *BucketsProvider { + return &BucketsProvider{buckets: prometheus.ExponentialBuckets(start, factor, count)} +} + +func (p BucketsProvider) Buckets() []float64 { + return p.buckets +} diff --git a/pkg/metrics/latency/latency_test.go b/pkg/metrics/latency/latency_test.go new file mode 100644 index 0000000..8d1114c --- /dev/null +++ b/pkg/metrics/latency/latency_test.go @@ -0,0 +1,66 @@ +package latency + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestNewBucketsProvider(t *testing.T) { + tests := []struct { + name string + want *BucketsProvider + }{ + { + name: "default latency buckets", + want: &BucketsProvider{ + buckets: []float64{2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // given + got := NewBucketsProvider() + + // then + assert.Equal(t, tt.want, got) + }) + } +} + +func TestBucketsProvider_Buckets(t *testing.T) { + tests := []struct { + name string + buckets []float64 + want []float64 + }{ + { + name: "nil buckets", + buckets: nil, + want: nil, + }, + { + name: "empty buckets", + buckets: []float64{}, + want: []float64{}, + }, + { + name: "non-empty buckets", + buckets: []float64{1, 2, 3}, + want: []float64{1, 2, 3}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // given + p := BucketsProvider{buckets: tt.buckets} + + // when + got := p.Buckets() + + // then + assert.Equal(t, tt.want, got) + }) + } +} From f6d1672fe88ce4f8812de61edc4a20e6c46d474b Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Wed, 26 Oct 2022 07:45:22 +0200 Subject: [PATCH 116/194] Update EPP deps (#15908) --- go.mod | 12 ++++++------ go.sum | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 0db2f5d..2653ed4 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,9 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221004144139-b69aea381b88 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221004144139-b69aea381b88 - github.com/nats-io/nats-server/v2 v2.9.2 - github.com/nats-io/nats.go v1.17.0 - github.com/onsi/gomega v1.20.2 + github.com/nats-io/nats-server/v2 v2.9.3 + github.com/nats-io/nats.go v1.18.0 + github.com/onsi/gomega v1.21.1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.13.0 github.com/stretchr/testify v1.8.0 @@ -18,9 +18,9 @@ require ( go.uber.org/zap v1.23.0 golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 - k8s.io/api v0.25.2 - k8s.io/apimachinery v0.25.2 - k8s.io/client-go v0.25.2 + k8s.io/api v0.25.3 + k8s.io/apimachinery v0.25.3 + k8s.io/client-go v0.25.3 sigs.k8s.io/controller-runtime v0.13.0 ) diff --git a/go.sum b/go.sum index a0d7336..602f6ae 100644 --- a/go.sum +++ b/go.sum @@ -254,10 +254,10 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= -github.com/nats-io/nats-server/v2 v2.9.2 h1:XNDgJgOYYaYlquLdbSHI3xssLipfKUOq3EmYIMNCOsE= -github.com/nats-io/nats-server/v2 v2.9.2/go.mod h1:4sq8wvrpbvSzL1n3ZfEYnH4qeUuIl5W990j3kw13rRk= -github.com/nats-io/nats.go v1.17.0 h1:1jp5BThsdGlN91hW0k3YEfJbfACjiOYtUiLXG0RL4IE= -github.com/nats-io/nats.go v1.17.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats-server/v2 v2.9.3 h1:HrfzA7G9LNetKkm1z+jU/e9kuAe+E6uaBuuq9EB5sQQ= +github.com/nats-io/nats-server/v2 v2.9.3/go.mod h1:4sq8wvrpbvSzL1n3ZfEYnH4qeUuIl5W990j3kw13rRk= +github.com/nats-io/nats.go v1.18.0 h1:o480Ao6kuSSFyJO75rGTXCEPj7LGkY84C1Ye+Uhm4c0= +github.com/nats-io/nats.go v1.18.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -267,8 +267,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU= -github.com/onsi/gomega v1.20.2 h1:8uQq0zMgLEfa0vRrrBgaJF2gyW9Da9BmfGV+OyUzfkY= -github.com/onsi/gomega v1.20.2/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= +github.com/onsi/gomega v1.21.1 h1:OB/euWYIExnPBohllTicTHmGTrMaqJ67nIu80j0/uEM= +github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -730,8 +730,8 @@ k8s.io/apiextensions-apiserver v0.25.2 h1:8uOQX17RE7XL02ngtnh3TgifY7EhekpK+/piwz k8s.io/apiextensions-apiserver v0.25.2/go.mod h1:iRwwRDlWPfaHhuBfQ0WMa5skdQfrE18QXJaJvIDLvE8= k8s.io/apimachinery v0.25.2 h1:WbxfAjCx+AeN8Ilp9joWnyJ6xu9OMeS/fsfjK/5zaQs= k8s.io/apimachinery v0.25.2/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA= -k8s.io/client-go v0.25.2 h1:SUPp9p5CwM0yXGQrwYurw9LWz+YtMwhWd0GqOsSiefo= -k8s.io/client-go v0.25.2/go.mod h1:i7cNU7N+yGQmJkewcRD2+Vuj4iz7b30kI8OcL3horQ4= +k8s.io/client-go v0.25.3 h1:oB4Dyl8d6UbfDHD8Bv8evKylzs3BXzzufLiO27xuPs0= +k8s.io/client-go v0.25.3/go.mod h1:t39LPczAIMwycjcXkVc+CB+PZV69jQuNx4um5ORDjQA= k8s.io/component-base v0.25.2 h1:Nve/ZyHLUBHz1rqwkjXm/Re6IniNa5k7KgzxZpTfSQY= k8s.io/component-base v0.25.2/go.mod h1:90W21YMr+Yjg7MX+DohmZLzjsBtaxQDDwaX4YxDkl60= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= From 034228c582754abc35edfc3672734b5fafe89348 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Wed, 26 Oct 2022 17:50:26 +0200 Subject: [PATCH 117/194] Introduce shared handler for EPP (#15672) * unify multiple epp handler implementations * fix review comment * add comment as requested by reviewer * fix review comment * more comments * fix typo * even more comments * rename generic handler to handler * fix review nits * test legacy responses * dont check if stream exists * add body assertion for publishCloudEvent * remove unnecessary functions * sort imports * fix review comments * fix nits * fix error handling Co-authored-by: VladislavPaskar --- cmd/event-publisher-proxy/main.go | 29 +- go.mod | 1 + go.sum | 2 + internal/httpconsts.go | 2 - pkg/application/clean_test.go | 1 + pkg/application/lister.go | 3 +- .../eventtype/eventtypetest/eventtypetest.go | 9 + pkg/cloudevents/utils.go | 2 +- pkg/cloudevents/utils_test.go | 2 +- .../commander}/beb/beb.go | 14 +- pkg/commander/commander.go | 13 + .../commander}/nats/nats.go | 13 +- pkg/env/beb_config_test.go | 14 +- pkg/handler/beb/handler.go | 275 ------- pkg/handler/beb/handler_health_test.go | 42 -- pkg/handler/beb/handler_integration_test.go | 507 ------------- pkg/handler/beb/mock/mock.go | 215 ------ pkg/handler/common.go | 32 - pkg/handler/common_test.go | 69 -- pkg/handler/endpoints.go | 7 + pkg/handler/handler.go | 222 ++++++ pkg/handler/handler_test.go | 694 ++++++++++++++++++ pkg/handler/handlertest/handlertest.go | 350 --------- pkg/handler/health/health.go | 46 +- pkg/handler/health/health_test.go | 48 +- pkg/handler/nats/handler.go | 238 ------ pkg/handler/nats/handler_health_test.go | 47 -- pkg/handler/nats/handler_integration_test.go | 321 -------- pkg/handler/nats/health.go | 31 - pkg/handler/nats/health_test.go | 70 -- pkg/handler/nats/mock/mock.go | 208 ------ pkg/{legacy-events => legacy}/api/types.go | 0 pkg/{legacy-events => legacy}/constants.go | 0 .../error_responses.go | 4 +- pkg/{legacy-events => legacy}/helpers.go | 2 +- pkg/{legacy-events => legacy}/helpers_test.go | 0 pkg/{legacy-events => legacy}/legacy.go | 7 +- pkg/{legacy-events => legacy}/legacy_test.go | 27 +- pkg/legacy/legacytest/test.go | 53 ++ pkg/metrics/collector.go | 20 +- pkg/metrics/metricstest/metricstest.go | 51 +- pkg/metrics/server.go | 8 +- pkg/receiver/receiver.go | 30 +- pkg/receiver/receiver_test.go | 9 +- pkg/sender/beb.go | 27 - pkg/sender/beb/beb.go | 86 +++ pkg/sender/beb/beb_test.go | 221 ++++++ pkg/sender/beb_test.go | 109 --- pkg/sender/helper.go | 28 + pkg/sender/jetstream.go | 139 ---- pkg/sender/jetstream/health.go | 25 + pkg/sender/jetstream/jetstream.go | 118 +++ pkg/sender/{ => jetstream}/jetstream_test.go | 86 +-- pkg/sender/sender.go | 16 + pkg/signals/signals.go | 6 - pkg/subscribed/processor.go | 9 +- pkg/subscribed/response.go | 2 +- testing/fixtures.go | 37 +- testing/nats.go | 63 +- testing/utils.go | 135 +--- 60 files changed, 1714 insertions(+), 3131 deletions(-) rename {cmd/event-publisher-proxy => pkg/commander}/beb/beb.go (91%) create mode 100644 pkg/commander/commander.go rename {cmd/event-publisher-proxy => pkg/commander}/nats/nats.go (92%) delete mode 100644 pkg/handler/beb/handler.go delete mode 100644 pkg/handler/beb/handler_health_test.go delete mode 100644 pkg/handler/beb/handler_integration_test.go delete mode 100644 pkg/handler/beb/mock/mock.go delete mode 100644 pkg/handler/common.go delete mode 100644 pkg/handler/common_test.go create mode 100644 pkg/handler/endpoints.go create mode 100644 pkg/handler/handler.go create mode 100644 pkg/handler/handler_test.go delete mode 100644 pkg/handler/handlertest/handlertest.go delete mode 100644 pkg/handler/nats/handler.go delete mode 100644 pkg/handler/nats/handler_health_test.go delete mode 100644 pkg/handler/nats/handler_integration_test.go delete mode 100644 pkg/handler/nats/health.go delete mode 100644 pkg/handler/nats/health_test.go delete mode 100644 pkg/handler/nats/mock/mock.go rename pkg/{legacy-events => legacy}/api/types.go (100%) rename pkg/{legacy-events => legacy}/constants.go (100%) rename pkg/{legacy-events => legacy}/error_responses.go (97%) rename pkg/{legacy-events => legacy}/helpers.go (99%) rename pkg/{legacy-events => legacy}/helpers_test.go (100%) rename pkg/{legacy-events => legacy}/legacy.go (96%) rename pkg/{legacy-events => legacy}/legacy_test.go (91%) create mode 100644 pkg/legacy/legacytest/test.go delete mode 100644 pkg/sender/beb.go create mode 100644 pkg/sender/beb/beb.go create mode 100644 pkg/sender/beb/beb_test.go delete mode 100644 pkg/sender/beb_test.go create mode 100644 pkg/sender/helper.go delete mode 100644 pkg/sender/jetstream.go create mode 100644 pkg/sender/jetstream/health.go create mode 100644 pkg/sender/jetstream/jetstream.go rename pkg/sender/{ => jetstream}/jetstream_test.go (68%) create mode 100644 pkg/sender/sender.go diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index 71b175d..fd16114 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -4,14 +4,15 @@ import ( golog "log" "github.com/kelseyhightower/envconfig" + kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" "github.com/prometheus/client_golang/prometheus" - "github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy/beb" - "github.com/kyma-project/kyma/components/event-publisher-proxy/cmd/event-publisher-proxy/nats" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/commander" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/commander/beb" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/commander/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/latency" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" ) const ( @@ -30,18 +31,6 @@ type Config struct { AppLogLevel string `envconfig:"APP_LOG_LEVEL" default:"info"` } -// Commander defines the interface of different implementations -type Commander interface { - // Init allows main() to pass flag values to the commander instance. - Init() error - - // Start runs the initialized commander instance. - Start() error - - // Stop stops the commander instance. - Stop() error -} - func main() { opts := options.ParseArgs() @@ -68,18 +57,18 @@ func main() { prometheus.MustRegister(metricsCollector) // Instantiate configured commander. - var commander Commander + var c commander.Commander switch cfg.Backend { case backendBEB: - commander = beb.NewCommander(opts, metricsCollector, logger) + c = beb.NewCommander(opts, metricsCollector, logger) case backendNATS: - commander = nats.NewCommander(opts, metricsCollector, logger) + c = nats.NewCommander(opts, metricsCollector, logger) default: setupLogger.Fatalf("Invalid publisher backend: %v", cfg.Backend) } // Init the commander. - if err := commander.Init(); err != nil { + if err := c.Init(); err != nil { setupLogger.Fatalw("Commander initialization failed", "error", err) } @@ -93,7 +82,7 @@ func main() { setupLogger.Infof("Starting publisher to: %v", cfg.Backend) // Start the commander. - if err := commander.Start(); err != nil { + if err := c.Start(); err != nil { setupLogger.Fatalw("Failed to to start publisher", "error", err) } diff --git a/go.mod b/go.mod index 2653ed4..3c8ce5a 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.19 require ( github.com/cloudevents/sdk-go/v2 v2.12.0 github.com/google/uuid v1.3.0 + github.com/gorilla/mux v1.8.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221004144139-b69aea381b88 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221004144139-b69aea381b88 diff --git a/go.sum b/go.sum index 602f6ae..6b92a2f 100644 --- a/go.sum +++ b/go.sum @@ -198,6 +198,8 @@ github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= diff --git a/internal/httpconsts.go b/internal/httpconsts.go index 0964813..9d134c2 100644 --- a/internal/httpconsts.go +++ b/internal/httpconsts.go @@ -1,12 +1,10 @@ package internal const ( - // HTTP ContentType constants HeaderContentType = "Content-Type" ContentTypeApplicationJSON = "application/json" ContentTypeApplicationCloudEventsJSON = "application/cloudevents+json" - // cloud event header constants CeIDHeader = "ce-id" CeTypeHeader = "ce-type" CeSourceHeader = "ce-source" diff --git a/pkg/application/clean_test.go b/pkg/application/clean_test.go index bbe3f6e..47c6fb5 100644 --- a/pkg/application/clean_test.go +++ b/pkg/application/clean_test.go @@ -4,6 +4,7 @@ import ( "testing" applicationv1alpha1 "github.com/kyma-project/kyma/components/application-operator/pkg/apis/applicationconnector/v1alpha1" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" ) diff --git a/pkg/application/lister.go b/pkg/application/lister.go index 0f5260c..7d4fc8f 100644 --- a/pkg/application/lister.go +++ b/pkg/application/lister.go @@ -5,8 +5,8 @@ import ( "errors" "time" + applicationv1alpha1 "github.com/kyma-project/kyma/components/application-operator/pkg/apis/applicationconnector/v1alpha1" kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" - v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" @@ -15,7 +15,6 @@ import ( "k8s.io/client-go/dynamic/dynamicinformer" "k8s.io/client-go/tools/cache" - applicationv1alpha1 "github.com/kyma-project/kyma/components/application-operator/pkg/apis/applicationconnector/v1alpha1" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" ) diff --git a/pkg/cloudevents/eventtype/eventtypetest/eventtypetest.go b/pkg/cloudevents/eventtype/eventtypetest/eventtypetest.go index 4efafbb..4c2a624 100644 --- a/pkg/cloudevents/eventtype/eventtypetest/eventtypetest.go +++ b/pkg/cloudevents/eventtype/eventtypetest/eventtypetest.go @@ -3,6 +3,15 @@ package eventtypetest type CleanerFunc func(string) (string, error) +type CleanerStub struct { + CleanType string + Error error +} + +func (c CleanerStub) Clean(_ string) (string, error) { + return c.CleanType, c.Error +} + func (cf CleanerFunc) Clean(eventType string) (string, error) { return cf(eventType) } diff --git a/pkg/cloudevents/utils.go b/pkg/cloudevents/utils.go index 809051e..0bfb372 100644 --- a/pkg/cloudevents/utils.go +++ b/pkg/cloudevents/utils.go @@ -1,4 +1,4 @@ -package events +package cloudevents import ( "context" diff --git a/pkg/cloudevents/utils_test.go b/pkg/cloudevents/utils_test.go index 374a867..dd3e406 100644 --- a/pkg/cloudevents/utils_test.go +++ b/pkg/cloudevents/utils_test.go @@ -1,4 +1,4 @@ -package events +package cloudevents import ( "context" diff --git a/cmd/event-publisher-proxy/beb/beb.go b/pkg/commander/beb/beb.go similarity index 91% rename from cmd/event-publisher-proxy/beb/beb.go rename to pkg/commander/beb/beb.go index 74b1f3b..9141c1b 100644 --- a/cmd/event-publisher-proxy/beb/beb.go +++ b/pkg/commander/beb/beb.go @@ -15,14 +15,15 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/beb" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/beb" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" ) @@ -75,7 +76,7 @@ func (c *Commander) Start() error { defer client.CloseIdleConnections() // configure message sender - messageSender := sender.NewBEBMessageSender(c.envCfg.EmsPublishURL, client) + messageSender := beb.NewSender(c.envCfg.EmsPublishURL, client) // cluster config k8sConfig := config.GetConfigOrDie() @@ -96,7 +97,8 @@ func (c *Commander) Start() error { subLister := subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() subscribedProcessor := &subscribed.Processor{ SubscriptionLister: &subLister, - Config: c.envCfg, + Prefix: c.envCfg.EventTypePrefix, + Namespace: c.envCfg.BEBNamespace, Logger: c.logger, } // Sync informer cache or die @@ -108,7 +110,7 @@ func (c *Commander) Start() error { eventTypeCleaner := eventtype.NewCleaner(c.envCfg.EventTypePrefix, applicationLister, c.logger) // start handler which blocks until it receives a shutdown signal - if err := beb.NewHandler(messageReceiver, messageSender, c.envCfg.RequestTimeout, legacyTransformer, c.opts, + if err := handler.NewHandler(messageReceiver, messageSender, health.NewChecker(), c.envCfg.RequestTimeout, legacyTransformer, c.opts, subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleaner).Start(ctx); err != nil { return xerrors.Errorf("failed to start handler for %s : %v", bebCommanderName, err) } diff --git a/pkg/commander/commander.go b/pkg/commander/commander.go new file mode 100644 index 0000000..577690d --- /dev/null +++ b/pkg/commander/commander.go @@ -0,0 +1,13 @@ +package commander + +// Commander defines the interface of different implementations +type Commander interface { + // Init allows main() to pass flag values to the commander instance. + Init() error + + // Start runs the initialized commander instance. + Start() error + + // Stop stops the commander instance. + Stop() error +} diff --git a/cmd/event-publisher-proxy/nats/nats.go b/pkg/commander/nats/nats.go similarity index 92% rename from cmd/event-publisher-proxy/nats/nats.go rename to pkg/commander/nats/nats.go index 9b2c1bd..daf135f 100644 --- a/cmd/event-publisher-proxy/nats/nats.go +++ b/pkg/commander/nats/nats.go @@ -16,14 +16,14 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/jetstream" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" ) @@ -83,7 +83,7 @@ func (c *Commander) Start() error { defer connection.Close() // configure the message sender - messageSender := sender.NewJetStreamMessageSender(ctx, connection, c.envCfg, c.logger) + messageSender := jetstream.NewSender(ctx, connection, c.envCfg, c.logger) // cluster config k8sConfig := config.GetConfigOrDie() @@ -104,7 +104,8 @@ func (c *Commander) Start() error { subLister := subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() subscribedProcessor := &subscribed.Processor{ SubscriptionLister: &subLister, - Config: c.envCfg.ToConfig(), + Prefix: c.envCfg.ToConfig().EventTypePrefix, + Namespace: c.envCfg.ToConfig().BEBNamespace, Logger: c.logger, } @@ -117,7 +118,7 @@ func (c *Commander) Start() error { eventTypeCleaner := eventtype.NewCleaner(c.envCfg.EventTypePrefix, applicationLister, c.logger) // start handler which blocks until it receives a shutdown signal - if err := nats.NewHandler(messageReceiver, messageSender, c.envCfg.RequestTimeout, legacyTransformer, c.opts, + if err := handler.NewHandler(messageReceiver, messageSender, messageSender, c.envCfg.RequestTimeout, legacyTransformer, c.opts, subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleaner).Start(ctx); err != nil { return xerrors.Errorf("failed to start handler for %s : %v", natsCommanderName, err) } diff --git a/pkg/env/beb_config_test.go b/pkg/env/beb_config_test.go index 276a7b9..69e5949 100644 --- a/pkg/env/beb_config_test.go +++ b/pkg/env/beb_config_test.go @@ -9,18 +9,18 @@ func TestConfigureTransport(t *testing.T) { t.Parallel() const ( - maxIdleConns = 100 - maxIdleConnsPerHost = 200 + maxIdleConnections = 100 + maxIdleConnectionsPerHost = 200 ) transport := &http.Transport{} - cfg := BEBConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost} + cfg := BEBConfig{MaxIdleConns: maxIdleConnections, MaxIdleConnsPerHost: maxIdleConnectionsPerHost} cfg.ConfigureTransport(transport) - if transport.MaxIdleConns != maxIdleConns { - t.Errorf("HTTP Transport MaxIdleConns is misconfigured want: %d but got: %d", maxIdleConns, transport.MaxIdleConns) + if transport.MaxIdleConns != maxIdleConnections { + t.Errorf("HTTP Transport MaxIdleConns is misconfigured want: %d but got: %d", maxIdleConnections, transport.MaxIdleConns) } - if transport.MaxIdleConnsPerHost != maxIdleConnsPerHost { - t.Errorf("HTTP Transport MaxIdleConnsPerHost is misconfigured want: %d but got: %d", maxIdleConnsPerHost, transport.MaxIdleConnsPerHost) + if transport.MaxIdleConnsPerHost != maxIdleConnectionsPerHost { + t.Errorf("HTTP Transport MaxIdleConnsPerHost is misconfigured want: %d but got: %d", maxIdleConnectionsPerHost, transport.MaxIdleConnsPerHost) } } diff --git a/pkg/handler/beb/handler.go b/pkg/handler/beb/handler.go deleted file mode 100644 index b1407db..0000000 --- a/pkg/handler/beb/handler.go +++ /dev/null @@ -1,275 +0,0 @@ -package beb - -import ( - "context" - "io" - "net/http" - "time" - - "github.com/kyma-project/kyma/components/eventing-controller/logger" - "go.uber.org/zap" - - "github.com/cloudevents/sdk-go/v2/binding" - cev2client "github.com/cloudevents/sdk-go/v2/client" - cev2event "github.com/cloudevents/sdk-go/v2/event" - cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" - cloudevents "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/ems" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" -) - -const ( - // noDuration signals that the dispatch step has not started yet. - noDuration = -1 - - bebCommanderName = "beb-commander" -) - -var ( - // additionalHeaders are the required headers by EMS for publish requests. - // Any alteration or removal of those headers might cause publish requests to fail. - additionalHeaders = http.Header{ - "qos": []string{string(ems.QosAtLeastOnce)}, - "Accept": []string{internal.ContentTypeApplicationJSON}, - } -) - -// Handler is responsible for receiving HTTP requests and dispatching them to the EMS gateway. -// It also assures that the messages received are compliant with the Cloud Events spec. -type Handler struct { - // Receiver receives incoming HTTP requests - Receiver *receiver.HTTPMessageReceiver - // Sender sends requests to the broker - Sender *sender.BEBMessageSender - // Defaulter sets default values to incoming events - Defaulter cev2client.EventDefaulter - // LegacyTransformer handles transformations needed to handle legacy events - LegacyTransformer *legacy.Transformer - // RequestTimeout timeout for outgoing requests - RequestTimeout time.Duration - // SubscribedProcessor processes requests for /:app/v1/events/subscribed endpoint - SubscribedProcessor *subscribed.Processor - // Logger default logger - Logger *logger.Logger - // Options configures HTTP server - Options *options.Options - // collector collects metrics - collector *metrics.Collector - // eventTypeCleaner cleans the cloud event type - eventTypeCleaner eventtype.Cleaner -} - -// NewHandler returns a new HTTP Handler instance. -func NewHandler(receiver *receiver.HTTPMessageReceiver, sender *sender.BEBMessageSender, requestTimeout time.Duration, - legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, - logger *logger.Logger, collector *metrics.Collector, eventTypeCleaner eventtype.Cleaner) *Handler { - return &Handler{ - Receiver: receiver, - Sender: sender, - RequestTimeout: requestTimeout, - LegacyTransformer: legacyTransformer, - SubscribedProcessor: subscribedProcessor, - Logger: logger, - Options: opts, - collector: collector, - eventTypeCleaner: eventTypeCleaner, - } -} - -// Start starts the Handler with the given context. -func (h *Handler) Start(ctx context.Context) error { - healthChecker := health.NewChecker() - return h.Receiver.StartListen(ctx, healthChecker.Check(h), h.Logger) -} - -// ServeHTTP serves an HTTP request and returns an HTTP response. -// It ensures that the incoming request is a valid Cloud Event, then dispatches it -// to the EMS gateway and writes back the HTTP response. -func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { - // validate request method - if request.Method != http.MethodPost && request.Method != http.MethodGet { - h.namedLogger().Warnf("Unexpected request method: %s", request.Method) - h.writeResponse(writer, http.StatusMethodNotAllowed, nil) - return - } - // Limit server from reading a huge payload - request.Body = http.MaxBytesReader(writer, request.Body, h.Options.MaxRequestSize) - uri := request.RequestURI - - // Process /publish endpoint - // Gets a CE and sends it to BEB - if handler.IsARequestWithCE(uri) { - h.publishCloudEvents(writer, request) - return - } - - // Process /:application/v1/events - // Publishes a legacy event as CE v1.0 to BEB - if handler.IsARequestWithLegacyEvent(uri) { - h.publishLegacyEventsAsCE(writer, request) - return - } - - // Process /:application/v1/events/subscribed - // Fetches the list of subscriptions available for the given application - if handler.IsARequestForSubscriptions(uri) { - h.SubscribedProcessor.ExtractEventsFromSubscriptions(writer, request) - return - } - - h.writeResponse(writer, http.StatusNotFound, nil) -} - -func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { - event, eventTypeOriginal := h.LegacyTransformer.TransformLegacyRequestsToCE(writer, request) - if event == nil { - h.namedLogger().Debug("Failed to transform legacy event to CloudEvent, event is nil") - return - } - - ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) - defer cancel() - h.receive(ctx, event) - statusCode, dispatchTime, respBody := h.send(ctx, event) - - // Change response as per old error codes - h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, statusCode, event, string(respBody)) - - h.namedLogger().With( - "id", event.ID(), - "source", event.Source(), - "before", eventTypeOriginal, - "after", event.Type(), - "statusCode", statusCode, - "duration", dispatchTime, - "responseBody", string(respBody), - ).Info("Event dispatched") -} - -func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.Request) { - ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) - defer cancel() - - message := cev2http.NewMessageFromHttpRequest(request) - defer func() { _ = message.Finish(nil) }() - - event, err := binding.ToEvent(ctx, message) - if err != nil { - h.namedLogger().Errorw("Failed to extract event from request", "error", err) - h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) - return - } - - eventTypeOriginal := event.Type() - eventTypeClean, err := h.eventTypeCleaner.Clean(eventTypeOriginal) - if err != nil { - h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) - return - } - event.SetType(eventTypeClean) - - if err := event.Validate(); err != nil { - h.namedLogger().Errorw("Request doesn't correspond to CloudEvent spec", "error", err) - h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) - return - } - - if request.Header.Get(cev2http.ContentType) == cev2event.ApplicationCloudEventsJSON { - ctx = binding.WithForceStructured(ctx) - } else { - ctx = binding.WithForceBinary(ctx) - } - - h.receive(ctx, event) - statusCode, dispatchTime, respBody := h.send(ctx, event) - h.writeResponse(writer, statusCode, respBody) - - h.namedLogger().With( - "id", event.ID(), - "source", event.Source(), - "before", eventTypeOriginal, - "after", eventTypeClean, - "statusCode", statusCode, - "duration", dispatchTime, - "responseBody", string(respBody), - ).Info("Event dispatched") -} - -// writeResponse writes the HTTP response given the status code and response body. -func (h *Handler) writeResponse(writer http.ResponseWriter, statusCode int, respBody []byte) { - writer.WriteHeader(statusCode) - - if respBody == nil { - return - } - if _, err := writer.Write(respBody); err != nil { - h.namedLogger().Errorw("Failed to write response body", "error", err) - } -} - -// receive applies the default values (if any) to the given Cloud Event. -func (h *Handler) receive(ctx context.Context, event *cev2event.Event) { - if h.Defaulter != nil { - newEvent := h.Defaulter(ctx, *event) - event = &newEvent - } - - h.namedLogger().Infof("CloudEvent received id:[%s]", event.ID()) -} - -// send dispatches the given Cloud Event to the EMS gateway and returns the response details and dispatch time. -func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.Duration, []byte) { - request, err := h.Sender.NewRequestWithTarget(ctx, h.Sender.Target) - if err != nil { - h.namedLogger().Errorw("Failed to prepare a CloudEvent request", "error", err) - return http.StatusInternalServerError, noDuration, []byte{} - } - - message := binding.ToMessage(event) - defer func() { _ = message.Finish(nil) }() - - err = cloudevents.WriteRequestWithHeaders(ctx, message, request, additionalHeaders) - if err != nil { - h.namedLogger().Errorw("Failed to add additional headers to the request", "error", err) - return http.StatusInternalServerError, noDuration, []byte{} - } - - resp, dispatchTime, err := h.sendAndRecordDispatchTime(request) - if err != nil { - h.namedLogger().Errorw("Failed to send CloudEvent and record dispatch time", "error", err) - h.collector.RecordError() - return http.StatusInternalServerError, dispatchTime, []byte{} - } - defer func() { _ = resp.Body.Close() }() - h.collector.RecordLatency(dispatchTime, resp.StatusCode, request.URL.Host) - h.collector.RecordRequests(resp.StatusCode, request.URL.Host) - body, err := io.ReadAll(resp.Body) - if err != nil { - h.namedLogger().Errorw("Failed to read response body", "error", err) - return http.StatusInternalServerError, dispatchTime, []byte{} - } - - return resp.StatusCode, dispatchTime, body -} - -// sendAndRecordDispatchTime sends a CloudEvent and records the time taken while sending. -func (h *Handler) sendAndRecordDispatchTime(request *http.Request) (*http.Response, time.Duration, error) { - start := time.Now() - resp, err := h.Sender.Send(request) - dispatchTime := time.Since(start) - return resp, dispatchTime, err -} - -func (h *Handler) namedLogger() *zap.SugaredLogger { - return h.Logger.WithContext().Named(bebCommanderName) -} diff --git a/pkg/handler/beb/handler_health_test.go b/pkg/handler/beb/handler_health_test.go deleted file mode 100644 index 51d43d0..0000000 --- a/pkg/handler/beb/handler_health_test.go +++ /dev/null @@ -1,42 +0,0 @@ -package beb_test - -import ( - "context" - "testing" - "time" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/beb/mock" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" -) - -func TestHandlerHealth(t *testing.T) { - var ( - requestSize = bigRequestSize - eventsEndpoint = defaultEventsEndpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - ) - testCases := []struct { - name string - wantLivenessStatusCode int - wantReadinessStatusCode int - }{ - { - name: "beb handler is healthy", - wantLivenessStatusCode: health.StatusCodeHealthy, - wantReadinessStatusCode: health.StatusCodeHealthy, - }, - } - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, testingutils.MessagingEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime) - defer handlerMock.Close() - - testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetLivenessEndpoint(), tc.wantLivenessStatusCode) - testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetReadinessEndpoint(), tc.wantReadinessStatusCode) - }) - } -} diff --git a/pkg/handler/beb/handler_integration_test.go b/pkg/handler/beb/handler_integration_test.go deleted file mode 100644 index 2f6ddef..0000000 --- a/pkg/handler/beb/handler_integration_test.go +++ /dev/null @@ -1,507 +0,0 @@ -package beb_test - -import ( - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "testing" - "time" - - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime" - - "github.com/stretchr/testify/require" - - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/beb/mock" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" - legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" -) - -const ( - // mock server endpoints - defaultEventsEndpoint = "/events" - defaultEventsHTTP400Endpoint = "/events400" - - // request size - smallRequestSize = 2 - bigRequestSize = 65536 - - publishEndpointFormat = "http://localhost:%d/publish" - publishLegacyEndpointFormat = "http://localhost:%d/%s/v1/events" - subscribedEndpointFormat = "http://localhost:%d/%s/v1/events/subscribed" -) - -func TestHandlerForCloudEvents(t *testing.T) { - t.Parallel() - - testCases := []struct { - name string - givenEventTypePrefix string - givenEventType string - givenApplicationNameToCreate string - givenApplicationNameToValidate string - }{ - // not-clean event-types - { - name: "With prefix and clean application name and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenEventType: testingutils.CloudEventTypeNotClean, - givenApplicationNameToCreate: testingutils.ApplicationName, - givenApplicationNameToValidate: testingutils.ApplicationName, - }, - { - name: "With empty prefix and clean application name and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenEventType: testingutils.CloudEventTypeNotClean, - givenApplicationNameToCreate: testingutils.ApplicationName, - givenApplicationNameToValidate: testingutils.ApplicationName, - }, - { - name: "With prefix and not-clean application name and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenEventType: testingutils.CloudEventTypeNotClean, - givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, - givenApplicationNameToValidate: testingutils.ApplicationName, - }, - { - name: "With empty prefix and not-clean application name and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenEventType: testingutils.CloudEventTypeNotClean, - givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, - givenApplicationNameToValidate: testingutils.ApplicationName, - }, - // clean event-types - { - name: "With prefix and clean application name and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenEventType: testingutils.CloudEventType, - givenApplicationNameToCreate: testingutils.ApplicationName, - givenApplicationNameToValidate: testingutils.ApplicationName, - }, - { - name: "With empty prefix and clean application name and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenEventType: testingutils.CloudEventType, - givenApplicationNameToCreate: testingutils.ApplicationName, - givenApplicationNameToValidate: testingutils.ApplicationName, - }, - { - name: "With prefix and not-clean application name and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenEventType: testingutils.CloudEventType, - givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, - givenApplicationNameToValidate: testingutils.ApplicationName, - }, - { - name: "With empty prefix and not-clean application name and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenEventType: testingutils.CloudEventType, - givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, - givenApplicationNameToValidate: testingutils.ApplicationName, - }, - } - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - - var ( - requestSize = bigRequestSize - eventsEndpoint = defaultEventsEndpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - ) - - handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithApplication(tc.givenApplicationNameToCreate, tc.givenApplicationNameToValidate), - ) - defer handlerMock.Close() - publishEndpoint := fmt.Sprintf(publishEndpointFormat, handlerMock.GetPort()) - - for _, testCase := range handlertest.TestCasesForCloudEvents { - testCase := testCase - t.Run(testCase.Name, func(t *testing.T) { - body, headers := testCase.ProvideMessage(tc.givenEventType) - resp, err := testingutils.SendEvent(publishEndpoint, body, headers) - require.NoError(t, err) - require.NoError(t, resp.Body.Close()) - require.Equal(t, testCase.WantStatusCode, resp.StatusCode) - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) - } - }) - } - }) - } -} - -func TestHandlerForLegacyEvents(t *testing.T) { - t.Parallel() - - testCases := []struct { - name string - givenEventTypePrefix string - givenApplicationNameToCreate string - givenApplicationNameToValidate string - }{ - { - name: "With prefix and clean application name", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenApplicationNameToCreate: testingutils.ApplicationName, - givenApplicationNameToValidate: testingutils.ApplicationName, - }, - { - name: "With empty prefix and clean application name", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenApplicationNameToCreate: testingutils.ApplicationName, - givenApplicationNameToValidate: testingutils.ApplicationName, - }, - { - name: "With prefix and not-clean application name", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, - givenApplicationNameToValidate: testingutils.ApplicationName, - }, - { - name: "With empty prefix and not-clean application name", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenApplicationNameToCreate: testingutils.ApplicationNameNotClean, - givenApplicationNameToValidate: testingutils.ApplicationName, - }, - } - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - - var ( - requestSize = bigRequestSize - eventsEndpoint = defaultEventsEndpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - ) - - handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithApplication(tc.givenApplicationNameToCreate, tc.givenApplicationNameToValidate), - ) - defer handlerMock.Close() - publishLegacyEndpoint := fmt.Sprintf(publishLegacyEndpointFormat, handlerMock.GetPort(), tc.givenApplicationNameToCreate) - - for _, testCase := range handlertest.TestCasesForLegacyEvents { - testCase := testCase - t.Run(testCase.Name, func(t *testing.T) { - body, headers := testCase.ProvideMessage() - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - require.NoError(t, err) - require.Equal(t, testCase.WantStatusCode, resp.StatusCode) - if testCase.WantStatusCode == http.StatusOK { - handlertest.ValidateLegacyOkResponse(t, *resp, &testCase.WantResponse) - } else { - handlertest.ValidateLegacyErrorResponse(t, *resp, &testCase.WantResponse) - } - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) - } - }) - } - }) - } -} - -func TestHandlerForBEBFailures(t *testing.T) { - t.Parallel() - - testCases := []struct { - name string - givenEventTypePrefix string - }{ - { - name: "With prefix", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - }, - { - name: "With empty prefix", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - }, - } - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - - var ( - requestSize = bigRequestSize - applicationName = testingutils.ApplicationName - eventsEndpoint = defaultEventsHTTP400Endpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - ) - - handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithApplication(applicationName, applicationName), - ) - defer handlerMock.Close() - publishEndpoint := fmt.Sprintf(publishEndpointFormat, handlerMock.GetPort()) - publishLegacyEndpoint := fmt.Sprintf(publishLegacyEndpointFormat, handlerMock.GetPort(), applicationName) - - innerTestCases := []struct { - name string - provideMessage func() (string, http.Header) - givenEndpoint string - wantStatusCode int - wantResponse legacyapi.PublishEventResponses - }{ - { - name: "Send a legacy event with event-id", - provideMessage: func() (string, http.Header) { - builder := testingutils.NewLegacyEventBuilder() - return builder.Build() - }, - givenEndpoint: publishLegacyEndpoint, - wantStatusCode: http.StatusBadRequest, - wantResponse: legacyapi.PublishEventResponses{ - Error: &legacyapi.Error{ - Status: http.StatusBadRequest, - Message: "invalid request"}, - }, - }, - { - name: "Binary CloudEvent is valid with required headers", - provideMessage: func() (string, http.Header) { - return fmt.Sprintf(`"%s"`, testingutils.EventData), testingutils.GetBinaryMessageHeaders() - }, - givenEndpoint: publishEndpoint, - wantStatusCode: http.StatusBadRequest, - }, - } - for _, testCase := range innerTestCases { - testCase := testCase - t.Run(testCase.name, func(t *testing.T) { - body, headers := testCase.provideMessage() - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - require.NoError(t, err) - require.Equal(t, testCase.wantStatusCode, resp.StatusCode) - if testCase.givenEndpoint == publishLegacyEndpoint { - handlertest.ValidateLegacyErrorResponse(t, *resp, &testCase.wantResponse) - } - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) - } - }) - } - }) - } -} - -func TestHandlerForHugeRequests(t *testing.T) { - t.Parallel() - - testCases := []struct { - name string - givenEventTypePrefix string - }{ - { - name: "With prefix", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - }, - { - name: "With empty prefix", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - }, - } - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - - var ( - requestSize = smallRequestSize - applicationName = testingutils.ApplicationName - eventsEndpoint = defaultEventsHTTP400Endpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - ) - - handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithApplication(applicationName, applicationName), - ) - defer handlerMock.Close() - publishLegacyEndpoint := fmt.Sprintf(publishLegacyEndpointFormat, handlerMock.GetPort(), applicationName) - - innerTestCases := []struct { - name string - provideMessage func() (string, http.Header) - givenEndpoint string - wantStatusCode int - }{ - { - name: "Should fail with HTTP 413 with a request which is larger than 2 Bytes as the maximum accepted size is 2 Bytes", - provideMessage: func() (string, http.Header) { - builder := testingutils.NewLegacyEventBuilder() - return builder.Build() - }, - givenEndpoint: publishLegacyEndpoint, - wantStatusCode: http.StatusRequestEntityTooLarge, - }, - { - name: "Should accept a request which is lesser than 2 Bytes as the maximum accepted size is 2 Bytes", - provideMessage: func() (string, http.Header) { - return "{}", testingutils.GetBinaryMessageHeaders() - }, - givenEndpoint: handler.PublishEndpoint, - wantStatusCode: http.StatusBadRequest, - }, - } - for _, testCase := range innerTestCases { - testCase := testCase - t.Run(testCase.name, func(t *testing.T) { - body, headers := testCase.provideMessage() - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - require.NoError(t, err) - require.Equal(t, testCase.wantStatusCode, resp.StatusCode) - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) - } - }) - } - }) - } -} - -func TestHandlerForSubscribedEndpoint(t *testing.T) { - t.Parallel() - - testCases := []struct { - name string - givenEventTypePrefix string - givenEventType string - }{ - { - name: "With prefix and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenEventType: testingutils.CloudEventType, - }, - { - name: "With empty prefix and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenEventType: testingutils.CloudEventTypePrefixEmpty, - }, - } - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - - var ( - requestSize = smallRequestSize - eventsEndpoint = defaultEventsHTTP400Endpoint - requestTimeout = time.Second - serverResponseTime = time.Nanosecond - subscribedEndpointFormat = subscribedEndpointFormat - ) - - scheme := runtime.NewScheme() - require.NoError(t, corev1.AddToScheme(scheme)) - require.NoError(t, eventingv1alpha1.AddToScheme(scheme)) - subscription := testingutils.NewSubscription(testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, tc.givenEventType)) - - handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, - mock.WithSubscription(scheme, subscription), - ) - defer handlerMock.Close() - - for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { - testCase := testCase - t.Run(testCase.Name, func(t *testing.T) { - subscribedURL := fmt.Sprintf(subscribedEndpointFormat, handlerMock.GetPort(), testCase.AppName) - resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) - require.NoError(t, err) - require.Equal(t, testCase.WantStatusCode, resp.StatusCode) - defer func() { require.NoError(t, resp.Body.Close()) }() - respBodyBytes, err := io.ReadAll(resp.Body) - require.NoError(t, err) - gotEventsResponse := subscribed.Events{} - err = json.Unmarshal(respBodyBytes, &gotEventsResponse) - require.NoError(t, err) - require.Equal(t, testCase.WantResponse, gotEventsResponse) - }) - } - }) - } -} - -func TestHandlerTimeout(t *testing.T) { - t.Parallel() - - testCases := []struct { - name string - givenEventTypePrefix string - givenEventType string - }{ - // not-clean event-types - { - name: "With prefix and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenEventType: testingutils.CloudEventTypeNotClean, - }, - { - name: "With empty prefix and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, - }, - // clean event-types - { - name: "With prefix and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenEventType: testingutils.CloudEventType, - }, - { - name: "With empty prefix and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenEventType: testingutils.CloudEventTypePrefixEmpty, - }, - } - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - - var ( - requestSize = bigRequestSize - applicationName = testingutils.ApplicationName - eventsEndpoint = defaultEventsHTTP400Endpoint - requestTimeout = time.Nanosecond // short request timeout - serverResponseTime = time.Millisecond // long server response time - ) - - handlerMock := mock.StartOrDie(context.TODO(), t, requestSize, tc.givenEventTypePrefix, eventsEndpoint, requestTimeout, serverResponseTime, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithApplication(applicationName, applicationName), - ) - defer handlerMock.Close() - publishEndpoint := fmt.Sprintf(publishEndpointFormat, handlerMock.GetPort()) - - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(tc.givenEventType), - ) - body, headers := builder.BuildStructured() - resp, err := testingutils.SendEvent(publishEndpoint, body, headers) - require.NoError(t, err) - require.NoError(t, resp.Body.Close()) - require.Equal(t, http.StatusInternalServerError, resp.StatusCode) - metricstest.EnsureMetricErrors(t, handlerMock.GetMetricsCollector()) - }) - } -} diff --git a/pkg/handler/beb/mock/mock.go b/pkg/handler/beb/mock/mock.go deleted file mode 100644 index 209092a..0000000 --- a/pkg/handler/beb/mock/mock.go +++ /dev/null @@ -1,215 +0,0 @@ -package mock - -import ( - "context" - "errors" - "fmt" - "net/http" - "strings" - "testing" - "time" - - "github.com/cloudevents/sdk-go/v2/binding" - cev2event "github.com/cloudevents/sdk-go/v2/event" - cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" - "github.com/stretchr/testify/require" - "golang.org/x/xerrors" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/dynamic/dynamicinformer" - dynamicfake "k8s.io/client-go/dynamic/fake" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype/eventtypetest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/beb" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/latency" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" - "github.com/kyma-project/kyma/components/eventing-controller/logger" -) - -const ( - defaultTokenEndpoint = "/token" - defaultEventsEndpoint = "/events" - defaultEventsHTTP400Endpoint = "/events400" -) - -// BEBHandlerMock represents a mock for the beb.Handler. -type BEBHandlerMock struct { - ctx context.Context - cfg *env.BEBConfig - logger *logger.Logger - collector *metrics.Collector - livenessEndpoint string - readinessEndpoint string - legacyTransformer *legacy.Transformer - subscribedProcessor *subscribed.Processor - mockServer *testingutils.MockServer - eventTypeCleaner eventtype.Cleaner -} - -// BEBHandlerMockOpt represents a BEBHandlerMock option. -type BEBHandlerMockOpt func(*BEBHandlerMock) - -// GetPort returns the port used by the BEBHandlerMock. -func (m *BEBHandlerMock) GetPort() int { - return m.cfg.Port -} - -// GetMetricsCollector returns the metrics.Collector used by the BEBHandlerMock. -func (m *BEBHandlerMock) GetMetricsCollector() *metrics.Collector { - return m.collector -} - -// Close closes the testing.MockServer used by the BEBHandlerMock. -func (m *BEBHandlerMock) Close() { - m.mockServer.Close() -} - -// GetLivenessEndpoint returns the liveness endpoint used by the BEBHandlerMock. -func (m *BEBHandlerMock) GetLivenessEndpoint() string { - return m.livenessEndpoint -} - -// GetReadinessEndpoint returns the readiness endpoint used by the BEBHandlerMock. -func (m *BEBHandlerMock) GetReadinessEndpoint() string { - return m.readinessEndpoint -} - -// StartOrDie starts a new BEBHandlerMock instance or die if a precondition fails. -// Preconditions: 1) beb.Handler started without errors. -func StartOrDie(ctx context.Context, t *testing.T, requestSize int, eventTypePrefix, eventsEndpoint string, - requestTimeout, serverResponseTime time.Duration, opts ...BEBHandlerMockOpt) *BEBHandlerMock { - mockServer := testingutils.NewMockServer(testingutils.WithResponseTime(serverResponseTime)) - mockServer.Start(t, defaultTokenEndpoint, defaultEventsEndpoint, defaultEventsHTTP400Endpoint) - - cfg := testingutils.NewEnvConfig( - fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint), - fmt.Sprintf("%s%s", mockServer.URL(), defaultTokenEndpoint), - testingutils.WithPort(testingutils.GeneratePortOrDie()), - testingutils.WithBEBNamespace(testingutils.MessagingNamespace), - testingutils.WithRequestTimeout(requestTimeout), - testingutils.WithEventTypePrefix(eventTypePrefix), - ) - - mockedLogger, err := logger.New("json", "info") - require.NoError(t, err) - - mock := &BEBHandlerMock{ - ctx: ctx, - cfg: cfg, - logger: mockedLogger, - collector: metrics.NewCollector(latency.NewBucketsProvider()), - livenessEndpoint: fmt.Sprintf("http://localhost:%d%s", cfg.Port, health.LivenessURI), - readinessEndpoint: fmt.Sprintf("http://localhost:%d%s", cfg.Port, health.ReadinessURI), - legacyTransformer: &legacy.Transformer{}, - subscribedProcessor: &subscribed.Processor{}, - mockServer: mockServer, - eventTypeCleaner: eventtypetest.CleanerFunc(eventtypetest.DefaultCleaner), - } - - for _, opt := range opts { - opt(mock) - } - - client := oauth.NewClient(ctx, mock.cfg) - defer client.CloseIdleConnections() - - msgReceiver := receiver.NewHTTPMessageReceiver(mock.cfg.Port) - msgSender := sender.NewBEBMessageSender(mock.cfg.EmsPublishURL, client) - msgHandlerOpts := &options.Options{MaxRequestSize: int64(requestSize)} - msgHandler := beb.NewHandler( - msgReceiver, - msgSender, - mock.cfg.RequestTimeout, - mock.legacyTransformer, - msgHandlerOpts, - mock.subscribedProcessor, - mock.logger, - mock.collector, - mock.eventTypeCleaner, - ) - - go func() { require.NoError(t, msgHandler.Start(ctx)) }() - testingutils.WaitForEndpointStatusCodeOrFail(mock.livenessEndpoint, health.StatusCodeHealthy) - - return mock -} - -// validateEventTypeContainsApplicationName extracts the cloud event type from the http.Request and validates that -// it contains the given application name. -func validateEventTypeContainsApplicationName(name string) testingutils.Validator { - return func(r *http.Request) error { - eventType, err := extractEventTypeFromRequest(r) - if err != nil { - return err - } - if !strings.Contains(eventType, name) { - return xerrors.Errorf("event-type:%s does not contain application name:%s", eventType, name) - } - return nil - } -} - -// extractEventTypeFromRequest returns the cloud event type from the given http.Request. -func extractEventTypeFromRequest(r *http.Request) (string, error) { - // structured - if r.Header.Get(cev2http.ContentType) == cev2event.ApplicationCloudEventsJSON { - message := cev2http.NewMessageFromHttpRequest(r) - defer func() { _ = message.Finish(nil) }() - event, err := binding.ToEvent(context.Background(), message) - if err != nil { - return "", err - } - return event.Type(), nil - } - - // binary - eventType := r.Header.Get(testingutils.CeTypeHeader) - if strings.TrimSpace(eventType) == "" { - return "", errors.New("event-type header is not found or empty") - } - return eventType, nil -} - -// WithEventTypePrefix returns BEBHandlerMockOpt which sets the eventTypePrefix for the given BEBHandlerMock. -func WithEventTypePrefix(eventTypePrefix string) BEBHandlerMockOpt { - return func(m *BEBHandlerMock) { - m.cfg.EventTypePrefix = eventTypePrefix - } -} - -// WithApplication returns BEBHandlerMockOpt which sets the subscribed.Processor for the given BEBHandlerMock. -func WithApplication(applicationNameToCreate, applicationNameToValidate string) BEBHandlerMockOpt { - return func(m *BEBHandlerMock) { - applicationLister := handlertest.NewApplicationListerOrDie(m.ctx, applicationNameToCreate) - m.legacyTransformer = legacy.NewTransformer(m.cfg.BEBNamespace, m.cfg.EventTypePrefix, applicationLister) - validator := validateEventTypeContainsApplicationName(applicationNameToValidate) - testingutils.WithValidator(validator)(m.mockServer) - m.eventTypeCleaner = eventtype.NewCleaner(m.cfg.EventTypePrefix, applicationLister, m.logger) - } -} - -// WithSubscription returns BEBHandlerMockOpt which sets the subscribed.Processor for the given BEBHandlerMock. -func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Subscription) BEBHandlerMockOpt { - return func(m *BEBHandlerMock) { - dynamicClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) - informerFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicClient, time.Second, v1.NamespaceAll, nil) - genericInformer := informerFactory.ForResource(subscribed.GVR) - mockedLogger, _ := logger.New("json", "info") - informers.WaitForCacheSyncOrDie(m.ctx, informerFactory, mockedLogger) - subscriptionLister := genericInformer.Lister() - m.subscribedProcessor = &subscribed.Processor{SubscriptionLister: &subscriptionLister, Config: m.cfg, Logger: m.logger} - } -} diff --git a/pkg/handler/common.go b/pkg/handler/common.go deleted file mode 100644 index 97908e6..0000000 --- a/pkg/handler/common.go +++ /dev/null @@ -1,32 +0,0 @@ -package handler - -import "strings" - -const ( - PublishEndpoint = "/publish" - LegacyEndpointSuffix = "/v1/events" - SubscribedEndpointSuffix = "/v1/events/subscribed" -) - -func IsARequestWithCE(uri string) bool { - return uri == PublishEndpoint -} -func IsARequestWithLegacyEvent(uri string) bool { - // Assuming the path should be of the form /:application/v1/events - uriPathSegments := make([]string, 0) - - for _, segment := range strings.Split(uri, "/") { - if strings.TrimSpace(segment) != "" { - uriPathSegments = append(uriPathSegments, segment) - } - } - if len(uriPathSegments) != 3 { - return false - } - return strings.HasSuffix(uri, LegacyEndpointSuffix) -} - -func IsARequestForSubscriptions(uri string) bool { - // Assuming the path should be of the form /:application/v1/events/subscribed - return strings.HasSuffix(uri, SubscribedEndpointSuffix) -} diff --git a/pkg/handler/common_test.go b/pkg/handler/common_test.go deleted file mode 100644 index 12f38d3..0000000 --- a/pkg/handler/common_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package handler - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestIsARequestWithLegacyEvent(t *testing.T) { - t.Parallel() - testCases := []struct { - name string - givenURI string - wantedResult bool - }{ - { - name: "is a legacy endpoint if application name, api version and events endpoint exist", - givenURI: "/app/v1/events", - wantedResult: true, - }, - { - name: "is not a legacy endpoint if application name, api version and events endpoint exist with multiple trailing slashes", - givenURI: "/app/v1/events//", - wantedResult: false, - }, - { - name: "is not a legacy endpoint if application name, api version and events endpoint exist after ", - givenURI: "/test/app/v1/events", - wantedResult: false, - }, - { - name: "is not a legacy endpoint if application name is missing", - givenURI: "/v1/events", - wantedResult: false, - }, - { - name: "is not a legacy endpoint if api version is missing", - givenURI: "/app/events", - wantedResult: false, - }, - { - name: "is not a legacy endpoint if events endpoint is missing", - givenURI: "/app/v1", - wantedResult: false, - }, - { - name: "is not a legacy endpoint if it ends with an endpoint other than events", - givenURI: "/app/v1/events/foo", - wantedResult: false, - }, - { - name: "is not a legacy endpoint if it contains multiple slashes in-between the api version and events endpoint", - givenURI: "/app/v1//events", - wantedResult: false, - }, - { - name: "is not a legacy endpoint if it contains any endpoint in-between the api version and events endpoint", - givenURI: "/app/v1/foo/events", - wantedResult: false, - }, - } - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - assert.Equal(t, tc.wantedResult, IsARequestWithLegacyEvent(tc.givenURI)) - }) - } -} diff --git a/pkg/handler/endpoints.go b/pkg/handler/endpoints.go new file mode 100644 index 0000000..23772bd --- /dev/null +++ b/pkg/handler/endpoints.go @@ -0,0 +1,7 @@ +package handler + +const ( + PublishEndpoint = "/publish" + LegacyEndpointPattern = "/{application}/v1/events" + SubscribedEndpointPattern = "/{application}/v1/events/subscribed" +) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go new file mode 100644 index 0000000..02c4fd8 --- /dev/null +++ b/pkg/handler/handler.go @@ -0,0 +1,222 @@ +package handler + +import ( + "context" + "net/http" + "time" + + "github.com/gorilla/mux" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "go.uber.org/zap" + + "github.com/cloudevents/sdk-go/v2/binding" + cev2client "github.com/cloudevents/sdk-go/v2/client" + cev2event "github.com/cloudevents/sdk-go/v2/event" + cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing" +) + +// EventingHandler is responsible for receiving HTTP requests and dispatching them to the Backend. +// It also assures that the messages received are compliant with the Cloud Events spec. +type EventingHandler interface { + Start(ctx context.Context) error +} +type Handler struct { + Name string + // Receiver receives incoming HTTP requests + Receiver *receiver.HTTPMessageReceiver + // Sender sends requests to the broker + Sender sender.GenericSender + HealthChecker health.Checker + // Defaulter sets default values to incoming events + Defaulter cev2client.EventDefaulter + // LegacyTransformer handles transformations needed to handle legacy events + LegacyTransformer legacy.RequestToCETransformer + // RequestTimeout timeout for outgoing requests + RequestTimeout time.Duration + // SubscribedProcessor processes requests for /:app/v1/events/subscribed endpoint + SubscribedProcessor *subscribed.Processor + // Logger default logger + Logger *logger.Logger + // Options configures HTTP server + Options *options.Options + // collector collects metrics + collector metrics.PublishingMetricsCollector + // eventTypeCleaner cleans the cloud event type + eventTypeCleaner eventtype.Cleaner + router *mux.Router +} + +// NewHandler returns a new HTTP Handler instance. +func NewHandler(receiver *receiver.HTTPMessageReceiver, sender sender.GenericSender, healthChecker health.Checker, requestTimeout time.Duration, + legacyTransformer legacy.RequestToCETransformer, opts *options.Options, subscribedProcessor *subscribed.Processor, + logger *logger.Logger, collector metrics.PublishingMetricsCollector, eventTypeCleaner eventtype.Cleaner) *Handler { + return &Handler{ + Receiver: receiver, + Sender: sender, + HealthChecker: healthChecker, + RequestTimeout: requestTimeout, + LegacyTransformer: legacyTransformer, + SubscribedProcessor: subscribedProcessor, + Logger: logger, + Options: opts, + collector: collector, + eventTypeCleaner: eventTypeCleaner, + } +} + +// setupMux configures the request router for all required endpoints. +func (h *Handler) setupMux() { + router := mux.NewRouter() + router.HandleFunc(PublishEndpoint, h.maxBytes(h.publishCloudEvents)).Methods(http.MethodPost) + router.HandleFunc(LegacyEndpointPattern, h.maxBytes(h.publishLegacyEventsAsCE)).Methods(http.MethodPost) + router.HandleFunc(SubscribedEndpointPattern, h.maxBytes(h.SubscribedProcessor.ExtractEventsFromSubscriptions)).Methods(http.MethodGet) + router.HandleFunc(health.ReadinessURI, h.maxBytes(h.HealthChecker.ReadinessCheck)) + router.HandleFunc(health.LivenessURI, h.maxBytes(h.HealthChecker.LivenessCheck)) + h.router = router +} + +// Start starts the Handler with the given context. +func (h *Handler) Start(ctx context.Context) error { + h.setupMux() + return h.Receiver.StartListen(ctx, h.router, h.Logger) +} + +// maxBytes installs a MaxBytesReader onto the request, so that incoming request larger than a given size will cause an error. +func (h *Handler) maxBytes(f http.HandlerFunc) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + r.Body = http.MaxBytesReader(w, r.Body, h.Options.MaxRequestSize) + f(w, r) + } +} + +// publishLegacyEventsAsCE converts an incoming request in legacy event format to a cloudevent and dispatches it using +// the configured GenericSender. +func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { + event, _ := h.LegacyTransformer.TransformLegacyRequestsToCE(writer, request) + if event == nil { + h.namedLogger().Debug("Failed to transform legacy event to CloudEvent, event is nil") + return + } + ctx := request.Context() + + result, err := h.sendEventAndRecordMetrics(ctx, event, request.URL.Host, request.Header) + if err != nil { + h.namedLogger().With().Error(err) + h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, http.StatusInternalServerError, event, err.Error()) + return + } + h.namedLogger().With().Debug(result) + + // Change response as per old error codes + h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, result.HTTPStatus(), event, string(result.ResponseBody())) +} + +// publishCloudEvents validates an incoming cloudevent and dispatches it using +// the configured GenericSender. +func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.Request) { + ctx := request.Context() + + event, err := extractCloudEventFromRequest(request) + if err != nil { + h.namedLogger().With().Error(err) + e := writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) + if e != nil { + h.namedLogger().Error(e) + } + return + } + + eventTypeOriginal := event.Type() + eventTypeClean, err := h.eventTypeCleaner.Clean(eventTypeOriginal) + if err != nil { + h.namedLogger().Error(err) + e := writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) + if e != nil { + h.namedLogger().Error(e) + } + return + } + event.SetType(eventTypeClean) + + result, err := h.sendEventAndRecordMetrics(ctx, event, request.URL.Host, request.Header) + if err != nil { + writer.WriteHeader(http.StatusInternalServerError) + h.namedLogger().With().Error(err) + return + } + h.namedLogger().With().Debug(result) + + err = writeResponse(writer, result.HTTPStatus(), result.ResponseBody()) + if err != nil { + h.namedLogger().With().Error(err) + } +} + +// extractCloudEventFromRequest converts an incoming CloudEvent request to an Event. +func extractCloudEventFromRequest(request *http.Request) (*cev2event.Event, error) { + message := cev2http.NewMessageFromHttpRequest(request) + defer func() { _ = message.Finish(nil) }() + + event, err := binding.ToEvent(context.Background(), message) + if err != nil { + return nil, err + } + + err = event.Validate() + if err != nil { + return nil, err + } + return event, nil +} + +// sendEventAndRecordMetrics dispatches an Event and records metrics based on dispatch success. +func (h *Handler) sendEventAndRecordMetrics(ctx context.Context, event *cev2event.Event, host string, header http.Header) (sender.PublishResult, error) { + ctx, cancel := context.WithTimeout(ctx, h.RequestTimeout) + defer cancel() + h.applyDefaults(ctx, event) + tracing.AddTracingContextToCEExtensions(header, event) + start := time.Now() + result, err := h.Sender.Send(ctx, event) + duration := time.Since(start) + if err != nil { + h.collector.RecordError() + return nil, err + } + h.collector.RecordEventType(event.Type(), event.Source(), result.HTTPStatus()) + h.collector.RecordLatency(duration, result.HTTPStatus(), host) + h.collector.RecordRequests(result.HTTPStatus(), host) + return result, nil +} + +// writeResponse writes the HTTP response given the status code and response body. +func writeResponse(writer http.ResponseWriter, statusCode int, respBody []byte) error { + writer.WriteHeader(statusCode) + + if respBody == nil { + return nil + } + _, err := writer.Write(respBody) + return err +} + +// applyDefaults applies the default values (if any) to the given Cloud Event. +func (h *Handler) applyDefaults(ctx context.Context, event *cev2event.Event) { + if h.Defaulter != nil { + newEvent := h.Defaulter(ctx, *event) + *event = newEvent + } +} + +func (h *Handler) namedLogger() *zap.SugaredLogger { + return h.Logger.WithContext().Named(h.Name) +} diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go new file mode 100644 index 0000000..ab0225e --- /dev/null +++ b/pkg/handler/handler_test.go @@ -0,0 +1,694 @@ +package handler + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + cloudevents "github.com/cloudevents/sdk-go/v2" + "github.com/cloudevents/sdk-go/v2/client" + cev2event "github.com/cloudevents/sdk-go/v2/event" + eclogger "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/stretchr/testify/assert" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype/eventtypetest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/legacytest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/histogram/mocks" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/beb" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" +) + +func Test_extractCloudEventFromRequest(t *testing.T) { + type args struct { + request *http.Request + } + type wants struct { + event *cev2event.Event + errorAssertionFunc assert.ErrorAssertionFunc + } + tests := []struct { + name string + args args + wants wants + }{ + { + name: "Valid event", + args: args{ + request: CreateValidStructuredRequest(t), + }, + wants: wants{ + event: CreateCloudEvent(t), + errorAssertionFunc: assert.NoError, + }, + }, + { + name: "Invalid event", + args: args{ + request: CreateInvalidStructuredRequest(t), + }, + wants: wants{ + event: nil, + errorAssertionFunc: assert.Error, + }, + }, + { + name: "Entirely broken Request", + args: args{ + request: CreateBrokenRequest(t), + }, + wants: wants{ + event: nil, + errorAssertionFunc: assert.Error, + }, + }, + { + name: "Valid event", + args: args{ + request: CreateValidBinaryRequest(t), + }, + wants: wants{ + event: CreateCloudEvent(t), + errorAssertionFunc: assert.NoError, + }, + }, + { + name: "Invalid event", + args: args{ + request: CreateInvalidBinaryRequest(t), + }, + wants: wants{ + event: nil, + errorAssertionFunc: assert.Error, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotEvent, err := extractCloudEventFromRequest(tt.args.request) + if !tt.wants.errorAssertionFunc(t, err, fmt.Sprintf("extractCloudEventFromRequest(%v)", tt.args.request)) { + return + } + assert.Equalf(t, tt.wants.event, gotEvent, "extractCloudEventFromRequest(%v)", tt.args.request) + }) + } +} + +func Test_writeResponse(t *testing.T) { + type args struct { + statusCode int + respBody []byte + } + tests := []struct { + name string + args args + assertionFunc assert.ErrorAssertionFunc + }{ + { + name: "Response and body", + args: args{ + statusCode: 200, + respBody: []byte("foo"), + }, + assertionFunc: assert.NoError, + }, + { + name: "Response and no body", + args: args{ + statusCode: 200, + respBody: nil, + }, + assertionFunc: assert.NoError, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // given + writer := httptest.NewRecorder() + + // when + err := writeResponse(writer, tt.args.statusCode, tt.args.respBody) + + // then + tt.assertionFunc(t, err, fmt.Sprintf("writeResponse(%v, %v)", tt.args.statusCode, tt.args.respBody)) + assert.Equal(t, tt.args.statusCode, writer.Result().StatusCode) + body, err := io.ReadAll(writer.Result().Body) + assert.NoError(t, err) + if tt.args.respBody != nil { + assert.Equal(t, tt.args.respBody, body) + } else { + assert.Equal(t, []byte(""), body) + } + }) + } +} + +func TestHandler_publishCloudEvents(t *testing.T) { + type fields struct { + Sender sender.GenericSender + collector metrics.PublishingMetricsCollector + eventTypeCleaner eventtype.Cleaner + } + type args struct { + request *http.Request + } + tests := []struct { + name string + fields fields + args args + wantStatus int + wantBody []byte + }{ + { + name: "Publish structured Cloudevent", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + Result: beb.HTTPPublishResult{ + Status: 204, + Body: []byte(""), + }, + }, + collector: metricstest.PublishingMetricsCollectorStub{}, + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidStructuredRequest(t), + }, + wantStatus: 204, + }, + { + name: "Publish binary Cloudevent", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + Result: beb.HTTPPublishResult{ + Status: 204, + Body: []byte(""), + }, + }, + collector: metricstest.PublishingMetricsCollectorStub{}, + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidBinaryRequest(t), + }, + wantStatus: 204, + }, + { + name: "Publish invalid structured CloudEvent", + fields: fields{ + Sender: &GenericSenderStub{}, + collector: metricstest.PublishingMetricsCollectorStub{}, + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateInvalidStructuredRequest(t), + }, + wantStatus: 400, + wantBody: []byte("type: MUST be a non-empty string\n"), + }, + { + name: "Publish invalid binary CloudEvent", + fields: fields{ + Sender: &GenericSenderStub{}, + collector: metricstest.PublishingMetricsCollectorStub{}, + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateInvalidBinaryRequest(t), + }, + wantStatus: 400, + }, + { + name: "Publish binary CloudEvent but cannot clean", + fields: fields{ + Sender: &GenericSenderStub{}, + collector: metricstest.PublishingMetricsCollectorStub{}, + eventTypeCleaner: &eventtypetest.CleanerStub{ + CleanType: "", + Error: fmt.Errorf("I cannot clean"), + }, + }, + args: args{ + request: CreateValidBinaryRequest(t), + }, + wantStatus: 400, + wantBody: []byte("I cannot clean"), + }, + { + name: "Publish binary CloudEvent but cannot send", + fields: fields{ + Sender: &GenericSenderStub{ + Err: fmt.Errorf("I cannot send"), + }, + collector: metricstest.PublishingMetricsCollectorStub{}, + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidBinaryRequest(t), + }, + wantStatus: 500, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // given + logger, err := eclogger.New("text", "debug") + assert.NoError(t, err) + + h := &Handler{ + Sender: tt.fields.Sender, + Logger: logger, + collector: tt.fields.collector, + eventTypeCleaner: tt.fields.eventTypeCleaner, + } + writer := httptest.NewRecorder() + + // when + h.publishCloudEvents(writer, tt.args.request) + + // then + assert.Equal(t, tt.wantStatus, writer.Result().StatusCode) + body, err := io.ReadAll(writer.Result().Body) + assert.NoError(t, err) + if tt.wantBody != nil { + assert.Equal(t, tt.wantBody, body) + } + }) + } +} + +func TestHandler_publishLegacyEventsAsCE(t *testing.T) { + type fields struct { + Sender sender.GenericSender + LegacyTransformer legacy.RequestToCETransformer + collector metrics.PublishingMetricsCollector + eventTypeCleaner eventtype.Cleaner + } + type args struct { + request *http.Request + } + tests := []struct { + name string + fields fields + args args + wantStatus int + wantOk bool + }{ + { + name: "Send valid legacy event", + fields: fields{ + Sender: &GenericSenderStub{ + Result: beb.HTTPPublishResult{ + Status: 204, + }, + }, + LegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", NewApplicationListerOrDie(context.Background(), "testapp")), + collector: metricstest.PublishingMetricsCollectorStub{}, + eventTypeCleaner: eventtypetest.CleanerStub{}, + }, + args: args{ + request: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + }, + wantStatus: 200, + wantOk: true, + }, + { + name: "Send valid legacy event but cannot send to backend", + fields: fields{ + Sender: &GenericSenderStub{ + Err: fmt.Errorf("i cannot send"), + }, + LegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", NewApplicationListerOrDie(context.Background(), "testapp")), + collector: metricstest.PublishingMetricsCollectorStub{}, + eventTypeCleaner: eventtypetest.CleanerStub{}, + }, + args: args{ + request: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + }, + wantStatus: 500, + wantOk: false, + }, + { + name: "Send invalid legacy event", + fields: fields{ + Sender: &GenericSenderStub{ + Result: beb.HTTPPublishResult{ + Status: 204, + }, + }, + LegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", NewApplicationListerOrDie(context.Background(), "testapp")), + collector: metricstest.PublishingMetricsCollectorStub{}, + eventTypeCleaner: eventtypetest.CleanerStub{}, + }, + args: args{ + request: legacytest.InvalidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + }, + wantStatus: 400, + wantOk: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // given + logger, err := eclogger.New("text", "debug") + assert.NoError(t, err) + + h := &Handler{ + Sender: tt.fields.Sender, + Logger: logger, + LegacyTransformer: tt.fields.LegacyTransformer, + collector: tt.fields.collector, + eventTypeCleaner: tt.fields.eventTypeCleaner, + } + writer := httptest.NewRecorder() + + // when + h.publishLegacyEventsAsCE(writer, tt.args.request) + + // then + assert.Equal(t, tt.wantStatus, writer.Result().StatusCode) + body, err := io.ReadAll(writer.Result().Body) + assert.NoError(t, err) + + if tt.wantOk { + ok := &api.PublishResponse{} + err = json.Unmarshal(body, ok) + assert.NoError(t, err) + } else { + nok := &api.Error{} + err = json.Unmarshal(body, nok) + assert.NoError(t, err) + } + + }) + } +} + +func TestHandler_maxBytes(t *testing.T) { + type fields struct { + maxBytes int + } + tests := []struct { + name string + fields fields + wantStatus int + }{ + { + name: "request small enough", + fields: fields{ + maxBytes: 10000, + }, + wantStatus: 200, + }, + { + name: "request too large", + fields: fields{ + maxBytes: 1, + }, + wantStatus: 400, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // given + h := &Handler{ + Options: &options.Options{ + MaxRequestSize: int64(tt.fields.maxBytes), + }, + } + writer := httptest.NewRecorder() + var mberr *http.MaxBytesError + f := func(writer http.ResponseWriter, r *http.Request) { + _, err := io.ReadAll(r.Body) + if errors.As(err, &mberr) { + writer.WriteHeader(http.StatusBadRequest) + } + writer.WriteHeader(http.StatusOK) + } + + // when + h.maxBytes(f)(writer, &http.Request{ + Method: http.MethodPost, + Body: io.NopCloser(strings.NewReader(strings.Repeat("#", 5))), + }) + + // then + assert.Equal(t, tt.wantStatus, writer.Result().StatusCode) + }) + } +} + +func TestHandler_sendEventAndRecordMetrics(t *testing.T) { + type fields struct { + Sender sender.GenericSender + Defaulter client.EventDefaulter + collector metrics.PublishingMetricsCollector + } + type args struct { + ctx context.Context + host string + event *cev2event.Event + header http.Header + } + type wants struct { + result sender.PublishResult + assertionFunc assert.ErrorAssertionFunc + metricErrors int + metricTotal int + metricLatency int + metricPublished int + } + + const bucketsFunc = "Buckets" + latency := new(mocks.BucketsProvider) + latency.On(bucketsFunc).Return(nil) + latency.Test(t) + + tests := []struct { + name string + fields fields + args args + wants wants + }{ + { + name: "No Error", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + SleepDuration: 0, + Result: beb.HTTPPublishResult{ + Status: 204, + Body: nil, + }, + }, + Defaulter: nil, + collector: metrics.NewCollector(latency), + }, + args: args{ + ctx: context.Background(), + host: "foo", + event: &cev2event.Event{}, + }, + wants: wants{ + result: beb.HTTPPublishResult{ + Status: 204, + Body: nil, + }, + assertionFunc: assert.NoError, + metricErrors: 0, + metricTotal: 1, + metricLatency: 1, + metricPublished: 1, + }, + }, + { + name: "Sending not successful, error returned", + fields: fields{ + Sender: &GenericSenderStub{ + Err: errors.New("i failed"), + SleepDuration: 5, + }, + Defaulter: nil, + collector: metrics.NewCollector(latency), + }, + args: args{ + ctx: context.Background(), + host: "foo", + event: &cev2event.Event{}, + }, + wants: wants{ + result: nil, + assertionFunc: assert.Error, + metricErrors: 1, + metricTotal: 0, + metricLatency: 0, + metricPublished: 0, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // given + h := &Handler{ + Sender: tt.fields.Sender, + Defaulter: tt.fields.Defaulter, + collector: tt.fields.collector, + } + + // when + got, err := h.sendEventAndRecordMetrics(tt.args.ctx, tt.args.event, tt.args.host, tt.args.header) + + // then + if !tt.wants.assertionFunc(t, err, fmt.Sprintf("sendEventAndRecordMetrics(%v, %v, %v)", tt.args.ctx, tt.args.host, tt.args.event)) { + return + } + assert.Equalf(t, tt.wants.result, got, "sendEventAndRecordMetrics(%v, %v, %v)", tt.args.ctx, tt.args.host, tt.args.event) + metricstest.EnsureMetricErrors(t, h.collector, tt.wants.metricErrors) + metricstest.EnsureMetricTotalRequests(t, h.collector, tt.wants.metricTotal) + metricstest.EnsureMetricLatency(t, h.collector, tt.wants.metricLatency) + metricstest.EnsureMetricEventTypePublished(t, h.collector, tt.wants.metricPublished) + }) + } +} + +func TestHandler_sendEventAndRecordMetrics_TracingAndDefaults(t *testing.T) { + // given + stub := &GenericSenderStub{ + Err: nil, + SleepDuration: 0, + Result: beb.HTTPPublishResult{Status: http.StatusInternalServerError}, + } + + const bucketsFunc = "Buckets" + latency := new(mocks.BucketsProvider) + latency.On(bucketsFunc).Return(nil) + latency.Test(t) + + h := &Handler{ + Sender: stub, + Defaulter: nil, + collector: metrics.NewCollector(latency), + } + header := http.Header{} + headers := []string{"traceparent", "X-B3-TraceId", "X-B3-ParentSpanId", "X-B3-SpanId", "X-B3-Sampled", "X-B3-Flags"} + + for _, v := range headers { + header.Add(v, v) + } + expectedExtensions := map[string]interface{}{ + "traceparent": "traceparent", + "b3traceid": "X-B3-TraceId", + "b3parentspanid": "X-B3-ParentSpanId", + "b3spanid": "X-B3-SpanId", + "b3sampled": "X-B3-Sampled", + "b3flags": "X-B3-Flags", + } + // when + _, err := h.sendEventAndRecordMetrics(context.Background(), CreateCloudEvent(t), "", header) + + // then + assert.NoError(t, err) + assert.Equal(t, expectedExtensions, stub.ReceivedEvent.Context.GetExtensions()) +} + +func CreateCloudEvent(t *testing.T) *cev2event.Event { + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(testingutils.CloudEventTypeWithPrefix), + ) + payload, _ := builder.BuildStructured() + newEvent := cloudevents.NewEvent() + err := json.Unmarshal([]byte(payload), &newEvent) + assert.NoError(t, err) + newEvent.SetType(testingutils.CloudEventTypeWithPrefix) + err = newEvent.SetData("", map[string]interface{}{"foo": "bar"}) + assert.NoError(t, err) + + return &newEvent +} + +// CreateValidStructuredRequest creates a structured cloudevent as http request. +func CreateValidStructuredRequest(t *testing.T) *http.Request { + t.Helper() + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"specversion\":\"1.0\",\"type\":\"prefix.testapp1023.order.created.v1\",\"source\":\"/default/sap.kyma/id\",\"id\":\"8945ec08-256b-11eb-9928-acde48001122\",\"data\":{\"foo\":\"bar\"}}")) + req.Header.Add("Content-Type", "application/cloudevents+json") + return req +} + +// CreateBrokenRequest creates a structured cloudevent request that cannot be parsed. +func CreateBrokenRequest(t *testing.T) *http.Request { + t.Helper() + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("I AM JUST A BROKEN REQUEST")) + req.Header.Add("Content-Type", "application/cloudevents+json") + return req +} + +// CreateInvalidStructuredRequest creates an invalid structured cloudevent as http request. The `type` is missing. +func CreateInvalidStructuredRequest(t *testing.T) *http.Request { + t.Helper() + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"specversion\":\"1.0\",\"source\":\"/default/sap.kyma/id\",\"id\":\"8945ec08-256b-11eb-9928-acde48001122\",\"data\":{\"foo\":\"bar\"}}")) + req.Header.Add("Content-Type", "application/cloudevents+json") + return req +} + +// CreateValidBinaryRequest creates a valid binary cloudevent as http request. +func CreateValidBinaryRequest(t *testing.T) *http.Request { + t.Helper() + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"foo\":\"bar\"}")) + req.Header.Add("Ce-Specversion", "1.0") + req.Header.Add("Ce-Type", "prefix.testapp1023.order.created.v1") + req.Header.Add("Ce-Source", "/default/sap.kyma/id") + req.Header.Add("Ce-ID", "8945ec08-256b-11eb-9928-acde48001122") + return req +} + +// CreateInvalidBinaryRequest creates an invalid binary cloudevent as http request. The `type` is missing. +func CreateInvalidBinaryRequest(t *testing.T) *http.Request { + t.Helper() + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"foo\":\"bar\"}")) + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Ce-Specversion", "1.0") + req.Header.Add("Ce-Source", "/default/sap.kyma/id") + req.Header.Add("Ce-ID", "8945ec08-256b-11eb-9928-acde48001122") + return req +} + +type GenericSenderStub struct { + Err error + SleepDuration time.Duration + Result sender.PublishResult + ReceivedEvent *cev2event.Event +} + +func (g *GenericSenderStub) Send(_ context.Context, event *cev2event.Event) (sender.PublishResult, error) { + g.ReceivedEvent = event + time.Sleep(g.SleepDuration) + return g.Result, g.Err +} + +func (g *GenericSenderStub) URL() string { + return "" +} + +func NewApplicationListerOrDie(ctx context.Context, appName string) *application.Lister { + app := applicationtest.NewApplication(appName, nil) + appLister := fake.NewApplicationListerOrDie(ctx, app) + return appLister +} diff --git a/pkg/handler/handlertest/handlertest.go b/pkg/handler/handlertest/handlertest.go deleted file mode 100644 index 5fc0440..0000000 --- a/pkg/handler/handlertest/handlertest.go +++ /dev/null @@ -1,350 +0,0 @@ -// Package handlertest provides utilities for Handler testing. -package handlertest - -import ( - "context" - "encoding/json" - "io" - "net/http" - "testing" - - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" - "github.com/stretchr/testify/require" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" - legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" -) - -// ValidateLegacyErrorResponse validates error responses for the legacy events endpoint. -func ValidateLegacyErrorResponse(t *testing.T, resp http.Response, wantResponse *legacyapi.PublishEventResponses) { - legacyResponse := legacyapi.PublishEventResponses{} - legacyErrorResponse := legacyapi.Error{} - bodyBytes, err := io.ReadAll(resp.Body) - require.NoError(t, err) - err = json.Unmarshal(bodyBytes, &legacyErrorResponse) - require.NoError(t, err) - legacyResponse.Error = &legacyErrorResponse - require.Equal(t, wantResponse.Error, legacyResponse.Error) - err = resp.Body.Close() - require.NoError(t, err) -} - -// ValidateLegacyOkResponse validates ok responses for the legacy events endpoint. -func ValidateLegacyOkResponse(t *testing.T, resp http.Response, wantResponse *legacyapi.PublishEventResponses) { - legacyResponse := legacyapi.PublishEventResponses{} - legacyOkResponse := legacyapi.PublishResponse{} - bodyBytes, err := io.ReadAll(resp.Body) - require.NoError(t, err) - err = json.Unmarshal(bodyBytes, &legacyOkResponse) - require.NoError(t, err) - legacyResponse.Ok = &legacyOkResponse - require.Equal(t, wantResponse.Error, legacyResponse.Error) - err = resp.Body.Close() - require.NoError(t, err) -} - -// getMissingFieldValidationError generates an Error message for a missing field -func getMissingFieldValidationError(field string) *legacyapi.Error { - return &legacyapi.Error{ - Status: 400, - Type: "validation_violation", - Message: "Missing field", - Details: []legacyapi.ErrorDetail{ - { - Field: field, - Type: "missing_field", - Message: "Missing field", - MoreInfo: "", - }, - }, - } -} - -// getInvalidValidationError generates an Error message for an invalid field -func getInvalidValidationError(field string) *legacyapi.Error { - return &legacyapi.Error{ - Status: 400, - Type: "validation_violation", - Message: "Invalid field", - Details: []legacyapi.ErrorDetail{ - { - Field: field, - Type: "invalid_field", - Message: "Invalid field", - MoreInfo: "", - }, - }, - } -} - -func NewApplicationListerOrDie(ctx context.Context, appName string) *application.Lister { - app := applicationtest.NewApplication(appName, nil) - appLister := fake.NewApplicationListerOrDie(ctx, app) - return appLister -} - -var ( - TestCasesForCloudEvents = []struct { - Name string - ProvideMessage func(string) (string, http.Header) - WantStatusCode int - }{ - // structured cloudevents - { - Name: "Structured CloudEvent without id", - ProvideMessage: func(eventType string) (string, http.Header) { - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(eventType), - testingutils.WithCloudEventID(""), - ) - return builder.BuildStructured() - }, - WantStatusCode: http.StatusBadRequest, - }, - { - Name: "Structured CloudEvent without type", - ProvideMessage: func(eventType string) (string, http.Header) { - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(""), - ) - return builder.BuildStructured() - }, - WantStatusCode: http.StatusBadRequest, - }, - { - Name: "Structured CloudEvent without specversion", - ProvideMessage: func(eventType string) (string, http.Header) { - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(eventType), - testingutils.WithCloudEventSpecVersion(""), - ) - return builder.BuildStructured() - }, - WantStatusCode: http.StatusBadRequest, - }, - { - Name: "Structured CloudEvent without source", - ProvideMessage: func(eventType string) (string, http.Header) { - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(eventType), - testingutils.WithCloudEventSource(""), - ) - return builder.BuildStructured() - }, - WantStatusCode: http.StatusBadRequest, - }, - { - Name: "Structured CloudEvent is valid", - ProvideMessage: func(eventType string) (string, http.Header) { - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(eventType), - ) - return builder.BuildStructured() - }, - WantStatusCode: http.StatusNoContent, - }, - // binary cloudevents - { - Name: "Binary CloudEvent without CE-ID header", - ProvideMessage: func(eventType string) (string, http.Header) { - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventID(""), - ) - return builder.BuildBinary() - }, - WantStatusCode: http.StatusBadRequest, - }, - { - Name: "Binary CloudEvent without CE-Type header", - ProvideMessage: func(eventType string) (string, http.Header) { - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(""), - ) - return builder.BuildBinary() - }, - WantStatusCode: http.StatusBadRequest, - }, - { - Name: "Binary CloudEvent without CE-SpecVersion header", - ProvideMessage: func(eventType string) (string, http.Header) { - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(eventType), - testingutils.WithCloudEventSpecVersion(""), - ) - return builder.BuildBinary() - }, - WantStatusCode: http.StatusBadRequest, - }, - { - Name: "Binary CloudEvent without CE-Source header", - ProvideMessage: func(eventType string) (string, http.Header) { - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(eventType), - testingutils.WithCloudEventSource(""), - ) - return builder.BuildBinary() - }, - WantStatusCode: http.StatusBadRequest, - }, - { - Name: "Binary CloudEvent is valid with required headers", - ProvideMessage: func(eventType string) (string, http.Header) { - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(eventType), - ) - return builder.BuildBinary() - }, - WantStatusCode: http.StatusNoContent, - }, - } - - TestCasesForLegacyEvents = []struct { - Name string - ProvideMessage func() (string, http.Header) - WantStatusCode int - WantResponse legacyapi.PublishEventResponses - }{ - { - Name: "Send a legacy event successfully with event id", - ProvideMessage: func() (string, http.Header) { - builder := testingutils.NewLegacyEventBuilder() - return builder.Build() - }, - WantStatusCode: http.StatusOK, - WantResponse: legacyapi.PublishEventResponses{ - Ok: &legacyapi.PublishResponse{ - EventID: testingutils.EventID, - Status: "", - Reason: "", - }, - }, - }, - { - Name: "Send a legacy event successfully without event id", - ProvideMessage: func() (string, http.Header) { - builder := testingutils.NewLegacyEventBuilder( - testingutils.WithLegacyEventID(""), - ) - return builder.Build() - }, - WantStatusCode: http.StatusOK, - WantResponse: legacyapi.PublishEventResponses{ - Ok: &legacyapi.PublishResponse{ - EventID: "", - Status: "", - Reason: "", - }, - }, - }, - { - Name: "Send a legacy event with invalid event id", - ProvideMessage: func() (string, http.Header) { - builder := testingutils.NewLegacyEventBuilder( - testingutils.WithLegacyEventID("invalid-id"), - ) - return builder.Build() - }, - WantStatusCode: http.StatusBadRequest, - WantResponse: legacyapi.PublishEventResponses{ - Error: getInvalidValidationError("event-id"), - }, - }, - { - Name: "Send a legacy event without event time", - ProvideMessage: func() (string, http.Header) { - builder := testingutils.NewLegacyEventBuilder( - testingutils.WithLegacyEventTime(""), - ) - return builder.Build() - }, - WantStatusCode: http.StatusBadRequest, - WantResponse: legacyapi.PublishEventResponses{ - Error: getMissingFieldValidationError("event-time"), - }, - }, - { - Name: "Send a legacy event without event type", - ProvideMessage: func() (string, http.Header) { - builder := testingutils.NewLegacyEventBuilder( - testingutils.WithLegacyEventType(""), - ) - return builder.Build() - }, - WantStatusCode: http.StatusBadRequest, - WantResponse: legacyapi.PublishEventResponses{ - Error: getMissingFieldValidationError("event-type"), - }, - }, - { - Name: "Send a legacy event with invalid event time", - ProvideMessage: func() (string, http.Header) { - builder := testingutils.NewLegacyEventBuilder( - testingutils.WithLegacyEventTime("invalid-time"), - ) - return builder.Build() - }, - WantStatusCode: http.StatusBadRequest, - WantResponse: legacyapi.PublishEventResponses{ - Error: getInvalidValidationError("event-time"), - }, - }, - { - Name: "Send a legacy event without event type version", - ProvideMessage: func() (string, http.Header) { - builder := testingutils.NewLegacyEventBuilder( - testingutils.WithLegacyEventTypeVersion(""), - ) - return builder.Build() - }, - WantStatusCode: http.StatusBadRequest, - WantResponse: legacyapi.PublishEventResponses{ - Error: getMissingFieldValidationError("event-type-version"), - }, - }, - { - Name: "Send a legacy event without data", - ProvideMessage: func() (string, http.Header) { - builder := testingutils.NewLegacyEventBuilder( - testingutils.WithLegacyEventData(""), - ) - return builder.Build() - }, - WantStatusCode: http.StatusBadRequest, - WantResponse: legacyapi.PublishEventResponses{ - Error: getMissingFieldValidationError("data"), - }, - }, - } - - TestCasesForSubscribedEndpoint = []struct { - Name string - AppName string - InputSubscriptions []eventingv1alpha1.Subscription - WantStatusCode int - WantResponse subscribed.Events - }{ - { - Name: "Send a request with a valid application Name", - AppName: testingutils.ApplicationName, - WantStatusCode: http.StatusOK, - WantResponse: subscribed.Events{ - EventsInfo: []subscribed.Event{{ - Name: testingutils.EventName, - Version: testingutils.EventVersion, - }}, - }, - }, - { - Name: "Send a request with an invalid application Name", - AppName: "invalid-app", - WantStatusCode: http.StatusOK, - WantResponse: subscribed.Events{ - EventsInfo: []subscribed.Event{}, - }, - }, - } -) diff --git a/pkg/handler/health/health.go b/pkg/handler/health/health.go index 550f7f5..9656fee 100644 --- a/pkg/handler/health/health.go +++ b/pkg/handler/health/health.go @@ -18,18 +18,31 @@ const ( StatusCodeNotHealthy = http.StatusInternalServerError ) -// Checker represents a health checker. -type Checker struct { +type Checker interface { + ReadinessCheck(w http.ResponseWriter, r *http.Request) + LivenessCheck(w http.ResponseWriter, r *http.Request) +} + +// ConfigurableChecker represents a health checker. +type ConfigurableChecker struct { livenessCheck http.HandlerFunc readinessCheck http.HandlerFunc } +func (c ConfigurableChecker) ReadinessCheck(w http.ResponseWriter, r *http.Request) { + c.readinessCheck(w, r) +} + +func (c ConfigurableChecker) LivenessCheck(w http.ResponseWriter, r *http.Request) { + c.livenessCheck(w, r) +} + // CheckerOpt represents a health checker option. -type CheckerOpt func(*Checker) +type CheckerOpt func(*ConfigurableChecker) -// NewChecker returns a new instance of Checker initialized with the default liveness and readiness checks. -func NewChecker(opts ...CheckerOpt) *Checker { - c := &Checker{ +// NewChecker returns a new instance of ConfigurableChecker initialized with the default liveness and readiness checks. +func NewChecker(opts ...CheckerOpt) *ConfigurableChecker { + c := &ConfigurableChecker{ livenessCheck: DefaultCheck, readinessCheck: DefaultCheck, } @@ -41,23 +54,6 @@ func NewChecker(opts ...CheckerOpt) *Checker { return c } -// Check does the necessary health checks (if applicable) before serving HTTP requests for the given http.Handler. -func (c *Checker) Check(h http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if c.livenessCheck != nil && r.RequestURI == LivenessURI { - c.livenessCheck(w, r) - return - } - - if c.readinessCheck != nil && r.RequestURI == ReadinessURI { - c.readinessCheck(w, r) - return - } - - h.ServeHTTP(w, r) - }) -} - // DefaultCheck always writes a 2XX status code for the given http.ResponseWriter. func DefaultCheck(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(StatusCodeHealthy) @@ -70,7 +66,7 @@ func WithLivenessCheck(h http.HandlerFunc) CheckerOpt { panic("liveness handler is nil") } - return func(c *Checker) { + return func(c *ConfigurableChecker) { c.livenessCheck = h } } @@ -82,7 +78,7 @@ func WithReadinessCheck(h http.HandlerFunc) CheckerOpt { panic("readiness handler is nil") } - return func(c *Checker) { + return func(c *ConfigurableChecker) { c.readinessCheck = h } } diff --git a/pkg/handler/health/health_test.go b/pkg/handler/health/health_test.go index afa00fe..d986ab4 100644 --- a/pkg/handler/health/health_test.go +++ b/pkg/handler/health/health_test.go @@ -16,12 +16,9 @@ func TestChecker(t *testing.T) { useCustomReadinessCheck bool // use the givenCustomReadinessCheck instead of the default one givenCustomLivenessCheck http.HandlerFunc // custom liveness check (can be nil) givenCustomReadinessCheck http.HandlerFunc // custom readiness check (can be nil) - givenNextHandler http.Handler // next handler - givenNextHandlerEndpoint string // next handler endpoint wantPanicForNilHealthChecks bool // panic if provided health checks is nil wantLivenessStatusCode int // expected liveness status code wantReadinessStatusCode int // expected readiness status code - wantNextHandlerStatusCode int // expected next handler status code }{ { name: "should report default health checks status-codes", @@ -31,14 +28,11 @@ func TestChecker(t *testing.T) { wantReadinessStatusCode: StatusCodeHealthy, }, { - name: "should report default health checks and next handler status-codes", - useCustomLivenessCheck: false, - useCustomReadinessCheck: false, - givenNextHandler: handlerWithStatusCode(http.StatusNoContent), - givenNextHandlerEndpoint: "/endpoint", - wantLivenessStatusCode: StatusCodeHealthy, - wantReadinessStatusCode: StatusCodeHealthy, - wantNextHandlerStatusCode: http.StatusNoContent, + name: "should report default health checks and next handler status-codes", + useCustomLivenessCheck: false, + useCustomReadinessCheck: false, + wantLivenessStatusCode: StatusCodeHealthy, + wantReadinessStatusCode: StatusCodeHealthy, }, { name: "should panic if provided liveness check is nil", @@ -60,12 +54,9 @@ func TestChecker(t *testing.T) { useCustomReadinessCheck: true, givenCustomLivenessCheck: handlerFuncWithStatusCode(http.StatusOK), givenCustomReadinessCheck: handlerFuncWithStatusCode(http.StatusAccepted), - givenNextHandler: handlerWithStatusCode(http.StatusNoContent), - givenNextHandlerEndpoint: "/endpoint", wantPanicForNilHealthChecks: false, wantLivenessStatusCode: http.StatusOK, wantReadinessStatusCode: http.StatusAccepted, - wantNextHandlerStatusCode: http.StatusNoContent, }, } for _, tc := range testCases { @@ -91,29 +82,34 @@ func TestChecker(t *testing.T) { checker := NewChecker(opts...) if tc.useCustomLivenessCheck { - assertResponseStatusCode(t, LivenessURI, checker, tc.givenCustomLivenessCheck, tc.wantLivenessStatusCode) + assertResponseLivenessStatusCode(t, LivenessURI, checker, tc.wantLivenessStatusCode) } else { - assertResponseStatusCode(t, LivenessURI, checker, http.HandlerFunc(DefaultCheck), StatusCodeHealthy) + assertResponseLivenessStatusCode(t, LivenessURI, checker, StatusCodeHealthy) } if tc.useCustomReadinessCheck { - assertResponseStatusCode(t, ReadinessURI, checker, tc.givenCustomReadinessCheck, tc.wantReadinessStatusCode) + assertResponseReadinessStatusCode(t, ReadinessURI, checker, tc.wantReadinessStatusCode) } else { - assertResponseStatusCode(t, ReadinessURI, checker, http.HandlerFunc(DefaultCheck), StatusCodeHealthy) - } - - if tc.givenNextHandler != nil { - assertResponseStatusCode(t, tc.givenNextHandlerEndpoint, checker, tc.givenNextHandler, tc.wantNextHandlerStatusCode) + assertResponseReadinessStatusCode(t, ReadinessURI, checker, StatusCodeHealthy) } }) } } -func assertResponseStatusCode(t *testing.T, endpoint string, checker *Checker, handler http.Handler, statusCode int) { +func assertResponseLivenessStatusCode(t *testing.T, endpoint string, checker *ConfigurableChecker, statusCode int) { writer := httptest.NewRecorder() request := httptest.NewRequest(http.MethodGet, endpoint, nil) - checker.Check(handler).ServeHTTP(writer, request) + checker.LivenessCheck(writer, request) + + require.Equal(t, statusCode, writer.Result().StatusCode) +} + +func assertResponseReadinessStatusCode(t *testing.T, endpoint string, checker *ConfigurableChecker, statusCode int) { + writer := httptest.NewRecorder() + request := httptest.NewRequest(http.MethodGet, endpoint, nil) + + checker.ReadinessCheck(writer, request) require.Equal(t, statusCode, writer.Result().StatusCode) } @@ -123,7 +119,3 @@ func handlerFuncWithStatusCode(statusCode int) http.HandlerFunc { writer.WriteHeader(statusCode) } } - -func handlerWithStatusCode(statusCode int) http.Handler { - return handlerFuncWithStatusCode(statusCode) -} diff --git a/pkg/handler/nats/handler.go b/pkg/handler/nats/handler.go deleted file mode 100644 index 1fcdf4b..0000000 --- a/pkg/handler/nats/handler.go +++ /dev/null @@ -1,238 +0,0 @@ -package nats - -import ( - "context" - "net/http" - "time" - - "github.com/kyma-project/kyma/components/eventing-controller/logger" - "go.uber.org/zap" - - "github.com/cloudevents/sdk-go/v2/binding" - cev2client "github.com/cloudevents/sdk-go/v2/client" - cev2event "github.com/cloudevents/sdk-go/v2/event" - cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing" -) - -const ( - natsHandlerName = "nats-handler" -) - -// Handler is responsible for receiving HTTP requests and dispatching them to NATS. -// It also assures that the messages received are compliant with the Cloud Events spec. -type Handler struct { - // Receiver receives incoming HTTP requests - Receiver *receiver.HTTPMessageReceiver - // Sender sends requests to the broker - Sender sender.GenericSender - // Defaulter sets default values to incoming events - Defaulter cev2client.EventDefaulter - // LegacyTransformer handles transformations needed to handle legacy events - LegacyTransformer *legacy.Transformer - // RequestTimeout timeout for outgoing requests - RequestTimeout time.Duration - // SubscribedProcessor processes requests for /:app/v1/events/subscribed endpoint - SubscribedProcessor *subscribed.Processor - // Logger default logger - Logger *logger.Logger - // Options configures HTTP server - Options *options.Options - // collector collects metrics - collector *metrics.Collector - // eventTypeCleaner cleans the cloud event type - eventTypeCleaner eventtype.Cleaner -} - -// NewHandler returns a new NATS Handler instance. -func NewHandler(receiver *receiver.HTTPMessageReceiver, sender sender.GenericSender, requestTimeout time.Duration, - legacyTransformer *legacy.Transformer, opts *options.Options, subscribedProcessor *subscribed.Processor, - logger *logger.Logger, collector *metrics.Collector, eventTypeCleaner eventtype.Cleaner) *Handler { - return &Handler{ - Receiver: receiver, - Sender: sender, - RequestTimeout: requestTimeout, - LegacyTransformer: legacyTransformer, - SubscribedProcessor: subscribedProcessor, - Logger: logger, - Options: opts, - collector: collector, - eventTypeCleaner: eventTypeCleaner, - } -} - -// Start starts the Handler with the given context. -func (h *Handler) Start(ctx context.Context) error { - healthChecker := health.NewChecker( - health.WithReadinessCheck(ReadinessCheck(h)), - ) - return h.Receiver.StartListen(ctx, healthChecker.Check(h), h.Logger) -} - -// ServeHTTP serves an HTTP request and returns an HTTP response. -// It ensures that the incoming request is a valid Cloud Event, then dispatches it -// to NATS and writes back the HTTP response. -func (h *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request) { - // validate request method - if request.Method != http.MethodPost && request.Method != http.MethodGet { - h.namedLogger().Warnf("Unexpected request method: %s", request.Method) - h.writeResponse(writer, http.StatusMethodNotAllowed, nil) - return - } - // Limit server from reading a huge payload - request.Body = http.MaxBytesReader(writer, request.Body, h.Options.MaxRequestSize) - uri := request.RequestURI - - // Process /publish endpoint - // Gets a CE and sends it to NATS - if handler.IsARequestWithCE(uri) { - h.publishCloudEvents(writer, request) - return - } - - // Process /:application/v1/events - // Publishes a legacy event as CE v1.0 to NATS - if handler.IsARequestWithLegacyEvent(uri) { - h.publishLegacyEventsAsCE(writer, request) - return - } - - // Process /:application/v1/events/subscribed - // Fetches the list of subscriptions available for the given application - if handler.IsARequestForSubscriptions(uri) { - h.SubscribedProcessor.ExtractEventsFromSubscriptions(writer, request) - return - } - - h.writeResponse(writer, http.StatusNotFound, nil) -} - -func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { - event, eventTypeOriginal := h.LegacyTransformer.TransformLegacyRequestsToCE(writer, request) - if event == nil { - h.namedLogger().Debug("Failed to transform legacy event to CloudEvent, event is nil") - return - } - ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) - defer cancel() - h.receive(ctx, event) - statusCode, dispatchTime, respBody := h.send(ctx, event) - - // Change response as per old error codes - h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, statusCode, event, string(respBody)) - - h.namedLogger().With( - "id", event.ID(), - "source", event.Source(), - "before", eventTypeOriginal, - "after", event.Type(), - "statusCode", statusCode, - "duration", dispatchTime, - "responseBody", string(respBody), - ).Info("Event dispatched") -} - -func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.Request) { - ctx, cancel := context.WithTimeout(request.Context(), h.RequestTimeout) - defer cancel() - - message := cev2http.NewMessageFromHttpRequest(request) - defer func() { _ = message.Finish(nil) }() - - event, err := binding.ToEvent(ctx, message) - if err != nil { - h.namedLogger().Errorw("Failed to extract CloudEvent from request", "error", err) - h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) - return - } - - eventTypeOriginal := event.Type() - eventTypeClean, err := h.eventTypeCleaner.Clean(eventTypeOriginal) - if err != nil { - h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) - return - } - event.SetType(eventTypeClean) - - if err := event.Validate(); err != nil { - h.namedLogger().Errorw("Request doesn't correspond to CloudEvent spec", "error", err) - h.writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) - return - } - - if request.Header.Get(cev2http.ContentType) == cev2event.ApplicationCloudEventsJSON { - ctx = binding.WithForceStructured(ctx) - } else { - ctx = binding.WithForceBinary(ctx) - } - - h.receive(ctx, event) - - // Add tracing context to cloud events - tracing.AddTracingContextToCEExtensions(request.Header, event) - - statusCode, dispatchTime, respBody := h.send(ctx, event) - h.writeResponse(writer, statusCode, respBody) - - h.namedLogger().With( - "id", event.ID(), - "source", event.Source(), - "before", eventTypeOriginal, - "after", eventTypeClean, - "statusCode", statusCode, - "duration", dispatchTime, - "responseBody", string(respBody), - ).Info("Event dispatched") -} - -// writeResponse writes the HTTP response given the status code and response body. -func (h *Handler) writeResponse(writer http.ResponseWriter, statusCode int, respBody []byte) { - writer.WriteHeader(statusCode) - - if respBody == nil { - return - } - if _, err := writer.Write(respBody); err != nil { - h.namedLogger().Errorw("Failed to write response body", "error", err) - } -} - -// receive applies the default values (if any) to the given Cloud Event. -func (h *Handler) receive(ctx context.Context, event *cev2event.Event) { - if h.Defaulter != nil { - newEvent := h.Defaulter(ctx, *event) - event = &newEvent - } - - h.namedLogger().Infof("CloudEvent received id:[%s]", event.ID()) -} - -// send dispatches the given Cloud Event to NATS and returns the response details and dispatch time. -func (h *Handler) send(ctx context.Context, event *cev2event.Event) (int, time.Duration, []byte) { - start := time.Now() - s := h.Sender - resp, err := s.Send(ctx, event) - h.collector.RecordEventType(event.Type(), event.Source(), resp) - dispatchTime := time.Since(start) - if err != nil { - h.collector.RecordError() - return resp, dispatchTime, []byte(err.Error()) - } - h.collector.RecordLatency(dispatchTime, resp, s.URL()) - h.collector.RecordRequests(resp, s.URL()) - return resp, dispatchTime, []byte{} -} - -func (h *Handler) namedLogger() *zap.SugaredLogger { - return h.Logger.WithContext().Named(natsHandlerName) -} diff --git a/pkg/handler/nats/handler_health_test.go b/pkg/handler/nats/handler_health_test.go deleted file mode 100644 index 4a6a82c..0000000 --- a/pkg/handler/nats/handler_health_test.go +++ /dev/null @@ -1,47 +0,0 @@ -package nats_test - -import ( - "context" - "testing" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats/mock" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" -) - -func TestHandlerHealth(t *testing.T) { - testCases := []struct { - name string - givenNATSServerShutdown bool - wantLivenessStatusCode int - wantReadinessStatusCode int - }{ - { - name: "NATS handler is healthy", - givenNATSServerShutdown: false, - wantLivenessStatusCode: health.StatusCodeHealthy, - wantReadinessStatusCode: health.StatusCodeHealthy, - }, - { - name: "NATS handler is unhealthy", - givenNATSServerShutdown: true, - wantLivenessStatusCode: health.StatusCodeHealthy, - wantReadinessStatusCode: health.StatusCodeNotHealthy, - }, - } - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - handlerMock := mock.StartOrDie(context.TODO(), t) - defer handlerMock.Stop() - - if tc.givenNATSServerShutdown { - handlerMock.ShutdownNATSServerAndWait() - } - - testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetLivenessEndpoint(), tc.wantLivenessStatusCode) - testingutils.WaitForEndpointStatusCodeOrFail(handlerMock.GetReadinessEndpoint(), tc.wantReadinessStatusCode) - }) - } -} diff --git a/pkg/handler/nats/handler_integration_test.go b/pkg/handler/nats/handler_integration_test.go deleted file mode 100644 index 43ad710..0000000 --- a/pkg/handler/nats/handler_integration_test.go +++ /dev/null @@ -1,321 +0,0 @@ -package nats_test - -import ( - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "testing" - "time" - - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats/mock" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" -) - -func TestHandlerForCloudEvents(t *testing.T) { - testCases := []struct { - name string - givenEventTypePrefix string - givenApplicationName string - givenEventType string - wantEventType string - }{ - // not-clean event-types - { - name: "With prefix and clean application name and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenApplicationName: testingutils.ApplicationName, - givenEventType: testingutils.CloudEventTypeNotClean, - wantEventType: testingutils.CloudEventType, - }, - { - name: "With prefix and not-clean application name and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenApplicationName: testingutils.ApplicationNameNotClean, - givenEventType: testingutils.CloudEventTypeNotClean, - wantEventType: testingutils.CloudEventType, - }, - { - name: "With empty prefix and clean application name and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenApplicationName: testingutils.ApplicationName, - givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, - wantEventType: testingutils.CloudEventTypePrefixEmpty, - }, - { - name: "With empty prefix and not-clean application name and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenApplicationName: testingutils.ApplicationNameNotClean, - givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, - wantEventType: testingutils.CloudEventTypePrefixEmpty, - }, - // clean event-types - { - name: "With prefix and clean application name and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenApplicationName: testingutils.ApplicationName, - givenEventType: testingutils.CloudEventType, - wantEventType: testingutils.CloudEventType, - }, - { - name: "With prefix and not-clean application name and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenApplicationName: testingutils.ApplicationNameNotClean, - givenEventType: testingutils.CloudEventType, - wantEventType: testingutils.CloudEventType, - }, - { - name: "With empty prefix and clean application name and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenApplicationName: testingutils.ApplicationName, - givenEventType: testingutils.CloudEventTypePrefixEmpty, - wantEventType: testingutils.CloudEventTypePrefixEmpty, - }, - { - name: "With empty prefix and not-clean application name and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenApplicationName: testingutils.ApplicationNameNotClean, - givenEventType: testingutils.CloudEventTypePrefixEmpty, - wantEventType: testingutils.CloudEventTypePrefixEmpty, - }, - } - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - handlerMock := mock.StartOrDie(ctx, t, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithApplication(tc.givenApplicationName), - ) - defer handlerMock.Stop() - - // run the tests for publishing cloudevents - publishEndpoint := fmt.Sprintf("http://localhost:%d/publish", handlerMock.GetNATSConfig().Port) - for _, testCase := range handlertest.TestCasesForCloudEvents { - testCase := testCase - t.Run(testCase.Name, func(t *testing.T) { - // connect to nats - connection, err := testingutils.ConnectToNATSServer(handlerMock.GetNATSURL()) - assert.Nil(t, err) - assert.NotNil(t, connection) - defer connection.Close() - - // validator to check NATS received events - notify := make(chan bool) - defer close(notify) - validator := testingutils.ValidateNATSSubjectOrFail(t, tc.wantEventType, notify) - testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) - - body, headers := testCase.ProvideMessage(tc.wantEventType) - resp, err := testingutils.SendEvent(publishEndpoint, body, headers) - assert.NoError(t, err) - assert.NoError(t, resp.Body.Close()) - assert.Equal(t, testCase.WantStatusCode, resp.StatusCode) - if testingutils.IsNot4XX(resp.StatusCode) { - metricstest.EnsureMetricEventTypePublished(t, handlerMock.GetMetricsCollector()) - } - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) - assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*3)) - } - }) - } - }) - } -} - -func TestHandlerForLegacyEvents(t *testing.T) { - testCases := []struct { - name string - givenEventTypePrefix string - givenApplicationName string - givenEventType string - wantEventType string - }{ - // not-clean event-types - { - name: "With prefix and clean application name and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenApplicationName: testingutils.ApplicationName, - givenEventType: testingutils.CloudEventTypeNotClean, - wantEventType: testingutils.CloudEventType, - }, - { - name: "With empty prefix and clean application name and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenApplicationName: testingutils.ApplicationName, - givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, - wantEventType: testingutils.CloudEventTypePrefixEmpty, - }, - { - name: "With prefix and not-clean application name and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenApplicationName: testingutils.ApplicationNameNotClean, - givenEventType: testingutils.CloudEventTypeNotClean, - wantEventType: testingutils.CloudEventType, - }, - { - name: "With empty prefix and not-clean application name and not-clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenApplicationName: testingutils.ApplicationNameNotClean, - givenEventType: testingutils.CloudEventTypeNotCleanPrefixEmpty, - wantEventType: testingutils.CloudEventTypePrefixEmpty, - }, - // clean event-types - { - name: "With prefix and clean application name and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenApplicationName: testingutils.ApplicationName, - givenEventType: testingutils.CloudEventType, - wantEventType: testingutils.CloudEventType, - }, - { - name: "With empty prefix and clean application name and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenApplicationName: testingutils.ApplicationName, - givenEventType: testingutils.CloudEventTypePrefixEmpty, - wantEventType: testingutils.CloudEventTypePrefixEmpty, - }, - { - name: "With prefix and not-clean application name and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenApplicationName: testingutils.ApplicationNameNotClean, - givenEventType: testingutils.CloudEventType, - wantEventType: testingutils.CloudEventType, - }, - { - name: "With empty prefix and not-clean application name and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenApplicationName: testingutils.ApplicationNameNotClean, - givenEventType: testingutils.CloudEventTypePrefixEmpty, - wantEventType: testingutils.CloudEventTypePrefixEmpty, - }, - } - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - handlerMock := mock.StartOrDie(ctx, t, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithApplication(tc.givenApplicationName), - ) - defer handlerMock.Stop() - - // run the tests for publishing legacy events - publishLegacyEndpoint := fmt.Sprintf("http://localhost:%d/%s/v1/events", handlerMock.GetNATSConfig().Port, tc.givenApplicationName) - for _, testCase := range handlertest.TestCasesForLegacyEvents { - testCase := testCase - t.Run(testCase.Name, func(t *testing.T) { - // connect to nats - connection, err := testingutils.ConnectToNATSServer(handlerMock.GetNATSURL()) - assert.Nil(t, err) - assert.NotNil(t, connection) - defer connection.Close() - - // publish a message to NATS and validate it - notify := make(chan bool) - defer close(notify) - validator := testingutils.ValidateNATSSubjectOrFail(t, tc.wantEventType, notify) - testingutils.SubscribeToEventOrFail(t, connection, tc.wantEventType, validator) - - body, headers := testCase.ProvideMessage() - resp, err := testingutils.SendEvent(publishLegacyEndpoint, body, headers) - require.NoError(t, err) - require.Equal(t, testCase.WantStatusCode, resp.StatusCode) - - if testCase.WantStatusCode == http.StatusOK { - handlertest.ValidateLegacyOkResponse(t, *resp, &testCase.WantResponse) - } else { - handlertest.ValidateLegacyErrorResponse(t, *resp, &testCase.WantResponse) - } - if testingutils.IsNot4XX(resp.StatusCode) { - metricstest.EnsureMetricEventTypePublished(t, handlerMock.GetMetricsCollector()) - } - if testingutils.Is2XX(resp.StatusCode) { - metricstest.EnsureMetricLatency(t, handlerMock.GetMetricsCollector()) - assert.NoError(t, testingutils.WaitForChannelOrTimeout(notify, time.Second*10)) - } - }) - } - }) - } -} - -func TestHandlerForSubscribedEndpoint(t *testing.T) { - testCases := []struct { - name string - givenEventTypePrefix string - givenEventType string - }{ - { - name: "With prefix and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefix, - givenEventType: testingutils.CloudEventType, - }, - { - name: "With empty prefix and clean event-type", - givenEventTypePrefix: testingutils.MessagingEventTypePrefixEmpty, - givenEventType: testingutils.CloudEventTypePrefixEmpty, - }, - } - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - - // setup test environment - scheme := runtime.NewScheme() - require.NoError(t, corev1.AddToScheme(scheme)) - require.NoError(t, eventingv1alpha1.AddToScheme(scheme)) - - subscribedEndpointFormat := "http://localhost:%d/%s/v1/events/subscribed" - subscription := testingutils.NewSubscription( - testingutils.SubscriptionWithFilter(testingutils.MessagingNamespace, tc.givenEventType), - ) - - handlerMock := mock.StartOrDie(ctx, t, - mock.WithEventTypePrefix(tc.givenEventTypePrefix), - mock.WithSubscription(scheme, subscription), - mock.WithApplication(testingutils.ApplicationName), - ) - defer handlerMock.Stop() - - for _, testCase := range handlertest.TestCasesForSubscribedEndpoint { - testCase := testCase - t.Run(testCase.Name, func(t *testing.T) { - subscribedURL := fmt.Sprintf(subscribedEndpointFormat, handlerMock.GetNATSConfig().Port, testCase.AppName) - resp, err := testingutils.QuerySubscribedEndpoint(subscribedURL) - require.NoError(t, err) - require.Equal(t, testCase.WantStatusCode, resp.StatusCode) - - respBodyBytes, err := io.ReadAll(resp.Body) - require.NoError(t, err) - require.NoError(t, resp.Body.Close()) - - gotEventsResponse := subscribed.Events{} - err = json.Unmarshal(respBodyBytes, &gotEventsResponse) - require.NoError(t, err) - require.Equal(t, testCase.WantResponse, gotEventsResponse) - }) - } - }) - } -} diff --git a/pkg/handler/nats/health.go b/pkg/handler/nats/health.go deleted file mode 100644 index e00af09..0000000 --- a/pkg/handler/nats/health.go +++ /dev/null @@ -1,31 +0,0 @@ -package nats - -import ( - "net/http" - - "github.com/nats-io/nats.go" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" -) - -const healthCheckName = "health-check" - -// ReadinessCheck returns an instance of http.HandlerFunc that checks the readiness of the given NATS Handler. -// It checks the NATS server connection status and reports 2XX if connected, otherwise reports 5XX. -// It panics if the given NATS Handler is nil. -func ReadinessCheck(h *Handler) http.HandlerFunc { - if h == nil { - panic("readiness handler is nil") - } - - return func(w http.ResponseWriter, _ *http.Request) { - s := h.Sender - if status := s.ConnectionStatus(); status != nats.CONNECTED { - h.Logger.WithContext().Named(healthCheckName).With("connection-status", status).Info("Disconnected from NATS server") - w.WriteHeader(health.StatusCodeNotHealthy) - return - } - - w.WriteHeader(health.StatusCodeHealthy) - } -} diff --git a/pkg/handler/nats/health_test.go b/pkg/handler/nats/health_test.go deleted file mode 100644 index 3c42444..0000000 --- a/pkg/handler/nats/health_test.go +++ /dev/null @@ -1,70 +0,0 @@ -package nats_test - -import ( - "context" - "net/http" - "net/http/httptest" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/stretchr/testify/require" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats/mock" -) - -func TestReadinessCheck(t *testing.T) { - testCases := []struct { - name string - givenHandlerEndpoint string - wantPanicForNilHandler bool - wantHandlerStatusCode int - }{ - { - name: "should panic if provided handler is nil", - wantPanicForNilHandler: true, - }, - { - name: "should report handler status-code", - givenHandlerEndpoint: "/endpoint", - wantPanicForNilHandler: false, - wantHandlerStatusCode: health.StatusCodeHealthy, - }, - } - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - - defer func() { - r := recover() - if !assert.Equal(t, tc.wantPanicForNilHandler, r != nil) { - t.Log(r) - } - }() - - handlerMock := mock.StartOrDie(context.TODO(), t) - defer handlerMock.Stop() - - var handler http.HandlerFunc - if tc.wantPanicForNilHandler { - handler = nats.ReadinessCheck(nil) - } else { - handler = nats.ReadinessCheck(handlerMock.GetHandler()) - } - - assertResponseStatusCode(t, tc.givenHandlerEndpoint, handler, tc.wantHandlerStatusCode) - }) - } -} - -func assertResponseStatusCode(t *testing.T, endpoint string, handler http.HandlerFunc, statusCode int) { - writer := httptest.NewRecorder() - request := httptest.NewRequest(http.MethodGet, endpoint, nil) - - handler.ServeHTTP(writer, request) - - require.Equal(t, statusCode, writer.Result().StatusCode) -} diff --git a/pkg/handler/nats/mock/mock.go b/pkg/handler/nats/mock/mock.go deleted file mode 100644 index 2071add..0000000 --- a/pkg/handler/nats/mock/mock.go +++ /dev/null @@ -1,208 +0,0 @@ -package mock - -import ( - "context" - "fmt" - "testing" - "time" - - "github.com/nats-io/nats-server/v2/server" - natsio "github.com/nats-io/nats.go" - "github.com/stretchr/testify/require" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/dynamic/dynamicinformer" - dynamicfake "k8s.io/client-go/dynamic/fake" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype/eventtypetest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/handlertest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/nats" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/informers" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/latency" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" - "github.com/kyma-project/kyma/components/eventing-controller/logger" -) - -// NATSHandlerMock represents a mock for the nats.Handler. -type NATSHandlerMock struct { - ctx context.Context - handler *nats.Handler - livenessEndpoint string - readinessEndpoint string - eventTypePrefix string - logger *logger.Logger - natsServer *server.Server - natsConfig *env.NATSConfig - collector *metrics.Collector - legacyTransformer *legacy.Transformer - subscribedProcessor *subscribed.Processor - eventTypeCleaner eventtype.Cleaner - connection *natsio.Conn -} - -// NATSHandlerMockOpt represents a NATSHandlerMock option. -type NATSHandlerMockOpt func(*NATSHandlerMock) - -// StartOrDie starts a new NATSHandlerMock instance or die if a precondition fails. -// Preconditions: 1) NATS connection and 2) nats.Handler started without errors. -func StartOrDie(ctx context.Context, t *testing.T, opts ...NATSHandlerMockOpt) *NATSHandlerMock { - port := testingutils.GeneratePortOrDie() - - mockedLogger, err := logger.New("json", "info") - require.NoError(t, err) - - mock := &NATSHandlerMock{ - ctx: ctx, - livenessEndpoint: fmt.Sprintf("http://localhost:%d%s", port, health.LivenessURI), - readinessEndpoint: fmt.Sprintf("http://localhost:%d%s", port, health.ReadinessURI), - logger: mockedLogger, - natsConfig: newNATSConfig(port), - collector: metrics.NewCollector(latency.NewBucketsProvider()), - legacyTransformer: &legacy.Transformer{}, - subscribedProcessor: &subscribed.Processor{}, - eventTypeCleaner: eventtypetest.CleanerFunc(eventtypetest.DefaultCleaner), - } - - for _, opt := range opts { - opt(mock) - } - mock.natsServer = testingutils.StartNATSServer() - - msgReceiver := receiver.NewHTTPMessageReceiver(mock.natsConfig.Port) - - connection, err := testingutils.ConnectToNATSServer(mock.GetNATSURL()) - require.NoError(t, err) - mock.connection = connection - js, err := connection.JetStream() - require.NoError(t, err) - _, err = js.AddStream(getStreamConfig()) - require.NoError(t, err) - - msgSender := sender.NewJetStreamMessageSender(ctx, mock.connection, mock.natsConfig, mock.logger) - - mock.handler = nats.NewHandler( - msgReceiver, - msgSender, - mock.natsConfig.RequestTimeout, - mock.legacyTransformer, - &options.Options{MaxRequestSize: 65536}, - mock.subscribedProcessor, - mock.logger, - mock.collector, - mock.eventTypeCleaner, - ) - - go func() { require.NoError(t, mock.handler.Start(ctx)) }() - testingutils.WaitForEndpointStatusCodeOrFail(mock.livenessEndpoint, health.StatusCodeHealthy) - - return mock -} - -// Stop closes the sender.NATSMessageSender connection and calls the NATSHandlerMock.ShutdownNATSServerAndWait. -func (m *NATSHandlerMock) Stop() { - m.connection.Close() - m.ShutdownNATSServerAndWait() -} - -// ShutdownNATSServerAndWait shuts down the NATS server used by the NATSHandlerMock and waits for the shutdown. -func (m *NATSHandlerMock) ShutdownNATSServerAndWait() { - m.natsServer.Shutdown() - m.natsServer.WaitForShutdown() -} - -// GetNATSURL returns the NATS server URL used by the NATSHandlerMock. -func (m *NATSHandlerMock) GetNATSURL() string { - return m.natsServer.ClientURL() -} - -// GetLivenessEndpoint returns the liveness endpoint used by the NATSHandlerMock. -func (m *NATSHandlerMock) GetLivenessEndpoint() string { - return m.livenessEndpoint -} - -// GetReadinessEndpoint returns the readiness endpoint used by the NATSHandlerMock. -func (m *NATSHandlerMock) GetReadinessEndpoint() string { - return m.readinessEndpoint -} - -// GetHandler returns the nats.Handler used by the NATSHandlerMock. -func (m *NATSHandlerMock) GetHandler() *nats.Handler { - return m.handler -} - -// GetMetricsCollector returns the metrics.Collector used by the NATSHandlerMock. -func (m *NATSHandlerMock) GetMetricsCollector() *metrics.Collector { - return m.collector -} - -// GetNATSConfig returns the env.NATSConfig used by the NATSHandlerMock. -func (m *NATSHandlerMock) GetNATSConfig() *env.NATSConfig { - return m.natsConfig -} - -// WithEventTypePrefix returns NATSHandlerMockOpt which sets the eventTypePrefix for the given NATSHandlerMock. -func WithEventTypePrefix(eventTypePrefix string) NATSHandlerMockOpt { - return func(m *NATSHandlerMock) { - m.eventTypePrefix = eventTypePrefix - } -} - -// WithSubscription returns NATSHandlerMockOpt which sets the subscribed.Processor for the given NATSHandlerMock. -func WithSubscription(scheme *runtime.Scheme, subscription *eventingv1alpha1.Subscription) NATSHandlerMockOpt { - return func(m *NATSHandlerMock) { - m.natsConfig.EventTypePrefix = m.eventTypePrefix - dynamicTestClient := dynamicfake.NewSimpleDynamicClient(scheme, subscription) - dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynamicTestClient, 10*time.Second, v1.NamespaceAll, nil) - genericInf := dFilteredSharedInfFactory.ForResource(subscribed.GVR) - mockedLogger, _ := logger.New("json", "info") - informers.WaitForCacheSyncOrDie(m.ctx, dFilteredSharedInfFactory, mockedLogger) - subLister := genericInf.Lister() - m.subscribedProcessor = &subscribed.Processor{ - SubscriptionLister: &subLister, - Config: m.natsConfig.ToConfig(), - Logger: m.logger, - } - } -} - -// WithApplication returns NATSHandlerMockOpt which sets the legacy.Transformer for the given NATSHandlerMock. -func WithApplication(applicationName string) NATSHandlerMockOpt { - return func(m *NATSHandlerMock) { - applicationLister := handlertest.NewApplicationListerOrDie(m.ctx, applicationName) - m.legacyTransformer = legacy.NewTransformer( - m.natsConfig.ToConfig().BEBNamespace, - m.eventTypePrefix, - applicationLister, - ) - m.eventTypeCleaner = eventtype.NewCleaner(m.eventTypePrefix, applicationLister, m.logger) - } -} - -func newNATSConfig(port int) *env.NATSConfig { - return &env.NATSConfig{ - Port: port, - LegacyNamespace: testingutils.MessagingNamespace, - EventTypePrefix: testingutils.MessagingEventTypePrefix, - JSStreamName: testingutils.StreamName, - } -} - -// getStreamConfig inits a testing stream config. -func getStreamConfig() *natsio.StreamConfig { - return &natsio.StreamConfig{ - Name: testingutils.StreamName, - Subjects: []string{fmt.Sprintf("%s.>", env.JetStreamSubjectPrefix)}, - Storage: natsio.MemoryStorage, - Retention: natsio.InterestPolicy, - } -} diff --git a/pkg/legacy-events/api/types.go b/pkg/legacy/api/types.go similarity index 100% rename from pkg/legacy-events/api/types.go rename to pkg/legacy/api/types.go diff --git a/pkg/legacy-events/constants.go b/pkg/legacy/constants.go similarity index 100% rename from pkg/legacy-events/constants.go rename to pkg/legacy/constants.go diff --git a/pkg/legacy-events/error_responses.go b/pkg/legacy/error_responses.go similarity index 97% rename from pkg/legacy-events/error_responses.go rename to pkg/legacy/error_responses.go index ec69452..0de2c7f 100644 --- a/pkg/legacy-events/error_responses.go +++ b/pkg/legacy/error_responses.go @@ -3,10 +3,10 @@ package legacy import ( "net/http" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" ) -// An ErrorResponse represents an error with a status code and an error message +// An HTTPErrorResponse represents an error with a status code and an error message type HTTPErrorResponse struct { Code int `json:"code"` Error string `json:"error"` diff --git a/pkg/legacy-events/helpers.go b/pkg/legacy/helpers.go similarity index 99% rename from pkg/legacy-events/helpers.go rename to pkg/legacy/helpers.go index 954d6ff..58321bd 100644 --- a/pkg/legacy-events/helpers.go +++ b/pkg/legacy/helpers.go @@ -9,7 +9,7 @@ import ( kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" ) const ( diff --git a/pkg/legacy-events/helpers_test.go b/pkg/legacy/helpers_test.go similarity index 100% rename from pkg/legacy-events/helpers_test.go rename to pkg/legacy/helpers_test.go diff --git a/pkg/legacy-events/legacy.go b/pkg/legacy/legacy.go similarity index 96% rename from pkg/legacy-events/legacy.go rename to pkg/legacy/legacy.go index b5724b0..57559bd 100644 --- a/pkg/legacy-events/legacy.go +++ b/pkg/legacy/legacy.go @@ -14,7 +14,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" - apiv1 "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + apiv1 "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing" ) @@ -28,6 +28,11 @@ const ( eventTypeVersionExtensionKey = "eventtypeversion" ) +type RequestToCETransformer interface { + TransformLegacyRequestsToCE(http.ResponseWriter, *http.Request) (*cev2event.Event, string) + TransformsCEResponseToLegacyResponse(http.ResponseWriter, int, *cev2event.Event, string) +} + type Transformer struct { bebNamespace string eventTypePrefix string diff --git a/pkg/legacy-events/legacy_test.go b/pkg/legacy/legacy_test.go similarity index 91% rename from pkg/legacy-events/legacy_test.go rename to pkg/legacy/legacy_test.go index 5cb4878..6bed1f9 100644 --- a/pkg/legacy-events/legacy_test.go +++ b/pkg/legacy/legacy_test.go @@ -1,11 +1,8 @@ package legacy import ( - "bytes" "context" - "encoding/json" "fmt" - "net/http" "net/http/httptest" "testing" "time" @@ -17,7 +14,8 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" - legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events/api" + legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/legacytest" . "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) @@ -97,7 +95,7 @@ func TestTransformLegacyRequestsToCE(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - request, err := mockLegacyRequest(tc.wantVersion, tc.givenApplication, tc.givenEventName) + request, err := legacytest.ValidLegacyRequest(tc.wantVersion, tc.givenApplication, tc.givenEventName) assert.NoError(t, err) writer := httptest.NewRecorder() @@ -108,7 +106,7 @@ func TestTransformLegacyRequestsToCE(t *testing.T) { wantEventType := formatEventType(tc.givenPrefix, tc.givenApplication, tc.givenEventName, tc.wantVersion) assert.Equal(t, wantEventType, gotEventType) - //check eventType + // check eventType gotType := gotEvent.Context.GetType() assert.Equal(t, tc.wantType, gotType) @@ -131,25 +129,10 @@ func applicationTypeLabel(label string) map[string]string { return nil } -func mockLegacyRequest(version, appname, eventType string) (*http.Request, error) { - body, err := json.Marshal(map[string]string{ - "event-type": eventType, - "event-type-version": version, - "event-time": "2020-04-02T21:37:00Z", - "data": "{\"legacy\":\"event\"}", - }) - if err != nil { - return nil, err - } - - url := fmt.Sprintf("http://localhost:8080/%s/%s/events", appname, version) - return http.NewRequest(http.MethodPost, url, bytes.NewBuffer(body)) -} - func TestConvertPublishRequestToCloudEvent(t *testing.T) { givenEventID := EventID givenApplicationName := ApplicationName - givenEventTypePrefix := MessagingEventTypePrefix + givenEventTypePrefix := Prefix givenTimeNow := time.Now().Format(time.RFC3339) givenLegacyEventVersion := EventVersion givenPublishReqParams := &legacyapi.PublishEventParametersV1{ diff --git a/pkg/legacy/legacytest/test.go b/pkg/legacy/legacytest/test.go new file mode 100644 index 0000000..d377db7 --- /dev/null +++ b/pkg/legacy/legacytest/test.go @@ -0,0 +1,53 @@ +package legacytest + +import ( + "bytes" + "encoding/json" + "fmt" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" +) + +func InvalidLegacyRequest(version, appname, eventType string) (*http.Request, error) { + body, err := json.Marshal(map[string]string{ + "eventtype": eventType, + "eventtypeversion": version, + "eventtime": "2020-04-02T21:37:00Z", + "data": "{\"legacy\":\"event\"}", + }) + if err != nil { + return nil, err + } + + url := fmt.Sprintf("http://localhost:8080/%s/%s/events", appname, version) + return http.NewRequest(http.MethodPost, url, bytes.NewBuffer(body)) +} + +func ValidLegacyRequest(version, appname, eventType string) (*http.Request, error) { + body, err := json.Marshal(map[string]string{ + "event-type": eventType, + "event-type-version": version, + "event-time": "2020-04-02T21:37:00Z", + "data": "{\"legacy\":\"event\"}", + }) + if err != nil { + return nil, err + } + + url := fmt.Sprintf("http://localhost:8080/%s/%s/events", appname, version) + return http.NewRequest(http.MethodPost, url, bytes.NewBuffer(body)) +} + +func InvalidLegacyRequestOrDie(t *testing.T, version, appname, eventType string) *http.Request { + r, err := InvalidLegacyRequest(version, appname, eventType) + assert.NoError(t, err) + return r +} + +func ValidLegacyRequestOrDie(t *testing.T, version, appname, eventType string) *http.Request { + r, err := ValidLegacyRequest(version, appname, eventType) + assert.NoError(t, err) + return r +} diff --git a/pkg/metrics/collector.go b/pkg/metrics/collector.go index 9cc2ee2..345cc6e 100644 --- a/pkg/metrics/collector.go +++ b/pkg/metrics/collector.go @@ -15,8 +15,8 @@ const ( // LatencyKey name of the latency metric LatencyKey = "eventing_epp_messaging_server_latency_duration_milliseconds" // EventTypePublishedMetricKey name of the eventTypeLabel metric - EventTypePublishedMetricKey = "nats_epp_event_type_published_total" - //EventRequestsKey name of the eventRequests metric + EventTypePublishedMetricKey = "epp_event_type_published_total" + // EventRequestsKey name of the eventRequests metric EventRequestsKey = "eventing_epp_requests_total" // errorsHelp help text for the errors metric errorsHelp = "The total number of errors while sending events to the messaging server" @@ -26,9 +26,9 @@ const ( eventTypePublishedMetricHelp = "The total number of events published for a given eventTypeLabel" // eventRequestsHelp help text for event requests metric eventRequestsHelp = "The total number of event requests" - //responseCodeLabel name of the status code labels used by multiple metrics + // responseCodeLabel name of the status code labels used by multiple metrics responseCodeLabel = "response_code" - //destSvcLabel name of the destination service label used by multiple metrics + // destSvcLabel name of the destination service label used by multiple metrics destSvcLabel = "destination_service" // eventTypeLabel name of the event type label used by metrics eventTypeLabel = "event_type" @@ -36,6 +36,18 @@ const ( eventSourceLabel = "event_source" ) +// PublishingMetricsCollector interface provides a Prometheus compatible Collector with additional convenience methods +// for recording epp specific metrics. +type PublishingMetricsCollector interface { + prometheus.Collector + RecordError() + RecordLatency(duration time.Duration, statusCode int, destSvc string) + RecordEventType(eventType, eventSource string, statusCode int) + RecordRequests(statusCode int, destSvc string) +} + +var _ PublishingMetricsCollector = &Collector{} + // Collector implements the prometheus.Collector interface type Collector struct { errors *prometheus.CounterVec diff --git a/pkg/metrics/metricstest/metricstest.go b/pkg/metrics/metricstest/metricstest.go index d6d5b57..428cd66 100644 --- a/pkg/metrics/metricstest/metricstest.go +++ b/pkg/metrics/metricstest/metricstest.go @@ -3,28 +3,57 @@ package metricstest import ( "testing" + "time" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/testutil" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" ) -// EnsureMetricErrors ensures metric errors exists -func EnsureMetricErrors(t *testing.T, collector *metrics.Collector) { - ensureMetricCount(t, collector, metrics.ErrorsKey, 1) +// EnsureMetricErrors ensures metric eventing_epp_errors_total exists. +func EnsureMetricErrors(t *testing.T, collector metrics.PublishingMetricsCollector, count int) { + ensureMetricCount(t, collector, metrics.ErrorsKey, count) +} + +// EnsureMetricLatency ensures metric eventing_epp_messaging_server_latency_duration_milliseconds exists. +func EnsureMetricLatency(t *testing.T, collector metrics.PublishingMetricsCollector, count int) { + ensureMetricCount(t, collector, metrics.LatencyKey, count) } -// EnsureMetricLatency ensures metric latency exists -func EnsureMetricLatency(t *testing.T, collector *metrics.Collector) { - ensureMetricCount(t, collector, metrics.LatencyKey, 1) +// EnsureMetricEventTypePublished ensures metric epp_event_type_published_total exists. +func EnsureMetricEventTypePublished(t *testing.T, collector metrics.PublishingMetricsCollector, count int) { + ensureMetricCount(t, collector, metrics.EventTypePublishedMetricKey, count) } -// EnsureMetricEventTypePublished ensures metric eventType exists -func EnsureMetricEventTypePublished(t *testing.T, collector *metrics.Collector) { - ensureMetricCount(t, collector, metrics.EventTypePublishedMetricKey, 1) +// EnsureMetricTotalRequests ensures metric eventing_epp_requests_total exists. +func EnsureMetricTotalRequests(t *testing.T, collector metrics.PublishingMetricsCollector, count int) { + ensureMetricCount(t, collector, metrics.EventRequestsKey, count) } -func ensureMetricCount(t *testing.T, collector *metrics.Collector, metric string, expectedCount int) { +func ensureMetricCount(t *testing.T, collector metrics.PublishingMetricsCollector, metric string, expectedCount int) { if count := testutil.CollectAndCount(collector, metric); count != expectedCount { t.Fatalf("invalid count for metric:%s, want:%d, got:%d", metric, expectedCount, count) } } + +type PublishingMetricsCollectorStub struct { +} + +func (p PublishingMetricsCollectorStub) Describe(_ chan<- *prometheus.Desc) { +} + +func (p PublishingMetricsCollectorStub) Collect(_ chan<- prometheus.Metric) { +} + +func (p PublishingMetricsCollectorStub) RecordError() { +} + +func (p PublishingMetricsCollectorStub) RecordLatency(_ time.Duration, _ int, _ string) { +} + +func (p PublishingMetricsCollectorStub) RecordEventType(_, _ string, _ int) { +} + +func (p PublishingMetricsCollectorStub) RecordRequests(_ int, _ string) { +} diff --git a/pkg/metrics/server.go b/pkg/metrics/server.go index 5c149e6..4f265af 100644 --- a/pkg/metrics/server.go +++ b/pkg/metrics/server.go @@ -2,6 +2,7 @@ package metrics import ( "context" + "errors" "net" "net/http" "strings" @@ -40,7 +41,12 @@ func (s *Server) Start(address string) error { } s.namedLogger().Infof("Metrics server started on %v", address) - go s.srv.Serve(listener) //nolint:errcheck + go func() { + err := s.srv.Serve(listener) + if !errors.Is(err, http.ErrServerClosed) { + s.logger.WithContext().Fatal(err) + } + }() } return nil diff --git a/pkg/receiver/receiver.go b/pkg/receiver/receiver.go index 4a26361..6baf097 100644 --- a/pkg/receiver/receiver.go +++ b/pkg/receiver/receiver.go @@ -13,7 +13,7 @@ import ( ) const ( - // defaultShutdownTimeout is the default timeout for the receiver to shutdown. + // defaultShutdownTimeout is the default timeout for the receiver to shut down. defaultShutdownTimeout = 1 * time.Minute readHeaderTimeout = 5 * time.Second @@ -22,34 +22,35 @@ const ( // HTTPMessageReceiver is responsible for receiving messages over HTTP. type HTTPMessageReceiver struct { - port int + Host string + Port int handler http.Handler server *http.Server listener net.Listener } -// NewHTTPMessageReceiver returns a new NewHTTPMessageReceiver instance with the given port. +// NewHTTPMessageReceiver returns a new NewHTTPMessageReceiver instance with the given Port. func NewHTTPMessageReceiver(port int) *HTTPMessageReceiver { - return &HTTPMessageReceiver{port: port} + return &HTTPMessageReceiver{Port: port} } // StartListen starts the HTTP message receiver and blocks until it receives a shutdown signal. -func (recv *HTTPMessageReceiver) StartListen(ctx context.Context, handler http.Handler, logger *kymalogger.Logger) error { +func (r *HTTPMessageReceiver) StartListen(ctx context.Context, handler http.Handler, logger *kymalogger.Logger) error { var err error - if recv.listener, err = net.Listen("tcp", fmt.Sprintf(":%d", recv.port)); err != nil { + if r.listener, err = net.Listen("tcp", fmt.Sprintf("%v:%d", r.Host, r.Port)); err != nil { return err } - recv.handler = createHandler(handler) - recv.server = &http.Server{ - Addr: recv.listener.Addr().String(), - Handler: recv.handler, + r.handler = createHandler(handler) + r.server = &http.Server{ + Addr: r.listener.Addr().String(), + Handler: r.handler, ReadHeaderTimeout: readHeaderTimeout, } errChan := make(chan error, 1) go func() { - errChan <- recv.server.Serve(recv.listener) + errChan <- r.server.Serve(r.listener) }() // init the contexted logger @@ -60,9 +61,10 @@ func (recv *HTTPMessageReceiver) StartListen(ctx context.Context, handler http.H // wait for the server to return or ctx.Done(). select { case <-ctx.Done(): + logger.WithContext().Info("shutdown") ctx, cancel := context.WithTimeout(context.Background(), defaultShutdownTimeout) defer cancel() - err := recv.server.Shutdown(ctx) + err := r.server.Shutdown(ctx) <-errChan // Wait for server goroutine to exit return err case err := <-errChan: @@ -74,3 +76,7 @@ func (recv *HTTPMessageReceiver) StartListen(ctx context.Context, handler http.H func createHandler(handler http.Handler) http.Handler { return &ochttp.Handler{Handler: handler} } + +func (r *HTTPMessageReceiver) BaseURL() string { + return fmt.Sprintf("http://%s", r.listener.Addr()) +} diff --git a/pkg/receiver/receiver_test.go b/pkg/receiver/receiver_test.go index abbc7cc..1d84edf 100644 --- a/pkg/receiver/receiver_test.go +++ b/pkg/receiver/receiver_test.go @@ -22,11 +22,8 @@ var _ http.Handler = (*testHandler)(nil) func TestNewHttpMessageReceiver(t *testing.T) { port := testingutils.GeneratePortOrDie() r := NewHTTPMessageReceiver(port) - if r == nil { - t.Fatalf("Could not create HTTPMessageReceiver") - } - if r.port != port { - t.Errorf("Port should be: %d is: %d", port, r.port) + if r.Port != port { + t.Errorf("Port should be: %d is: %d", port, r.Port) } } @@ -79,5 +76,5 @@ func TestStartListener(t *testing.T) { } func fixtureReceiver() *HTTPMessageReceiver { - return NewHTTPMessageReceiver(0) + return &HTTPMessageReceiver{Port: 0, Host: "localhost"} } diff --git a/pkg/sender/beb.go b/pkg/sender/beb.go deleted file mode 100644 index a4a50ad..0000000 --- a/pkg/sender/beb.go +++ /dev/null @@ -1,27 +0,0 @@ -package sender - -import ( - "context" - "net/http" -) - -// BEBMessageSender is responsible for sending messages over HTTP. -type BEBMessageSender struct { - Client *http.Client - Target string -} - -// NewBEBMessageSender returns a new BEBMessageSender instance with the given target and client. -func NewBEBMessageSender(target string, client *http.Client) *BEBMessageSender { - return &BEBMessageSender{Client: client, Target: target} -} - -// NewRequestWithTarget returns a new HTTP POST request with the given context and target. -func (s *BEBMessageSender) NewRequestWithTarget(ctx context.Context, target string) (*http.Request, error) { - return http.NewRequestWithContext(ctx, http.MethodPost, target, nil) -} - -// Send sends the given HTTP request and returns the HTTP response back. -func (s *BEBMessageSender) Send(req *http.Request) (*http.Response, error) { - return s.Client.Do(req) -} diff --git a/pkg/sender/beb/beb.go b/pkg/sender/beb/beb.go new file mode 100644 index 0000000..9207e06 --- /dev/null +++ b/pkg/sender/beb/beb.go @@ -0,0 +1,86 @@ +package beb + +import ( + "context" + "io" + "net/http" + + "github.com/cloudevents/sdk-go/v2/binding" + cev2event "github.com/cloudevents/sdk-go/v2/event" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/ems" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" +) + +var _ sender.GenericSender = &Sender{} + +var ( + // additionalHeaders are the required headers by EMS for publish requests. + // Any alteration or removal of those headers might cause publish requests to fail. + additionalHeaders = http.Header{ + "qos": []string{string(ems.QosAtLeastOnce)}, + "Accept": []string{internal.ContentTypeApplicationJSON}, + } +) + +// Sender is responsible for sending messages over HTTP. +type Sender struct { + Client *http.Client + Target string +} + +type HTTPPublishResult struct { + Status int + Body []byte +} + +func (h HTTPPublishResult) HTTPStatus() int { + return h.Status +} + +func (h HTTPPublishResult) ResponseBody() []byte { + return h.Body +} + +func (s *Sender) Checker() *health.ConfigurableChecker { + return &health.ConfigurableChecker{} +} + +func (s *Sender) Send(ctx context.Context, event *cev2event.Event) (sender.PublishResult, error) { + request, err := s.NewRequestWithTarget(ctx, s.Target) + if err != nil { + return nil, err + } + + message := binding.ToMessage(event) + defer func() { _ = message.Finish(nil) }() + + err = cloudevents.WriteRequestWithHeaders(ctx, message, request, additionalHeaders) + if err != nil { + return nil, err + } + + resp, err := s.Client.Do(request) + if err != nil { + return nil, err + } + body, err := io.ReadAll(resp.Body) + defer func() { _ = resp.Body.Close() }() + if err != nil { + return nil, err + } + return HTTPPublishResult{Status: resp.StatusCode, Body: body}, nil +} + +// NewSender returns a new Sender instance with the given target and client. +func NewSender(target string, client *http.Client) *Sender { + return &Sender{Client: client, Target: target} +} + +// NewRequestWithTarget returns a new HTTP POST request with the given context and target. +func (s *Sender) NewRequestWithTarget(ctx context.Context, target string) (*http.Request, error) { + return http.NewRequestWithContext(ctx, http.MethodPost, target, nil) +} diff --git a/pkg/sender/beb/beb_test.go b/pkg/sender/beb/beb_test.go new file mode 100644 index 0000000..38389e5 --- /dev/null +++ b/pkg/sender/beb/beb_test.go @@ -0,0 +1,221 @@ +package beb + +import ( + "context" + "net/http" + "net/http/httptest" + "net/url" + "reflect" + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + testing2 "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" +) + +const ( + // mock server endpoints. + eventsEndpoint = "/events" + eventsHTTP400Endpoint = "/events400" + + // connection settings. + maxIdleConns = 100 + maxIdleConnsPerHost = 200 +) + +func TestNewHttpMessageSender(t *testing.T) { + t.Parallel() + + client := oauth.NewClient(context.Background(), &env.BEBConfig{}) + defer client.CloseIdleConnections() + + msgSender := NewSender(eventsEndpoint, client) + if msgSender.Target != eventsEndpoint { + t.Errorf("Message sender target is misconfigured want: %s but got: %s", eventsEndpoint, msgSender.Target) + } + if msgSender.Client != client { + t.Errorf("Message sender client is misconfigured want: %#v but got: %#v", client, msgSender.Client) + } +} + +func TestNewRequestWithTarget(t *testing.T) { + t.Parallel() + + client := oauth.NewClient(context.Background(), &env.BEBConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) + defer client.CloseIdleConnections() + + msgSender := NewSender(eventsEndpoint, client) + + type ctxKey struct{} + const ctxValue = "testValue" + ctx := context.WithValue(context.Background(), ctxKey{}, ctxValue) + req, err := msgSender.NewRequestWithTarget(ctx, eventsEndpoint) + if err != nil { + t.Errorf("Failed to create a CloudEvent HTTP request with error: %v", err) + } + if req == nil { + t.Error("Failed to create a CloudEvent HTTP request want new request but got nil") + return + } + if req.Method != http.MethodPost { + t.Errorf("HTTP request has invalid method want: %s but got: %s", http.MethodPost, req.Method) + } + if req.URL.Path != eventsEndpoint { + t.Errorf("HTTP request has invalid target want: %s but got: %s", eventsEndpoint, req.URL.Path) + } + if len(req.Header) > 0 { + t.Error("HTTP request should be created with empty headers") + } + if req.Close != false { + t.Errorf("HTTP request close is invalid want: %v but got: %v", false, req.Close) + } + if req.Body != nil { + t.Error("HTTP request should be created with empty body") + } + if req.Context() != ctx { + t.Errorf("HTTP request context does not match original context want: %#v, but got %#v", ctx, req.Context()) + } + if got := req.Context().Value(ctxKey{}); got != ctxValue { + t.Errorf("HTTP request context key:value do not match mant: %v:%v but got %v:%v", ctxKey{}, ctxValue, ctxKey{}, got) + } +} + +func TestSender_Send_Error(t *testing.T) { + type fields struct { + Target string + } + type args struct { + // timeout is one easy way to trigger an error on sending + timeout time.Duration + builder *testing2.CloudEventBuilder + } + var tests = []struct { + name string + fields fields + args args + want sender.PublishResult + wantErr bool + }{ + { + name: "valid event", + fields: fields{ + Target: "https://127.1.1.1:12345/idontexist", + }, + args: args{ + timeout: 1 * time.Millisecond, + builder: testing2.NewCloudEventBuilder(), + }, + want: nil, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + hOk := &HandlerStub{ResponseStatus: 204} + hFail := &HandlerStub{ResponseStatus: 400} + mux := http.NewServeMux() + mux.HandleFunc(eventsEndpoint, hOk.ServeHTTP) + mux.HandleFunc(eventsHTTP400Endpoint, hFail.ServeHTTP) + server := httptest.NewServer(mux) + s := &Sender{ + Client: server.Client(), + Target: tt.fields.Target, + } + ctx, cancel := context.WithTimeout(context.Background(), tt.args.timeout) + defer cancel() + got, err := s.Send(ctx, tt.args.builder.Build(t)) + if (err != nil) != tt.wantErr { + t.Errorf("Send() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("Send() got = %v, want %v", got, tt.want) + } + }) + } +} +func TestSender_Send(t *testing.T) { + type fields struct { + Target string + } + type args struct { + ctx context.Context + builder *testing2.CloudEventBuilder + } + var tests = []struct { + name string + fields fields + args args + want sender.PublishResult + wantErr bool + }{ + { + name: "valid event, backend 400", + fields: fields{ + Target: eventsHTTP400Endpoint, + }, + args: args{ + ctx: context.Background(), + builder: testing2.NewCloudEventBuilder(), + }, + want: HTTPPublishResult{ + Status: 400, + Body: []byte{}, + }, + wantErr: false, + }, + { + name: "valid event", + fields: fields{ + Target: eventsEndpoint, + }, + args: args{ + ctx: context.Background(), + builder: testing2.NewCloudEventBuilder(), + }, + want: HTTPPublishResult{ + Status: 204, + Body: []byte{}, + }, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + hOk := &HandlerStub{ResponseStatus: 204} + hFail := &HandlerStub{ResponseStatus: 400} + mux := http.NewServeMux() + mux.HandleFunc(eventsEndpoint, hOk.ServeHTTP) + mux.HandleFunc(eventsHTTP400Endpoint, hFail.ServeHTTP) + server := httptest.NewServer(mux) + target, err := url.JoinPath(server.URL, tt.fields.Target) + assert.NoError(t, err) + s := &Sender{ + Client: server.Client(), + Target: target, + } + got, err := s.Send(tt.args.ctx, tt.args.builder.Build(t)) + if (err != nil) != tt.wantErr { + t.Errorf("Send() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("Send() got = %v, want %v", got, tt.want) + } + }) + } +} + +type HandlerStub struct { + Request http.Request + ResponseStatus int +} + +func (h *HandlerStub) ServeHTTP(writer http.ResponseWriter, request *http.Request) { + h.Request = *request + writer.WriteHeader(h.ResponseStatus) +} diff --git a/pkg/sender/beb_test.go b/pkg/sender/beb_test.go deleted file mode 100644 index 782e76e..0000000 --- a/pkg/sender/beb_test.go +++ /dev/null @@ -1,109 +0,0 @@ -package sender - -import ( - "context" - "fmt" - "net/http" - "testing" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" -) - -const ( - // mock server endpoints - tokenEndpoint = "/token" - eventsEndpoint = "/events" - eventsHTTP400Endpoint = "/events400" - - // connection settings - maxIdleConns = 100 - maxIdleConnsPerHost = 200 -) - -func TestNewHttpMessageSender(t *testing.T) { - t.Parallel() - - client := oauth.NewClient(context.Background(), &env.BEBConfig{}) - defer client.CloseIdleConnections() - - msgSender := NewBEBMessageSender(eventsEndpoint, client) - if msgSender.Target != eventsEndpoint { - t.Errorf("Message sender target is misconfigured want: %s but got: %s", eventsEndpoint, msgSender.Target) - } - if msgSender.Client != client { - t.Errorf("Message sender client is misconfigured want: %#v but got: %#v", client, msgSender.Client) - } -} - -func TestNewRequestWithTarget(t *testing.T) { - t.Parallel() - - client := oauth.NewClient(context.Background(), &env.BEBConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) - defer client.CloseIdleConnections() - - msgSender := NewBEBMessageSender(eventsEndpoint, client) - - type ctxKey struct{} - const ctxValue = "testValue" - ctx := context.WithValue(context.Background(), ctxKey{}, ctxValue) - req, err := msgSender.NewRequestWithTarget(ctx, eventsEndpoint) - if err != nil { - t.Errorf("Failed to create a CloudEvent HTTP request with error: %v", err) - } - if req == nil { - t.Error("Failed to create a CloudEvent HTTP request want new request but got nil") - return - } - if req.Method != http.MethodPost { - t.Errorf("HTTP request has invalid method want: %s but got: %s", http.MethodPost, req.Method) - } - if req.URL.Path != eventsEndpoint { - t.Errorf("HTTP request has invalid target want: %s but got: %s", eventsEndpoint, req.URL.Path) - } - if len(req.Header) > 0 { - t.Error("HTTP request should be created with empty headers") - } - if req.Close != false { - t.Errorf("HTTP request close is invalid want: %v but got: %v", false, req.Close) - } - if req.Body != nil { - t.Error("HTTP request should be created with empty body") - } - if req.Context() != ctx { - t.Errorf("HTTP request context does not match original context want: %#v, but got %#v", ctx, req.Context()) - } - if got := req.Context().Value(ctxKey{}); got != ctxValue { - t.Errorf("HTTP request context key:value do not match mant: %v:%v but got %v:%v", ctxKey{}, ctxValue, ctxKey{}, got) - } -} - -func TestSend(t *testing.T) { - mockServer := testingutils.NewMockServer() - mockServer.Start(t, tokenEndpoint, eventsEndpoint, eventsHTTP400Endpoint) - defer mockServer.Close() - - ctx := context.Background() - emsCEURL := fmt.Sprintf("%s%s", mockServer.URL(), eventsEndpoint) - authURL := fmt.Sprintf("%s%s", mockServer.URL(), tokenEndpoint) - cfg := testingutils.NewEnvConfig(emsCEURL, authURL, testingutils.WithMaxIdleConns(maxIdleConns), testingutils.WithMaxIdleConnsPerHost(maxIdleConnsPerHost)) - client := oauth.NewClient(ctx, cfg) - defer client.CloseIdleConnections() - - msgSender := NewBEBMessageSender(emsCEURL, client) - - request, err := msgSender.NewRequestWithTarget(ctx, msgSender.Target) - if err != nil { - t.Errorf("Failed to create a CloudEvent HTTP request with error: %v", err) - } - - resp, err := msgSender.Send(request) - defer func() { _ = resp.Body.Close() }() - if err != nil { - t.Errorf("Failed to send request with error: %v", err) - } - if resp.StatusCode > http.StatusNoContent { - t.Errorf("HTTP response has invalid HTTP status code want: %d but got: %d", http.StatusNoContent, resp.StatusCode) - } -} diff --git a/pkg/sender/helper.go b/pkg/sender/helper.go new file mode 100644 index 0000000..41399fc --- /dev/null +++ b/pkg/sender/helper.go @@ -0,0 +1,28 @@ +package sender + +import ( + "time" + + "github.com/prometheus/client_golang/prometheus" +) + +type PublishingMetricsCollectorStub struct { +} + +func (p PublishingMetricsCollectorStub) Describe(chan<- *prometheus.Desc) { +} + +func (p PublishingMetricsCollectorStub) Collect(chan<- prometheus.Metric) { +} + +func (p PublishingMetricsCollectorStub) RecordError() { +} + +func (p PublishingMetricsCollectorStub) RecordLatency(time.Duration, int, string) { +} + +func (p PublishingMetricsCollectorStub) RecordEventType(string, string, int) { +} + +func (p PublishingMetricsCollectorStub) RecordRequests(int, string) { +} diff --git a/pkg/sender/jetstream.go b/pkg/sender/jetstream.go deleted file mode 100644 index ced97c1..0000000 --- a/pkg/sender/jetstream.go +++ /dev/null @@ -1,139 +0,0 @@ -package sender - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/http" - "strings" - - "github.com/kyma-project/kyma/components/eventing-controller/logger" - "go.uber.org/zap" - - "github.com/cloudevents/sdk-go/v2/event" - "github.com/nats-io/nats.go" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" -) - -const ( - natsBackend = "nats" - jestreamHandlerName = "jetstream-handler" - noSpaceLeftErrMessage = "no space left on device" -) - -// compile time check -var _ GenericSender = &JetStreamMessageSender{} - -type GenericSender interface { - Send(context.Context, *event.Event) (int, error) - ConnectionStatus() nats.Status - URL() string -} - -// JetStreamMessageSender is responsible for sending messages over HTTP. -type JetStreamMessageSender struct { - ctx context.Context - logger *logger.Logger - connection *nats.Conn - envCfg *env.NATSConfig -} - -// NewJetStreamMessageSender returns a new NewJetStreamMessageSender instance with the given nats connection. -func NewJetStreamMessageSender(ctx context.Context, connection *nats.Conn, envCfg *env.NATSConfig, logger *logger.Logger) *JetStreamMessageSender { - return &JetStreamMessageSender{ctx: ctx, connection: connection, envCfg: envCfg, logger: logger} -} - -// URL returns the URL of the Sender's connection. -func (s *JetStreamMessageSender) URL() string { - return s.envCfg.URL -} - -// ConnectionStatus returns nats.Status for the NATS connection used by the JetStreamMessageSender. -func (s *JetStreamMessageSender) ConnectionStatus() nats.Status { - return s.connection.Status() -} - -// Send dispatches the event to the NATS backend in JetStream mode. -// If the NATS connection is not open, it returns an error. -func (s *JetStreamMessageSender) Send(_ context.Context, event *event.Event) (int, error) { - if s.ConnectionStatus() != nats.CONNECTED { - return http.StatusBadGateway, errors.New("connection status: no connection to NATS JetStream server") - } - // ensure the stream exists - streamExists, err := s.streamExists(s.connection) - if err != nil && err != nats.ErrStreamNotFound { - return http.StatusInternalServerError, err - } - if !streamExists { - return http.StatusNotFound, nats.ErrStreamNotFound - } - - jsCtx, jsError := s.connection.JetStream() - if jsError != nil { - return http.StatusInternalServerError, jsError - } - msg, err := s.eventToNATSMsg(event) - if err != nil { - return http.StatusUnprocessableEntity, err - } - - // send the event - _, err = jsCtx.PublishMsg(msg) - if err != nil { - s.namedLogger().Errorw("Cannot send event to backend", "error", err) - if strings.Contains(err.Error(), noSpaceLeftErrMessage) { - return http.StatusInsufficientStorage, err - } - return http.StatusInternalServerError, err - } - return http.StatusNoContent, nil -} - -// streamExists checks if the stream with the expected name exists. -func (s *JetStreamMessageSender) streamExists(connection *nats.Conn) (bool, error) { - jsCtx, err := connection.JetStream() - if err != nil { - return false, err - } - if info, err := jsCtx.StreamInfo(s.envCfg.JSStreamName); err == nil { - s.namedLogger().Infof("Stream %s exists, using it for publishing", info.Config.Name) - return true, nil - } else if err != nats.ErrStreamNotFound { - s.namedLogger().Debug("The connection to NATS server is not established!") - return false, err - } - return false, nats.ErrStreamNotFound -} - -// eventToNATSMsg translates cloud event into the NATS Msg. -func (s *JetStreamMessageSender) eventToNATSMsg(event *event.Event) (*nats.Msg, error) { - header := make(nats.Header) - header.Set(internal.HeaderContentType, event.DataContentType()) - header.Set(internal.CeSpecVersionHeader, event.SpecVersion()) - header.Set(internal.CeTypeHeader, event.Type()) - header.Set(internal.CeSourceHeader, event.Source()) - header.Set(internal.CeIDHeader, event.ID()) - - eventJSON, err := json.Marshal(event) - if err != nil { - return nil, err - } - - return &nats.Msg{ - Subject: s.getJsSubjectToPublish(event.Type()), - Header: header, - Data: eventJSON, - }, err -} - -// getJsSubjectToPublish appends stream name to subject if needed. -func (s *JetStreamMessageSender) getJsSubjectToPublish(subject string) string { - return fmt.Sprintf("%s.%s", env.JetStreamSubjectPrefix, subject) -} - -func (s *JetStreamMessageSender) namedLogger() *zap.SugaredLogger { - return s.logger.WithContext().Named(jestreamHandlerName).With("backend", natsBackend, "jetstream enabled", true) -} diff --git a/pkg/sender/jetstream/health.go b/pkg/sender/jetstream/health.go new file mode 100644 index 0000000..15c481b --- /dev/null +++ b/pkg/sender/jetstream/health.go @@ -0,0 +1,25 @@ +package jetstream + +import ( + "net/http" + + "github.com/nats-io/nats.go" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" +) + +// ReadinessCheck returns an instance of http.HandlerFunc that checks the readiness of the given NATS Handler. +// It checks the NATS server connection status and reports 2XX if connected, otherwise reports 5XX. +// It panics if the given NATS Handler is nil. +func (s *Sender) ReadinessCheck(w http.ResponseWriter, _ *http.Request) { + if status := s.ConnectionStatus(); status != nats.CONNECTED { + s.namedLogger().Error("Readiness check failed: not connected to nats server") + w.WriteHeader(health.StatusCodeNotHealthy) + return + } + w.WriteHeader(health.StatusCodeHealthy) +} + +func (s *Sender) LivenessCheck(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(health.StatusCodeHealthy) +} diff --git a/pkg/sender/jetstream/jetstream.go b/pkg/sender/jetstream/jetstream.go new file mode 100644 index 0000000..7c56880 --- /dev/null +++ b/pkg/sender/jetstream/jetstream.go @@ -0,0 +1,118 @@ +package jetstream + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net/http" + "strings" + + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "go.uber.org/zap" + + "github.com/cloudevents/sdk-go/v2/event" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/beb" + + "github.com/nats-io/nats.go" +) + +const ( + natsBackend = "nats" + jestreamHandlerName = "jetstream-handler" + noSpaceLeftErrMessage = "no space left on device" +) + +// compile time check +var _ sender.GenericSender = &Sender{} +var _ health.Checker = &Sender{} + +var ( + ErrNotConnected = errors.New("no connection to NATS JetStream server") + ErrCannotSendToStream = errors.New("cannot send to stream") +) + +// Sender is responsible for sending messages over HTTP. +type Sender struct { + ctx context.Context + logger *logger.Logger + connection *nats.Conn + envCfg *env.NATSConfig +} + +// NewSender returns a new NewSender instance with the given NATS connection. +func NewSender(ctx context.Context, connection *nats.Conn, envCfg *env.NATSConfig, logger *logger.Logger) *Sender { + return &Sender{ctx: ctx, connection: connection, envCfg: envCfg, logger: logger} +} + +// ConnectionStatus returns nats.Status for the NATS connection used by the Sender. +func (s *Sender) ConnectionStatus() nats.Status { + return s.connection.Status() +} + +// Send dispatches the event to the NATS backend in JetStream mode. +// If the NATS connection is not open, it returns an error. +func (s *Sender) Send(_ context.Context, event *event.Event) (sender.PublishResult, error) { + if s.ConnectionStatus() != nats.CONNECTED { + return nil, ErrNotConnected + } + + jsCtx, jsError := s.connection.JetStream() + if jsError != nil { + return nil, jsError + } + + msg, err := s.eventToNATSMsg(event) + if err != nil { + return nil, err + } + + // send the event + _, err = jsCtx.PublishMsg(msg) + if err != nil { + s.namedLogger().Errorw("Cannot send event to backend", "error", err) + if errors.Is(err, nats.ErrNoStreamResponse) { + return nil, fmt.Errorf("%w : %v", ErrCannotSendToStream, err) + } + if strings.Contains(err.Error(), noSpaceLeftErrMessage) { + return nil, err + } + return nil, fmt.Errorf("%w: %v", ErrCannotSendToStream, err) + } + return beb.HTTPPublishResult{Status: http.StatusNoContent}, nil +} + +// eventToNATSMsg translates cloud event into the NATS Msg. +func (s *Sender) eventToNATSMsg(event *event.Event) (*nats.Msg, error) { + header := make(nats.Header) + header.Set(internal.HeaderContentType, event.DataContentType()) + header.Set(internal.CeSpecVersionHeader, event.SpecVersion()) + header.Set(internal.CeTypeHeader, event.Type()) + header.Set(internal.CeSourceHeader, event.Source()) + header.Set(internal.CeIDHeader, event.ID()) + + eventJSON, err := json.Marshal(event) + if err != nil { + return nil, err + } + + return &nats.Msg{ + Subject: s.getJsSubjectToPublish(event.Type()), + Header: header, + Data: eventJSON, + }, err +} + +// getJsSubjectToPublish appends stream name to subject if needed. +func (s *Sender) getJsSubjectToPublish(subject string) string { + return fmt.Sprintf("%s.%s", env.JetStreamSubjectPrefix, subject) +} + +func (s *Sender) namedLogger() *zap.SugaredLogger { + return s.logger.WithContext().Named(jestreamHandlerName).With("backend", natsBackend, "jetstream enabled", true) +} diff --git a/pkg/sender/jetstream_test.go b/pkg/sender/jetstream/jetstream_test.go similarity index 68% rename from pkg/sender/jetstream_test.go rename to pkg/sender/jetstream/jetstream_test.go index 29b264c..512e796 100644 --- a/pkg/sender/jetstream_test.go +++ b/pkg/sender/jetstream/jetstream_test.go @@ -1,4 +1,4 @@ -package sender +package jetstream import ( "context" @@ -14,13 +14,12 @@ import ( "github.com/cloudevents/sdk-go/v2/event" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - cloudevents "github.com/cloudevents/sdk-go/v2" "github.com/nats-io/nats-server/v2/server" "github.com/nats-io/nats.go" "github.com/stretchr/testify/assert" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) @@ -57,7 +56,7 @@ func TestJetStreamMessageSender(t *testing.T) { for _, tc := range testCases { tc := tc t.Run(tc.name, func(t *testing.T) { - // given + // arrange testEnv := setupTestEnvironment(t) natsServer, connection, mockedLogger := testEnv.Server, testEnv.Connection, testEnv.Logger @@ -72,82 +71,23 @@ func TestJetStreamMessageSender(t *testing.T) { ce := createCloudEvent(t) - // when ctx := context.Background() - sender := NewJetStreamMessageSender(context.Background(), connection, testEnv.Config, mockedLogger) + sender := NewSender(context.Background(), connection, testEnv.Config, mockedLogger) if tc.givenNATSConnectionClosed { connection.Close() } - // then + // act status, err := sender.Send(ctx, ce) testEnv.Logger.WithContext().Errorf("err: %v", err) - assert.Equal(t, tc.wantError, err != nil) - assert.Equal(t, tc.wantStatusCode, status) - }) - } -} -func TestStreamExists(t *testing.T) { - testCases := []struct { - name string - givenStream bool - givenNATSConnectionClosed bool - wantResult bool - wantError error - }{ - { - name: "Stream doesn't exist and should return false", - givenStream: false, - givenNATSConnectionClosed: false, - wantResult: false, - wantError: nats.ErrStreamNotFound, - }, - { - name: "Stream exists and should return true", - givenStream: true, - givenNATSConnectionClosed: false, - wantResult: true, - wantError: nil, - }, - { - name: "Connection closed and error should happen", - givenStream: true, - givenNATSConnectionClosed: true, - wantResult: false, - wantError: nats.ErrConnectionClosed, - }, - } - - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - // given - testEnv := setupTestEnvironment(t) - natsServer, connection, sender := testEnv.Server, testEnv.Connection, testEnv.Sender - - defer func() { - connection.Close() - natsServer.Shutdown() - }() - - if tc.givenStream { - addStream(t, connection, getStreamConfig()) - } - - // close the connection to provoke the error - if tc.givenNATSConnectionClosed { - connection.Close() + // assert + assert.Equal(t, tc.wantError, err != nil) + if !tc.wantError { + assert.Equal(t, tc.wantStatusCode, status.HTTPStatus()) } - - // when - result, err := sender.streamExists(connection) - - // then - assert.Equal(t, result, tc.wantResult) - assert.Equal(t, err, tc.wantError) }) } } @@ -158,7 +98,7 @@ type TestEnvironment struct { Connection *nats.Conn Config *env.NATSConfig Logger *logger.Logger - Sender *JetStreamMessageSender + Sender *Sender Server *server.Server JsContext *nats.JetStreamContext } @@ -180,7 +120,7 @@ func setupTestEnvironment(t *testing.T) *TestEnvironment { jsCtx, err := connection.JetStream() require.NoError(t, err) - sender := &JetStreamMessageSender{ + sender := &Sender{ connection: connection, envCfg: natsConfig, logger: mockedLogger, @@ -199,11 +139,11 @@ func setupTestEnvironment(t *testing.T) *TestEnvironment { // createCloudEvent build a cloud event. func createCloudEvent(t *testing.T) *event.Event { builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(testingutils.CloudEventType), + testingutils.WithCloudEventType(testingutils.CloudEventTypeWithPrefix), ) payload, _ := builder.BuildStructured() newEvent := cloudevents.NewEvent() - newEvent.SetType(testingutils.CloudEventType) + newEvent.SetType(testingutils.CloudEventTypeWithPrefix) err := json.Unmarshal([]byte(payload), &newEvent) assert.NoError(t, err) diff --git a/pkg/sender/sender.go b/pkg/sender/sender.go new file mode 100644 index 0000000..0a0992b --- /dev/null +++ b/pkg/sender/sender.go @@ -0,0 +1,16 @@ +package sender + +import ( + "context" + + "github.com/cloudevents/sdk-go/v2/event" +) + +type GenericSender interface { + Send(context.Context, *event.Event) (PublishResult, error) +} + +type PublishResult interface { + HTTPStatus() int + ResponseBody() []byte +} diff --git a/pkg/signals/signals.go b/pkg/signals/signals.go index 745db17..31c7aaa 100644 --- a/pkg/signals/signals.go +++ b/pkg/signals/signals.go @@ -51,12 +51,6 @@ func NewContext() context.Context { return &signalContext{stopCh: SetupSignalHandler()} } -// NewReusableContext creates a new context with setupStopChannel() as our Done() channel. -// This method can be called multiple times, returning new contexts. -func NewReusableContext() context.Context { - return &signalContext{stopCh: setupStopChannel()} -} - // Deadline implements context.Context. func (scc *signalContext) Deadline() (deadline time.Time, ok bool) { return diff --git a/pkg/subscribed/processor.go b/pkg/subscribed/processor.go index 2738958..7593965 100644 --- a/pkg/subscribed/processor.go +++ b/pkg/subscribed/processor.go @@ -6,17 +6,18 @@ import ( "github.com/kyma-project/kyma/components/eventing-controller/logger" "go.uber.org/zap" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" ) const processorName = "processor" type Processor struct { SubscriptionLister *cache.GenericLister - Config *env.BEBConfig + Prefix string + Namespace string Logger *logger.Logger } @@ -37,7 +38,7 @@ func (p Processor) ExtractEventsFromSubscriptions(writer http.ResponseWriter, re continue } if sub.Spec.Filter != nil { - eventsForSub := FilterEventTypeVersions(p.Config.EventTypePrefix, p.Config.BEBNamespace, appName, sub.Spec.Filter) + eventsForSub := FilterEventTypeVersions(p.Prefix, p.Namespace, appName, sub.Spec.Filter) eventsMap = AddUniqueEventsToResult(eventsForSub, eventsMap) } } diff --git a/pkg/subscribed/response.go b/pkg/subscribed/response.go index 43cc085..de56a29 100644 --- a/pkg/subscribed/response.go +++ b/pkg/subscribed/response.go @@ -8,7 +8,7 @@ import ( "go.uber.org/zap" "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy-events" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" ) const responseName = "response" diff --git a/testing/fixtures.go b/testing/fixtures.go index 42a26bf..2e34588 100644 --- a/testing/fixtures.go +++ b/testing/fixtures.go @@ -4,6 +4,10 @@ import ( "fmt" "net/http" "strings" + "testing" + + cev2 "github.com/cloudevents/sdk-go/v2/event" + "github.com/stretchr/testify/assert" "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" ) @@ -12,23 +16,22 @@ const ( ApplicationName = "testapp1023" ApplicationNameNotClean = "testapp_1-0+2=3" - MessagingNamespace = "/messaging.namespace" - MessagingEventTypePrefix = "prefix" - JSStreamPrefix = "sap.kyma.custom" - MessagingEventTypePrefixEmpty = "" + MessagingNamespace = "/messaging.namespace" + Prefix = "prefix" + EmptyPrefix = "" EventID = "8945ec08-256b-11eb-9928-acde48001122" EventData = `{\"key\":\"value\"}` EventName = "order.created" EventVersion = "v1" - CloudEventNameAndVersion = EventName + "." + EventVersion - CloudEventType = MessagingEventTypePrefix + "." + ApplicationName + "." + CloudEventNameAndVersion - CloudEventTypePrefixEmpty = ApplicationName + "." + CloudEventNameAndVersion - CloudEventTypeNotClean = MessagingEventTypePrefix + "." + ApplicationNameNotClean + "." + CloudEventNameAndVersion - CloudEventTypeNotCleanPrefixEmpty = ApplicationNameNotClean + "." + CloudEventNameAndVersion - CloudEventSource = "/default/sap.kyma/id" - CloudEventSpecVersion = "1.0" + CloudEventNameAndVersion = EventName + "." + EventVersion + CloudEventType = ApplicationName + "." + CloudEventNameAndVersion + CloudEventTypeNotClean = ApplicationNameNotClean + "." + CloudEventNameAndVersion + CloudEventTypeWithPrefix = Prefix + "." + CloudEventType + CloudEventTypeWithPrefixNotClean = Prefix + "." + CloudEventTypeNotClean + CloudEventSource = "/default/sap.kyma/id" + CloudEventSpecVersion = "1.0" LegacyEventTime = "2020-04-02T21:37:00Z" ) @@ -58,7 +61,7 @@ func NewCloudEventBuilder(opts ...CloudEventBuilderOpt) *CloudEventBuilder { Event: Event{ id: EventID, data: EventData, - eventType: CloudEventType, + eventType: CloudEventTypeWithPrefix, }, specVersion: CloudEventSpecVersion, eventSource: CloudEventSource, @@ -115,7 +118,6 @@ func (b *CloudEventBuilder) BuildBinary() (string, http.Header) { func (b *CloudEventBuilder) BuildStructured() (string, http.Header) { payload := `{ "id":"` + b.id + `", - "data":"` + b.data + `", "type":"` + b.eventType + `", "source":"` + b.eventSource + `", "specversion":"` + b.specVersion + `", @@ -125,6 +127,15 @@ func (b *CloudEventBuilder) BuildStructured() (string, http.Header) { return payload, headers } +func (b *CloudEventBuilder) Build(t *testing.T) *cev2.Event { + e := cev2.New(b.specVersion) + assert.NoError(t, e.Context.SetID(b.id)) + assert.NoError(t, e.Context.SetType(b.eventType)) + assert.NoError(t, e.Context.SetSource(b.eventSource)) + assert.NoError(t, e.SetData(b.dataContentType, b.data)) + return &e +} + type LegacyEvent struct { Event eventTime string diff --git a/testing/nats.go b/testing/nats.go index 8c32aed..837450e 100644 --- a/testing/nats.go +++ b/testing/nats.go @@ -1,16 +1,12 @@ package testing import ( - "encoding/json" - "fmt" - "testing" "time" "github.com/kyma-project/kyma/components/eventing-controller/logger" pkgnats "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/nats" - cev2 "github.com/cloudevents/sdk-go/v2/event" "github.com/nats-io/nats-server/v2/server" "github.com/nats-io/nats-server/v2/test" "github.com/nats-io/nats.go" @@ -24,6 +20,7 @@ func StartNATSServer() *server.Server { opts := test.DefaultTestOptions opts.Port = server.RANDOM_PORT opts.JetStream = true + opts.Host = "localhost" log, _ := logger.New("json", "info") log.WithContext().Info("Starting test NATS Server in JetStream mode") @@ -37,61 +34,3 @@ func ConnectToNATSServer(url string) (*nats.Conn, error) { pkgnats.WithReconnectWait(time.Second), ) } - -// SubscribeToEventOrFail subscribes to the given eventType using the given NATS connection. -// The received messages are then validated using the given validator. -func SubscribeToEventOrFail(t *testing.T, connection *nats.Conn, eventType string, validator nats.MsgHandler) { - if _, err := connection.Subscribe(GetStreamSubject(eventType), validator); err != nil { - t.Fatalf("Failed to subscribe to event with error: %v", err) - } -} - -func GetStreamSubject(eventType string) string { - return fmt.Sprintf("%v.%v", StreamName, eventType) -} - -func ValidateNATSSubjectOrFail(t *testing.T, subject string, notify ...chan bool) nats.MsgHandler { - return func(msg *nats.Msg) { - if msg == nil { - return - } - for _, n := range notify { - n <- true - } - if msg.Subject != GetStreamSubject(subject) { - t.Errorf("invalid NATS subject, expected [%s] but found [%s]", subject, msg.Subject) - } - } -} - -// ValidateNATSMessageDataOrFail returns a function which can be used to validate a nats.Msg. -// It reads the data from nats.Msg and unmarshalls it as a CloudEvent. -// The data section of the CloudEvent is then checked against the value provided in data. -func ValidateNATSMessageDataOrFail(t *testing.T, data string, notify ...chan bool) nats.MsgHandler { - return func(msg *nats.Msg) { - for _, n := range notify { - n <- true - } - - event := cev2.New(cev2.CloudEventsVersionV1) - if err := json.Unmarshal(msg.Data, &event); err != nil { - t.Errorf("failed to unmarshal message with error: %v", err) - } - - if eventData := string(event.Data()); data != eventData { - t.Errorf("invalid message data, expected [%s] but found [%s]", data, eventData) - } - } -} - -func WaitForChannelOrTimeout(ch chan bool, timeout time.Duration) error { - timer := time.NewTimer(timeout) - defer timer.Stop() - - select { - case <-ch: - return nil - case <-timer.C: - return fmt.Errorf("timeout is reached %v", timeout) - } -} diff --git a/testing/utils.go b/testing/utils.go index a565382..b601a25 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -1,18 +1,14 @@ package testing import ( - "bytes" "crypto/rand" "fmt" "io" "log" "net" - "net/http" "strconv" "time" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) @@ -24,129 +20,8 @@ const ( CeSpecVersionHeader = "ce-specversion" ) -func QuerySubscribedEndpoint(endpoint string) (*http.Response, error) { - emptyBody := bytes.NewBuffer([]byte("")) - req, err := http.NewRequest(http.MethodGet, endpoint, emptyBody) - if err != nil { - return nil, err - } - - client := http.Client{} - defer client.CloseIdleConnections() - - return client.Do(req) -} - -func SendEvent(endpoint, body string, headers http.Header) (*http.Response, error) { - req, err := http.NewRequest(http.MethodPost, endpoint, bytes.NewBuffer([]byte(body))) - if err != nil { - return nil, err - } - - for k, v := range headers { - req.Header[k] = v - } - - client := http.Client{} - defer client.CloseIdleConnections() - - return client.Do(req) -} - -func GetBinaryMessageHeaders() http.Header { - headers := make(http.Header) - headers.Add(CeIDHeader, EventID) - headers.Add(CeTypeHeader, CloudEventTypeNotClean) - headers.Add(CeSourceHeader, CloudEventSource) - headers.Add(CeSpecVersionHeader, CloudEventSpecVersion) - return headers -} - type SubscriptionOpt func(*eventingv1alpha1.Subscription) -func NewSubscription(opts ...SubscriptionOpt) *eventingv1alpha1.Subscription { - subscription := &eventingv1alpha1.Subscription{ - ObjectMeta: metav1.ObjectMeta{ - Name: "foo", - Labels: map[string]string{ - "foo": "bar", - }, - }, - Spec: eventingv1alpha1.SubscriptionSpec{ - ID: "", - Protocol: "", - ProtocolSettings: nil, - Sink: "", - Filter: &eventingv1alpha1.BEBFilters{ - Filters: []*eventingv1alpha1.BEBFilter{ - { - EventSource: &eventingv1alpha1.Filter{ - Type: "exact", - Property: "source", - Value: MessagingNamespace, - }, - EventType: &eventingv1alpha1.Filter{ - Type: "exact", - Property: "type", - Value: CloudEventType, - }, - }, - }, - }, - }, - } - - for _, opt := range opts { - opt(subscription) - } - - return subscription -} - -func SubscriptionWithFilter(eventSource, eventType string) SubscriptionOpt { - return func(subscription *eventingv1alpha1.Subscription) { - subscription.Spec.Filter = &eventingv1alpha1.BEBFilters{ - Filters: []*eventingv1alpha1.BEBFilter{ - { - EventSource: &eventingv1alpha1.Filter{ - Type: "exact", - Property: "source", - Value: eventSource, - }, - EventType: &eventingv1alpha1.Filter{ - Type: "exact", - Property: "type", - Value: eventType, - }, - }, - }, - } - } -} - -// WaitForEndpointStatusCodeOrFail waits for endpoint status code or timeout. -func WaitForEndpointStatusCodeOrFail(endpoint string, statusCode int) { - timeout := time.After(time.Second * 30) - ticker := time.NewTicker(time.Second * 1) - - for { - select { - case <-timeout: - { - log.Fatalf("Endpoint:%s did not respond with the expected status-code:%d", endpoint, statusCode) - } - case <-ticker.C: - { - if resp, err := http.Get(endpoint); err != nil { //nolint:gosec - continue - } else if resp.StatusCode == statusCode { - return - } - } - } - } -} - // GeneratePortOrDie generates a random 5 digit port or fail func GeneratePortOrDie() int { tick := time.NewTicker(time.Second / 2) @@ -204,17 +79,9 @@ func generatePort() (int, error) { var table = [...]byte{'1', '2', '3', '4', '5', '6', '7', '8', '9'} -func Is2XX(statusCode int) bool { - return statusCode/100 == 2 -} - -func IsNot4XX(statusCode int) bool { - return statusCode/100 != 4 -} - // isPortAvailable returns true if the port is available for use, otherwise returns false func isPortAvailable(port int) bool { - address := fmt.Sprintf(":%d", port) + address := fmt.Sprintf("localhost:%d", port) listener, err := net.Listen("tcp", address) if err != nil { return false From 13bad9f15b2f48b8891448919ce894cb37558574 Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Fri, 28 Oct 2022 01:39:31 +1100 Subject: [PATCH 118/194] Check for empty segments in event type in EPP (#15917) * check for empty segments in event type in EPP * image bump --- pkg/cloudevents/eventtype/parse.go | 11 ++++++++- pkg/cloudevents/eventtype/parse_test.go | 33 +++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/pkg/cloudevents/eventtype/parse.go b/pkg/cloudevents/eventtype/parse.go index 34fad73..662e938 100644 --- a/pkg/cloudevents/eventtype/parse.go +++ b/pkg/cloudevents/eventtype/parse.go @@ -23,7 +23,7 @@ func parse(eventType, prefix string) (string, string, string, error) { // make sure that the remaining string has at least 4 segments separated by "." // (e.g. application.businessObject.operation.version) parts := strings.Split(eventType, ".") - if len(parts) < 4 { + if len(parts) < 4 || checkForEmptySegments(parts) { return "", "", "", errors.New("invalid format") } @@ -36,3 +36,12 @@ func parse(eventType, prefix string) (string, string, string, error) { return applicationName, event, version, nil } + +func checkForEmptySegments(segments []string) bool { + for _, segment := range segments { + if segment == "" { + return true + } + } + return false +} diff --git a/pkg/cloudevents/eventtype/parse_test.go b/pkg/cloudevents/eventtype/parse_test.go index 37582b7..e1ae8be 100644 --- a/pkg/cloudevents/eventtype/parse_test.go +++ b/pkg/cloudevents/eventtype/parse_test.go @@ -23,6 +23,12 @@ func TestParser(t *testing.T) { givenPrefix: "missing.prefix", wantError: true, }, + { + name: "should fail if prefix is duplicated", + givenEventType: "one.two.one.two.prefix.test.app.name.123.order.created.v1", + givenPrefix: "one.two", + wantError: true, + }, { name: "should fail if event-type is incomplete", givenEventType: "prefix.order.created.v1", @@ -71,3 +77,30 @@ func TestParser(t *testing.T) { }) } } + +func Test_checkForEmptySegments(t *testing.T) { + t.Parallel() + testCases := []struct { + name string + givenSegments []string + wantResult bool + }{ + { + name: "should pass if all segments are non-empty", + givenSegments: []string{"one", "two", "three"}, + wantResult: false, + }, + { + name: "should fail if any segment is empty", + givenSegments: []string{"one", "", "three"}, + wantResult: true, + }, + } + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + require.Equal(t, tc.wantResult, checkForEmptySegments(tc.givenSegments)) + }) + } +} From d414cb7de2d3123d80f95db2fd86e2e8fb1f2b44 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Thu, 27 Oct 2022 17:51:25 +0200 Subject: [PATCH 119/194] fix epp latency metric labels (#15928) * fix missing destination service label on latency metric * unexport previously exported helper function, update comment on new TEF comparison function * bump image * add a test for URL * fix comment --- pkg/handler/handler.go | 4 +- pkg/handler/handler_test.go | 164 ++++++++++++++++++++++--- pkg/metrics/metricstest/metricstest.go | 9 ++ pkg/sender/beb/beb.go | 4 + pkg/sender/jetstream/jetstream.go | 4 + pkg/sender/jetstream/jetstream_test.go | 29 +++++ pkg/sender/sender.go | 1 + 7 files changed, 196 insertions(+), 19 deletions(-) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 02c4fd8..414d5f2 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -109,7 +109,7 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h } ctx := request.Context() - result, err := h.sendEventAndRecordMetrics(ctx, event, request.URL.Host, request.Header) + result, err := h.sendEventAndRecordMetrics(ctx, event, h.Sender.URL(), request.Header) if err != nil { h.namedLogger().With().Error(err) h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, http.StatusInternalServerError, event, err.Error()) @@ -148,7 +148,7 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R } event.SetType(eventTypeClean) - result, err := h.sendEventAndRecordMetrics(ctx, event, request.URL.Host, request.Header) + result, err := h.sendEventAndRecordMetrics(ctx, event, h.Sender.URL(), request.Header) if err != nil { writer.WriteHeader(http.StatusInternalServerError) h.namedLogger().With().Error(err) diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index ab0225e..1b37fce 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -168,12 +168,19 @@ func TestHandler_publishCloudEvents(t *testing.T) { type args struct { request *http.Request } + + const bucketsFunc = "Buckets" + latency := new(mocks.BucketsProvider) + latency.On(bucketsFunc).Return(nil) + latency.Test(t) + tests := []struct { name string fields fields args args wantStatus int wantBody []byte + wantTEF string }{ { name: "Publish structured Cloudevent", @@ -184,14 +191,39 @@ func TestHandler_publishCloudEvents(t *testing.T) { Status: 204, Body: []byte(""), }, + BackendURL: "FOO", }, - collector: metricstest.PublishingMetricsCollectorStub{}, + collector: metrics.NewCollector(latency), eventTypeCleaner: &eventtypetest.CleanerStub{}, }, args: args{ request: CreateValidStructuredRequest(t), }, wantStatus: 204, + wantTEF: ` + # HELP epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE epp_event_type_published_total counter + epp_event_type_published_total{event_source="/default/sap.kyma/id",event_type="",response_code="204"} 1 + # HELP eventing_epp_messaging_server_latency_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_messaging_server_latency_duration_milliseconds histogram + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.005"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.01"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.025"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.05"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.1"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.25"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.5"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="1"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="2.5"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="5"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="10"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="+Inf"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_sum{destination_service="FOO",response_code="204"} 0 + eventing_epp_messaging_server_latency_duration_milliseconds_count{destination_service="FOO",response_code="204"} 1 + # HELP eventing_epp_requests_total The total number of event requests + # TYPE eventing_epp_requests_total counter + eventing_epp_requests_total{destination_service="FOO",response_code="204"} 1 + `, }, { name: "Publish binary Cloudevent", @@ -202,20 +234,45 @@ func TestHandler_publishCloudEvents(t *testing.T) { Status: 204, Body: []byte(""), }, + BackendURL: "FOO", }, - collector: metricstest.PublishingMetricsCollectorStub{}, + collector: metrics.NewCollector(latency), eventTypeCleaner: &eventtypetest.CleanerStub{}, }, args: args{ request: CreateValidBinaryRequest(t), }, wantStatus: 204, + wantTEF: ` + # HELP epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE epp_event_type_published_total counter + epp_event_type_published_total{event_source="/default/sap.kyma/id",event_type="",response_code="204"} 1 + # HELP eventing_epp_messaging_server_latency_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_messaging_server_latency_duration_milliseconds histogram + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.005"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.01"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.025"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.05"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.1"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.25"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.5"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="1"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="2.5"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="5"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="10"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="+Inf"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_sum{destination_service="FOO",response_code="204"} 0 + eventing_epp_messaging_server_latency_duration_milliseconds_count{destination_service="FOO",response_code="204"} 1 + # HELP eventing_epp_requests_total The total number of event requests + # TYPE eventing_epp_requests_total counter + eventing_epp_requests_total{destination_service="FOO",response_code="204"} 1 + `, }, { name: "Publish invalid structured CloudEvent", fields: fields{ Sender: &GenericSenderStub{}, - collector: metricstest.PublishingMetricsCollectorStub{}, + collector: metrics.NewCollector(latency), eventTypeCleaner: &eventtypetest.CleanerStub{}, }, args: args{ @@ -228,7 +285,7 @@ func TestHandler_publishCloudEvents(t *testing.T) { name: "Publish invalid binary CloudEvent", fields: fields{ Sender: &GenericSenderStub{}, - collector: metricstest.PublishingMetricsCollectorStub{}, + collector: metrics.NewCollector(latency), eventTypeCleaner: &eventtypetest.CleanerStub{}, }, args: args{ @@ -240,7 +297,7 @@ func TestHandler_publishCloudEvents(t *testing.T) { name: "Publish binary CloudEvent but cannot clean", fields: fields{ Sender: &GenericSenderStub{}, - collector: metricstest.PublishingMetricsCollectorStub{}, + collector: metrics.NewCollector(latency), eventTypeCleaner: &eventtypetest.CleanerStub{ CleanType: "", Error: fmt.Errorf("I cannot clean"), @@ -251,6 +308,7 @@ func TestHandler_publishCloudEvents(t *testing.T) { }, wantStatus: 400, wantBody: []byte("I cannot clean"), + wantTEF: "", // client error will not be recorded as EPP internal error. So no metric will be updated. }, { name: "Publish binary CloudEvent but cannot send", @@ -258,13 +316,18 @@ func TestHandler_publishCloudEvents(t *testing.T) { Sender: &GenericSenderStub{ Err: fmt.Errorf("I cannot send"), }, - collector: metricstest.PublishingMetricsCollectorStub{}, + collector: metrics.NewCollector(latency), eventTypeCleaner: &eventtypetest.CleanerStub{}, }, args: args{ request: CreateValidBinaryRequest(t), }, wantStatus: 500, + wantTEF: ` + # HELP eventing_epp_errors_total The total number of errors while sending events to the messaging server + # TYPE eventing_epp_errors_total counter + eventing_epp_errors_total 1 + `, }, } for _, tt := range tests { @@ -291,6 +354,8 @@ func TestHandler_publishCloudEvents(t *testing.T) { if tt.wantBody != nil { assert.Equal(t, tt.wantBody, body) } + + metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wantTEF) }) } } @@ -305,12 +370,19 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { type args struct { request *http.Request } + + const bucketsFunc = "Buckets" + latency := new(mocks.BucketsProvider) + latency.On(bucketsFunc).Return(nil) + latency.Test(t) + tests := []struct { name string fields fields args args wantStatus int wantOk bool + wantTEF string }{ { name: "Send valid legacy event", @@ -319,9 +391,10 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { Result: beb.HTTPPublishResult{ Status: 204, }, + BackendURL: "FOO", }, LegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", NewApplicationListerOrDie(context.Background(), "testapp")), - collector: metricstest.PublishingMetricsCollectorStub{}, + collector: metrics.NewCollector(latency), eventTypeCleaner: eventtypetest.CleanerStub{}, }, args: args{ @@ -329,15 +402,42 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { }, wantStatus: 200, wantOk: true, + wantTEF: ` + # HELP epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE epp_event_type_published_total counter + epp_event_type_published_total{event_source="namespace",event_type="im.a.prefix.testapp.object.created.v1",response_code="204"} 1 + + # HELP eventing_epp_messaging_server_latency_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_messaging_server_latency_duration_milliseconds histogram + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.005"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.01"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.025"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.05"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.1"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.25"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.5"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="1"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="2.5"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="5"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="10"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="+Inf"} 1 + eventing_epp_messaging_server_latency_duration_milliseconds_sum{destination_service="FOO",response_code="204"} 0 + eventing_epp_messaging_server_latency_duration_milliseconds_count{destination_service="FOO",response_code="204"} 1 + + # HELP eventing_epp_requests_total The total number of event requests + # TYPE eventing_epp_requests_total counter + eventing_epp_requests_total{destination_service="FOO",response_code="204"} 1 + `, }, { name: "Send valid legacy event but cannot send to backend", fields: fields{ Sender: &GenericSenderStub{ - Err: fmt.Errorf("i cannot send"), + Err: fmt.Errorf("i cannot send"), + BackendURL: "FOO", }, LegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", NewApplicationListerOrDie(context.Background(), "testapp")), - collector: metricstest.PublishingMetricsCollectorStub{}, + collector: metrics.NewCollector(latency), eventTypeCleaner: eventtypetest.CleanerStub{}, }, args: args{ @@ -345,6 +445,11 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { }, wantStatus: 500, wantOk: false, + wantTEF: ` + # HELP eventing_epp_errors_total The total number of errors while sending events to the messaging server + # TYPE eventing_epp_errors_total counter + eventing_epp_errors_total 1 + `, }, { name: "Send invalid legacy event", @@ -353,9 +458,10 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { Result: beb.HTTPPublishResult{ Status: 204, }, + BackendURL: "FOO", }, LegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", NewApplicationListerOrDie(context.Background(), "testapp")), - collector: metricstest.PublishingMetricsCollectorStub{}, + collector: metrics.NewCollector(latency), eventTypeCleaner: eventtypetest.CleanerStub{}, }, args: args{ @@ -363,6 +469,7 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { }, wantStatus: 400, wantOk: false, + wantTEF: "", // this is a client error. We do record an error metric for requests that cannot even be decoded correctly. }, } for _, tt := range tests { @@ -398,6 +505,8 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { assert.NoError(t, err) } + metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wantTEF) + }) } } @@ -469,12 +578,13 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { header http.Header } type wants struct { - result sender.PublishResult - assertionFunc assert.ErrorAssertionFunc - metricErrors int - metricTotal int - metricLatency int - metricPublished int + result sender.PublishResult + assertionFunc assert.ErrorAssertionFunc + metricErrors int + metricTotal int + metricLatency int + metricPublished int + metricLatencyTEF string } const bucketsFunc = "Buckets" @@ -517,6 +627,24 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { metricTotal: 1, metricLatency: 1, metricPublished: 1, + metricLatencyTEF: ` +# HELP eventing_epp_messaging_server_latency_duration_milliseconds The duration of sending events to the messaging server in milliseconds +# TYPE eventing_epp_messaging_server_latency_duration_milliseconds histogram +eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.005"} 1 +eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.01"} 1 +eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.025"} 1 +eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.05"} 1 +eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.1"} 1 +eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.25"} 1 +eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.5"} 1 +eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="1"} 1 +eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="2.5"} 1 +eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="5"} 1 +eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="10"} 1 +eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="+Inf"} 1 +eventing_epp_messaging_server_latency_duration_milliseconds_sum{destination_service="foo",response_code="204"} 0 +eventing_epp_messaging_server_latency_duration_milliseconds_count{destination_service="foo",response_code="204"} 1 +`, }, }, { @@ -565,6 +693,7 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { metricstest.EnsureMetricTotalRequests(t, h.collector, tt.wants.metricTotal) metricstest.EnsureMetricLatency(t, h.collector, tt.wants.metricLatency) metricstest.EnsureMetricEventTypePublished(t, h.collector, tt.wants.metricPublished) + metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wants.metricLatencyTEF, "eventing_epp_messaging_server_latency_duration_milliseconds") }) } } @@ -675,6 +804,7 @@ type GenericSenderStub struct { SleepDuration time.Duration Result sender.PublishResult ReceivedEvent *cev2event.Event + BackendURL string } func (g *GenericSenderStub) Send(_ context.Context, event *cev2event.Event) (sender.PublishResult, error) { @@ -684,7 +814,7 @@ func (g *GenericSenderStub) Send(_ context.Context, event *cev2event.Event) (sen } func (g *GenericSenderStub) URL() string { - return "" + return g.BackendURL } func NewApplicationListerOrDie(ctx context.Context, appName string) *application.Lister { diff --git a/pkg/metrics/metricstest/metricstest.go b/pkg/metrics/metricstest/metricstest.go index 428cd66..49ddb75 100644 --- a/pkg/metrics/metricstest/metricstest.go +++ b/pkg/metrics/metricstest/metricstest.go @@ -2,6 +2,7 @@ package metricstest import ( + "strings" "testing" "time" @@ -37,6 +38,14 @@ func ensureMetricCount(t *testing.T, collector metrics.PublishingMetricsCollecto } } +// EnsureMetricMatchesTextExpositionFormat ensures that metrics collected by the given collector match the given metric output in TextExpositionFormat. +// This is useful to compare metrics with their given labels. +func EnsureMetricMatchesTextExpositionFormat(t *testing.T, collector metrics.PublishingMetricsCollector, tef string, metricNames ...string) { + if err := testutil.CollectAndCompare(collector, strings.NewReader(tef), metricNames...); err != nil { + t.Fatalf("%v", err) + } +} + type PublishingMetricsCollectorStub struct { } diff --git a/pkg/sender/beb/beb.go b/pkg/sender/beb/beb.go index 9207e06..bb6cf54 100644 --- a/pkg/sender/beb/beb.go +++ b/pkg/sender/beb/beb.go @@ -32,6 +32,10 @@ type Sender struct { Target string } +func (s *Sender) URL() string { + return s.Target +} + type HTTPPublishResult struct { Status int Body []byte diff --git a/pkg/sender/jetstream/jetstream.go b/pkg/sender/jetstream/jetstream.go index 7c56880..1c103e3 100644 --- a/pkg/sender/jetstream/jetstream.go +++ b/pkg/sender/jetstream/jetstream.go @@ -45,6 +45,10 @@ type Sender struct { envCfg *env.NATSConfig } +func (s *Sender) URL() string { + return s.envCfg.URL +} + // NewSender returns a new NewSender instance with the given NATS connection. func NewSender(ctx context.Context, connection *nats.Conn, envCfg *env.NATSConfig, logger *logger.Logger) *Sender { return &Sender{ctx: ctx, connection: connection, envCfg: envCfg, logger: logger} diff --git a/pkg/sender/jetstream/jetstream_test.go b/pkg/sender/jetstream/jetstream_test.go index 512e796..712d90f 100644 --- a/pkg/sender/jetstream/jetstream_test.go +++ b/pkg/sender/jetstream/jetstream_test.go @@ -175,3 +175,32 @@ func CreateNATSJsConfig(url string) *env.NATSConfig { ReconnectWait: time.Second, } } + +func TestSender_URL(t *testing.T) { + type fields struct { + envCfg *env.NATSConfig + } + tests := []struct { + name string + fields fields + want string + }{ + { + name: "URL is correct", + want: "FOO", + fields: fields{ + envCfg: &env.NATSConfig{ + URL: "FOO", + }, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + s := &Sender{ + envCfg: tt.fields.envCfg, + } + assert.Equalf(t, tt.want, s.URL(), "URL()") + }) + } +} diff --git a/pkg/sender/sender.go b/pkg/sender/sender.go index 0a0992b..173a2c8 100644 --- a/pkg/sender/sender.go +++ b/pkg/sender/sender.go @@ -8,6 +8,7 @@ import ( type GenericSender interface { Send(context.Context, *event.Event) (PublishResult, error) + URL() string } type PublishResult interface { From 403807656cf2c9ba6da6182b52bf93f24d253188 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Oct 2022 08:51:26 +0200 Subject: [PATCH 120/194] gomod(deps): bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /components/event-publisher-proxy (#15888) * gomod(deps): bump github.com/stretchr/testify Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.0 to 1.8.1. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.8.0...v1.8.1) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump img Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Raymond Co-authored-by: Raymond Pinto <45314732+raypinto@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 4 ++-- go.sum | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 3c8ce5a..7cb1848 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/onsi/gomega v1.21.1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.13.0 - github.com/stretchr/testify v1.8.0 + github.com/stretchr/testify v1.8.1 go.opencensus.io v0.23.0 go.uber.org/zap v1.23.0 golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 @@ -67,7 +67,7 @@ require ( github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/objx v0.4.0 // indirect + github.com/stretchr/objx v0.5.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect diff --git a/go.sum b/go.sum index 6b92a2f..787d357 100644 --- a/go.sum +++ b/go.sum @@ -293,16 +293,18 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From 0b35ae18be6ecfb1913590c63feb350902eb50d9 Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Wed, 2 Nov 2022 20:01:47 +1100 Subject: [PATCH 121/194] bump gomega version to 1.23 in Eventing (#15940) * bump gomega version to 1.23 in Eventing * image bump * fix failing test --- go.mod | 12 ++++++------ go.sum | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 7cb1848..749b49e 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221004144139-b69aea381b88 github.com/nats-io/nats-server/v2 v2.9.3 github.com/nats-io/nats.go v1.18.0 - github.com/onsi/gomega v1.21.1 + github.com/onsi/gomega v1.23.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.13.0 github.com/stretchr/testify v1.8.1 @@ -45,7 +45,7 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.8 // indirect + github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -71,10 +71,10 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect - golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect - golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect - golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/net v0.1.0 // indirect + golang.org/x/sys v0.1.0 // indirect + golang.org/x/term v0.1.0 // indirect + golang.org/x/text v0.4.0 // indirect golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 787d357..1844978 100644 --- a/go.sum +++ b/go.sum @@ -168,8 +168,8 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -268,9 +268,9 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.1.6 h1:Fx2POJZfKRQcM1pH49qSZiYeu319wji004qX+GDovrU= -github.com/onsi/gomega v1.21.1 h1:OB/euWYIExnPBohllTicTHmGTrMaqJ67nIu80j0/uEM= -github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc= +github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= +github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= +github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -405,8 +405,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -485,11 +485,11 @@ golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI= -golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -498,8 +498,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 253a80fd515dce62b65bee950fd7794c0e0b8e75 Mon Sep 17 00:00:00 2001 From: Raymond Pinto <45314732+raypinto@users.noreply.github.com> Date: Tue, 8 Nov 2022 12:22:27 +0100 Subject: [PATCH 122/194] Bump dependencies for eventing controller and epp (#16018) * Bump dependencies * Bump dependencies * Bump images * retrigger jobs --- Dockerfile | 2 +- go.mod | 5 +++-- go.sum | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 04b6979..5af3833 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.19.2-alpine3.16 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.19.3-alpine3.16 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy diff --git a/go.mod b/go.mod index 749b49e..bce3a58 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221004144139-b69aea381b88 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221004144139-b69aea381b88 - github.com/nats-io/nats-server/v2 v2.9.3 - github.com/nats-io/nats.go v1.18.0 + github.com/nats-io/nats-server/v2 v2.9.5 + github.com/nats-io/nats.go v1.19.0 github.com/onsi/gomega v1.23.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.13.0 @@ -107,6 +107,7 @@ replace ( github.com/dgrijalva/jwt-go => github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 // fix CVE-2020-26160 github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d github.com/docker/docker => github.com/docker/docker v20.10.3+incompatible + github.com/kyma-incubator/api-gateway => github.com/kyma-project/api-gateway v0.0.0-20220819093753-296e6704d413 github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.0-rc93 github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.12.2 golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 diff --git a/go.sum b/go.sum index 1844978..7f9dae0 100644 --- a/go.sum +++ b/go.sum @@ -228,7 +228,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kyma-incubator/api-gateway v0.0.0-20220819093753-296e6704d413 h1:Np4jOrlYMJcgklgrvVwXWfFMCtlg06SDAaxk9SIX7xE= +github.com/kyma-project/api-gateway v0.0.0-20220819093753-296e6704d413 h1:fkGKNOFbltycpdQ7yCGfa+7MpH9X18F09x+n7Tgfp7A= github.com/kyma-project/kyma/common/logging v0.0.0-20220903121145-690b76935712 h1:f+GRwlfq/PFnvWcI5MNVOdaefTu88RwYMMigoFVFZDE= github.com/kyma-project/kyma/common/logging v0.0.0-20220903121145-690b76935712/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= github.com/kyma-project/kyma/components/application-operator v0.0.0-20221004144139-b69aea381b88 h1:BCjnfGDRolGbuKcX962OSZJfyEJzqhDb2yQIDdzH2nk= @@ -256,10 +256,10 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= -github.com/nats-io/nats-server/v2 v2.9.3 h1:HrfzA7G9LNetKkm1z+jU/e9kuAe+E6uaBuuq9EB5sQQ= -github.com/nats-io/nats-server/v2 v2.9.3/go.mod h1:4sq8wvrpbvSzL1n3ZfEYnH4qeUuIl5W990j3kw13rRk= -github.com/nats-io/nats.go v1.18.0 h1:o480Ao6kuSSFyJO75rGTXCEPj7LGkY84C1Ye+Uhm4c0= -github.com/nats-io/nats.go v1.18.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= +github.com/nats-io/nats-server/v2 v2.9.5 h1:TlduKZ9YGoM0n34Lhm6AN0zRFOt/G3jTy9mPxXnE6dU= +github.com/nats-io/nats-server/v2 v2.9.5/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= +github.com/nats-io/nats.go v1.19.0 h1:H6j8aBnTQFoVrTGB6Xjd903UMdE7jz6DS4YkmAqgZ9Q= +github.com/nats-io/nats.go v1.19.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= From e5f19f0359fda6d41cbfe2d334c669cb52e150c8 Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Tue, 15 Nov 2022 10:50:42 +0100 Subject: [PATCH 123/194] Update Eventing deps (#16085) * Update Eventing deps * Update images * Fix tests --- go.mod | 16 ++++++++-------- go.sum | 33 +++++++++++++++++---------------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index bce3a58..25b8723 100644 --- a/go.mod +++ b/go.mod @@ -9,20 +9,20 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221004144139-b69aea381b88 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221004144139-b69aea381b88 - github.com/nats-io/nats-server/v2 v2.9.5 - github.com/nats-io/nats.go v1.19.0 - github.com/onsi/gomega v1.23.0 + github.com/nats-io/nats-server/v2 v2.9.6 + github.com/nats-io/nats.go v1.19.1 + github.com/onsi/gomega v1.24.1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.13.0 github.com/stretchr/testify v1.8.1 - go.opencensus.io v0.23.0 + go.opencensus.io v0.24.0 go.uber.org/zap v1.23.0 golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 k8s.io/api v0.25.3 k8s.io/apimachinery v0.25.3 k8s.io/client-go v0.25.3 - sigs.k8s.io/controller-runtime v0.13.0 + sigs.k8s.io/controller-runtime v0.13.1 ) require ( @@ -71,9 +71,9 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect - golang.org/x/net v0.1.0 // indirect - golang.org/x/sys v0.1.0 // indirect - golang.org/x/term v0.1.0 // indirect + golang.org/x/net v0.2.0 // indirect + golang.org/x/sys v0.2.0 // indirect + golang.org/x/term v0.2.0 // indirect golang.org/x/text v0.4.0 // indirect golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect diff --git a/go.sum b/go.sum index 7f9dae0..decbc36 100644 --- a/go.sum +++ b/go.sum @@ -256,10 +256,10 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= -github.com/nats-io/nats-server/v2 v2.9.5 h1:TlduKZ9YGoM0n34Lhm6AN0zRFOt/G3jTy9mPxXnE6dU= -github.com/nats-io/nats-server/v2 v2.9.5/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= -github.com/nats-io/nats.go v1.19.0 h1:H6j8aBnTQFoVrTGB6Xjd903UMdE7jz6DS4YkmAqgZ9Q= -github.com/nats-io/nats.go v1.19.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= +github.com/nats-io/nats-server/v2 v2.9.6 h1:RTtK+rv/4CcliOuqGsy58g7MuWkBaWmF5TUNwuUo9Uw= +github.com/nats-io/nats-server/v2 v2.9.6/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= +github.com/nats-io/nats.go v1.19.1 h1:pDQZthDfxRMSJ0ereExAM9ODf3JyS42Exk7iCMdbpec= +github.com/nats-io/nats.go v1.19.1/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -268,9 +268,9 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= -github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= -github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= +github.com/onsi/ginkgo/v2 v2.5.0 h1:TRtrvv2vdQqzkwrQ1ke6vtXf7IK34RBUJafIy1wMwls= +github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E= +github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -317,8 +317,9 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= +go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= @@ -405,8 +406,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -485,11 +486,11 @@ golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -748,8 +749,8 @@ k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/controller-runtime v0.13.0 h1:iqa5RNciy7ADWnIc8QxCbOX5FEKVR3uxVxKHRMc2WIQ= -sigs.k8s.io/controller-runtime v0.13.0/go.mod h1:Zbz+el8Yg31jubvAEyglRZGdLAjplZl+PgtYNI6WNTI= +sigs.k8s.io/controller-runtime v0.13.1 h1:tUsRCSJVM1QQOOeViGeX3GMT3dQF1eePPw6sEE3xSlg= +sigs.k8s.io/controller-runtime v0.13.1/go.mod h1:Zbz+el8Yg31jubvAEyglRZGdLAjplZl+PgtYNI6WNTI= sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= From 4a4ff3391d5b3fe8a7e29f35a5ab7fff4bff38bc Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Thu, 17 Nov 2022 13:30:26 +0100 Subject: [PATCH 124/194] Change http response code based on backend error (#16115) * introduce common errors to allow returning custom http responses * bump image * evaluate API Error returned by nats * fix code review comments --- pkg/handler/handler.go | 15 +++++- pkg/handler/handler_test.go | 63 ++++++++++++++++++++++++++ pkg/sender/jetstream/jetstream.go | 14 ++++-- pkg/sender/jetstream/jetstream_test.go | 53 +++++++++++++++++----- pkg/sender/sender.go | 8 ++++ 5 files changed, 137 insertions(+), 16 deletions(-) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 414d5f2..0cdd91a 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -2,6 +2,7 @@ package handler import ( "context" + "errors" "net/http" "time" @@ -112,7 +113,13 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h result, err := h.sendEventAndRecordMetrics(ctx, event, h.Sender.URL(), request.Header) if err != nil { h.namedLogger().With().Error(err) - h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, http.StatusInternalServerError, event, err.Error()) + httpStatus := http.StatusInternalServerError + if errors.Is(err, sender.ErrInsufficientStorage) { + httpStatus = http.StatusInsufficientStorage + } else if errors.Is(err, sender.ErrBackendTargetNotFound) { + httpStatus = http.StatusBadGateway + } + h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, httpStatus, event, err.Error()) return } h.namedLogger().With().Debug(result) @@ -150,7 +157,11 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R result, err := h.sendEventAndRecordMetrics(ctx, event, h.Sender.URL(), request.Header) if err != nil { - writer.WriteHeader(http.StatusInternalServerError) + httpStatus := http.StatusInternalServerError + if errors.Is(err, sender.ErrInsufficientStorage) { + httpStatus = http.StatusInsufficientStorage + } + writer.WriteHeader(httpStatus) h.namedLogger().With().Error(err) return } diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index 1b37fce..94257dc 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -329,6 +329,25 @@ func TestHandler_publishCloudEvents(t *testing.T) { eventing_epp_errors_total 1 `, }, + { + name: "Publish binary CloudEvent but backend is full", + fields: fields{ + Sender: &GenericSenderStub{ + Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrInsufficientStorage), + }, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidBinaryRequest(t), + }, + wantStatus: 507, + wantTEF: ` + # HELP eventing_epp_errors_total The total number of errors while sending events to the messaging server + # TYPE eventing_epp_errors_total counter + eventing_epp_errors_total 1 + `, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -429,6 +448,50 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { eventing_epp_requests_total{destination_service="FOO",response_code="204"} 1 `, }, + { + name: "Send valid legacy event but cannot send to backend due to target not found (e.g. stream missing)", + fields: fields{ + Sender: &GenericSenderStub{ + Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrBackendTargetNotFound), + BackendURL: "FOO", + }, + LegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", NewApplicationListerOrDie(context.Background(), "testapp")), + collector: metrics.NewCollector(latency), + eventTypeCleaner: eventtypetest.CleanerStub{}, + }, + args: args{ + request: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + }, + wantStatus: http.StatusBadGateway, + wantOk: false, + wantTEF: ` + # HELP eventing_epp_errors_total The total number of errors while sending events to the messaging server + # TYPE eventing_epp_errors_total counter + eventing_epp_errors_total 1 + `, + }, + { + name: "Send valid legacy event but cannot send to backend due to full storage", + fields: fields{ + Sender: &GenericSenderStub{ + Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrInsufficientStorage), + BackendURL: "FOO", + }, + LegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", NewApplicationListerOrDie(context.Background(), "testapp")), + collector: metrics.NewCollector(latency), + eventTypeCleaner: eventtypetest.CleanerStub{}, + }, + args: args{ + request: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + }, + wantStatus: 507, + wantOk: false, + wantTEF: ` + # HELP eventing_epp_errors_total The total number of errors while sending events to the messaging server + # TYPE eventing_epp_errors_total counter + eventing_epp_errors_total 1 + `, + }, { name: "Send valid legacy event but cannot send to backend", fields: fields{ diff --git a/pkg/sender/jetstream/jetstream.go b/pkg/sender/jetstream/jetstream.go index 1c103e3..1f4aa1c 100644 --- a/pkg/sender/jetstream/jetstream.go +++ b/pkg/sender/jetstream/jetstream.go @@ -23,6 +23,7 @@ import ( ) const ( + JSStoreFailedCode = 10077 natsBackend = "nats" jestreamHandlerName = "jetstream-handler" noSpaceLeftErrMessage = "no space left on device" @@ -81,12 +82,19 @@ func (s *Sender) Send(_ context.Context, event *event.Event) (sender.PublishResu if err != nil { s.namedLogger().Errorw("Cannot send event to backend", "error", err) if errors.Is(err, nats.ErrNoStreamResponse) { - return nil, fmt.Errorf("%w : %v", ErrCannotSendToStream, err) + return nil, fmt.Errorf("%w : %v", sender.ErrBackendTargetNotFound, fmt.Errorf("%w, %v", ErrCannotSendToStream, err)) + } + + var apiErr nats.JetStreamError + if ok := errors.As(err, &apiErr); ok { + if apiErr.APIError().ErrorCode == JSStoreFailedCode { + return nil, fmt.Errorf("%w: %v", sender.ErrInsufficientStorage, err) + } } if strings.Contains(err.Error(), noSpaceLeftErrMessage) { - return nil, err + return nil, fmt.Errorf("%w: %v", sender.ErrInsufficientStorage, err) } - return nil, fmt.Errorf("%w: %v", ErrCannotSendToStream, err) + return nil, fmt.Errorf("%w : %v", sender.ErrInternalBackendError, fmt.Errorf("%w, %v", ErrCannotSendToStream, err)) } return beb.HTTPPublishResult{Status: http.StatusNoContent}, nil } diff --git a/pkg/sender/jetstream/jetstream_test.go b/pkg/sender/jetstream/jetstream_test.go index 712d90f..e8cfe18 100644 --- a/pkg/sender/jetstream/jetstream_test.go +++ b/pkg/sender/jetstream/jetstream_test.go @@ -20,6 +20,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) @@ -27,29 +28,36 @@ func TestJetStreamMessageSender(t *testing.T) { testCases := []struct { name string givenStream bool + givenStreamMaxBytes int64 givenNATSConnectionClosed bool - wantError bool + wantErr error wantStatusCode int }{ { name: "send in jetstream mode should not succeed if stream doesn't exist", givenStream: false, givenNATSConnectionClosed: false, - wantError: true, - wantStatusCode: http.StatusNotFound, + wantErr: sender.ErrBackendTargetNotFound, + }, + { + name: "send in jetstream mode should not succeed if stream is full", + givenStream: true, + givenStreamMaxBytes: 1, + givenNATSConnectionClosed: false, + wantErr: sender.ErrInsufficientStorage, }, { name: "send in jetstream mode should succeed if NATS connection is open and the stream exists", givenStream: true, + givenStreamMaxBytes: 5000, givenNATSConnectionClosed: false, - wantError: false, + wantErr: nil, wantStatusCode: http.StatusNoContent, }, { name: "send in jetstream mode should fail if NATS connection is not open", givenNATSConnectionClosed: true, - wantError: true, - wantStatusCode: http.StatusBadGateway, + wantErr: ErrNotConnected, }, } @@ -66,7 +74,10 @@ func TestJetStreamMessageSender(t *testing.T) { }() if tc.givenStream { - addStream(t, connection, getStreamConfig()) + sc := getStreamConfig(tc.givenStreamMaxBytes) + cc := getConsumerConfig() + addStream(t, connection, sc) + addConsumer(t, connection, sc, cc) } ce := createCloudEvent(t) @@ -84,8 +95,8 @@ func TestJetStreamMessageSender(t *testing.T) { testEnv.Logger.WithContext().Errorf("err: %v", err) // assert - assert.Equal(t, tc.wantError, err != nil) - if !tc.wantError { + assert.ErrorIs(t, err, tc.wantErr) + if tc.wantErr == nil { assert.Equal(t, tc.wantStatusCode, status.HTTPStatus()) } }) @@ -151,12 +162,23 @@ func createCloudEvent(t *testing.T) *event.Event { } // getStreamConfig inits a testing stream config. -func getStreamConfig() *nats.StreamConfig { +func getStreamConfig(maxBytes int64) *nats.StreamConfig { return &nats.StreamConfig{ Name: testingutils.StreamName, Subjects: []string{fmt.Sprintf("%s.>", env.JetStreamSubjectPrefix)}, Storage: nats.MemoryStorage, Retention: nats.InterestPolicy, + Discard: nats.DiscardNew, + MaxBytes: maxBytes, + } +} + +func getConsumerConfig() *nats.ConsumerConfig { + return &nats.ConsumerConfig{ + Durable: "test", + DeliverPolicy: nats.DeliverAllPolicy, + AckPolicy: nats.AckExplicitPolicy, + FilterSubject: fmt.Sprintf("%v.%v", env.JetStreamSubjectPrefix, testingutils.CloudEventTypeWithPrefix), } } @@ -164,7 +186,16 @@ func getStreamConfig() *nats.StreamConfig { func addStream(t *testing.T, connection *nats.Conn, config *nats.StreamConfig) { js, err := connection.JetStream() assert.NoError(t, err) - _, err = js.AddStream(config) + info, err := js.AddStream(config) + t.Logf("%+v", info) + assert.NoError(t, err) +} + +func addConsumer(t *testing.T, connection *nats.Conn, sc *nats.StreamConfig, config *nats.ConsumerConfig) { + js, err := connection.JetStream() + assert.NoError(t, err) + info, err := js.AddConsumer(sc.Name, config) + t.Logf("%+v", info) assert.NoError(t, err) } diff --git a/pkg/sender/sender.go b/pkg/sender/sender.go index 173a2c8..3a86d8a 100644 --- a/pkg/sender/sender.go +++ b/pkg/sender/sender.go @@ -2,10 +2,18 @@ package sender import ( "context" + "errors" "github.com/cloudevents/sdk-go/v2/event" ) +var ( + ErrInsufficientStorage = errors.New("insufficient storage on backend") + ErrBackendTargetNotFound = errors.New("publishing target on backend not found") + ErrNoConnection = errors.New("no connection to backend") + ErrInternalBackendError = errors.New("internal error on backend") +) + type GenericSender interface { Send(context.Context, *event.Event) (PublishResult, error) URL() string From 5e97ed189e9f3409dade71a5dc6985cb592f96ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 09:41:31 +0100 Subject: [PATCH 125/194] gomod(deps): bump k8s.io/client-go from 0.25.3 to 0.25.4 in /components/event-publisher-proxy (#16102) * gomod(deps): bump k8s.io/client-go in /components/event-publisher-proxy Bumps [k8s.io/client-go](https://github.com/kubernetes/client-go) from 0.25.3 to 0.25.4. - [Release notes](https://github.com/kubernetes/client-go/releases) - [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/kubernetes/client-go/compare/v0.25.3...v0.25.4) --- updated-dependencies: - dependency-name: k8s.io/client-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update values.yaml Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 6 +++--- go.sum | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 25b8723..1cd88bc 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( go.uber.org/zap v1.23.0 golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 - k8s.io/api v0.25.3 - k8s.io/apimachinery v0.25.3 - k8s.io/client-go v0.25.3 + k8s.io/api v0.25.4 + k8s.io/apimachinery v0.25.4 + k8s.io/client-go v0.25.4 sigs.k8s.io/controller-runtime v0.13.1 ) diff --git a/go.sum b/go.sum index decbc36..5e19af3 100644 --- a/go.sum +++ b/go.sum @@ -735,8 +735,8 @@ k8s.io/apiextensions-apiserver v0.25.2 h1:8uOQX17RE7XL02ngtnh3TgifY7EhekpK+/piwz k8s.io/apiextensions-apiserver v0.25.2/go.mod h1:iRwwRDlWPfaHhuBfQ0WMa5skdQfrE18QXJaJvIDLvE8= k8s.io/apimachinery v0.25.2 h1:WbxfAjCx+AeN8Ilp9joWnyJ6xu9OMeS/fsfjK/5zaQs= k8s.io/apimachinery v0.25.2/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA= -k8s.io/client-go v0.25.3 h1:oB4Dyl8d6UbfDHD8Bv8evKylzs3BXzzufLiO27xuPs0= -k8s.io/client-go v0.25.3/go.mod h1:t39LPczAIMwycjcXkVc+CB+PZV69jQuNx4um5ORDjQA= +k8s.io/client-go v0.25.4 h1:3RNRDffAkNU56M/a7gUfXaEzdhZlYhoW8dgViGy5fn8= +k8s.io/client-go v0.25.4/go.mod h1:8trHCAC83XKY0wsBIpbirZU4NTUpbuhc2JnI7OruGZw= k8s.io/component-base v0.25.2 h1:Nve/ZyHLUBHz1rqwkjXm/Re6IniNa5k7KgzxZpTfSQY= k8s.io/component-base v0.25.2/go.mod h1:90W21YMr+Yjg7MX+DohmZLzjsBtaxQDDwaX4YxDkl60= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= From 5afeb0579de0d800f268c0a70d418e8d67743776 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 11:01:16 +0100 Subject: [PATCH 126/194] gomod(deps): bump github.com/nats-io/nats.go from 1.19.0 to 1.20.0 in /components/event-publisher-proxy (#16093) * gomod(deps): bump github.com/nats-io/nats.go Bumps [github.com/nats-io/nats.go](https://github.com/nats-io/nats.go) from 1.19.0 to 1.20.0. - [Release notes](https://github.com/nats-io/nats.go/releases) - [Commits](https://github.com/nats-io/nats.go/compare/v1.19.0...v1.20.0) --- updated-dependencies: - dependency-name: github.com/nats-io/nats.go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 1cd88bc..c9841b2 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/kyma-project/kyma/components/application-operator v0.0.0-20221004144139-b69aea381b88 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221004144139-b69aea381b88 github.com/nats-io/nats-server/v2 v2.9.6 - github.com/nats-io/nats.go v1.19.1 + github.com/nats-io/nats.go v1.20.0 github.com/onsi/gomega v1.24.1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.13.0 diff --git a/go.sum b/go.sum index 5e19af3..492e40a 100644 --- a/go.sum +++ b/go.sum @@ -258,8 +258,8 @@ github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.9.6 h1:RTtK+rv/4CcliOuqGsy58g7MuWkBaWmF5TUNwuUo9Uw= github.com/nats-io/nats-server/v2 v2.9.6/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= -github.com/nats-io/nats.go v1.19.1 h1:pDQZthDfxRMSJ0ereExAM9ODf3JyS42Exk7iCMdbpec= -github.com/nats-io/nats.go v1.19.1/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= +github.com/nats-io/nats.go v1.20.0 h1:T8JJnQfVSdh1CzGiwAOv5hEobYCBho/0EupGznYw0oM= +github.com/nats-io/nats.go v1.20.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= From 011d87cc07942bfe48a457eee48e66e77e6d9d76 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Tue, 22 Nov 2022 11:48:34 +0100 Subject: [PATCH 127/194] Bump dependencies `event-publisher-proxy` (#16130) * bump dependencies * bump k8s * bump crypto * remove replace for containerd * remove replace for jwt-go * remove replace for docker * remove replace for docker/docker * bump prometheus/client_golang * bump image --- go.mod | 44 +++++++++++++--------------- go.sum | 90 +++++++++++++++++++++++++++++++++------------------------- 2 files changed, 71 insertions(+), 63 deletions(-) diff --git a/go.mod b/go.mod index c9841b2..e7f822b 100644 --- a/go.mod +++ b/go.mod @@ -7,17 +7,17 @@ require ( github.com/google/uuid v1.3.0 github.com/gorilla/mux v1.8.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20221004144139-b69aea381b88 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221004144139-b69aea381b88 - github.com/nats-io/nats-server/v2 v2.9.6 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221118103320-ffe096ff3455 + github.com/nats-io/nats-server/v2 v2.9.7 github.com/nats-io/nats.go v1.20.0 github.com/onsi/gomega v1.24.1 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.13.0 + github.com/prometheus/client_golang v1.14.0 github.com/stretchr/testify v1.8.1 go.opencensus.io v0.24.0 go.uber.org/zap v1.23.0 - golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 + golang.org/x/oauth2 v0.2.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 k8s.io/api v0.25.4 k8s.io/apimachinery v0.25.4 @@ -51,7 +51,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.15.11 // indirect - github.com/kyma-project/kyma/common/logging v0.0.0-20220903121145-690b76935712 // indirect + github.com/kyma-project/kyma/common/logging v0.0.0-20221018132434-282eeb492ce2 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/minio/highwayhash v1.0.2 // indirect @@ -63,9 +63,9 @@ require ( github.com/nats-io/nkeys v0.3.0 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // 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/client_model v0.3.0 // indirect + github.com/prometheus/common v0.37.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect go.uber.org/atomic v1.10.0 // indirect @@ -78,13 +78,13 @@ require ( golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.28.0 // indirect + google.golang.org/protobuf v1.28.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.25.0 // indirect - k8s.io/component-base v0.25.2 // indirect - k8s.io/klog/v2 v2.70.1 // indirect + k8s.io/component-base v0.25.4 // indirect + k8s.io/klog/v2 v2.80.1 // indirect k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect @@ -94,22 +94,18 @@ require ( replace ( // keep all following packages at the same version - k8s.io/api => k8s.io/api v0.25.2 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.2 - k8s.io/apimachinery => k8s.io/apimachinery v0.25.2 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.2 - k8s.io/component-base => k8s.io/component-base v0.25.2 - k8s.io/kubectl => k8s.io/kubectl v0.25.2 + k8s.io/api => k8s.io/api v0.25.4 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.4 + k8s.io/apimachinery => k8s.io/apimachinery v0.25.4 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.4 + k8s.io/component-base => k8s.io/component-base v0.25.4 + k8s.io/kubectl => k8s.io/kubectl v0.25.4 ) replace ( - github.com/containerd/containerd => github.com/containerd/containerd v1.4.4 - github.com/dgrijalva/jwt-go => github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 // fix CVE-2020-26160 - github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d - github.com/docker/docker => github.com/docker/docker v20.10.3+incompatible github.com/kyma-incubator/api-gateway => github.com/kyma-project/api-gateway v0.0.0-20220819093753-296e6704d413 github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.0-rc93 - github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.12.2 - golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 + github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.14.0 + golang.org/x/crypto => golang.org/x/crypto v0.3.0 k8s.io/utils => k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 ) diff --git a/go.sum b/go.sum index 492e40a..660886d 100644 --- a/go.sum +++ b/go.sum @@ -98,8 +98,8 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -115,7 +115,6 @@ github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -168,6 +167,7 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -210,6 +210,7 @@ github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -229,12 +230,12 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kyma-project/api-gateway v0.0.0-20220819093753-296e6704d413 h1:fkGKNOFbltycpdQ7yCGfa+7MpH9X18F09x+n7Tgfp7A= -github.com/kyma-project/kyma/common/logging v0.0.0-20220903121145-690b76935712 h1:f+GRwlfq/PFnvWcI5MNVOdaefTu88RwYMMigoFVFZDE= -github.com/kyma-project/kyma/common/logging v0.0.0-20220903121145-690b76935712/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20221004144139-b69aea381b88 h1:BCjnfGDRolGbuKcX962OSZJfyEJzqhDb2yQIDdzH2nk= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20221004144139-b69aea381b88/go.mod h1:4jh1Qn1DLbQRdCHqEdHsV4Tk9b6L4i9nhgGdEc2XaIg= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221004144139-b69aea381b88 h1:pehPxhpC28OpnLrWKgLTLv25/UFM8DcTZTBYOBziqok= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221004144139-b69aea381b88/go.mod h1:PfPweLv+tK/gI4dCyfXEd4V8Ebyb2/oXM1cDaYS3Jcg= +github.com/kyma-project/kyma/common/logging v0.0.0-20221018132434-282eeb492ce2 h1:arx/6vjR1R8Bo+GKXb6NPYS8eYRcwCWQPKzrVuFUdG8= +github.com/kyma-project/kyma/common/logging v0.0.0-20221018132434-282eeb492ce2/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 h1:XxhNPU8Z1eknyepGqg21ajEisuTeknKydHiZ6m5Qp3k= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455/go.mod h1:18VKkunC8gEMKAIX3/64rXDq3XNk82CfHQ2G1kZPSQM= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221118103320-ffe096ff3455 h1:yAOCvw1Rnd+KK25SQYm38d0zdi+JIPOvDT1iFgWjSeM= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221118103320-ffe096ff3455/go.mod h1:tENMAIjc7Pj6iueTfg83a2c+8+OSFIXw7LuPb6K3v3s= 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.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= @@ -256,8 +257,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= -github.com/nats-io/nats-server/v2 v2.9.6 h1:RTtK+rv/4CcliOuqGsy58g7MuWkBaWmF5TUNwuUo9Uw= -github.com/nats-io/nats-server/v2 v2.9.6/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= +github.com/nats-io/nats-server/v2 v2.9.7 h1:VBlfq7xvv/72v0mzGZ2rgsDzUoVyX2Xhssl9XpKDue0= +github.com/nats-io/nats-server/v2 v2.9.7/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= github.com/nats-io/nats.go v1.20.0 h1:T8JJnQfVSdh1CzGiwAOv5hEobYCBho/0EupGznYw0oM= github.com/nats-io/nats.go v1.20.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= @@ -276,15 +277,16 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -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_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -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.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= 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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -311,6 +313,7 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -325,15 +328,15 @@ go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= -golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29 h1:tkVvjkPTB7pnW3jnid7kNyAMPVWllTNOf/qKDze4p9o= -golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -369,6 +372,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -404,8 +408,9 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -423,8 +428,9 @@ golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.2.0 h1:GtQkldQ9m7yvzCL1V+LrYow3Khe0eJH0w7RbX/VbaIU= +golang.org/x/oauth2 v0.2.0/go.mod h1:Cwn6afJ8jrQwYMxQDTpISoXmXW9I6qF6vDeuuoX3Ibs= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -436,6 +442,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -468,7 +476,6 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -484,11 +491,14 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -499,6 +509,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -560,6 +571,7 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -699,8 +711,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -729,19 +741,19 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.2 h1:v6G8RyFcwf0HR5jQGIAYlvtRNrxMJQG1xJzaSeVnIS8= -k8s.io/api v0.25.2/go.mod h1:qP1Rn4sCVFwx/xIhe+we2cwBLTXNcheRyYXwajonhy0= -k8s.io/apiextensions-apiserver v0.25.2 h1:8uOQX17RE7XL02ngtnh3TgifY7EhekpK+/piwzQNnBo= -k8s.io/apiextensions-apiserver v0.25.2/go.mod h1:iRwwRDlWPfaHhuBfQ0WMa5skdQfrE18QXJaJvIDLvE8= -k8s.io/apimachinery v0.25.2 h1:WbxfAjCx+AeN8Ilp9joWnyJ6xu9OMeS/fsfjK/5zaQs= -k8s.io/apimachinery v0.25.2/go.mod h1:hqqA1X0bsgsxI6dXsJ4HnNTBOmJNxyPp8dw3u2fSHwA= +k8s.io/api v0.25.4 h1:3YO8J4RtmG7elEgaWMb4HgmpS2CfY1QlaOz9nwB+ZSs= +k8s.io/api v0.25.4/go.mod h1:IG2+RzyPQLllQxnhzD8KQNEu4c4YvyDTpSMztf4A0OQ= +k8s.io/apiextensions-apiserver v0.25.4 h1:7hu9pF+xikxQuQZ7/30z/qxIPZc2J1lFElPtr7f+B6U= +k8s.io/apiextensions-apiserver v0.25.4/go.mod h1:bkSGki5YBoZWdn5pWtNIdGvDrrsRWlmnvl9a+tAw5vQ= +k8s.io/apimachinery v0.25.4 h1:CtXsuaitMESSu339tfhVXhQrPET+EiWnIY1rcurKnAc= +k8s.io/apimachinery v0.25.4/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqwo= k8s.io/client-go v0.25.4 h1:3RNRDffAkNU56M/a7gUfXaEzdhZlYhoW8dgViGy5fn8= k8s.io/client-go v0.25.4/go.mod h1:8trHCAC83XKY0wsBIpbirZU4NTUpbuhc2JnI7OruGZw= -k8s.io/component-base v0.25.2 h1:Nve/ZyHLUBHz1rqwkjXm/Re6IniNa5k7KgzxZpTfSQY= -k8s.io/component-base v0.25.2/go.mod h1:90W21YMr+Yjg7MX+DohmZLzjsBtaxQDDwaX4YxDkl60= +k8s.io/component-base v0.25.4 h1:n1bjg9Yt+G1C0WnIDJmg2fo6wbEU1UGMRiQSjmj7hNQ= +k8s.io/component-base v0.25.4/go.mod h1:nnZJU8OP13PJEm6/p5V2ztgX2oyteIaAGKGMYb2L2cY= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.70.1 h1:7aaoSdahviPmR+XkS7FyxlkkXs6tHISSG03RxleQAVQ= -k8s.io/klog/v2 v2.70.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= +k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= From d48223fa1164d5408a77984af4302d4088de15ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 15:06:46 +0100 Subject: [PATCH 128/194] gomod(deps): bump github.com/nats-io/nats-server/v2 from 2.9.7 to 2.9.8 in /components/event-publisher-proxy (#16159) * gomod(deps): bump github.com/nats-io/nats-server/v2 Bumps [github.com/nats-io/nats-server/v2](https://github.com/nats-io/nats-server) from 2.9.7 to 2.9.8. - [Release notes](https://github.com/nats-io/nats-server/releases) - [Changelog](https://github.com/nats-io/nats-server/blob/main/.goreleaser.yml) - [Commits](https://github.com/nats-io/nats-server/compare/v2.9.7...v2.9.8) --- updated-dependencies: - dependency-name: github.com/nats-io/nats-server/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * bump image Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e7f822b..9d72647 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221118103320-ffe096ff3455 - github.com/nats-io/nats-server/v2 v2.9.7 + github.com/nats-io/nats-server/v2 v2.9.8 github.com/nats-io/nats.go v1.20.0 github.com/onsi/gomega v1.24.1 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 660886d..0335207 100644 --- a/go.sum +++ b/go.sum @@ -257,8 +257,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= -github.com/nats-io/nats-server/v2 v2.9.7 h1:VBlfq7xvv/72v0mzGZ2rgsDzUoVyX2Xhssl9XpKDue0= -github.com/nats-io/nats-server/v2 v2.9.7/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= +github.com/nats-io/nats-server/v2 v2.9.8 h1:jgxZsv+A3Reb3MgwxaINcNq/za8xZInKhDg9Q0cGN1o= +github.com/nats-io/nats-server/v2 v2.9.8/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= github.com/nats-io/nats.go v1.20.0 h1:T8JJnQfVSdh1CzGiwAOv5hEobYCBho/0EupGznYw0oM= github.com/nats-io/nats.go v1.20.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= From 473b9ec9cb14e1ed740ab338f82bf986516ff999 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Dec 2022 14:45:27 +0100 Subject: [PATCH 129/194] gomod(deps): bump go.uber.org/zap from 1.23.0 to 1.24.0 in /components/event-publisher-proxy (#16236) * gomod(deps): bump go.uber.org/zap in /components/event-publisher-proxy Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.23.0 to 1.24.0. - [Release notes](https://github.com/uber-go/zap/releases) - [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/zap/compare/v1.23.0...v1.24.0) --- updated-dependencies: - dependency-name: go.uber.org/zap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9d72647..b6bb7cd 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/prometheus/client_golang v1.14.0 github.com/stretchr/testify v1.8.1 go.opencensus.io v0.24.0 - go.uber.org/zap v1.23.0 + go.uber.org/zap v1.24.0 golang.org/x/oauth2 v0.2.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 k8s.io/api v0.25.4 diff --git a/go.sum b/go.sum index 0335207..da0aef3 100644 --- a/go.sum +++ b/go.sum @@ -333,8 +333,8 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= -go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A= golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= From f9bcfa966adf97e61655141015026e0d4dc38334 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Fri, 2 Dec 2022 11:57:22 +0100 Subject: [PATCH 130/194] change loglevel from debug to error for invalid legacyEvent (#16243) --- pkg/handler/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 0cdd91a..4d03e1a 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -105,7 +105,7 @@ func (h *Handler) maxBytes(f http.HandlerFunc) http.HandlerFunc { func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { event, _ := h.LegacyTransformer.TransformLegacyRequestsToCE(writer, request) if event == nil { - h.namedLogger().Debug("Failed to transform legacy event to CloudEvent, event is nil") + h.namedLogger().Error("Failed to transform legacy event to CloudEvent, event is nil") return } ctx := request.Context() From 3712b79c04eff7835d0b1873bf6769c3c29a0a92 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Sat, 3 Dec 2022 19:57:15 +0100 Subject: [PATCH 131/194] add component name to nats connection (#16176) * add component name to nats connection * bump image * add name for v1 controller Co-authored-by: Friedrich --- pkg/commander/nats/nats.go | 1 + pkg/nats/connect.go | 1 + 2 files changed, 2 insertions(+) diff --git a/pkg/commander/nats/nats.go b/pkg/commander/nats/nats.go index daf135f..6507b81 100644 --- a/pkg/commander/nats/nats.go +++ b/pkg/commander/nats/nats.go @@ -76,6 +76,7 @@ func (c *Commander) Start() error { pkgnats.WithRetryOnFailedConnect(c.envCfg.RetryOnFailedConnect), pkgnats.WithMaxReconnects(c.envCfg.MaxReconnects), pkgnats.WithReconnectWait(c.envCfg.ReconnectWait), + pkgnats.WithName("Kyma Publisher"), ) if err != nil { return xerrors.Errorf("failed to connect to backend server for %s : %v", natsCommanderName, err) diff --git a/pkg/nats/connect.go b/pkg/nats/connect.go index 66dab58..a2dc3fe 100644 --- a/pkg/nats/connect.go +++ b/pkg/nats/connect.go @@ -12,6 +12,7 @@ var ( WithRetryOnFailedConnect = nats.RetryOnFailedConnect WithMaxReconnects = nats.MaxReconnects WithReconnectWait = nats.ReconnectWait + WithName = nats.Name ) // Connect returns a NATS connection that is ready for use, or an error if connection to the NATS server failed. From 32c88d5b19cbf1a2b9f599946d6c1540ded69d42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Dec 2022 11:28:24 +0100 Subject: [PATCH 132/194] gomod(deps): bump github.com/nats-io/nats.go from 1.20.0 to 1.21.0 in /components/event-publisher-proxy (#16269) * gomod(deps): bump github.com/nats-io/nats.go Bumps [github.com/nats-io/nats.go](https://github.com/nats-io/nats.go) from 1.20.0 to 1.21.0. - [Release notes](https://github.com/nats-io/nats.go/releases) - [Commits](https://github.com/nats-io/nats.go/compare/v1.20.0...v1.21.0) --- updated-dependencies: - dependency-name: github.com/nats-io/nats.go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b6bb7cd..0640db2 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221118103320-ffe096ff3455 github.com/nats-io/nats-server/v2 v2.9.8 - github.com/nats-io/nats.go v1.20.0 + github.com/nats-io/nats.go v1.21.0 github.com/onsi/gomega v1.24.1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 diff --git a/go.sum b/go.sum index da0aef3..31b3c4e 100644 --- a/go.sum +++ b/go.sum @@ -259,8 +259,8 @@ github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.9.8 h1:jgxZsv+A3Reb3MgwxaINcNq/za8xZInKhDg9Q0cGN1o= github.com/nats-io/nats-server/v2 v2.9.8/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= -github.com/nats-io/nats.go v1.20.0 h1:T8JJnQfVSdh1CzGiwAOv5hEobYCBho/0EupGznYw0oM= -github.com/nats-io/nats.go v1.20.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= +github.com/nats-io/nats.go v1.21.0 h1:kQiWyQMMMIPjDR7NanrLhTnRUxWgU04yrzmYdq9JxCU= +github.com/nats-io/nats.go v1.21.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= From 73dca7eacb6865fc7d8e0d8b8e72a6395688e8c6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Dec 2022 08:44:25 +0100 Subject: [PATCH 133/194] gomod(deps): bump golang.org/x/oauth2 from 0.2.0 to 0.3.0 in /components/event-publisher-proxy (#16280) * gomod(deps): bump golang.org/x/oauth2 Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.2.0 to 0.3.0. - [Release notes](https://github.com/golang/oauth2/releases) - [Commits](https://github.com/golang/oauth2/compare/v0.2.0...v0.3.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 10 +++++----- go.sum | 16 ++++++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 0640db2..bde9619 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/stretchr/testify v1.8.1 go.opencensus.io v0.24.0 go.uber.org/zap v1.24.0 - golang.org/x/oauth2 v0.2.0 + golang.org/x/oauth2 v0.3.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 k8s.io/api v0.25.4 k8s.io/apimachinery v0.25.4 @@ -71,10 +71,10 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect - golang.org/x/net v0.2.0 // indirect - golang.org/x/sys v0.2.0 // indirect - golang.org/x/term v0.2.0 // indirect - golang.org/x/text v0.4.0 // indirect + golang.org/x/net v0.3.0 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/term v0.3.0 // indirect + golang.org/x/text v0.5.0 // indirect golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 31b3c4e..bcb75d6 100644 --- a/go.sum +++ b/go.sum @@ -411,8 +411,9 @@ golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.3.0 h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk= +golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -429,8 +430,8 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.2.0 h1:GtQkldQ9m7yvzCL1V+LrYow3Khe0eJH0w7RbX/VbaIU= -golang.org/x/oauth2 v0.2.0/go.mod h1:Cwn6afJ8jrQwYMxQDTpISoXmXW9I6qF6vDeuuoX3Ibs= +golang.org/x/oauth2 v0.3.0 h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8= +golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -495,12 +496,14 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -510,8 +513,9 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= +golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From d4f484ba0a92916ea5792796a9a37c83d85ffa39 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Fri, 9 Dec 2022 16:37:27 +0100 Subject: [PATCH 134/194] bump image to golang1.19.4-alpine3.17 in ec and epp (#16308) * bump dep * bump image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5af3833..59799c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.19.3-alpine3.16 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.19.4-alpine3.17 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From 8df094aa8c950ba52db5ebfd78374930f2cbbcb8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 11 Dec 2022 03:13:12 +0100 Subject: [PATCH 135/194] gomod(deps): bump github.com/nats-io/nats-server/v2 from 2.9.8 to 2.9.9 in /components/event-publisher-proxy (#16314) * gomod(deps): bump github.com/nats-io/nats-server/v2 Bumps [github.com/nats-io/nats-server/v2](https://github.com/nats-io/nats-server) from 2.9.8 to 2.9.9. - [Release notes](https://github.com/nats-io/nats-server/releases) - [Changelog](https://github.com/nats-io/nats-server/blob/main/.goreleaser.yml) - [Commits](https://github.com/nats-io/nats-server/compare/v2.9.8...v2.9.9) --- updated-dependencies: - dependency-name: github.com/nats-io/nats-server/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update values.yaml Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index bde9619..38db951 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221118103320-ffe096ff3455 - github.com/nats-io/nats-server/v2 v2.9.8 + github.com/nats-io/nats-server/v2 v2.9.9 github.com/nats-io/nats.go v1.21.0 github.com/onsi/gomega v1.24.1 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index bcb75d6..5986fed 100644 --- a/go.sum +++ b/go.sum @@ -257,8 +257,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= -github.com/nats-io/nats-server/v2 v2.9.8 h1:jgxZsv+A3Reb3MgwxaINcNq/za8xZInKhDg9Q0cGN1o= -github.com/nats-io/nats-server/v2 v2.9.8/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= +github.com/nats-io/nats-server/v2 v2.9.9 h1:bmj0RhvHOc8+z5/RuhI38GqPwtkFAHQuU3e99FVA/TI= +github.com/nats-io/nats-server/v2 v2.9.9/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= github.com/nats-io/nats.go v1.21.0 h1:kQiWyQMMMIPjDR7NanrLhTnRUxWgU04yrzmYdq9JxCU= github.com/nats-io/nats.go v1.21.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= From d29cb8affaaaedefcfb2e9af7fa373f12107bd25 Mon Sep 17 00:00:00 2001 From: Mansur Uralov Date: Tue, 13 Dec 2022 10:45:00 +0100 Subject: [PATCH 136/194] Adapt subscribed api (#16275) * Adapt /subscribed API for v1alpha2 * Update /subscribed API for v1alpha2 subscription CRD version * Write Unit tests for the new implementaion * Write /subscribed API for v1alpha2 newly * Write /subscribed API for v1alpha2 newly * Adapt the unit tests accordingly * Update Changes according to code review * Add New CRD Flag for EPP in EC * Update EC and EPP Version to PR Number * Improve according to Review Comments * Improve documentations * Improve New CRD Distinction * BEB should also able to distinct new crd * Use new crd flag for DynamicSharedInformerFactory --- cmd/event-publisher-proxy/main.go | 5 +- pkg/commander/beb/beb.go | 10 ++- pkg/commander/nats/nats.go | 10 ++- pkg/handler/handler.go | 10 ++- pkg/options/options.go | 44 +++++++-- pkg/subscribed/helpers.go | 71 +++++++++++++-- pkg/subscribed/helpers_test.go | 145 +++++++++++++++++++++++++++++- pkg/subscribed/processor.go | 44 +++++++-- 8 files changed, 311 insertions(+), 28 deletions(-) diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index fd16114..03365e9 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -32,7 +32,10 @@ type Config struct { } func main() { - opts := options.ParseArgs() + opts := options.New() + if err := opts.Parse(); err != nil { + golog.Fatalf("Failed to parse options, error: %v", err) + } // parse the config for main: cfg := new(Config) diff --git a/pkg/commander/beb/beb.go b/pkg/commander/beb/beb.go index 9141c1b..a847aac 100644 --- a/pkg/commander/beb/beb.go +++ b/pkg/commander/beb/beb.go @@ -2,6 +2,7 @@ package beb import ( "context" + "k8s.io/client-go/tools/cache" "github.com/kelseyhightower/envconfig" "golang.org/x/xerrors" @@ -93,8 +94,13 @@ func (c *Commander) Start() error { ) // Configure Subscription Lister - subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig) - subLister := subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() + subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig, c.opts.EnableNewCRDVersion) + var subLister cache.GenericLister + if c.opts.EnableNewCRDVersion { + subLister = subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() + } else { + subLister = subDynamicSharedInfFactory.ForResource(subscribed.GVRV1alpha1).Lister() + } subscribedProcessor := &subscribed.Processor{ SubscriptionLister: &subLister, Prefix: c.envCfg.EventTypePrefix, diff --git a/pkg/commander/nats/nats.go b/pkg/commander/nats/nats.go index 6507b81..8d96f9c 100644 --- a/pkg/commander/nats/nats.go +++ b/pkg/commander/nats/nats.go @@ -2,6 +2,7 @@ package nats import ( "context" + "k8s.io/client-go/tools/cache" "github.com/kelseyhightower/envconfig" "golang.org/x/xerrors" @@ -101,8 +102,13 @@ func (c *Commander) Start() error { ) // configure Subscription Lister - subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig) - subLister := subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() + subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig, c.opts.EnableNewCRDVersion) + var subLister cache.GenericLister + if c.opts.EnableNewCRDVersion { + subLister = subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() + } else { + subLister = subDynamicSharedInfFactory.ForResource(subscribed.GVRV1alpha1).Lister() + } subscribedProcessor := &subscribed.Processor{ SubscriptionLister: &subLister, Prefix: c.envCfg.ToConfig().EventTypePrefix, diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 4d03e1a..9837fb9 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -80,7 +80,15 @@ func (h *Handler) setupMux() { router := mux.NewRouter() router.HandleFunc(PublishEndpoint, h.maxBytes(h.publishCloudEvents)).Methods(http.MethodPost) router.HandleFunc(LegacyEndpointPattern, h.maxBytes(h.publishLegacyEventsAsCE)).Methods(http.MethodPost) - router.HandleFunc(SubscribedEndpointPattern, h.maxBytes(h.SubscribedProcessor.ExtractEventsFromSubscriptions)).Methods(http.MethodGet) + if h.Options.EnableNewCRDVersion { + router.HandleFunc( + SubscribedEndpointPattern, + h.maxBytes(h.SubscribedProcessor.ExtractEventsFromSubscriptions)).Methods(http.MethodGet) + } else { + router.HandleFunc( + SubscribedEndpointPattern, + h.maxBytes(h.SubscribedProcessor.ExtractEventsFromSubscriptionsV1alpha1)).Methods(http.MethodGet) + } router.HandleFunc(health.ReadinessURI, h.maxBytes(h.HealthChecker.ReadinessCheck)) router.HandleFunc(health.LivenessURI, h.maxBytes(h.HealthChecker.LivenessCheck)) h.router = router diff --git a/pkg/options/options.go b/pkg/options/options.go index d43b8b8..2ce8425 100644 --- a/pkg/options/options.go +++ b/pkg/options/options.go @@ -1,20 +1,50 @@ package options -import "flag" +import ( + "flag" + "fmt" + + "github.com/kelseyhightower/envconfig" +) + +const ( + // All the available arguments. + argMaxRequestSize = "max-request-size" + argMetricsAddress = "metrics-addr" + // All the available environment variables. + envEnableNewCRDVersion = "ENABLE_NEW_CRD_VERSION" +) type Options struct { MaxRequestSize int64 MetricsAddress string + Env } -func ParseArgs() *Options { - maxRequestSize := flag.Int64("max-request-size", 65536, "The maximum request size in bytes.") - metricsAddress := flag.String("metrics-addr", ":9090", "The address the metric endpoint binds to.") +// Env represents the controller environment variables. +type Env struct { + EnableNewCRDVersion bool `envconfig:"ENABLE_NEW_CRD_VERSION" default:"false"` +} +func New() *Options { + return &Options{} +} + +func (o *Options) Parse() error { + flag.Int64Var(&o.MaxRequestSize, argMaxRequestSize, 65536, "The maximum request size in bytes.") + flag.StringVar(&o.MetricsAddress, argMetricsAddress, ":9090", "The address the metric endpoint binds to.") flag.Parse() - return &Options{ - MaxRequestSize: *maxRequestSize, - MetricsAddress: *metricsAddress, + if err := envconfig.Process("", &o.Env); err != nil { + return err } + return nil +} + +func (o Options) String() string { + return fmt.Sprintf("--%s=%v --%s=%v %s=%v", + argMaxRequestSize, o.MaxRequestSize, + argMetricsAddress, o.MetricsAddress, + envEnableNewCRDVersion, o.EnableNewCRDVersion, + ) } diff --git a/pkg/subscribed/helpers.go b/pkg/subscribed/helpers.go index ad31c30..91c7645 100644 --- a/pkg/subscribed/helpers.go +++ b/pkg/subscribed/helpers.go @@ -4,6 +4,8 @@ import ( "fmt" "strings" + eventingv1alpha2 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha2" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" @@ -19,14 +21,20 @@ import ( var ( GVR = schema.GroupVersionResource{ + Version: eventingv1alpha2.GroupVersion.Version, + Group: eventingv1alpha2.GroupVersion.Group, + Resource: "subscriptions", + } + GVRV1alpha1 = schema.GroupVersionResource{ Version: eventingv1alpha1.GroupVersion.Version, Group: eventingv1alpha1.GroupVersion.Group, Resource: "subscriptions", } ) -// ConvertRuntimeObjToSubscription converts a runtime.Object to a Subscription object by converting to unstructured in between -func ConvertRuntimeObjToSubscription(sObj runtime.Object) (*eventingv1alpha1.Subscription, error) { +// ConvertRuntimeObjToSubscriptionV1alpha1 converts a runtime.Object to a v1alpha1 version of Subscription object +// by converting to unstructured in between +func ConvertRuntimeObjToSubscriptionV1alpha1(sObj runtime.Object) (*eventingv1alpha1.Subscription, error) { sub := &eventingv1alpha1.Subscription{} if subUnstructured, ok := sObj.(*unstructured.Unstructured); ok { err := runtime.DefaultUnstructuredConverter.FromUnstructured(subUnstructured.Object, sub) @@ -37,15 +45,31 @@ func ConvertRuntimeObjToSubscription(sObj runtime.Object) (*eventingv1alpha1.Sub return sub, nil } +// ConvertRuntimeObjToSubscription converts a runtime.Object to a Subscription object by converting to unstructured in between +func ConvertRuntimeObjToSubscription(sObj runtime.Object) (*eventingv1alpha2.Subscription, error) { + sub := &eventingv1alpha2.Subscription{} + if subUnstructured, ok := sObj.(*unstructured.Unstructured); ok { + err := runtime.DefaultUnstructuredConverter.FromUnstructured(subUnstructured.Object, sub) + if err != nil { + return nil, err + } + } + return sub, nil +} + // GenerateSubscriptionInfFactory generates DynamicSharedInformerFactory for Subscription -func GenerateSubscriptionInfFactory(k8sConfig *rest.Config) dynamicinformer.DynamicSharedInformerFactory { +func GenerateSubscriptionInfFactory(k8sConfig *rest.Config, enableNewCrd bool) dynamicinformer.DynamicSharedInformerFactory { subDynamicClient := dynamic.NewForConfigOrDie(k8sConfig) dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(subDynamicClient, informers.DefaultResyncPeriod, v1.NamespaceAll, nil, ) - dFilteredSharedInfFactory.ForResource(GVR) + if enableNewCrd { + dFilteredSharedInfFactory.ForResource(GVR) + } else { + dFilteredSharedInfFactory.ForResource(GVRV1alpha1) + } return dFilteredSharedInfFactory } @@ -72,10 +96,47 @@ func AddUniqueEventsToResult(eventsSubSet []Event, uniqEvents map[Event]bool) ma } // FilterEventTypeVersions returns a slice of Events: +// if the event source matches the appName for typeMatching standard +// if the . is present in the eventType for typeMatching exact +func FilterEventTypeVersions(eventTypePrefix, appName string, subscription *eventingv1alpha2.Subscription) []Event { + events := make([]Event, 0) + prefixAndAppName := fmt.Sprintf("%s.%s.", eventTypePrefix, appName) + + for _, eventType := range subscription.Spec.Types { + if subscription.Spec.TypeMatching == eventingv1alpha2.TypeMatchingExact { + // in case of type matching exact, we have app name as a part of event type + if strings.HasPrefix(eventType, prefixAndAppName) { + eventTypeVersion := strings.ReplaceAll(eventType, prefixAndAppName, "") + event := buildEvent(eventTypeVersion) + events = append(events, event) + } + } else { + // in case of type matching standard, the source must be app name + if appName == subscription.Spec.Source { + event := buildEvent(eventType) + events = append(events, event) + } + } + } + return events +} + +// it receives event and type version, e.g. order.created.v1 and returns {Name: order.created, Version: v1} +func buildEvent(eventTypeAndVersion string) Event { + lastDotIndex := strings.LastIndex(eventTypeAndVersion, ".") + eventName := eventTypeAndVersion[:lastDotIndex] + eventVersion := eventTypeAndVersion[lastDotIndex+1:] + return Event{ + Name: eventName, + Version: eventVersion, + } +} + +// FilterEventTypeVersionsV1alpha1 returns a slice of Events for v1alpha1 version of Subscription resource: // 1. if the eventType matches the format: .. // E.g. sap.kyma.custom.varkes.order.created.v0 // 2. if the eventSource matches BEBNamespace name -func FilterEventTypeVersions(eventTypePrefix, bebNs, appName string, filters *eventingv1alpha1.BEBFilters) []Event { +func FilterEventTypeVersionsV1alpha1(eventTypePrefix, bebNs, appName string, filters *eventingv1alpha1.BEBFilters) []Event { events := make([]Event, 0) if filters == nil { return events diff --git a/pkg/subscribed/helpers_test.go b/pkg/subscribed/helpers_test.go index f9c80af..56497c2 100644 --- a/pkg/subscribed/helpers_test.go +++ b/pkg/subscribed/helpers_test.go @@ -4,10 +4,153 @@ import ( "reflect" "testing" + eventingv1alpha2 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha2" + eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) func TestFilterEventTypeVersions(t *testing.T) { + testCases := []struct { + name string + appName string + subscription *eventingv1alpha2.Subscription + expectedEvents []Event + }{ + { + name: "should return no events when there is no subscription", + appName: "fooapp", + subscription: &eventingv1alpha2.Subscription{}, + expectedEvents: make([]Event, 0), + }, { + name: "should return a slice of events when eventTypes are provided", + appName: "foovarkes", + subscription: &eventingv1alpha2.Subscription{ + Spec: eventingv1alpha2.SubscriptionSpec{ + Source: "foovarkes", + Types: []string{ + "order.created.v1", + "order.created.v2", + }, + }, + }, + expectedEvents: []Event{ + NewEvent("order.created", "v1"), + NewEvent("order.created", "v2"), + }, + }, { + name: "should return no event if app name is different than subscription source", + appName: "foovarkes", + subscription: &eventingv1alpha2.Subscription{ + Spec: eventingv1alpha2.SubscriptionSpec{ + Source: "diff-source", + Types: []string{ + "order.created.v1", + "order.created.v2", + }, + }, + }, + expectedEvents: []Event{}, + }, { + name: "should return event types if event type consists of eventType and appName for typeMaching exact", + appName: "foovarkes", + subscription: &eventingv1alpha2.Subscription{ + Spec: eventingv1alpha2.SubscriptionSpec{ + Source: "/default/sap.kyma/tunas-develop", + TypeMatching: eventingv1alpha2.TypeMatchingExact, + Types: []string{ + "sap.kyma.custom.foovarkes.order.created.v1", + "sap.kyma.custom.foovarkes.order.created.v2", + }, + }, + }, + expectedEvents: []Event{ + NewEvent("order.created", "v1"), + NewEvent("order.created", "v2"), + }, + }, { + name: "should return no event if app name is not part of external event types", + appName: "foovarkes", + subscription: &eventingv1alpha2.Subscription{ + Spec: eventingv1alpha2.SubscriptionSpec{ + Source: "/default/sap.kyma/tunas-develop", + TypeMatching: eventingv1alpha2.TypeMatchingExact, + Types: []string{ + "sap.kyma.custom.difffoovarkes.order.created.v1", + "sap.kyma.custom.difffoovarkes.order.created.v2", + }, + }, + }, + expectedEvents: []Event{}, + }, { + name: "should return event type only with 'sap.kyma.custom' prefix and appname", + appName: "foovarkes", + subscription: &eventingv1alpha2.Subscription{ + Spec: eventingv1alpha2.SubscriptionSpec{ + Source: "/default/sap.kyma/tunas-develop", + TypeMatching: eventingv1alpha2.TypeMatchingExact, + Types: []string{ + "foo.prefix.custom.foovarkes.order.created.v1", + "sap.kyma.custom.foovarkes.order.created.v2", + "sap.kyma.custom.diffvarkes.order.created.v2", + }, + }, + }, + expectedEvents: []Event{ + NewEvent("order.created", "v2"), + }, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + gotEvents := FilterEventTypeVersions("sap.kyma.custom", tc.appName, tc.subscription) + if !reflect.DeepEqual(tc.expectedEvents, gotEvents) { + t.Errorf("Received incorrect events, Wanted: %v, Got: %v", tc.expectedEvents, gotEvents) + } + }) + } +} + +func TestBuildEventType(t *testing.T) { + testCases := []struct { + name string + appName string + want Event + }{ + { + name: "should return no events when there is no subscription", + appName: "order.created.v1", + want: Event{ + Name: "order.created", + Version: "v1", + }, + }, { + name: "should return a slice of events when eventTypes are provided", + appName: "product.order.created.v1", + want: Event{ + Name: "product.order.created", + Version: "v1", + }, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + event := buildEvent(tc.appName) + if !reflect.DeepEqual(tc.want, event) { + t.Errorf("Received incorrect events, Wanted: %v, Got: %v", tc.want, event) + } + }) + } +} + +func TestFilterEventTypeVersionsV1alpha1(t *testing.T) { testCases := []struct { name string appName string @@ -78,7 +221,7 @@ func TestFilterEventTypeVersions(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() - gotEvents := FilterEventTypeVersions(tc.eventTypePrefix, tc.bebNs, tc.appName, tc.filters) + gotEvents := FilterEventTypeVersionsV1alpha1(tc.eventTypePrefix, tc.bebNs, tc.appName, tc.filters) if !reflect.DeepEqual(tc.expectedEvents, gotEvents) { t.Errorf("Received incorrect events, Wanted: %v, Got: %v", tc.expectedEvents, gotEvents) } diff --git a/pkg/subscribed/processor.go b/pkg/subscribed/processor.go index 7593965..7561558 100644 --- a/pkg/subscribed/processor.go +++ b/pkg/subscribed/processor.go @@ -21,7 +21,11 @@ type Processor struct { Logger *logger.Logger } -func (p Processor) ExtractEventsFromSubscriptions(writer http.ResponseWriter, request *http.Request) { +func (p Processor) extractEventsFromSubscriptions( + writer http.ResponseWriter, + request *http.Request, + enableNewCRDVersion bool, +) { eventsMap := make(map[Event]bool) subsList, err := (*p.SubscriptionLister).List(labels.Everything()) if err != nil { @@ -32,14 +36,28 @@ func (p Processor) ExtractEventsFromSubscriptions(writer http.ResponseWriter, re appName := legacy.ParseApplicationNameFromPath(request.URL.Path) for _, sObj := range subsList { - sub, err := ConvertRuntimeObjToSubscription(sObj) - if err != nil { - p.namedLogger().Errorw("Failed to convert a runtime obj to a Subscription", "error", err) - continue - } - if sub.Spec.Filter != nil { - eventsForSub := FilterEventTypeVersions(p.Prefix, p.Namespace, appName, sub.Spec.Filter) - eventsMap = AddUniqueEventsToResult(eventsForSub, eventsMap) + if enableNewCRDVersion { + sub, err := ConvertRuntimeObjToSubscription(sObj) + + if err != nil { + p.namedLogger().Errorw("Failed to convert a runtime obj to a Subscription", "error", err) + continue + } + if sub.Spec.Types != nil { + eventsForSub := FilterEventTypeVersions(p.Prefix, appName, sub) + eventsMap = AddUniqueEventsToResult(eventsForSub, eventsMap) + } + } else { + sub, err := ConvertRuntimeObjToSubscriptionV1alpha1(sObj) + + if err != nil { + p.namedLogger().Errorw("Failed to convert a runtime obj to a Subscription", "error", err) + continue + } + if sub.Spec.Filter != nil { + eventsForSub := FilterEventTypeVersionsV1alpha1(p.Prefix, p.Namespace, appName, sub.Spec.Filter) + eventsMap = AddUniqueEventsToResult(eventsForSub, eventsMap) + } } } events := ConvertEventsMapToSlice(eventsMap) @@ -48,6 +66,14 @@ func (p Processor) ExtractEventsFromSubscriptions(writer http.ResponseWriter, re }, http.StatusOK) } +func (p Processor) ExtractEventsFromSubscriptions(writer http.ResponseWriter, request *http.Request) { + p.extractEventsFromSubscriptions(writer, request, true) +} + +func (p Processor) ExtractEventsFromSubscriptionsV1alpha1(writer http.ResponseWriter, request *http.Request) { + p.extractEventsFromSubscriptions(writer, request, false) +} + func (p Processor) namedLogger() *zap.SugaredLogger { return p.Logger.WithContext().Named(processorName) } From 2492ba3be32b1cc30be85d2b484c09b8eabb6ec7 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Wed, 21 Dec 2022 14:40:59 +0100 Subject: [PATCH 137/194] improve epp metrics (#16298) * rename metrics to the following pattern eventting_epp-- * revert unnecessary changes * revert two missing changes * Update components/event-publisher-proxy/pkg/metrics/collector.go Co-authored-by: Friedrich * change metrics test * Simplify TestNewCollector * Update components/event-publisher-proxy/pkg/handler/handler_test.go Co-authored-by: Nils Seip * fix outdated comment * remove unused parameter * fix review comments * bump image * rename duration histogram to milliseconds Co-authored-by: Friedrich Co-authored-by: Nils Seip Co-authored-by: Nils Seip --- pkg/handler/handler.go | 7 +- pkg/handler/handler_test.go | 199 ++++++++++++------------- pkg/metrics/collector.go | 143 +++++++++++++----- pkg/metrics/collector_test.go | 18 +-- pkg/metrics/metricstest/metricstest.go | 14 +- 5 files changed, 219 insertions(+), 162 deletions(-) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 9837fb9..080ec60 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -78,6 +78,7 @@ func NewHandler(receiver *receiver.HTTPMessageReceiver, sender sender.GenericSen // setupMux configures the request router for all required endpoints. func (h *Handler) setupMux() { router := mux.NewRouter() + router.Use(h.collector.MetricsMiddleware()) router.HandleFunc(PublishEndpoint, h.maxBytes(h.publishCloudEvents)).Methods(http.MethodPost) router.HandleFunc(LegacyEndpointPattern, h.maxBytes(h.publishLegacyEventsAsCE)).Methods(http.MethodPost) if h.Options.EnableNewCRDVersion { @@ -208,12 +209,12 @@ func (h *Handler) sendEventAndRecordMetrics(ctx context.Context, event *cev2even result, err := h.Sender.Send(ctx, event) duration := time.Since(start) if err != nil { - h.collector.RecordError() + h.collector.RecordBackendError() return nil, err } h.collector.RecordEventType(event.Type(), event.Source(), result.HTTPStatus()) - h.collector.RecordLatency(duration, result.HTTPStatus(), host) - h.collector.RecordRequests(result.HTTPStatus(), host) + h.collector.RecordBackendLatency(duration, result.HTTPStatus(), host) + h.collector.RecordBackendRequests(result.HTTPStatus(), host) return result, nil } diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index 94257dc..004d84c 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -201,28 +201,27 @@ func TestHandler_publishCloudEvents(t *testing.T) { }, wantStatus: 204, wantTEF: ` - # HELP epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE epp_event_type_published_total counter - epp_event_type_published_total{event_source="/default/sap.kyma/id",event_type="",response_code="204"} 1 - # HELP eventing_epp_messaging_server_latency_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_messaging_server_latency_duration_milliseconds histogram - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.005"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.01"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.025"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.05"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.1"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.25"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.5"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="1"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="2.5"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="5"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="10"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="+Inf"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_sum{destination_service="FOO",response_code="204"} 0 - eventing_epp_messaging_server_latency_duration_milliseconds_count{destination_service="FOO",response_code="204"} 1 - # HELP eventing_epp_requests_total The total number of event requests - # TYPE eventing_epp_requests_total counter - eventing_epp_requests_total{destination_service="FOO",response_code="204"} 1 + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 `, }, { @@ -244,28 +243,28 @@ func TestHandler_publishCloudEvents(t *testing.T) { }, wantStatus: 204, wantTEF: ` - # HELP epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE epp_event_type_published_total counter - epp_event_type_published_total{event_source="/default/sap.kyma/id",event_type="",response_code="204"} 1 - # HELP eventing_epp_messaging_server_latency_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_messaging_server_latency_duration_milliseconds histogram - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.005"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.01"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.025"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.05"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.1"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.25"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.5"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="1"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="2.5"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="5"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="10"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="+Inf"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_sum{destination_service="FOO",response_code="204"} 0 - eventing_epp_messaging_server_latency_duration_milliseconds_count{destination_service="FOO",response_code="204"} 1 - # HELP eventing_epp_requests_total The total number of event requests - # TYPE eventing_epp_requests_total counter - eventing_epp_requests_total{destination_service="FOO",response_code="204"} 1 + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 + eventing_epp_backend_duration_milliseconds_count{destination_service="FOO",code="204"} 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 `, }, { @@ -324,9 +323,9 @@ func TestHandler_publishCloudEvents(t *testing.T) { }, wantStatus: 500, wantTEF: ` - # HELP eventing_epp_errors_total The total number of errors while sending events to the messaging server - # TYPE eventing_epp_errors_total counter - eventing_epp_errors_total 1 + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 `, }, { @@ -343,9 +342,9 @@ func TestHandler_publishCloudEvents(t *testing.T) { }, wantStatus: 507, wantTEF: ` - # HELP eventing_epp_errors_total The total number of errors while sending events to the messaging server - # TYPE eventing_epp_errors_total counter - eventing_epp_errors_total 1 + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 `, }, } @@ -422,30 +421,30 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { wantStatus: 200, wantOk: true, wantTEF: ` - # HELP epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE epp_event_type_published_total counter - epp_event_type_published_total{event_source="namespace",event_type="im.a.prefix.testapp.object.created.v1",response_code="204"} 1 - - # HELP eventing_epp_messaging_server_latency_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_messaging_server_latency_duration_milliseconds histogram - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.005"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.01"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.025"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.05"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.1"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.25"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="0.5"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="1"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="2.5"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="5"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="10"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="FOO",response_code="204",le="+Inf"} 1 - eventing_epp_messaging_server_latency_duration_milliseconds_sum{destination_service="FOO",response_code="204"} 0 - eventing_epp_messaging_server_latency_duration_milliseconds_count{destination_service="FOO",response_code="204"} 1 - - # HELP eventing_epp_requests_total The total number of event requests - # TYPE eventing_epp_requests_total counter - eventing_epp_requests_total{destination_service="FOO",response_code="204"} 1 + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="namespace",event_type="im.a.prefix.testapp.object.created.v1"} 1 + + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 + eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 + + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 `, }, { @@ -465,9 +464,9 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { wantStatus: http.StatusBadGateway, wantOk: false, wantTEF: ` - # HELP eventing_epp_errors_total The total number of errors while sending events to the messaging server - # TYPE eventing_epp_errors_total counter - eventing_epp_errors_total 1 + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 `, }, { @@ -487,9 +486,9 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { wantStatus: 507, wantOk: false, wantTEF: ` - # HELP eventing_epp_errors_total The total number of errors while sending events to the messaging server - # TYPE eventing_epp_errors_total counter - eventing_epp_errors_total 1 + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 `, }, { @@ -509,9 +508,9 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { wantStatus: 500, wantOk: false, wantTEF: ` - # HELP eventing_epp_errors_total The total number of errors while sending events to the messaging server - # TYPE eventing_epp_errors_total counter - eventing_epp_errors_total 1 + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 `, }, { @@ -691,22 +690,22 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { metricLatency: 1, metricPublished: 1, metricLatencyTEF: ` -# HELP eventing_epp_messaging_server_latency_duration_milliseconds The duration of sending events to the messaging server in milliseconds -# TYPE eventing_epp_messaging_server_latency_duration_milliseconds histogram -eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.005"} 1 -eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.01"} 1 -eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.025"} 1 -eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.05"} 1 -eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.1"} 1 -eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.25"} 1 -eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="0.5"} 1 -eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="1"} 1 -eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="2.5"} 1 -eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="5"} 1 -eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="10"} 1 -eventing_epp_messaging_server_latency_duration_milliseconds_bucket{destination_service="foo",response_code="204",le="+Inf"} 1 -eventing_epp_messaging_server_latency_duration_milliseconds_sum{destination_service="foo",response_code="204"} 0 -eventing_epp_messaging_server_latency_duration_milliseconds_count{destination_service="foo",response_code="204"} 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{code="204",destination_service="foo"} 0 + eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="foo"} 1 `, }, }, @@ -756,7 +755,7 @@ eventing_epp_messaging_server_latency_duration_milliseconds_count{destination_se metricstest.EnsureMetricTotalRequests(t, h.collector, tt.wants.metricTotal) metricstest.EnsureMetricLatency(t, h.collector, tt.wants.metricLatency) metricstest.EnsureMetricEventTypePublished(t, h.collector, tt.wants.metricPublished) - metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wants.metricLatencyTEF, "eventing_epp_messaging_server_latency_duration_milliseconds") + metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wants.metricLatencyTEF, "eventing_epp_backend_duration_milliseconds") }) } } diff --git a/pkg/metrics/collector.go b/pkg/metrics/collector.go index 345cc6e..12dc2e4 100644 --- a/pkg/metrics/collector.go +++ b/pkg/metrics/collector.go @@ -2,32 +2,53 @@ package metrics import ( "fmt" + "net/http" "time" + "github.com/gorilla/mux" "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/histogram" ) const ( - // ErrorsKey name of the errors metric - ErrorsKey = "eventing_epp_errors_total" - // LatencyKey name of the latency metric - LatencyKey = "eventing_epp_messaging_server_latency_duration_milliseconds" + // BackendErrorsKey name of the backendErrors metric + BackendErrorsKey = "eventing_epp_backend_errors_total" + // backendErrorsHelp help text for the backendErrors metric + backendErrorsHelp = "The total number of backend errors while sending events to the messaging server" + + // BackendLatencyKey name of the backendLatencyHelp metric + BackendLatencyKey = "eventing_epp_backend_duration_milliseconds" + // backendLatencyHelp help text for the backendLatencyHelp metric + backendLatencyHelp = "The duration of sending events to the messaging server in milliseconds" + + // BackendRequestsKey name of the eventRequests metric + BackendRequestsKey = "eventing_epp_backend_requests_total" + // backendRequestsHelp help text for event backendRequests metric + backendRequestsHelp = "The total number of backend requests" + + // durationKey name of the duration metric + durationKey = "eventing_epp_requests_duration_milliseconds" + // durationHelp help text for the duration metric + durationHelp = "The duration of processing an incoming request (includes sending to the backend)" + + // RequestsKey name of the Requests metric + RequestsKey = "eventing_epp_requests_total" + // requestsHelp help text for event requests metric + requestsHelp = "The total number of requests" + // EventTypePublishedMetricKey name of the eventTypeLabel metric - EventTypePublishedMetricKey = "epp_event_type_published_total" - // EventRequestsKey name of the eventRequests metric - EventRequestsKey = "eventing_epp_requests_total" - // errorsHelp help text for the errors metric - errorsHelp = "The total number of errors while sending events to the messaging server" - // latencyHelp help text for the latency metric - latencyHelp = "The duration of sending events to the messaging server in milliseconds" + EventTypePublishedMetricKey = "eventing_epp_event_type_published_total" // eventTypePublishedMetricHelp help text for the eventTypeLabel metric eventTypePublishedMetricHelp = "The total number of events published for a given eventTypeLabel" - // eventRequestsHelp help text for event requests metric - eventRequestsHelp = "The total number of event requests" + // methodLabel label for the method used in the http request + + methodLabel = "method" // responseCodeLabel name of the status code labels used by multiple metrics - responseCodeLabel = "response_code" + responseCodeLabel = "code" + // pathLabel name of the path service label + pathLabel = "path" // destSvcLabel name of the destination service label used by multiple metrics destSvcLabel = "destination_service" // eventTypeLabel name of the event type label used by metrics @@ -40,40 +61,53 @@ const ( // for recording epp specific metrics. type PublishingMetricsCollector interface { prometheus.Collector - RecordError() - RecordLatency(duration time.Duration, statusCode int, destSvc string) + RecordBackendError() + RecordBackendLatency(duration time.Duration, statusCode int, destSvc string) RecordEventType(eventType, eventSource string, statusCode int) - RecordRequests(statusCode int, destSvc string) + RecordBackendRequests(statusCode int, destSvc string) + MetricsMiddleware() mux.MiddlewareFunc } var _ PublishingMetricsCollector = &Collector{} // Collector implements the prometheus.Collector interface type Collector struct { - errors *prometheus.CounterVec - latency *prometheus.HistogramVec + backendErrors *prometheus.CounterVec + backendLatency *prometheus.HistogramVec + backendRequests *prometheus.CounterVec + + duration *prometheus.HistogramVec + requests *prometheus.CounterVec + eventType *prometheus.CounterVec - requests *prometheus.CounterVec } // NewCollector a new instance of Collector func NewCollector(latency histogram.BucketsProvider) *Collector { return &Collector{ - errors: prometheus.NewCounterVec( + backendErrors: prometheus.NewCounterVec( prometheus.CounterOpts{ - Name: ErrorsKey, - Help: errorsHelp, + Name: BackendErrorsKey, + Help: backendErrorsHelp, }, []string{}, ), - latency: prometheus.NewHistogramVec( + backendLatency: prometheus.NewHistogramVec( prometheus.HistogramOpts{ - Name: LatencyKey, - Help: latencyHelp, + Name: BackendLatencyKey, + Help: backendLatencyHelp, Buckets: latency.Buckets(), }, []string{responseCodeLabel, destSvcLabel}, ), + backendRequests: prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: BackendRequestsKey, + Help: backendRequestsHelp, + }, + []string{responseCodeLabel, destSvcLabel}, + ), + eventType: prometheus.NewCounterVec( prometheus.CounterOpts{ Name: EventTypePublishedMetricKey, @@ -81,40 +115,52 @@ func NewCollector(latency histogram.BucketsProvider) *Collector { }, []string{eventTypeLabel, eventSourceLabel, responseCodeLabel}, ), + + duration: prometheus.NewHistogramVec( + prometheus.HistogramOpts{ + Name: durationKey, + Help: durationHelp, + Buckets: latency.Buckets(), + }, + []string{responseCodeLabel, methodLabel, pathLabel}, + ), requests: prometheus.NewCounterVec( prometheus.CounterOpts{ - Name: EventRequestsKey, - Help: eventRequestsHelp, + Name: RequestsKey, + Help: requestsHelp, }, - []string{responseCodeLabel, destSvcLabel}, - ), + []string{responseCodeLabel, methodLabel, pathLabel}), } } // Describe implements the prometheus.Collector interface Describe method func (c *Collector) Describe(ch chan<- *prometheus.Desc) { - c.errors.Describe(ch) - c.latency.Describe(ch) + c.backendErrors.Describe(ch) + c.backendLatency.Describe(ch) + c.backendRequests.Describe(ch) c.eventType.Describe(ch) c.requests.Describe(ch) + c.duration.Describe(ch) } // Collect implements the prometheus.Collector interface Collect method func (c *Collector) Collect(ch chan<- prometheus.Metric) { - c.errors.Collect(ch) - c.latency.Collect(ch) + c.backendErrors.Collect(ch) + c.backendLatency.Collect(ch) + c.backendRequests.Collect(ch) c.eventType.Collect(ch) c.requests.Collect(ch) + c.duration.Collect(ch) } // RecordError records an error metric -func (c *Collector) RecordError() { - c.errors.WithLabelValues().Inc() +func (c *Collector) RecordBackendError() { + c.backendErrors.WithLabelValues().Inc() } -// RecordLatency records a latency metric -func (c *Collector) RecordLatency(duration time.Duration, statusCode int, destSvc string) { - c.latency.WithLabelValues(fmt.Sprint(statusCode), destSvc).Observe(float64(duration.Milliseconds())) +// RecordLatency records a backendLatencyHelp metric +func (c *Collector) RecordBackendLatency(duration time.Duration, statusCode int, destSvc string) { + c.backendLatency.WithLabelValues(fmt.Sprint(statusCode), destSvc).Observe(float64(duration.Milliseconds())) } // RecordEventType records an eventType metric @@ -123,6 +169,21 @@ func (c *Collector) RecordEventType(eventType, eventSource string, statusCode in } // RecordRequests records an eventRequests metric -func (c *Collector) RecordRequests(statusCode int, destSvc string) { - c.requests.WithLabelValues(fmt.Sprint(statusCode), destSvc).Inc() +func (c *Collector) RecordBackendRequests(statusCode int, destSvc string) { + c.backendRequests.WithLabelValues(fmt.Sprint(statusCode), destSvc).Inc() +} + +// MetricsMiddleware returns a http.Handler that can be used as middleware in gorilla.mux to track latencies for all handled paths in the gorilla router +func (c *Collector) MetricsMiddleware() mux.MiddlewareFunc { + return func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + route := mux.CurrentRoute(r) + path, _ := route.GetPathTemplate() + promhttp.InstrumentHandlerDuration( + c.duration.MustCurryWith(prometheus.Labels{pathLabel: path}), + promhttp.InstrumentHandlerCounter(c.requests.MustCurryWith(prometheus.Labels{pathLabel: path}), next), + ).ServeHTTP(w, r) + }) + + } } diff --git a/pkg/metrics/collector_test.go b/pkg/metrics/collector_test.go index d8d5504..41393a9 100644 --- a/pkg/metrics/collector_test.go +++ b/pkg/metrics/collector_test.go @@ -10,25 +10,21 @@ import ( func TestNewCollector(t *testing.T) { // given - const bucketsFunc = "Buckets" latency := new(mocks.BucketsProvider) - latency.On(bucketsFunc).Return(nil) - latency.Test(t) + latency.On("Buckets").Return(nil) // when collector := NewCollector(latency) // then assert.NotNil(t, collector) - assert.NotNil(t, collector.errors) - assert.NotNil(t, collector.errors.MetricVec) - assert.NotNil(t, collector.latency) - assert.NotNil(t, collector.latency.MetricVec) + assert.NotNil(t, collector.backendErrors) + assert.NotNil(t, collector.backendErrors.MetricVec) + assert.NotNil(t, collector.backendLatency) + assert.NotNil(t, collector.backendLatency.MetricVec) assert.NotNil(t, collector.eventType) assert.NotNil(t, collector.eventType.MetricVec) - assert.NotNil(t, collector.requests) - assert.NotNil(t, collector.requests.MetricVec) - latency.AssertCalled(t, bucketsFunc) - latency.AssertNumberOfCalls(t, bucketsFunc, 1) + assert.NotNil(t, collector.backendRequests) + assert.NotNil(t, collector.backendRequests.MetricVec) latency.AssertExpectations(t) } diff --git a/pkg/metrics/metricstest/metricstest.go b/pkg/metrics/metricstest/metricstest.go index 49ddb75..e443863 100644 --- a/pkg/metrics/metricstest/metricstest.go +++ b/pkg/metrics/metricstest/metricstest.go @@ -12,24 +12,24 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" ) -// EnsureMetricErrors ensures metric eventing_epp_errors_total exists. +// EnsureMetricErrors ensures metric eventing_epp_backend_errors_total exists. func EnsureMetricErrors(t *testing.T, collector metrics.PublishingMetricsCollector, count int) { - ensureMetricCount(t, collector, metrics.ErrorsKey, count) + ensureMetricCount(t, collector, metrics.BackendErrorsKey, count) } -// EnsureMetricLatency ensures metric eventing_epp_messaging_server_latency_duration_milliseconds exists. +// EnsureMetricLatency ensures metric eventing_epp_backend_duration_seconds exists. func EnsureMetricLatency(t *testing.T, collector metrics.PublishingMetricsCollector, count int) { - ensureMetricCount(t, collector, metrics.LatencyKey, count) + ensureMetricCount(t, collector, metrics.BackendLatencyKey, count) } -// EnsureMetricEventTypePublished ensures metric epp_event_type_published_total exists. +// EnsureMetricEventTypePublished ensures metric eventing_epp_event_type_published_total exists. func EnsureMetricEventTypePublished(t *testing.T, collector metrics.PublishingMetricsCollector, count int) { ensureMetricCount(t, collector, metrics.EventTypePublishedMetricKey, count) } -// EnsureMetricTotalRequests ensures metric eventing_epp_requests_total exists. +// EnsureMetricTotalRequests ensures metric eventing_epp_backend_requests_total exists. func EnsureMetricTotalRequests(t *testing.T, collector metrics.PublishingMetricsCollector, count int) { - ensureMetricCount(t, collector, metrics.EventRequestsKey, count) + ensureMetricCount(t, collector, metrics.BackendRequestsKey, count) } func ensureMetricCount(t *testing.T, collector metrics.PublishingMetricsCollector, metric string, expectedCount int) { From ed516fe364fb7c5cfa63fc4f39239a4facaffd38 Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Fri, 23 Dec 2022 10:17:05 +0100 Subject: [PATCH 138/194] Support publishing cloud-events for Subscritpion v1alpha2 CRD in EPP (#16401) * Support publihsing events for Subscritpion v1alpha2 CRD in EPP * updated tests * updated tests * addressed review comments --- go.mod | 4 +- go.sum | 8 +- pkg/cloudevents/builder/eventmesh.go | 38 +++ pkg/cloudevents/builder/eventmesh_test.go | 135 ++++++++ pkg/cloudevents/builder/generic.go | 84 +++++ pkg/cloudevents/builder/generic_test.go | 224 +++++++++++++ pkg/cloudevents/builder/types.go | 24 ++ pkg/cloudevents/builder/utils.go | 10 + pkg/cloudevents/builder/utils_test.go | 34 ++ pkg/cloudevents/eventtype/parse.go | 13 +- pkg/cloudevents/eventtype/parse_test.go | 27 -- pkg/commander/beb/beb.go | 15 +- pkg/commander/nats/nats.go | 17 +- pkg/env/types.go | 3 + pkg/handler/handler.go | 47 ++- pkg/handler/handler_test.go | 17 +- pkg/handler/handler_v1alpha2_test.go | 369 ++++++++++++++++++++++ pkg/sender/jetstream/jetstream.go | 12 +- pkg/sender/jetstream/jetstream_test.go | 59 +++- 19 files changed, 1074 insertions(+), 66 deletions(-) create mode 100644 pkg/cloudevents/builder/eventmesh.go create mode 100644 pkg/cloudevents/builder/eventmesh_test.go create mode 100644 pkg/cloudevents/builder/generic.go create mode 100644 pkg/cloudevents/builder/generic_test.go create mode 100644 pkg/cloudevents/builder/types.go create mode 100644 pkg/cloudevents/builder/utils.go create mode 100644 pkg/cloudevents/builder/utils_test.go create mode 100644 pkg/env/types.go create mode 100644 pkg/handler/handler_v1alpha2_test.go diff --git a/go.mod b/go.mod index 38db951..191ceaf 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221118103320-ffe096ff3455 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f github.com/nats-io/nats-server/v2 v2.9.9 github.com/nats-io/nats.go v1.21.0 github.com/onsi/gomega v1.24.1 @@ -51,7 +51,7 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.15.11 // indirect - github.com/kyma-project/kyma/common/logging v0.0.0-20221018132434-282eeb492ce2 // indirect + github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect github.com/minio/highwayhash v1.0.2 // indirect diff --git a/go.sum b/go.sum index 5986fed..0261bb4 100644 --- a/go.sum +++ b/go.sum @@ -230,12 +230,12 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kyma-project/api-gateway v0.0.0-20220819093753-296e6704d413 h1:fkGKNOFbltycpdQ7yCGfa+7MpH9X18F09x+n7Tgfp7A= -github.com/kyma-project/kyma/common/logging v0.0.0-20221018132434-282eeb492ce2 h1:arx/6vjR1R8Bo+GKXb6NPYS8eYRcwCWQPKzrVuFUdG8= -github.com/kyma-project/kyma/common/logging v0.0.0-20221018132434-282eeb492ce2/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= +github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 h1:7CVA4isawiebZGBPeaRwFyxNLb36ZWgmfiSpJSUgI+c= +github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 h1:XxhNPU8Z1eknyepGqg21ajEisuTeknKydHiZ6m5Qp3k= github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455/go.mod h1:18VKkunC8gEMKAIX3/64rXDq3XNk82CfHQ2G1kZPSQM= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221118103320-ffe096ff3455 h1:yAOCvw1Rnd+KK25SQYm38d0zdi+JIPOvDT1iFgWjSeM= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221118103320-ffe096ff3455/go.mod h1:tENMAIjc7Pj6iueTfg83a2c+8+OSFIXw7LuPb6K3v3s= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f h1:p6AwRi+RTCynwtUJ3ihvb1QlLAzWchC3J2FWDIAdVjo= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f/go.mod h1:qbrPobautjB9Mu0jV6+wPcc3LToy0+iiffiY+cQvb2Q= 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.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= diff --git a/pkg/cloudevents/builder/eventmesh.go b/pkg/cloudevents/builder/eventmesh.go new file mode 100644 index 0000000..980870d --- /dev/null +++ b/pkg/cloudevents/builder/eventmesh.go @@ -0,0 +1,38 @@ +package builder + +import ( + cev2event "github.com/cloudevents/sdk-go/v2/event" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" +) + +// Perform a compile-time check. +var _ CloudEventBuilder = &EventMeshBuilder{} + +func NewEventMeshBuilder(typePrefix string, eventMeshNamespace string, cleaner cleaner.Cleaner, applicationLister *application.Lister, logger *logger.Logger) CloudEventBuilder { + genericBuilder := GenericBuilder{ + typePrefix: typePrefix, + applicationLister: applicationLister, + logger: logger, + cleaner: cleaner, + } + + return &EventMeshBuilder{ + genericBuilder: &genericBuilder, + eventMeshNamespace: eventMeshNamespace, + } +} + +func (emb *EventMeshBuilder) Build(event cev2event.Event) (*cev2event.Event, error) { + ceEvent, err := emb.genericBuilder.Build(event) + if err != nil { + return nil, err + } + + // set eventMesh namespace as event source (required by EventMesh) + ceEvent.SetSource(emb.eventMeshNamespace) + + return ceEvent, err +} diff --git a/pkg/cloudevents/builder/eventmesh_test.go b/pkg/cloudevents/builder/eventmesh_test.go new file mode 100644 index 0000000..c4b5b30 --- /dev/null +++ b/pkg/cloudevents/builder/eventmesh_test.go @@ -0,0 +1,135 @@ +package builder + +import ( + "context" + "encoding/json" + "fmt" + golog "log" + "testing" + + cloudevents "github.com/cloudevents/sdk-go/v2" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" + "github.com/stretchr/testify/require" +) + +func Test_EventMesh_Build(t *testing.T) { + t.Parallel() + + const sampleEventMeshNamespace = "/default/sample1/kyma1" + const eventMeshPrefix = "one.two.three" + + // init the logger + logger, err := kymalogger.New("json", "debug") + if err != nil { + golog.Fatalf("Failed to initialize logger, error: %v", err) + } + + testCases := []struct { + name string + givenSource string + givenType string + givenApplicationName string + givenApplicationLabels map[string]string + wantType string + wantSource string + wantError bool + }{ + { + name: "should return correct source and type (without application)", + givenSource: "source1", + givenType: "order.created.v1", + givenApplicationName: "appName1", + wantType: fmt.Sprintf("%s.source1.order.created.v1", eventMeshPrefix), + wantSource: sampleEventMeshNamespace, + }, + { + name: "should return cleaned source and type (without application)", + givenSource: "source1", + givenType: "o-rder.creat ed.v1", + givenApplicationName: "appName1", + wantType: fmt.Sprintf("%s.source1.order.created.v1", eventMeshPrefix), + wantSource: sampleEventMeshNamespace, + }, + { + name: "should return merged type segments if exceeds segments limit", + givenSource: "source1", + givenType: "haha.hehe.hmm.order.created.v1", + givenApplicationName: "appName1", + wantType: fmt.Sprintf("%s.source1.hahahehehmmorder.created.v1", eventMeshPrefix), + wantSource: sampleEventMeshNamespace, + }, + { + name: "should return application name as source", + givenSource: "appName1", + givenType: "order.created.v1", + givenApplicationName: "appName1", + wantType: fmt.Sprintf("%s.appName1.order.created.v1", eventMeshPrefix), + wantSource: sampleEventMeshNamespace, + }, + { + name: "should return application label as source", + givenSource: "appName1", + givenType: "order.created.v1", + givenApplicationName: "appName1", + givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, + wantType: fmt.Sprintf("%s.testapptype.order.created.v1", eventMeshPrefix), + wantSource: sampleEventMeshNamespace, + }, + { + name: "should return error if empty type", + givenSource: "source1", + givenType: "", + givenApplicationName: "appName1", + wantError: true, + }, + } + + for _, testCase := range testCases { + tc := testCase + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + // given + // build cloud event + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventSource(tc.givenSource), + testingutils.WithCloudEventType(tc.givenType), + ) + payload, _ := builder.BuildStructured() + newEvent := cloudevents.NewEvent() + newEvent.SetType(testingutils.CloudEventTypeWithPrefix) + err := json.Unmarshal([]byte(payload), &newEvent) + require.NoError(t, err) + + appLister := fake.NewApplicationListerOrDie( + context.Background(), + applicationtest.NewApplication(tc.givenApplicationName, tc.givenApplicationLabels)) + + eventMeshBuilder := NewEventMeshBuilder( + eventMeshPrefix, + sampleEventMeshNamespace, + cleaner.NewEventMeshCleaner(logger), + appLister, + logger, + ) + + // when + buildEvent, err := eventMeshBuilder.Build(newEvent) + + // then + if tc.wantError { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tc.wantSource, buildEvent.Source()) + require.Equal(t, tc.wantType, buildEvent.Type()) + } + }) + } +} diff --git a/pkg/cloudevents/builder/generic.go b/pkg/cloudevents/builder/generic.go new file mode 100644 index 0000000..e5feb24 --- /dev/null +++ b/pkg/cloudevents/builder/generic.go @@ -0,0 +1,84 @@ +package builder + +import ( + "fmt" + "strings" + + cev2event "github.com/cloudevents/sdk-go/v2/event" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" + "go.uber.org/zap" +) + +// Perform a compile-time check. +var _ CloudEventBuilder = &GenericBuilder{} + +var ( + // jsBuilderName used as the logger name. + genericBuilderName = "generic-type-builder" +) + +func NewGenericBuilder(typePrefix string, cleaner cleaner.Cleaner, applicationLister *application.Lister, logger *logger.Logger) CloudEventBuilder { + return &GenericBuilder{ + typePrefix: typePrefix, + applicationLister: applicationLister, + logger: logger, + cleaner: cleaner, + } +} + +func (gb *GenericBuilder) Build(event cev2event.Event) (*cev2event.Event, error) { + // format logger + namedLogger := gb.namedLogger(event.Source(), event.Type()) + + // clean the source + cleanSource, err := gb.cleaner.CleanSource(gb.GetAppNameOrSource(event.Source(), namedLogger)) + if err != nil { + return nil, err + } + + // clean the event type + cleanEventType, err := gb.cleaner.CleanEventType(event.Type()) + if err != nil { + return nil, err + } + + // build event type + finalEventType := gb.getFinalSubject(cleanSource, cleanEventType) + + // validate if the segments are not empty + segments := strings.Split(finalEventType, ".") + if DoesEmptySegmentsExist(segments) { + return nil, fmt.Errorf("event type cannot have empty segments after cleaning: %s", finalEventType) + } + namedLogger.Debugf("using event type: %s", finalEventType) + + ceEvent := event.Clone() + ceEvent.SetType(finalEventType) + ceEvent.SetSource(cleanSource) + + return &ceEvent, nil +} + +// getFinalSubject return the final prefixed event type +func (gb *GenericBuilder) getFinalSubject(source, eventType string) string { + return fmt.Sprintf("%s.%s.%s", gb.typePrefix, source, eventType) +} + +// GetAppNameOrSource returns the application name if exists, otherwise returns source name +func (gb *GenericBuilder) GetAppNameOrSource(source string, namedLogger *zap.SugaredLogger) string { + var appName = source + if appObj, err := gb.applicationLister.Get(source); err == nil && appObj != nil { + appName = application.GetCleanTypeOrName(appObj) + namedLogger.With("application", source).Debug("Using application name: %s as source.", appName) + } else { + namedLogger.With("application", source).Debug("Cannot find application.") + } + return appName +} + +func (gb *GenericBuilder) namedLogger(source, eventType string) *zap.SugaredLogger { + return gb.logger.WithContext().Named(genericBuilderName).With("source", source, "type", eventType) +} diff --git a/pkg/cloudevents/builder/generic_test.go b/pkg/cloudevents/builder/generic_test.go new file mode 100644 index 0000000..8c20dc2 --- /dev/null +++ b/pkg/cloudevents/builder/generic_test.go @@ -0,0 +1,224 @@ +package builder + +import ( + "context" + "encoding/json" + golog "log" + "testing" + + cloudevents "github.com/cloudevents/sdk-go/v2" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" + kymalogger "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" + "github.com/stretchr/testify/require" +) + +func Test_Build(t *testing.T) { + t.Parallel() + + // init the logger + logger, err := kymalogger.New("json", "debug") + if err != nil { + golog.Fatalf("Failed to initialize logger, error: %v", err) + } + + testCases := []struct { + name string + givenSource string + givenType string + givenApplicationName string + givenApplicationLabels map[string]string + wantType string + wantSource string + wantError bool + }{ + { + name: "should return correct source and type (without application)", + givenSource: "source1", + givenType: "order.created.v1", + givenApplicationName: "appName1", + wantType: "prefix.source1.order.created.v1", + wantSource: "source1", + }, + { + name: "should return cleaned source and type (without application)", + givenSource: "source1", + givenType: "o-rder.creat ed.v1", + givenApplicationName: "appName1", + wantType: "prefix.source1.o-rder.created.v1", + wantSource: "source1", + }, + { + name: "should return application name as source", + givenSource: "appName1", + givenType: "order.created.v1", + givenApplicationName: "appName1", + wantType: "prefix.appName1.order.created.v1", + wantSource: "appName1", + }, + { + name: "should return application label as source", + givenSource: "appName1", + givenType: "order.created.v1", + givenApplicationName: "appName1", + givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, + wantType: "prefix.testapptype.order.created.v1", + wantSource: "testapptype", + }, + { + name: "should return error if empty type", + givenSource: "source1", + givenType: "", + givenApplicationName: "appName1", + wantError: true, + }, + } + + for _, testCase := range testCases { + tc := testCase + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + // given + // build cloud event + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventSource(tc.givenSource), + testingutils.WithCloudEventType(tc.givenType), + ) + payload, _ := builder.BuildStructured() + newEvent := cloudevents.NewEvent() + newEvent.SetType(testingutils.CloudEventTypeWithPrefix) + err := json.Unmarshal([]byte(payload), &newEvent) + require.NoError(t, err) + + appLister := fake.NewApplicationListerOrDie( + context.Background(), + applicationtest.NewApplication(tc.givenApplicationName, tc.givenApplicationLabels)) + + genericBuilder := &GenericBuilder{ + typePrefix: "prefix", + applicationLister: appLister, + logger: logger, + cleaner: cleaner.NewJetStreamCleaner(logger), + } + + // when + buildEvent, err := genericBuilder.Build(newEvent) + + // then + if tc.wantError { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tc.wantSource, buildEvent.Source()) + require.Equal(t, tc.wantType, buildEvent.Type()) + } + }) + } +} + +func Test_GetAppNameOrSource(t *testing.T) { + t.Parallel() + + // init the logger + logger, err := kymalogger.New("json", "debug") + if err != nil { + golog.Fatalf("Failed to initialize logger, error: %v", err) + } + + testCases := []struct { + name string + givenApplicationName string + givenApplicationLabels map[string]string + givenSource string + wantSource string + }{ + { + name: "should return application name instead of source name", + givenSource: "appName1", + givenApplicationName: "appName1", + wantSource: "appName1", + }, + { + name: "should return application label instead of source name or app name", + givenSource: "appName1", + givenApplicationName: "appName1", + givenApplicationLabels: map[string]string{application.TypeLabel: "testapptype"}, + wantSource: "testapptype", + }, + { + name: "should return cleaned application label", + givenSource: "appName1", + givenApplicationName: "appName1", + givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, + wantSource: "testapptype", + }, + { + name: "should return source name as application does not exists", + givenSource: "noapp1", + givenApplicationName: "appName1", + givenApplicationLabels: map[string]string{application.TypeLabel: "testapptype"}, + wantSource: "noapp1", + }, + } + for _, testCase := range testCases { + tc := testCase + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + app := applicationtest.NewApplication(tc.givenApplicationName, tc.givenApplicationLabels) + appLister := fake.NewApplicationListerOrDie(context.Background(), app) + + genericBuilder := &GenericBuilder{ + applicationLister: appLister, + logger: logger, + } + + namedLogger := logger.WithContext().Named(genericBuilderName).With("source", tc.givenSource) + require.Equal(t, tc.wantSource, genericBuilder.GetAppNameOrSource(tc.givenSource, namedLogger)) + }) + } +} + +func Test_getFinalSubject(t *testing.T) { + t.Parallel() + + testCases := []struct { + name string + givenTypePrefix string + givenSource string + givenType string + wantSubject string + }{ + { + name: "should return correct subject", + givenTypePrefix: "prefix", + givenSource: "test1", + givenType: "test2", + wantSubject: "prefix.test1.test2", + }, + { + name: "should return correct subject", + givenTypePrefix: "kyma", + givenSource: "inapp", + givenType: "order.created.v1", + wantSubject: "kyma.inapp.order.created.v1", + }, + } + for _, testCase := range testCases { + tc := testCase + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + genericBuilder := &GenericBuilder{ + typePrefix: tc.givenTypePrefix, + } + + require.Equal(t, tc.wantSubject, genericBuilder.getFinalSubject(tc.givenSource, tc.givenType)) + }) + } +} diff --git a/pkg/cloudevents/builder/types.go b/pkg/cloudevents/builder/types.go new file mode 100644 index 0000000..c811f54 --- /dev/null +++ b/pkg/cloudevents/builder/types.go @@ -0,0 +1,24 @@ +package builder + +import ( + cev2event "github.com/cloudevents/sdk-go/v2/event" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" +) + +type CloudEventBuilder interface { + Build(event cev2event.Event) (*cev2event.Event, error) +} + +type GenericBuilder struct { + typePrefix string + applicationLister *application.Lister + cleaner cleaner.Cleaner + logger *logger.Logger +} + +type EventMeshBuilder struct { + genericBuilder *GenericBuilder + eventMeshNamespace string +} diff --git a/pkg/cloudevents/builder/utils.go b/pkg/cloudevents/builder/utils.go new file mode 100644 index 0000000..9ea907b --- /dev/null +++ b/pkg/cloudevents/builder/utils.go @@ -0,0 +1,10 @@ +package builder + +func DoesEmptySegmentsExist(segments []string) bool { + for _, segment := range segments { + if segment == "" { + return true + } + } + return false +} diff --git a/pkg/cloudevents/builder/utils_test.go b/pkg/cloudevents/builder/utils_test.go new file mode 100644 index 0000000..ee483d0 --- /dev/null +++ b/pkg/cloudevents/builder/utils_test.go @@ -0,0 +1,34 @@ +package builder + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func Test_checkForEmptySegments(t *testing.T) { + t.Parallel() + testCases := []struct { + name string + givenSegments []string + wantResult bool + }{ + { + name: "should pass if all segments are non-empty", + givenSegments: []string{"one", "two", "three"}, + wantResult: false, + }, + { + name: "should fail if any segment is empty", + givenSegments: []string{"one", "", "three"}, + wantResult: true, + }, + } + for _, testCase := range testCases { + tc := testCase + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + require.Equal(t, tc.wantResult, DoesEmptySegmentsExist(tc.givenSegments)) + }) + } +} diff --git a/pkg/cloudevents/eventtype/parse.go b/pkg/cloudevents/eventtype/parse.go index 662e938..1dbf210 100644 --- a/pkg/cloudevents/eventtype/parse.go +++ b/pkg/cloudevents/eventtype/parse.go @@ -4,6 +4,8 @@ import ( "errors" "fmt" "strings" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" ) // parse splits the event-type using the given prefix and returns the application name, event and version @@ -23,7 +25,7 @@ func parse(eventType, prefix string) (string, string, string, error) { // make sure that the remaining string has at least 4 segments separated by "." // (e.g. application.businessObject.operation.version) parts := strings.Split(eventType, ".") - if len(parts) < 4 || checkForEmptySegments(parts) { + if len(parts) < 4 || builder.DoesEmptySegmentsExist(parts) { return "", "", "", errors.New("invalid format") } @@ -36,12 +38,3 @@ func parse(eventType, prefix string) (string, string, string, error) { return applicationName, event, version, nil } - -func checkForEmptySegments(segments []string) bool { - for _, segment := range segments { - if segment == "" { - return true - } - } - return false -} diff --git a/pkg/cloudevents/eventtype/parse_test.go b/pkg/cloudevents/eventtype/parse_test.go index e1ae8be..f17fe0f 100644 --- a/pkg/cloudevents/eventtype/parse_test.go +++ b/pkg/cloudevents/eventtype/parse_test.go @@ -77,30 +77,3 @@ func TestParser(t *testing.T) { }) } } - -func Test_checkForEmptySegments(t *testing.T) { - t.Parallel() - testCases := []struct { - name string - givenSegments []string - wantResult bool - }{ - { - name: "should pass if all segments are non-empty", - givenSegments: []string{"one", "two", "three"}, - wantResult: false, - }, - { - name: "should fail if any segment is empty", - givenSegments: []string{"one", "", "three"}, - wantResult: true, - }, - } - for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - require.Equal(t, tc.wantResult, checkForEmptySegments(tc.givenSegments)) - }) - } -} diff --git a/pkg/commander/beb/beb.go b/pkg/commander/beb/beb.go index a847aac..18e1e21 100644 --- a/pkg/commander/beb/beb.go +++ b/pkg/commander/beb/beb.go @@ -2,6 +2,10 @@ package beb import ( "context" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" + + "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" "k8s.io/client-go/tools/cache" "github.com/kelseyhightower/envconfig" @@ -113,11 +117,18 @@ func (c *Commander) Start() error { c.namedLogger().Info("Informers were successfully synced") // configure event type cleaner - eventTypeCleaner := eventtype.NewCleaner(c.envCfg.EventTypePrefix, applicationLister, c.logger) + eventTypeCleanerV1 := eventtype.NewCleaner(c.envCfg.EventTypePrefix, applicationLister, c.logger) + + // configure event type cleaner for subscription CRD v1alpha2 + eventTypeCleaner := cleaner.NewEventMeshCleaner(c.logger) + + // configure cloud event builder for subscription CRD v1alpha2 + ceBuilder := builder.NewEventMeshBuilder(c.envCfg.EventTypePrefix, c.envCfg.BEBNamespace, eventTypeCleaner, + applicationLister, c.logger) // start handler which blocks until it receives a shutdown signal if err := handler.NewHandler(messageReceiver, messageSender, health.NewChecker(), c.envCfg.RequestTimeout, legacyTransformer, c.opts, - subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleaner).Start(ctx); err != nil { + subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleanerV1, ceBuilder).Start(ctx); err != nil { return xerrors.Errorf("failed to start handler for %s : %v", bebCommanderName, err) } c.namedLogger().Info("Event Publisher was shut down") diff --git a/pkg/commander/nats/nats.go b/pkg/commander/nats/nats.go index 8d96f9c..1068971 100644 --- a/pkg/commander/nats/nats.go +++ b/pkg/commander/nats/nats.go @@ -2,6 +2,10 @@ package nats import ( "context" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" + + "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" "k8s.io/client-go/tools/cache" "github.com/kelseyhightower/envconfig" @@ -85,7 +89,7 @@ func (c *Commander) Start() error { defer connection.Close() // configure the message sender - messageSender := jetstream.NewSender(ctx, connection, c.envCfg, c.logger) + messageSender := jetstream.NewSender(ctx, connection, c.envCfg, c.opts, c.logger) // cluster config k8sConfig := config.GetConfigOrDie() @@ -122,11 +126,18 @@ func (c *Commander) Start() error { c.namedLogger().Info("Informers are synced successfully") // configure event type cleaner - eventTypeCleaner := eventtype.NewCleaner(c.envCfg.EventTypePrefix, applicationLister, c.logger) + eventTypeCleanerV1 := eventtype.NewCleaner(c.envCfg.EventTypePrefix, applicationLister, c.logger) + + // configure event type cleaner for subscription CRD v1alpha2 + eventTypeCleaner := cleaner.NewJetStreamCleaner(c.logger) + + // configure cloud event builder for subscription CRD v1alpha2 + ceBuilder := builder.NewGenericBuilder(env.JetStreamSubjectPrefix, eventTypeCleaner, + applicationLister, c.logger) // start handler which blocks until it receives a shutdown signal if err := handler.NewHandler(messageReceiver, messageSender, messageSender, c.envCfg.RequestTimeout, legacyTransformer, c.opts, - subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleaner).Start(ctx); err != nil { + subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleanerV1, ceBuilder).Start(ctx); err != nil { return xerrors.Errorf("failed to start handler for %s : %v", natsCommanderName, err) } diff --git a/pkg/env/types.go b/pkg/env/types.go new file mode 100644 index 0000000..3336ad9 --- /dev/null +++ b/pkg/env/types.go @@ -0,0 +1,3 @@ +package env + +const OldEventTypePrefix = "sap.kyma.custom" diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 080ec60..ea17545 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -4,8 +4,11 @@ import ( "context" "errors" "net/http" + "strings" "time" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/gorilla/mux" "github.com/kyma-project/kyma/components/eventing-controller/logger" "go.uber.org/zap" @@ -15,6 +18,7 @@ import ( cev2event "github.com/cloudevents/sdk-go/v2/event" cev2http "github.com/cloudevents/sdk-go/v2/protocol/http" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" @@ -54,13 +58,21 @@ type Handler struct { collector metrics.PublishingMetricsCollector // eventTypeCleaner cleans the cloud event type eventTypeCleaner eventtype.Cleaner - router *mux.Router + // builds the cloud event according to Subscription v1alpha2 specifications + ceBuilder builder.CloudEventBuilder + router *mux.Router } +const ( + originalTypeHeaderName = "ce-original-type" +) + // NewHandler returns a new HTTP Handler instance. func NewHandler(receiver *receiver.HTTPMessageReceiver, sender sender.GenericSender, healthChecker health.Checker, requestTimeout time.Duration, legacyTransformer legacy.RequestToCETransformer, opts *options.Options, subscribedProcessor *subscribed.Processor, - logger *logger.Logger, collector metrics.PublishingMetricsCollector, eventTypeCleaner eventtype.Cleaner) *Handler { + logger *logger.Logger, collector metrics.PublishingMetricsCollector, eventTypeCleaner eventtype.Cleaner, + ceBuilder builder.CloudEventBuilder) *Handler { + return &Handler{ Receiver: receiver, Sender: sender, @@ -72,6 +84,7 @@ func NewHandler(receiver *receiver.HTTPMessageReceiver, sender sender.GenericSen Options: opts, collector: collector, eventTypeCleaner: eventTypeCleaner, + ceBuilder: ceBuilder, } } @@ -153,16 +166,30 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R } eventTypeOriginal := event.Type() - eventTypeClean, err := h.eventTypeCleaner.Clean(eventTypeOriginal) - if err != nil { - h.namedLogger().Error(err) - e := writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) - if e != nil { - h.namedLogger().Error(e) + event.SetExtension(originalTypeHeaderName, eventTypeOriginal) + + if h.Options.EnableNewCRDVersion && !strings.HasPrefix(eventTypeOriginal, env.OldEventTypePrefix) { + // build a new cloud event instance as per specifications per backend + event, err = h.ceBuilder.Build(*event) + if err != nil { + e := writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) + if e != nil { + h.namedLogger().Error(e) + } + return } - return + } else { + eventTypeClean, err := h.eventTypeCleaner.Clean(eventTypeOriginal) + if err != nil { + h.namedLogger().Error(err) + e := writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) + if e != nil { + h.namedLogger().Error(e) + } + return + } + event.SetType(eventTypeClean) } - event.SetType(eventTypeClean) result, err := h.sendEventAndRecordMetrics(ctx, event, h.Sender.URL(), request.Header) if err != nil { diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index 004d84c..84fb5c8 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -44,15 +44,17 @@ func Test_extractCloudEventFromRequest(t *testing.T) { errorAssertionFunc assert.ErrorAssertionFunc } tests := []struct { - name string - args args - wants wants + name string + args args + wantType string + wants wants }{ { name: "Valid event", args: args{ request: CreateValidStructuredRequest(t), }, + wantType: fmt.Sprintf("sap.kyma.custom.%s", testingutils.CloudEventType), wants: wants{ event: CreateCloudEvent(t), errorAssertionFunc: assert.NoError, @@ -83,6 +85,7 @@ func Test_extractCloudEventFromRequest(t *testing.T) { args: args{ request: CreateValidBinaryRequest(t), }, + wantType: fmt.Sprintf("sap.kyma.custom.%s", testingutils.CloudEventType), wants: wants{ event: CreateCloudEvent(t), errorAssertionFunc: assert.NoError, @@ -102,6 +105,9 @@ func Test_extractCloudEventFromRequest(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { gotEvent, err := extractCloudEventFromRequest(tt.args.request) + if tt.wantType != "" { + tt.wants.event.SetType(tt.wantType) + } if !tt.wants.errorAssertionFunc(t, err, fmt.Sprintf("extractCloudEventFromRequest(%v)", tt.args.request)) { return } @@ -359,6 +365,7 @@ func TestHandler_publishCloudEvents(t *testing.T) { Logger: logger, collector: tt.fields.collector, eventTypeCleaner: tt.fields.eventTypeCleaner, + Options: &options.Options{}, } writer := httptest.NewRecorder() @@ -818,7 +825,7 @@ func CreateCloudEvent(t *testing.T) *cev2event.Event { // CreateValidStructuredRequest creates a structured cloudevent as http request. func CreateValidStructuredRequest(t *testing.T) *http.Request { t.Helper() - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"specversion\":\"1.0\",\"type\":\"prefix.testapp1023.order.created.v1\",\"source\":\"/default/sap.kyma/id\",\"id\":\"8945ec08-256b-11eb-9928-acde48001122\",\"data\":{\"foo\":\"bar\"}}")) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"specversion\":\"1.0\",\"type\":\"sap.kyma.custom.testapp1023.order.created.v1\",\"source\":\"/default/sap.kyma/id\",\"id\":\"8945ec08-256b-11eb-9928-acde48001122\",\"data\":{\"foo\":\"bar\"}}")) req.Header.Add("Content-Type", "application/cloudevents+json") return req } @@ -844,7 +851,7 @@ func CreateValidBinaryRequest(t *testing.T) *http.Request { t.Helper() req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"foo\":\"bar\"}")) req.Header.Add("Ce-Specversion", "1.0") - req.Header.Add("Ce-Type", "prefix.testapp1023.order.created.v1") + req.Header.Add("Ce-Type", "sap.kyma.custom.testapp1023.order.created.v1") req.Header.Add("Ce-Source", "/default/sap.kyma/id") req.Header.Add("Ce-ID", "8945ec08-256b-11eb-9928-acde48001122") return req diff --git a/pkg/handler/handler_v1alpha2_test.go b/pkg/handler/handler_v1alpha2_test.go new file mode 100644 index 0000000..fa2d83a --- /dev/null +++ b/pkg/handler/handler_v1alpha2_test.go @@ -0,0 +1,369 @@ +package handler + +import ( + "context" + "fmt" + "io" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" + eclogger "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" + "github.com/stretchr/testify/assert" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype/eventtypetest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/histogram/mocks" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/beb" +) + +func TestHandler_publishCloudEventsV1Alpha2(t *testing.T) { + type fields struct { + Sender sender.GenericSender + collector metrics.PublishingMetricsCollector + eventTypeCleaner eventtype.Cleaner + } + type args struct { + request *http.Request + } + + const bucketsFunc = "Buckets" + latency := new(mocks.BucketsProvider) + latency.On(bucketsFunc).Return(nil) + latency.Test(t) + + tests := []struct { + name string + fields fields + args args + wantStatus int + wantBody []byte + wantTEF string + }{ + { + name: "Publish structured Cloudevent for Subscription v1alpha1", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + Result: beb.HTTPPublishResult{ + Status: 204, + Body: []byte(""), + }, + BackendURL: "FOO", + }, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidStructuredRequest(t), + }, + wantStatus: 204, + wantTEF: ` + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 + `, + }, + { + name: "Publish binary Cloudevent for Subscription v1alpha1", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + Result: beb.HTTPPublishResult{ + Status: 204, + Body: []byte(""), + }, + BackendURL: "FOO", + }, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidBinaryRequest(t), + }, + wantStatus: 204, + wantTEF: ` + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 + eventing_epp_backend_duration_milliseconds_count{destination_service="FOO",code="204"} 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 + `, + }, + { + name: "Publish structured Cloudevent", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + Result: beb.HTTPPublishResult{ + Status: 204, + Body: []byte(""), + }, + BackendURL: "FOO", + }, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidStructuredRequestV1Alpha2(t), + }, + wantStatus: 204, + wantTEF: ` + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="testapp1023",event_type="prefix.testapp1023.order.created.v1"} 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 + `, + }, + { + name: "Publish binary Cloudevent", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + Result: beb.HTTPPublishResult{ + Status: 204, + Body: []byte(""), + }, + BackendURL: "FOO", + }, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidBinaryRequestV1Alpha2(t), + }, + wantStatus: 204, + wantTEF: ` + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="testapp1023",event_type="prefix.testapp1023.order.created.v1"} 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 + eventing_epp_backend_duration_milliseconds_count{destination_service="FOO",code="204"} 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 + `, + }, + { + name: "Publish invalid structured CloudEvent", + fields: fields{ + Sender: &GenericSenderStub{}, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateInvalidStructuredRequestV1Alpha2(t), + }, + wantStatus: 400, + wantBody: []byte("type: MUST be a non-empty string\n"), + }, + { + name: "Publish invalid binary CloudEvent", + fields: fields{ + Sender: &GenericSenderStub{}, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateInvalidBinaryRequestV1Alpha2(t), + }, + wantStatus: 400, + }, + { + name: "Publish binary CloudEvent but cannot send", + fields: fields{ + Sender: &GenericSenderStub{ + Err: fmt.Errorf("I cannot send"), + }, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidBinaryRequestV1Alpha2(t), + }, + wantStatus: 500, + wantTEF: ` + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 + `, + }, + { + name: "Publish binary CloudEvent but backend is full", + fields: fields{ + Sender: &GenericSenderStub{ + Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrInsufficientStorage), + }, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidBinaryRequestV1Alpha2(t), + }, + wantStatus: 507, + wantTEF: ` + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 + `, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // given + logger, err := eclogger.New("text", "debug") + assert.NoError(t, err) + + app := applicationtest.NewApplication("appName1", nil) + appLister := fake.NewApplicationListerOrDie(context.Background(), app) + + ceBuilder := builder.NewGenericBuilder("prefix", cleaner.NewJetStreamCleaner(logger), appLister, logger) + + h := &Handler{ + Sender: tt.fields.Sender, + Logger: logger, + collector: tt.fields.collector, + eventTypeCleaner: tt.fields.eventTypeCleaner, + ceBuilder: ceBuilder, + Options: &options.Options{ + Env: options.Env{EnableNewCRDVersion: true}, + }, + } + writer := httptest.NewRecorder() + + // when + h.publishCloudEvents(writer, tt.args.request) + + // then + assert.Equal(t, tt.wantStatus, writer.Result().StatusCode) + body, err := io.ReadAll(writer.Result().Body) + assert.NoError(t, err) + if tt.wantBody != nil { + assert.Equal(t, tt.wantBody, body) + } + + metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wantTEF) + }) + } +} + +// CreateValidStructuredRequestV1Alpha2 creates a structured cloudevent as http request. +func CreateValidStructuredRequestV1Alpha2(t *testing.T) *http.Request { + t.Helper() + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"specversion\":\"1.0\",\"type\":\"order.created.v1\",\"source\":\"testapp1023\",\"id\":\"8945ec08-256b-11eb-9928-acde48001122\",\"data\":{\"foo\":\"bar\"}}")) + req.Header.Add("Content-Type", "application/cloudevents+json") + return req +} + +// CreateBrokenRequestV1Alpha2 creates a structured cloudevent request that cannot be parsed. +func CreateBrokenRequestV1Alpha2(t *testing.T) *http.Request { + t.Helper() + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("I AM JUST A BROKEN REQUEST")) + req.Header.Add("Content-Type", "application/cloudevents+json") + return req +} + +// CreateInvalidStructuredRequestV1Alpha2 creates an invalid structured cloudevent as http request. The `type` is missing. +func CreateInvalidStructuredRequestV1Alpha2(t *testing.T) *http.Request { + t.Helper() + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"specversion\":\"1.0\",\"source\":\"testapp1023\",\"id\":\"8945ec08-256b-11eb-9928-acde48001122\",\"data\":{\"foo\":\"bar\"}}")) + req.Header.Add("Content-Type", "application/cloudevents+json") + return req +} + +// CreateValidBinaryRequestV1Alpha2 creates a valid binary cloudevent as http request. +func CreateValidBinaryRequestV1Alpha2(t *testing.T) *http.Request { + t.Helper() + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"foo\":\"bar\"}")) + req.Header.Add("Ce-Specversion", "1.0") + req.Header.Add("Ce-Type", "order.created.v1") + req.Header.Add("Ce-Source", "testapp1023") + req.Header.Add("Ce-ID", "8945ec08-256b-11eb-9928-acde48001122") + return req +} + +// CreateInvalidBinaryRequestV1Alpha2 creates an invalid binary cloudevent as http request. The `type` is missing. +func CreateInvalidBinaryRequestV1Alpha2(t *testing.T) *http.Request { + t.Helper() + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"foo\":\"bar\"}")) + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Ce-Specversion", "1.0") + req.Header.Add("Ce-Source", "testapp1023") + req.Header.Add("Ce-ID", "8945ec08-256b-11eb-9928-acde48001122") + return req +} diff --git a/pkg/sender/jetstream/jetstream.go b/pkg/sender/jetstream/jetstream.go index 1f4aa1c..f1b2fc0 100644 --- a/pkg/sender/jetstream/jetstream.go +++ b/pkg/sender/jetstream/jetstream.go @@ -8,6 +8,8 @@ import ( "net/http" "strings" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/eventing-controller/logger" "go.uber.org/zap" @@ -44,6 +46,7 @@ type Sender struct { logger *logger.Logger connection *nats.Conn envCfg *env.NATSConfig + opts *options.Options } func (s *Sender) URL() string { @@ -51,8 +54,8 @@ func (s *Sender) URL() string { } // NewSender returns a new NewSender instance with the given NATS connection. -func NewSender(ctx context.Context, connection *nats.Conn, envCfg *env.NATSConfig, logger *logger.Logger) *Sender { - return &Sender{ctx: ctx, connection: connection, envCfg: envCfg, logger: logger} +func NewSender(ctx context.Context, connection *nats.Conn, envCfg *env.NATSConfig, opts *options.Options, logger *logger.Logger) *Sender { + return &Sender{ctx: ctx, connection: connection, envCfg: envCfg, opts: opts, logger: logger} } // ConnectionStatus returns nats.Status for the NATS connection used by the Sender. @@ -122,6 +125,11 @@ func (s *Sender) eventToNATSMsg(event *event.Event) (*nats.Msg, error) { // getJsSubjectToPublish appends stream name to subject if needed. func (s *Sender) getJsSubjectToPublish(subject string) string { + // if subscription CRD v1alpha2 is enabled then do not append prefix. + if s.opts.EnableNewCRDVersion && !strings.HasPrefix(subject, env.OldEventTypePrefix) { + return subject + } + return fmt.Sprintf("%s.%s", env.JetStreamSubjectPrefix, subject) } diff --git a/pkg/sender/jetstream/jetstream_test.go b/pkg/sender/jetstream/jetstream_test.go index e8cfe18..1e79d30 100644 --- a/pkg/sender/jetstream/jetstream_test.go +++ b/pkg/sender/jetstream/jetstream_test.go @@ -8,6 +8,8 @@ import ( "testing" "time" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/eventing-controller/logger" "github.com/stretchr/testify/require" @@ -83,7 +85,7 @@ func TestJetStreamMessageSender(t *testing.T) { ce := createCloudEvent(t) ctx := context.Background() - sender := NewSender(context.Background(), connection, testEnv.Config, mockedLogger) + sender := NewSender(context.Background(), connection, testEnv.Config, &options.Options{}, mockedLogger) if tc.givenNATSConnectionClosed { connection.Close() @@ -235,3 +237,58 @@ func TestSender_URL(t *testing.T) { }) } } + +func TestSender_getJsSubjectToPublish(t *testing.T) { + t.Parallel() + + type fields struct { + opts *options.Options + } + tests := []struct { + name string + fields fields + subject string + want string + }{ + { + name: "Appends JS prefix for v1alpha1 subscription", + subject: "sap.kyma.custom.noapp.order.created.v1", + want: "kyma.sap.kyma.custom.noapp.order.created.v1", + fields: fields{ + opts: &options.Options{}, + }, + }, + { + name: "Appends JS prefix for v1alpha2 exact type matching subscription", + subject: "sap.kyma.custom.noapp.order.created.v1", + want: "kyma.sap.kyma.custom.noapp.order.created.v1", + fields: fields{ + opts: &options.Options{ + Env: options.Env{EnableNewCRDVersion: true}, + }, + }, + }, + { + name: "Does not append JS prefix for v1alpha2 standard type matching subscription", + subject: "kyma.noapp.order.created.v1", + want: "kyma.noapp.order.created.v1", + fields: fields{ + opts: &options.Options{ + Env: options.Env{EnableNewCRDVersion: true}, + }, + }, + }, + } + + for _, tt := range tests { + tc := tt + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + s := &Sender{ + opts: tc.fields.opts, + } + assert.Equal(t, tc.want, s.getJsSubjectToPublish(tc.subject)) + }) + } +} From 670cfdbd41ad6890496643adf3be9fd96bf8ca59 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Dec 2022 17:43:01 +0100 Subject: [PATCH 139/194] gomod(deps): bump github.com/nats-io/nats-server/v2 from 2.9.9 to 2.9.10 in /components/event-publisher-proxy (#16417) * gomod(deps): bump github.com/nats-io/nats-server/v2 Bumps [github.com/nats-io/nats-server/v2](https://github.com/nats-io/nats-server) from 2.9.9 to 2.9.10. - [Release notes](https://github.com/nats-io/nats-server/releases) - [Changelog](https://github.com/nats-io/nats-server/blob/main/.goreleaser.yml) - [Commits](https://github.com/nats-io/nats-server/compare/v2.9.9...v2.9.10) --- updated-dependencies: - dependency-name: github.com/nats-io/nats-server/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update values.yaml Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 191ceaf..38ab4ba 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f - github.com/nats-io/nats-server/v2 v2.9.9 + github.com/nats-io/nats-server/v2 v2.9.10 github.com/nats-io/nats.go v1.21.0 github.com/onsi/gomega v1.24.1 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 0261bb4..d4999dd 100644 --- a/go.sum +++ b/go.sum @@ -257,8 +257,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= -github.com/nats-io/nats-server/v2 v2.9.9 h1:bmj0RhvHOc8+z5/RuhI38GqPwtkFAHQuU3e99FVA/TI= -github.com/nats-io/nats-server/v2 v2.9.9/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= +github.com/nats-io/nats-server/v2 v2.9.10 h1:LMC46Oi9E6BUx/xBsaCVZgofliAqKQzRPU6eKWkN8jE= +github.com/nats-io/nats-server/v2 v2.9.10/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= github.com/nats-io/nats.go v1.21.0 h1:kQiWyQMMMIPjDR7NanrLhTnRUxWgU04yrzmYdq9JxCU= github.com/nats-io/nats.go v1.21.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= From ed8ea70abae99764a4c65d73e181101d80803132 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Dec 2022 01:47:01 +0100 Subject: [PATCH 140/194] gomod(deps): bump github.com/nats-io/nats.go from 1.21.0 to 1.22.1 in /components/event-publisher-proxy (#16437) * gomod(deps): bump github.com/nats-io/nats.go Bumps [github.com/nats-io/nats.go](https://github.com/nats-io/nats.go) from 1.21.0 to 1.22.1. - [Release notes](https://github.com/nats-io/nats.go/releases) - [Commits](https://github.com/nats-io/nats.go/compare/v1.21.0...v1.22.1) --- updated-dependencies: - dependency-name: github.com/nats-io/nats.go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 38ab4ba..67ca767 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f github.com/nats-io/nats-server/v2 v2.9.10 - github.com/nats-io/nats.go v1.21.0 + github.com/nats-io/nats.go v1.22.1 github.com/onsi/gomega v1.24.1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 diff --git a/go.sum b/go.sum index d4999dd..c3cd68a 100644 --- a/go.sum +++ b/go.sum @@ -259,8 +259,8 @@ github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.9.10 h1:LMC46Oi9E6BUx/xBsaCVZgofliAqKQzRPU6eKWkN8jE= github.com/nats-io/nats-server/v2 v2.9.10/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= -github.com/nats-io/nats.go v1.21.0 h1:kQiWyQMMMIPjDR7NanrLhTnRUxWgU04yrzmYdq9JxCU= -github.com/nats-io/nats.go v1.21.0/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= +github.com/nats-io/nats.go v1.22.1 h1:XzfqDspY0RNufzdrB8c4hFR+R3dahkxlpWe5+IWJzbE= +github.com/nats-io/nats.go v1.22.1/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= From 4ad3a5a00af38b721e13a9afdeb96a41f29025d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Dec 2022 10:41:34 +0100 Subject: [PATCH 141/194] gomod(deps): bump github.com/onsi/gomega from 1.24.1 to 1.24.2 in /components/event-publisher-proxy (#16365) * gomod(deps): bump github.com/onsi/gomega Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.24.1 to 1.24.2. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.24.1...v1.24.2) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update values.yaml Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 4 ++-- go.sum | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 67ca767..f94b553 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f github.com/nats-io/nats-server/v2 v2.9.10 github.com/nats-io/nats.go v1.22.1 - github.com/onsi/gomega v1.24.1 + github.com/onsi/gomega v1.24.2 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 github.com/stretchr/testify v1.8.1 @@ -71,7 +71,7 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect - golang.org/x/net v0.3.0 // indirect + golang.org/x/net v0.4.0 // indirect golang.org/x/sys v0.3.0 // indirect golang.org/x/term v0.3.0 // indirect golang.org/x/text v0.5.0 // indirect diff --git a/go.sum b/go.sum index c3cd68a..8c1ba8f 100644 --- a/go.sum +++ b/go.sum @@ -269,9 +269,9 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.5.0 h1:TRtrvv2vdQqzkwrQ1ke6vtXf7IK34RBUJafIy1wMwls= -github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E= -github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM= +github.com/onsi/ginkgo/v2 v2.6.1 h1:1xQPCjcqYw/J5LchOcp4/2q/jzJFjiAOc25chhnDw+Q= +github.com/onsi/gomega v1.24.2 h1:J/tulyYK6JwBldPViHJReihxxZ+22FHs0piGjQAvoUE= +github.com/onsi/gomega v1.24.2/go.mod h1:gs3J10IS7Z7r7eXRoNJIrNqU4ToQukCJhFtKrWgHWnk= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -412,8 +412,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.3.0 h1:VWL6FNY2bEEmsGVKabSlHu5Irp34xmMRoqb/9lF9lxk= -golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= From 63d207b22ba99ab067b483977ad6a952e3e04db7 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Thu, 29 Dec 2022 15:03:15 +0100 Subject: [PATCH 142/194] Update dependencies in eventing 2022 dec 29 (#16456) * bump k8s packages in ec * bump k8s packages in epp * bump image --- go.mod | 20 ++++++++++---------- go.sum | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index f94b553..180730e 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( go.uber.org/zap v1.24.0 golang.org/x/oauth2 v0.3.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 - k8s.io/api v0.25.4 - k8s.io/apimachinery v0.25.4 - k8s.io/client-go v0.25.4 + k8s.io/api v0.25.5 + k8s.io/apimachinery v0.25.5 + k8s.io/client-go v0.25.5 sigs.k8s.io/controller-runtime v0.13.1 ) @@ -83,7 +83,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.25.0 // indirect - k8s.io/component-base v0.25.4 // indirect + k8s.io/component-base v0.25.5 // indirect k8s.io/klog/v2 v2.80.1 // indirect k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect @@ -94,12 +94,12 @@ require ( replace ( // keep all following packages at the same version - k8s.io/api => k8s.io/api v0.25.4 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.4 - k8s.io/apimachinery => k8s.io/apimachinery v0.25.4 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.4 - k8s.io/component-base => k8s.io/component-base v0.25.4 - k8s.io/kubectl => k8s.io/kubectl v0.25.4 + k8s.io/api => k8s.io/api v0.25.5 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.5 + k8s.io/apimachinery => k8s.io/apimachinery v0.25.5 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.5 + k8s.io/component-base => k8s.io/component-base v0.25.5 + k8s.io/kubectl => k8s.io/kubectl v0.25.5 ) replace ( diff --git a/go.sum b/go.sum index 8c1ba8f..fc59da9 100644 --- a/go.sum +++ b/go.sum @@ -745,16 +745,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.4 h1:3YO8J4RtmG7elEgaWMb4HgmpS2CfY1QlaOz9nwB+ZSs= -k8s.io/api v0.25.4/go.mod h1:IG2+RzyPQLllQxnhzD8KQNEu4c4YvyDTpSMztf4A0OQ= -k8s.io/apiextensions-apiserver v0.25.4 h1:7hu9pF+xikxQuQZ7/30z/qxIPZc2J1lFElPtr7f+B6U= -k8s.io/apiextensions-apiserver v0.25.4/go.mod h1:bkSGki5YBoZWdn5pWtNIdGvDrrsRWlmnvl9a+tAw5vQ= -k8s.io/apimachinery v0.25.4 h1:CtXsuaitMESSu339tfhVXhQrPET+EiWnIY1rcurKnAc= -k8s.io/apimachinery v0.25.4/go.mod h1:jaF9C/iPNM1FuLl7Zuy5b9v+n35HGSh6AQ4HYRkCqwo= -k8s.io/client-go v0.25.4 h1:3RNRDffAkNU56M/a7gUfXaEzdhZlYhoW8dgViGy5fn8= -k8s.io/client-go v0.25.4/go.mod h1:8trHCAC83XKY0wsBIpbirZU4NTUpbuhc2JnI7OruGZw= -k8s.io/component-base v0.25.4 h1:n1bjg9Yt+G1C0WnIDJmg2fo6wbEU1UGMRiQSjmj7hNQ= -k8s.io/component-base v0.25.4/go.mod h1:nnZJU8OP13PJEm6/p5V2ztgX2oyteIaAGKGMYb2L2cY= +k8s.io/api v0.25.5 h1:mqyHf7aoaYMpdvO87mqpol+Qnsmo+y09S0PMIXwiZKo= +k8s.io/api v0.25.5/go.mod h1:RzplZX0Z8rV/WhSTfEvnyd91bBhBQTRWo85qBQwRmb8= +k8s.io/apiextensions-apiserver v0.25.5 h1:iHkMyFGzRgXO8AQlCYPVTVsKLqXvruswirIW8hRji+g= +k8s.io/apiextensions-apiserver v0.25.5/go.mod h1:TWAHgFssGm050Oe6MhN+Jaeav+ISEl9M/qWsPzq2s3k= +k8s.io/apimachinery v0.25.5 h1:SQomYHvv+aO43qdu3QKRf9YuI0oI8w3RrOQ1qPbAUGY= +k8s.io/apimachinery v0.25.5/go.mod h1:1S2i1QHkmxc8+EZCIxe/fX5hpldVXk4gvnJInMEb8D4= +k8s.io/client-go v0.25.5 h1:7QWVK0Ph4bLn0UwotPTc2FTgm8shreQXyvXnnHDd8rE= +k8s.io/client-go v0.25.5/go.mod h1:bOeoaUUdpyz3WDFGo+Xm3nOQFh2KuYXRDwrvbAPtFQA= +k8s.io/component-base v0.25.5 h1:tVni0kgpceq71MDMBSixp8Y621YGvTS/1zq3RABgX9A= +k8s.io/component-base v0.25.5/go.mod h1:9J+e9uIUwUOG2x5q5+aaOR0b8QI5OIqwqPAbeODkYpc= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= From bee7f98e8df2672711e410b26aadcb2dc61b5769 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Fri, 30 Dec 2022 12:07:10 +0100 Subject: [PATCH 143/194] rename `beb` to `eventmesh` in epp/pkg/sender (#16466) * rename beb to eventmesh in pkg/sender/ * bump image --- pkg/commander/beb/beb.go | 4 ++-- pkg/handler/handler_test.go | 16 ++++++++-------- pkg/handler/handler_v1alpha2_test.go | 10 +++++----- .../{beb/beb.go => eventmesh/eventmesh.go} | 2 +- .../beb_test.go => eventmesh/eventmesh_test.go} | 2 +- pkg/sender/jetstream/jetstream.go | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) rename pkg/sender/{beb/beb.go => eventmesh/eventmesh.go} (99%) rename pkg/sender/{beb/beb_test.go => eventmesh/eventmesh_test.go} (99%) diff --git a/pkg/commander/beb/beb.go b/pkg/commander/beb/beb.go index 18e1e21..1c138b1 100644 --- a/pkg/commander/beb/beb.go +++ b/pkg/commander/beb/beb.go @@ -28,7 +28,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/beb" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/eventmesh" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" ) @@ -81,7 +81,7 @@ func (c *Commander) Start() error { defer client.CloseIdleConnections() // configure message sender - messageSender := beb.NewSender(c.envCfg.EmsPublishURL, client) + messageSender := eventmesh.NewSender(c.envCfg.EmsPublishURL, client) // cluster config k8sConfig := config.GetConfigOrDie() diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index 84fb5c8..8a9f86c 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -31,7 +31,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/beb" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/eventmesh" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) @@ -193,7 +193,7 @@ func TestHandler_publishCloudEvents(t *testing.T) { fields: fields{ Sender: &GenericSenderStub{ Err: nil, - Result: beb.HTTPPublishResult{ + Result: eventmesh.HTTPPublishResult{ Status: 204, Body: []byte(""), }, @@ -235,7 +235,7 @@ func TestHandler_publishCloudEvents(t *testing.T) { fields: fields{ Sender: &GenericSenderStub{ Err: nil, - Result: beb.HTTPPublishResult{ + Result: eventmesh.HTTPPublishResult{ Status: 204, Body: []byte(""), }, @@ -413,7 +413,7 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { name: "Send valid legacy event", fields: fields{ Sender: &GenericSenderStub{ - Result: beb.HTTPPublishResult{ + Result: eventmesh.HTTPPublishResult{ Status: 204, }, BackendURL: "FOO", @@ -524,7 +524,7 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { name: "Send invalid legacy event", fields: fields{ Sender: &GenericSenderStub{ - Result: beb.HTTPPublishResult{ + Result: eventmesh.HTTPPublishResult{ Status: 204, }, BackendURL: "FOO", @@ -673,7 +673,7 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { Sender: &GenericSenderStub{ Err: nil, SleepDuration: 0, - Result: beb.HTTPPublishResult{ + Result: eventmesh.HTTPPublishResult{ Status: 204, Body: nil, }, @@ -687,7 +687,7 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { event: &cev2event.Event{}, }, wants: wants{ - result: beb.HTTPPublishResult{ + result: eventmesh.HTTPPublishResult{ Status: 204, Body: nil, }, @@ -772,7 +772,7 @@ func TestHandler_sendEventAndRecordMetrics_TracingAndDefaults(t *testing.T) { stub := &GenericSenderStub{ Err: nil, SleepDuration: 0, - Result: beb.HTTPPublishResult{Status: http.StatusInternalServerError}, + Result: eventmesh.HTTPPublishResult{Status: http.StatusInternalServerError}, } const bucketsFunc = "Buckets" diff --git a/pkg/handler/handler_v1alpha2_test.go b/pkg/handler/handler_v1alpha2_test.go index fa2d83a..831b8fa 100644 --- a/pkg/handler/handler_v1alpha2_test.go +++ b/pkg/handler/handler_v1alpha2_test.go @@ -23,7 +23,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/beb" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/eventmesh" ) func TestHandler_publishCloudEventsV1Alpha2(t *testing.T) { @@ -54,7 +54,7 @@ func TestHandler_publishCloudEventsV1Alpha2(t *testing.T) { fields: fields{ Sender: &GenericSenderStub{ Err: nil, - Result: beb.HTTPPublishResult{ + Result: eventmesh.HTTPPublishResult{ Status: 204, Body: []byte(""), }, @@ -96,7 +96,7 @@ func TestHandler_publishCloudEventsV1Alpha2(t *testing.T) { fields: fields{ Sender: &GenericSenderStub{ Err: nil, - Result: beb.HTTPPublishResult{ + Result: eventmesh.HTTPPublishResult{ Status: 204, Body: []byte(""), }, @@ -139,7 +139,7 @@ func TestHandler_publishCloudEventsV1Alpha2(t *testing.T) { fields: fields{ Sender: &GenericSenderStub{ Err: nil, - Result: beb.HTTPPublishResult{ + Result: eventmesh.HTTPPublishResult{ Status: 204, Body: []byte(""), }, @@ -181,7 +181,7 @@ func TestHandler_publishCloudEventsV1Alpha2(t *testing.T) { fields: fields{ Sender: &GenericSenderStub{ Err: nil, - Result: beb.HTTPPublishResult{ + Result: eventmesh.HTTPPublishResult{ Status: 204, Body: []byte(""), }, diff --git a/pkg/sender/beb/beb.go b/pkg/sender/eventmesh/eventmesh.go similarity index 99% rename from pkg/sender/beb/beb.go rename to pkg/sender/eventmesh/eventmesh.go index bb6cf54..06cf9a9 100644 --- a/pkg/sender/beb/beb.go +++ b/pkg/sender/eventmesh/eventmesh.go @@ -1,4 +1,4 @@ -package beb +package eventmesh import ( "context" diff --git a/pkg/sender/beb/beb_test.go b/pkg/sender/eventmesh/eventmesh_test.go similarity index 99% rename from pkg/sender/beb/beb_test.go rename to pkg/sender/eventmesh/eventmesh_test.go index 38389e5..139310a 100644 --- a/pkg/sender/beb/beb_test.go +++ b/pkg/sender/eventmesh/eventmesh_test.go @@ -1,4 +1,4 @@ -package beb +package eventmesh import ( "context" diff --git a/pkg/sender/jetstream/jetstream.go b/pkg/sender/jetstream/jetstream.go index f1b2fc0..dbb014b 100644 --- a/pkg/sender/jetstream/jetstream.go +++ b/pkg/sender/jetstream/jetstream.go @@ -19,7 +19,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/beb" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/eventmesh" "github.com/nats-io/nats.go" ) @@ -99,7 +99,7 @@ func (s *Sender) Send(_ context.Context, event *event.Event) (sender.PublishResu } return nil, fmt.Errorf("%w : %v", sender.ErrInternalBackendError, fmt.Errorf("%w, %v", ErrCannotSendToStream, err)) } - return beb.HTTPPublishResult{Status: http.StatusNoContent}, nil + return eventmesh.HTTPPublishResult{Status: http.StatusNoContent}, nil } // eventToNATSMsg translates cloud event into the NATS Msg. From 04c03ce784aba004838f367ba21d7a081fd1cc70 Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Fri, 30 Dec 2022 13:37:03 +0100 Subject: [PATCH 144/194] Support publishing legacy-events for Subscritpion v1alpha2 CRD in EPP (#16433) * Support publihsing events for Subscritpion v1alpha2 CRD in EPP * updated tests * updated tests * Support publishing legacy-events for Subscritpion v1alpha2 CRD in EPP * updated legacy * Replaced hardcoded old Event type prefix in EPP * image bump * added tests * added tests * added tests * addressed review comments * addressed review comments part 2 * addressed review comments part 3 --- pkg/commander/beb/beb.go | 2 +- pkg/commander/nats/nats.go | 2 +- pkg/env/types.go | 7 +- pkg/handler/handler.go | 126 +++++++++++--- pkg/handler/handler_test.go | 1 + pkg/handler/handler_v1alpha2_test.go | 170 ++++++++++++++++++ pkg/legacy/api/types.go | 24 ++- pkg/legacy/helpers.go | 4 +- pkg/legacy/legacy.go | 108 +++++++++--- pkg/legacy/legacy_test.go | 231 +++++++++++++++++++++++-- pkg/legacy/legacytest/test.go | 5 + pkg/sender/jetstream/jetstream.go | 2 +- pkg/sender/jetstream/jetstream_test.go | 10 +- testing/fixtures.go | 2 + 14 files changed, 611 insertions(+), 83 deletions(-) diff --git a/pkg/commander/beb/beb.go b/pkg/commander/beb/beb.go index 1c138b1..56d3db5 100644 --- a/pkg/commander/beb/beb.go +++ b/pkg/commander/beb/beb.go @@ -128,7 +128,7 @@ func (c *Commander) Start() error { // start handler which blocks until it receives a shutdown signal if err := handler.NewHandler(messageReceiver, messageSender, health.NewChecker(), c.envCfg.RequestTimeout, legacyTransformer, c.opts, - subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleanerV1, ceBuilder).Start(ctx); err != nil { + subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleanerV1, ceBuilder, c.envCfg.EventTypePrefix, env.EventMeshBackend).Start(ctx); err != nil { return xerrors.Errorf("failed to start handler for %s : %v", bebCommanderName, err) } c.namedLogger().Info("Event Publisher was shut down") diff --git a/pkg/commander/nats/nats.go b/pkg/commander/nats/nats.go index 1068971..46540e4 100644 --- a/pkg/commander/nats/nats.go +++ b/pkg/commander/nats/nats.go @@ -137,7 +137,7 @@ func (c *Commander) Start() error { // start handler which blocks until it receives a shutdown signal if err := handler.NewHandler(messageReceiver, messageSender, messageSender, c.envCfg.RequestTimeout, legacyTransformer, c.opts, - subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleanerV1, ceBuilder).Start(ctx); err != nil { + subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleanerV1, ceBuilder, c.envCfg.EventTypePrefix, env.JetStreamBackend).Start(ctx); err != nil { return xerrors.Errorf("failed to start handler for %s : %v", natsCommanderName, err) } diff --git a/pkg/env/types.go b/pkg/env/types.go index 3336ad9..062d4d7 100644 --- a/pkg/env/types.go +++ b/pkg/env/types.go @@ -1,3 +1,8 @@ package env -const OldEventTypePrefix = "sap.kyma.custom" +type ActiveBackend string + +const ( + JetStreamBackend = "JetStream" + EventMeshBackend = "EventMesh" +) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index ea17545..9b9041c 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -9,6 +9,8 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" + "github.com/gorilla/mux" "github.com/kyma-project/kyma/components/eventing-controller/logger" "go.uber.org/zap" @@ -59,8 +61,10 @@ type Handler struct { // eventTypeCleaner cleans the cloud event type eventTypeCleaner eventtype.Cleaner // builds the cloud event according to Subscription v1alpha2 specifications - ceBuilder builder.CloudEventBuilder - router *mux.Router + ceBuilder builder.CloudEventBuilder + router *mux.Router + activeBackend env.ActiveBackend + OldEventTypePrefix string } const ( @@ -71,7 +75,7 @@ const ( func NewHandler(receiver *receiver.HTTPMessageReceiver, sender sender.GenericSender, healthChecker health.Checker, requestTimeout time.Duration, legacyTransformer legacy.RequestToCETransformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logger.Logger, collector metrics.PublishingMetricsCollector, eventTypeCleaner eventtype.Cleaner, - ceBuilder builder.CloudEventBuilder) *Handler { + ceBuilder builder.CloudEventBuilder, oldEventTypePrefix string, activeBackend env.ActiveBackend) *Handler { return &Handler{ Receiver: receiver, @@ -85,6 +89,8 @@ func NewHandler(receiver *receiver.HTTPMessageReceiver, sender sender.GenericSen collector: collector, eventTypeCleaner: eventTypeCleaner, ceBuilder: ceBuilder, + OldEventTypePrefix: oldEventTypePrefix, + activeBackend: activeBackend, } } @@ -122,32 +128,112 @@ func (h *Handler) maxBytes(f http.HandlerFunc) http.HandlerFunc { } } -// publishLegacyEventsAsCE converts an incoming request in legacy event format to a cloudevent and dispatches it using -// the configured GenericSender. -func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { - event, _ := h.LegacyTransformer.TransformLegacyRequestsToCE(writer, request) - if event == nil { - h.namedLogger().Error("Failed to transform legacy event to CloudEvent, event is nil") - return - } - ctx := request.Context() - - result, err := h.sendEventAndRecordMetrics(ctx, event, h.Sender.URL(), request.Header) +// handlePublishLegacyEventV1alpha1 handles the publishing of metrics. +// It writes to the user request if any error occurs. +// Otherwise, returns the result. +func (h *Handler) handleSendEventAndRecordMetricsLegacy(writer http.ResponseWriter, request *http.Request, event *cev2event.Event) (sender.PublishResult, error) { + result, err := h.sendEventAndRecordMetrics(request.Context(), event, h.Sender.URL(), request.Header) if err != nil { - h.namedLogger().With().Error(err) + h.namedLogger().Error(err) httpStatus := http.StatusInternalServerError if errors.Is(err, sender.ErrInsufficientStorage) { httpStatus = http.StatusInsufficientStorage } else if errors.Is(err, sender.ErrBackendTargetNotFound) { httpStatus = http.StatusBadGateway } - h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, httpStatus, event, err.Error()) + h.LegacyTransformer.WriteCEResponseAsLegacyResponse(writer, httpStatus, event, err.Error()) + return nil, err + } + h.namedLogger().Debug(result) + return result, nil +} + +// handlePublishLegacyEventV1alpha2 handles the publishing of events for Subscription v1alpha2 CRD. +// It writes to the user request if any error occurs. +// Otherwise, return the published event. +func (h *Handler) handlePublishLegacyEventV1alpha2(writer http.ResponseWriter, publishData *api.PublishRequestData, request *http.Request) (sender.PublishResult, *cev2event.Event) { + ceEvent, err := h.LegacyTransformer.TransformPublishRequestToCloudEvent(publishData) + if err != nil { + legacy.WriteJSONResponse(writer, legacy.ErrorResponse(http.StatusInternalServerError, err)) + return nil, nil + } + + // set original type header + ceEvent.SetExtension(originalTypeHeaderName, ceEvent.Type()) + + // build a new cloud event instance as per specifications per backend + event, err := h.ceBuilder.Build(*ceEvent) + if err != nil { + legacy.WriteJSONResponse(writer, legacy.ErrorResponseBadRequest(err.Error())) + return nil, nil + } + + result, err := h.handleSendEventAndRecordMetricsLegacy(writer, request, event) + if err != nil { + return nil, nil + } + + return result, event +} + +// handlePublishLegacyEventV1alpha1 handles the publishing of events for Subscription v1alpha1 CRD. +// It writes to the user request if any error occurs. +// Otherwise, return the published event. +func (h *Handler) handlePublishLegacyEventV1alpha1(writer http.ResponseWriter, publishData *api.PublishRequestData, request *http.Request) (sender.PublishResult, *cev2event.Event) { + event, _ := h.LegacyTransformer.WriteLegacyRequestsToCE(writer, publishData) + if event == nil { + h.namedLogger().Error("Failed to transform legacy event to CloudEvent, event is nil") + return nil, nil + } + + result, err := h.handleSendEventAndRecordMetricsLegacy(writer, request, event) + if err != nil { + return nil, nil + } + + return result, event +} + +// publishLegacyEventsAsCE converts an incoming request in legacy event format to a cloudevent and dispatches it using +// the configured GenericSender. +func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { + var publishedEvent *cev2event.Event + var successResult sender.PublishResult + + // extract publish data from request + publishRequestData, errResp, _ := h.LegacyTransformer.ExtractPublishRequestData(request) + if errResp != nil { + legacy.WriteJSONResponse(writer, errResp) return } - h.namedLogger().With().Debug(result) - // Change response as per old error codes - h.LegacyTransformer.TransformsCEResponseToLegacyResponse(writer, result.HTTPStatus(), event, string(result.ResponseBody())) + // publish event for Subscription v1alpha2 + if h.Options.EnableNewCRDVersion { + successResult, publishedEvent = h.handlePublishLegacyEventV1alpha2(writer, publishRequestData, request) + // if publishedEvent is nil, then it means that the publishing failed + // and the response is already returned to the user + if publishedEvent == nil { + return + } + } + + // publish event for Subscription v1alpha1 + // In case of EnableNewCRDVersion is true and the active backend is JetStream + // then we will publish event on both possible subjects + // i.e. with prefix (`sap.kyma.custom`) and without prefix + // this behaviour will be deprecated when we remove support for JetStream with Subscription `exact` typeMatching + if !h.Options.EnableNewCRDVersion || h.activeBackend == env.JetStreamBackend { + successResult, publishedEvent = h.handlePublishLegacyEventV1alpha1(writer, publishRequestData, request) + // if publishedEvent is nil, then it means that the publishing failed + // and the response is already returned to the user + if publishedEvent == nil { + return + } + } + + // return success response to user + // change response as per old error codes + h.LegacyTransformer.WriteCEResponseAsLegacyResponse(writer, successResult.HTTPStatus(), publishedEvent, string(successResult.ResponseBody())) } // publishCloudEvents validates an incoming cloudevent and dispatches it using @@ -168,7 +254,7 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R eventTypeOriginal := event.Type() event.SetExtension(originalTypeHeaderName, eventTypeOriginal) - if h.Options.EnableNewCRDVersion && !strings.HasPrefix(eventTypeOriginal, env.OldEventTypePrefix) { + if h.Options.EnableNewCRDVersion && !strings.HasPrefix(eventTypeOriginal, h.OldEventTypePrefix) { // build a new cloud event instance as per specifications per backend event, err = h.ceBuilder.Build(*event) if err != nil { diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index 8a9f86c..04154af 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -553,6 +553,7 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { LegacyTransformer: tt.fields.LegacyTransformer, collector: tt.fields.collector, eventTypeCleaner: tt.fields.eventTypeCleaner, + Options: &options.Options{}, } writer := httptest.NewRecorder() diff --git a/pkg/handler/handler_v1alpha2_test.go b/pkg/handler/handler_v1alpha2_test.go index 831b8fa..744036b 100644 --- a/pkg/handler/handler_v1alpha2_test.go +++ b/pkg/handler/handler_v1alpha2_test.go @@ -2,6 +2,7 @@ package handler import ( "context" + "encoding/json" "fmt" "io" "net/http" @@ -9,6 +10,11 @@ import ( "strings" "testing" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/legacytest" + "github.com/stretchr/testify/require" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" @@ -24,6 +30,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/eventmesh" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) func TestHandler_publishCloudEventsV1Alpha2(t *testing.T) { @@ -303,6 +310,7 @@ func TestHandler_publishCloudEventsV1Alpha2(t *testing.T) { Options: &options.Options{ Env: options.Env{EnableNewCRDVersion: true}, }, + OldEventTypePrefix: testingutils.OldEventTypePrefix, } writer := httptest.NewRecorder() @@ -322,6 +330,168 @@ func TestHandler_publishCloudEventsV1Alpha2(t *testing.T) { } } +func TestHandler_publishLegacyEventsAsCEV1alpha2(t *testing.T) { + // define common given variables + appLister := NewApplicationListerOrDie(context.Background(), "testapp") + + // set mock for latency metrics + latency := new(mocks.BucketsProvider) + latency.On("Buckets").Return(nil) + + tests := []struct { + name string + givenSender sender.GenericSender + givenLegacyTransformer legacy.RequestToCETransformer + givenCollector metrics.PublishingMetricsCollector + givenRequest *http.Request + wantHttpStatus int + wantTEF string + }{ + { + name: "Send valid legacy event", + givenSender: &GenericSenderStub{ + Result: eventmesh.HTTPPublishResult{ + Status: 204, + }, + BackendURL: "FOO", + }, + givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), + givenCollector: metrics.NewCollector(latency), + givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + wantHttpStatus: http.StatusOK, + wantTEF: ` + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="testapp",event_type="prefix.testapp.object.created.v1"} 1 + + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 + eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 + + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 + `, + }, + { + name: "Send valid legacy event but cannot send to backend due to target not found (e.g. stream missing)", + givenSender: &GenericSenderStub{ + Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrBackendTargetNotFound), + BackendURL: "FOO", + }, + givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), + givenCollector: metrics.NewCollector(latency), + givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + wantHttpStatus: http.StatusBadGateway, + wantTEF: ` + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 + `, + }, + { + name: "Send valid legacy event but cannot send to backend due to full storage", + givenSender: &GenericSenderStub{ + Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrInsufficientStorage), + BackendURL: "FOO", + }, + givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), + givenCollector: metrics.NewCollector(latency), + givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + wantHttpStatus: 507, + wantTEF: ` + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 + `, + }, + { + name: "Send valid legacy event but cannot send to backend", + givenSender: &GenericSenderStub{ + Err: fmt.Errorf("i cannot send"), + BackendURL: "FOO", + }, + givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), + givenCollector: metrics.NewCollector(latency), + givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + wantHttpStatus: 500, + wantTEF: ` + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 + `, + }, + { + name: "Send invalid legacy event", + givenSender: &GenericSenderStub{ + Result: eventmesh.HTTPPublishResult{ + Status: 204, + }, + BackendURL: "FOO", + }, + givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), + givenCollector: metrics.NewCollector(latency), + givenRequest: legacytest.InvalidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + wantHttpStatus: 400, + wantTEF: "", // this is a client error. We do record an error metric for requests that cannot even be decoded correctly. + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // given + logger, err := eclogger.New("text", "debug") + require.NoError(t, err) + + ceBuilder := builder.NewGenericBuilder("prefix", cleaner.NewJetStreamCleaner(logger), appLister, logger) + + h := &Handler{ + Sender: tt.givenSender, + Logger: logger, + LegacyTransformer: tt.givenLegacyTransformer, + collector: tt.givenCollector, + ceBuilder: ceBuilder, + Options: &options.Options{ + Env: options.Env{EnableNewCRDVersion: true}, + }, + } + writer := httptest.NewRecorder() + + // when + h.publishLegacyEventsAsCE(writer, tt.givenRequest) + + // then + require.Equal(t, tt.wantHttpStatus, writer.Result().StatusCode) + body, err := io.ReadAll(writer.Result().Body) + require.NoError(t, err) + + if tt.wantHttpStatus == http.StatusOK { + ok := &api.PublishResponse{} + err = json.Unmarshal(body, ok) + require.NoError(t, err) + } else { + nok := &api.Error{} + err = json.Unmarshal(body, nok) + require.NoError(t, err) + } + + metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wantTEF) + }) + } +} + // CreateValidStructuredRequestV1Alpha2 creates a structured cloudevent as http request. func CreateValidStructuredRequestV1Alpha2(t *testing.T) *http.Request { t.Helper() diff --git a/pkg/legacy/api/types.go b/pkg/legacy/api/types.go index 5520f9b..de05395 100644 --- a/pkg/legacy/api/types.go +++ b/pkg/legacy/api/types.go @@ -1,10 +1,20 @@ package api -// AnyValue implements the service definition of AnyValue +import "net/http" + +// AnyValue implements the service definition of AnyValue. type AnyValue interface { } -// PublishRequestV1 implements the service definition of PublishRequestV1 +// PublishRequestData holds request data. +type PublishRequestData struct { + PublishEventParameters *PublishEventParametersV1 + ApplicationName string + Headers http.Header + URLPath string +} + +// PublishRequestV1 implements the service definition of PublishRequestV1. type PublishRequestV1 struct { EventType string `json:"event-type,omitempty"` EventTypeVersion string `json:"event-type-version,omitempty"` @@ -13,19 +23,19 @@ type PublishRequestV1 struct { Data AnyValue `json:"data,omitempty"` } -// PublishEventParametersV1 holds parameters to PublishEvent +// PublishEventParametersV1 holds parameters to PublishEvent. type PublishEventParametersV1 struct { PublishrequestV1 PublishRequestV1 `json:"publishrequest,omitempty"` } -// PublishResponse implements the service definition of PublishResponse +// PublishResponse implements the service definition of PublishResponse. type PublishResponse struct { EventID string `json:"event-id,omitempty"` Status string `json:"status"` Reason string `json:"reason"` } -// Error implements the service definition of APIError +// Error implements the service definition of APIError. type Error struct { Status int `json:"status,omitempty"` Type string `json:"type,omitempty"` @@ -34,7 +44,7 @@ type Error struct { Details []ErrorDetail `json:"details,omitempty"` } -// ErrorDetail implements the service definition of APIErrorDetail +// ErrorDetail implements the service definition of APIErrorDetail. type ErrorDetail struct { Field string `json:"field,omitempty"` Type string `json:"type,omitempty"` @@ -42,7 +52,7 @@ type ErrorDetail struct { MoreInfo string `json:"moreInfo,omitempty"` } -// PublishEventResponses holds responses of PublishEvent +// PublishEventResponses holds responses of PublishEvent. type PublishEventResponses struct { Ok *PublishResponse Error *Error diff --git a/pkg/legacy/helpers.go b/pkg/legacy/helpers.go index 58321bd..b57a6ff 100644 --- a/pkg/legacy/helpers.go +++ b/pkg/legacy/helpers.go @@ -44,8 +44,8 @@ func is2XXStatusCode(statusCode int) bool { return statusCode >= http.StatusOK && statusCode < http.StatusMultipleChoices } -// writeJSONResponse writes a JSON response -func writeJSONResponse(w http.ResponseWriter, resp *api.PublishEventResponses) { +// WriteJSONResponse writes a JSON response. +func WriteJSONResponse(w http.ResponseWriter, resp *api.PublishEventResponses) { encoder := json.NewEncoder(w) w.Header().Set(internal.HeaderContentType, internal.ContentTypeApplicationJSON) diff --git a/pkg/legacy/legacy.go b/pkg/legacy/legacy.go index 57559bd..7fe1b5a 100644 --- a/pkg/legacy/legacy.go +++ b/pkg/legacy/legacy.go @@ -8,14 +8,13 @@ import ( "strings" "time" - cev2event "github.com/cloudevents/sdk-go/v2/event" + cev2 "github.com/cloudevents/sdk-go/v2/event" "github.com/google/uuid" "github.com/pkg/errors" "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" apiv1 "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing" ) var ( @@ -29,8 +28,10 @@ const ( ) type RequestToCETransformer interface { - TransformLegacyRequestsToCE(http.ResponseWriter, *http.Request) (*cev2event.Event, string) - TransformsCEResponseToLegacyResponse(http.ResponseWriter, int, *cev2event.Event, string) + ExtractPublishRequestData(*http.Request) (*apiv1.PublishRequestData, *apiv1.PublishEventResponses, error) + TransformPublishRequestToCloudEvent(*apiv1.PublishRequestData) (*cev2.Event, error) + WriteLegacyRequestsToCE(http.ResponseWriter, *apiv1.PublishRequestData) (*cev2.Event, string) + WriteCEResponseAsLegacyResponse(http.ResponseWriter, int, *cev2.Event, string) } type Transformer struct { @@ -47,7 +48,7 @@ func NewTransformer(bebNamespace string, eventTypePrefix string, applicationList } } -// CheckParameters validates the parameters in the request and sends error responses if found invalid +// CheckParameters validates the parameters in the request and sends error responses if found invalid. func (t *Transformer) checkParameters(parameters *apiv1.PublishEventParametersV1) (response *apiv1.PublishEventResponses) { if parameters == nil { return ErrorResponseBadRequest(ErrorMessageBadPayload) @@ -81,14 +82,12 @@ func (t *Transformer) checkParameters(parameters *apiv1.PublishEventParametersV1 return &apiv1.PublishEventResponses{} } -// TransformLegacyRequestsToCE transforms the legacy event to cloudevent from the given request. -// It also returns the original event-type without cleanup as the second return type. -func (t *Transformer) TransformLegacyRequestsToCE(writer http.ResponseWriter, request *http.Request) (*cev2event.Event, string) { +// ExtractPublishRequestData extracts the data for publishing event from the given legacy event request. +func (t *Transformer) ExtractPublishRequestData(request *http.Request) (*apiv1.PublishRequestData, *apiv1.PublishEventResponses, error) { // parse request body to PublishRequestV1 if request.Body == nil || request.ContentLength == 0 { resp := ErrorResponseBadRequest(ErrorMessageBadPayload) - writeJSONResponse(writer, resp) - return nil, "" + return nil, resp, errors.New(resp.Error.Message) } parameters := &apiv1.PublishEventParametersV1{} @@ -100,20 +99,37 @@ func (t *Transformer) TransformLegacyRequestsToCE(writer http.ResponseWriter, re } else { resp = ErrorResponseBadRequest(err.Error()) } - writeJSONResponse(writer, resp) - return nil, "" + return nil, resp, errors.New(resp.Error.Message) } // validate the PublishRequestV1 for missing / incoherent values checkResp := t.checkParameters(parameters) if checkResp.Error != nil { - writeJSONResponse(writer, checkResp) - return nil, "" + return nil, checkResp, errors.New(checkResp.Error.Message) + } + + // validate the application name + appName := ParseApplicationNameFromPath(request.URL.Path) + if !application.IsCleanName(appName) { + err := errors.New("application name should be cleaned from non-alphanumeric characters") + return nil, ErrorResponse(http.StatusInternalServerError, err), err } + publishRequestData := &apiv1.PublishRequestData{ + PublishEventParameters: parameters, + ApplicationName: appName, + URLPath: request.URL.Path, + Headers: request.Header, + } + + return publishRequestData, nil, nil +} + +// WriteLegacyRequestsToCE transforms the legacy event to cloudevent from the given request. +// It also returns the original event-type without cleanup as the second return type. +func (t *Transformer) WriteLegacyRequestsToCE(writer http.ResponseWriter, publishData *apiv1.PublishRequestData) (*cev2.Event, string) { // clean the application name form non-alphanumeric characters - appNameOriginal := ParseApplicationNameFromPath(request.URL.Path) - appName := appNameOriginal + appName := publishData.ApplicationName if appObj, err := t.applicationLister.Get(appName); err == nil { // handle existing applications appName = application.GetCleanTypeOrName(appObj) @@ -122,23 +138,22 @@ func (t *Transformer) TransformLegacyRequestsToCE(writer http.ResponseWriter, re appName = application.GetCleanName(appName) } - event, err := t.convertPublishRequestToCloudEvent(appName, parameters) + event, err := t.convertPublishRequestToCloudEvent(appName, publishData.PublishEventParameters) if err != nil { response := ErrorResponse(http.StatusInternalServerError, err) - writeJSONResponse(writer, response) + WriteJSONResponse(writer, response) return nil, "" } - // Add tracing context to cloud events - tracing.AddTracingContextToCEExtensions(request.Header, event) - // prepare the original event-type without cleanup - eventType := formatEventType(t.eventTypePrefix, appNameOriginal, parameters.PublishrequestV1.EventType, parameters.PublishrequestV1.EventTypeVersion) + eventType := formatEventType(t.eventTypePrefix, publishData.ApplicationName, + publishData.PublishEventParameters.PublishrequestV1.EventType, + publishData.PublishEventParameters.PublishrequestV1.EventTypeVersion) return event, eventType } -func (t *Transformer) TransformsCEResponseToLegacyResponse(writer http.ResponseWriter, statusCode int, event *cev2event.Event, msg string) { +func (t *Transformer) WriteCEResponseAsLegacyResponse(writer http.ResponseWriter, statusCode int, event *cev2.Event, msg string) { response := &apiv1.PublishEventResponses{} // Fail if !is2XXStatusCode(statusCode) { @@ -146,22 +161,61 @@ func (t *Transformer) TransformsCEResponseToLegacyResponse(writer http.ResponseW Status: statusCode, Message: msg, } - writeJSONResponse(writer, response) + WriteJSONResponse(writer, response) return } // Success response.Ok = &apiv1.PublishResponse{EventID: event.ID()} - writeJSONResponse(writer, response) + WriteJSONResponse(writer, response) +} + +// TransformPublishRequestToCloudEvent converts the given publish request to a CloudEvent with raw values. +func (t *Transformer) TransformPublishRequestToCloudEvent(publishRequestData *apiv1.PublishRequestData) (*cev2.Event, error) { + source := publishRequestData.ApplicationName + publishRequest := publishRequestData.PublishEventParameters + + // instantiate a new cloudEvent object + event := cev2.New(cev2.CloudEventsVersionV1) + eventName := publishRequest.PublishrequestV1.EventType + eventTypeVersion := publishRequest.PublishrequestV1.EventTypeVersion + + // set type by combining type and version (.) e.g. order.created.v1 + event.SetType(fmt.Sprintf("%s.%s", eventName, eventTypeVersion)) + event.SetSource(source) + event.SetExtension(eventTypeVersionExtensionKey, eventTypeVersion) + event.SetDataContentType(internal.ContentTypeApplicationJSON) + + // set cloudEvent time + evTime, err := time.Parse(time.RFC3339, publishRequest.PublishrequestV1.EventTime) + if err != nil { + return nil, errors.Wrap(err, "failed to parse time from the external publish request") + } + event.SetTime(evTime) + + // set cloudEvent data + if err := event.SetData(internal.ContentTypeApplicationJSON, publishRequest.PublishrequestV1.Data); err != nil { + return nil, errors.Wrap(err, "failed to set data to CloudEvent data field") + } + + // set the event id from the request if it is available + // otherwise generate a new one + if len(publishRequest.PublishrequestV1.EventID) > 0 { + event.SetID(publishRequest.PublishrequestV1.EventID) + } else { + event.SetID(uuid.New().String()) + } + + return &event, nil } // convertPublishRequestToCloudEvent converts the given publish request to a CloudEvent. -func (t *Transformer) convertPublishRequestToCloudEvent(appName string, publishRequest *apiv1.PublishEventParametersV1) (*cev2event.Event, error) { +func (t *Transformer) convertPublishRequestToCloudEvent(appName string, publishRequest *apiv1.PublishEventParametersV1) (*cev2.Event, error) { if !application.IsCleanName(appName) { return nil, errors.New("application name should be cleaned from none-alphanumeric characters") } - event := cev2event.New(cev2event.CloudEventsVersionV1) + event := cev2.New(cev2.CloudEventsVersionV1) evTime, err := time.Parse(time.RFC3339, publishRequest.PublishrequestV1.EventTime) if err != nil { diff --git a/pkg/legacy/legacy_test.go b/pkg/legacy/legacy_test.go index 6bed1f9..1246361 100644 --- a/pkg/legacy/legacy_test.go +++ b/pkg/legacy/legacy_test.go @@ -3,10 +3,13 @@ package legacy import ( "context" "fmt" + "net/http" "net/http/httptest" "testing" "time" + cev2event "github.com/cloudevents/sdk-go/v2/event" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -16,7 +19,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" legacyapi "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/legacytest" - . "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) const ( @@ -58,15 +61,6 @@ func TestTransformLegacyRequestsToCE(t *testing.T) { wantVersion: "v1", wantType: "pre1.pre2.pre3.app.object.do.v1", }, - { - name: "unclean", - givenPrefix: "p!r@e&1.p,r:e2.p|r+e3", - givenApplication: "m(i_s+h*a}p", - givenTypeLabel: "", - givenEventName: "o{b?j>e$c't.d;o", - wantVersion: "v1", - wantType: "pre1.pre2.pre3.mishap.object.do.v1", - }, { name: "event name too many segments", givenPrefix: "pre1.pre2.pre3", @@ -102,7 +96,9 @@ func TestTransformLegacyRequestsToCE(t *testing.T) { app := applicationtest.NewApplication(tc.givenApplication, applicationTypeLabel(tc.givenTypeLabel)) appLister := fake.NewApplicationListerOrDie(ctx, app) transformer := NewTransformer("test", tc.givenPrefix, appLister) - gotEvent, gotEventType := transformer.TransformLegacyRequestsToCE(writer, request) + publishData, errResp, _ := transformer.ExtractPublishRequestData(request) + assert.Nil(t, errResp) + gotEvent, gotEventType := transformer.WriteLegacyRequestsToCE(writer, publishData) wantEventType := formatEventType(tc.givenPrefix, tc.givenApplication, tc.givenEventName, tc.wantVersion) assert.Equal(t, wantEventType, gotEventType) @@ -130,22 +126,22 @@ func applicationTypeLabel(label string) map[string]string { } func TestConvertPublishRequestToCloudEvent(t *testing.T) { - givenEventID := EventID - givenApplicationName := ApplicationName - givenEventTypePrefix := Prefix + givenEventID := testingutils.EventID + givenApplicationName := testingutils.ApplicationName + givenEventTypePrefix := testingutils.Prefix givenTimeNow := time.Now().Format(time.RFC3339) - givenLegacyEventVersion := EventVersion + givenLegacyEventVersion := testingutils.EventVersion givenPublishReqParams := &legacyapi.PublishEventParametersV1{ PublishrequestV1: legacyapi.PublishRequestV1{ EventID: givenEventID, EventType: eventTypeMultiSegment, EventTime: givenTimeNow, EventTypeVersion: givenLegacyEventVersion, - Data: EventData, + Data: testingutils.EventData, }, } - wantBEBNamespace := MessagingNamespace + wantBEBNamespace := testingutils.MessagingNamespace wantEventID := givenEventID wantEventType := formatEventType(givenEventTypePrefix, givenApplicationName, eventTypeMultiSegmentCombined, givenLegacyEventVersion) wantTimeNowFormatted, _ := time.Parse(time.RFC3339, givenTimeNow) @@ -174,8 +170,8 @@ func TestCombineEventTypeSegments(t *testing.T) { }{ { name: "event-type with two segments", - givenEventType: EventName, - wantEventType: EventName, + givenEventType: testingutils.EventName, + wantEventType: testingutils.EventName, }, { name: "event-type with more than two segments", @@ -233,3 +229,200 @@ func TestRemoveNonAlphanumeric(t *testing.T) { }) } } + +func TestExtractPublishRequestData(t *testing.T) { + const givenVersion = "v1" + const givenPrefix = "pre1.pre2.pre3" + const givenApplication = "app" + const givenEventName = "object.do" + + testCases := []struct { + name string + givenLegacyRequestFunc func() (*http.Request, error) + wantPublishRequestData *legacyapi.PublishRequestData + wantErrorResponse *legacyapi.PublishEventResponses + }{ + { + name: "should fail if request body is empty", + givenLegacyRequestFunc: func() (*http.Request, error) { + return legacytest.InvalidLegacyRequestWithEmptyBody(givenVersion, givenApplication) + }, + wantErrorResponse: ErrorResponseBadRequest(ErrorMessageBadPayload), + }, + { + name: "should fail if request body has missing parameters", + givenLegacyRequestFunc: func() (*http.Request, error) { + return legacytest.InvalidLegacyRequest(givenVersion, givenApplication, givenEventName) + }, + wantErrorResponse: ErrorResponseMissingFieldEventType(), + }, + { + name: "should fail if application name is not cleaned from non-alphanumeric characters", + givenLegacyRequestFunc: func() (*http.Request, error) { + return legacytest.ValidLegacyRequest(givenVersion, "app^^*&", givenEventName) + }, + wantErrorResponse: &legacyapi.PublishEventResponses{ + Error: &legacyapi.Error{ + Status: http.StatusInternalServerError, + Message: "application name should be cleaned from non-alphanumeric characters", + }, + }, + }, + { + name: "should succeed if request body is valid", + givenLegacyRequestFunc: func() (*http.Request, error) { + return legacytest.ValidLegacyRequest(givenVersion, givenApplication, givenEventName) + }, + wantPublishRequestData: &legacyapi.PublishRequestData{ + PublishEventParameters: &legacyapi.PublishEventParametersV1{ + PublishrequestV1: legacyapi.PublishRequestV1{ + EventType: "object.do", + EventTypeVersion: "v1", + EventTime: "2020-04-02T21:37:00Z", + Data: "{\"legacy\":\"event\"}", + }, + }, + ApplicationName: "app", + URLPath: "/app/v1/events", + }, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + // given + request, err := tc.givenLegacyRequestFunc() + require.NoError(t, err) + // set expected header + if tc.wantPublishRequestData != nil { + tc.wantPublishRequestData.Headers = request.Header + } + + transformer := NewTransformer("test", givenPrefix, nil) + + // when + publishData, errResp, err := transformer.ExtractPublishRequestData(request) + + // then + if tc.wantErrorResponse != nil { + require.Error(t, err) + require.Equal(t, *tc.wantErrorResponse, *errResp) + } else { + require.NoError(t, err) + require.Nil(t, errResp) + require.Equal(t, *tc.wantPublishRequestData, *publishData) + } + }) + } +} + +func TestTransformPublishRequestToCloudEvent(t *testing.T) { + const givenVersion = "v1" + const givenPrefix = "pre1.pre2.pre3" + const givenApplication = "app" + const givenEventName = "object.do" + + testCases := []struct { + name string + givenPublishEventParameters legacyapi.PublishEventParametersV1 + wantCloudEventFunc func() (cev2event.Event, error) + wantErrorResponse legacyapi.PublishEventResponses + wantError bool + wantEventType string + wantSource string + wantData string + wantEventID string + }{ + { + name: "should succeed if publish data is valid", + givenPublishEventParameters: legacyapi.PublishEventParametersV1{ + PublishrequestV1: legacyapi.PublishRequestV1{ + EventID: testingutils.EventID, + EventType: givenEventName, + EventTypeVersion: givenVersion, + EventTime: "2020-04-02T21:37:00Z", + Data: map[string]string{"key": "value"}, + }, + }, + wantError: false, + wantEventID: testingutils.EventID, + wantEventType: "object.do.v1", + wantSource: givenApplication, + wantData: `{"key":"value"}`, + }, + { + name: "should set new event ID when not provided", + givenPublishEventParameters: legacyapi.PublishEventParametersV1{ + PublishrequestV1: legacyapi.PublishRequestV1{ + EventType: givenEventName, + EventTypeVersion: givenVersion, + EventTime: "2020-04-02T21:37:00Z", + Data: map[string]string{"key": "value"}, + }, + }, + wantError: false, + wantEventType: "object.do.v1", + wantSource: givenApplication, + wantData: `{"key":"value"}`, + }, + { + name: "should fail if event time is invalid", + givenPublishEventParameters: legacyapi.PublishEventParametersV1{ + PublishrequestV1: legacyapi.PublishRequestV1{ + EventType: givenEventName, + EventTypeVersion: givenVersion, + EventTime: "20dsadsa20-04-02T21:37:00Z", + Data: map[string]string{"key": "value"}, + }, + }, + wantError: true, + }, + { + name: "should fail if event data is not json", + givenPublishEventParameters: legacyapi.PublishEventParametersV1{ + PublishrequestV1: legacyapi.PublishRequestV1{ + EventType: givenEventName, + EventTypeVersion: givenVersion, + EventTime: "20dsadsa20-04-02T21:37:00Z", + Data: "test", + }, + }, + wantError: true, + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + + // given + givenPublishRequestData := legacyapi.PublishRequestData{ + PublishEventParameters: &tc.givenPublishEventParameters, + ApplicationName: givenApplication, + } + transformer := NewTransformer("test", givenPrefix, nil) + + // when + ceEvent, err := transformer.TransformPublishRequestToCloudEvent(&givenPublishRequestData) + + // then + if tc.wantError { + require.Error(t, err) + } else { + require.NoError(t, err) + + require.Equal(t, tc.wantEventType, ceEvent.Type()) + require.Equal(t, tc.wantSource, ceEvent.Source()) + require.Equal(t, tc.wantData, string(ceEvent.Data())) + require.NotEmpty(t, ceEvent.ID()) + if tc.wantEventID != "" { + require.Equal(t, tc.wantEventID, ceEvent.ID()) + } + } + }) + } +} diff --git a/pkg/legacy/legacytest/test.go b/pkg/legacy/legacytest/test.go index d377db7..e5eaf32 100644 --- a/pkg/legacy/legacytest/test.go +++ b/pkg/legacy/legacytest/test.go @@ -51,3 +51,8 @@ func ValidLegacyRequestOrDie(t *testing.T, version, appname, eventType string) * assert.NoError(t, err) return r } + +func InvalidLegacyRequestWithEmptyBody(version, appname string) (*http.Request, error) { + url := fmt.Sprintf("http://localhost:8080/%s/%s/events", appname, version) + return http.NewRequest(http.MethodPost, url, nil) +} diff --git a/pkg/sender/jetstream/jetstream.go b/pkg/sender/jetstream/jetstream.go index dbb014b..52bf187 100644 --- a/pkg/sender/jetstream/jetstream.go +++ b/pkg/sender/jetstream/jetstream.go @@ -126,7 +126,7 @@ func (s *Sender) eventToNATSMsg(event *event.Event) (*nats.Msg, error) { // getJsSubjectToPublish appends stream name to subject if needed. func (s *Sender) getJsSubjectToPublish(subject string) string { // if subscription CRD v1alpha2 is enabled then do not append prefix. - if s.opts.EnableNewCRDVersion && !strings.HasPrefix(subject, env.OldEventTypePrefix) { + if s.opts.EnableNewCRDVersion && !strings.HasPrefix(subject, s.envCfg.EventTypePrefix) { return subject } diff --git a/pkg/sender/jetstream/jetstream_test.go b/pkg/sender/jetstream/jetstream_test.go index 1e79d30..e39f372 100644 --- a/pkg/sender/jetstream/jetstream_test.go +++ b/pkg/sender/jetstream/jetstream_test.go @@ -203,9 +203,10 @@ func addConsumer(t *testing.T, connection *nats.Conn, sc *nats.StreamConfig, con func CreateNATSJsConfig(url string) *env.NATSConfig { return &env.NATSConfig{ - JSStreamName: testingutils.StreamName, - URL: url, - ReconnectWait: time.Second, + JSStreamName: testingutils.StreamName, + URL: url, + ReconnectWait: time.Second, + EventTypePrefix: testingutils.OldEventTypePrefix, } } @@ -286,7 +287,8 @@ func TestSender_getJsSubjectToPublish(t *testing.T) { t.Parallel() s := &Sender{ - opts: tc.fields.opts, + opts: tc.fields.opts, + envCfg: CreateNATSJsConfig(""), } assert.Equal(t, tc.want, s.getJsSubjectToPublish(tc.subject)) }) diff --git a/testing/fixtures.go b/testing/fixtures.go index 2e34588..054d83b 100644 --- a/testing/fixtures.go +++ b/testing/fixtures.go @@ -34,6 +34,8 @@ const ( CloudEventSpecVersion = "1.0" LegacyEventTime = "2020-04-02T21:37:00Z" + + OldEventTypePrefix = "sap.kyma.custom" ) type Event struct { From 949140ca65dd38a089642b0dc202bc42adc68016 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Fri, 30 Dec 2022 16:49:10 +0100 Subject: [PATCH 145/194] Change `BEB` to `EventMesh` in `epp/pkg/env` (#16472) * Change `BEB` to `EventMesh` in epp/pkg/beb_config.go and beb_config_test.go. * Bump the image of epp. --- pkg/commander/beb/beb.go | 10 +++++----- pkg/commander/nats/nats.go | 4 ++-- .../{beb_config.go => eventmesh_config.go} | 18 ++++++++--------- ...onfig_test.go => eventmesh_config_test.go} | 2 +- pkg/env/nats_config.go | 8 ++++---- pkg/oauth/client.go | 2 +- pkg/oauth/client_test.go | 2 +- pkg/oauth/config.go | 2 +- pkg/oauth/config_test.go | 2 +- pkg/sender/eventmesh/eventmesh_test.go | 4 ++-- testing/env_config.go | 20 +++++++++---------- 11 files changed, 37 insertions(+), 37 deletions(-) rename pkg/env/{beb_config.go => eventmesh_config.go} (68%) rename pkg/env/{beb_config_test.go => eventmesh_config_test.go} (85%) diff --git a/pkg/commander/beb/beb.go b/pkg/commander/beb/beb.go index 56d3db5..76fa772 100644 --- a/pkg/commander/beb/beb.go +++ b/pkg/commander/beb/beb.go @@ -41,7 +41,7 @@ const ( // Commander implements the Commander interface. type Commander struct { cancel context.CancelFunc - envCfg *env.BEBConfig + envCfg *env.EventMeshConfig logger *logger.Logger metricsCollector *metrics.Collector opts *options.Options @@ -52,7 +52,7 @@ func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, lo return &Commander{ metricsCollector: metricsCollector, logger: logger, - envCfg: new(env.BEBConfig), + envCfg: new(env.EventMeshConfig), opts: opts, } } @@ -92,7 +92,7 @@ func (c *Commander) Start() error { // configure legacyTransformer legacyTransformer := legacy.NewTransformer( - c.envCfg.BEBNamespace, + c.envCfg.EventMeshNamespace, c.envCfg.EventTypePrefix, applicationLister, ) @@ -108,7 +108,7 @@ func (c *Commander) Start() error { subscribedProcessor := &subscribed.Processor{ SubscriptionLister: &subLister, Prefix: c.envCfg.EventTypePrefix, - Namespace: c.envCfg.BEBNamespace, + Namespace: c.envCfg.EventMeshNamespace, Logger: c.logger, } // Sync informer cache or die @@ -123,7 +123,7 @@ func (c *Commander) Start() error { eventTypeCleaner := cleaner.NewEventMeshCleaner(c.logger) // configure cloud event builder for subscription CRD v1alpha2 - ceBuilder := builder.NewEventMeshBuilder(c.envCfg.EventTypePrefix, c.envCfg.BEBNamespace, eventTypeCleaner, + ceBuilder := builder.NewEventMeshBuilder(c.envCfg.EventTypePrefix, c.envCfg.EventMeshNamespace, eventTypeCleaner, applicationLister, c.logger) // start handler which blocks until it receives a shutdown signal diff --git a/pkg/commander/nats/nats.go b/pkg/commander/nats/nats.go index 46540e4..1280040 100644 --- a/pkg/commander/nats/nats.go +++ b/pkg/commander/nats/nats.go @@ -100,7 +100,7 @@ func (c *Commander) Start() error { // configure legacyTransformer legacyTransformer := legacy.NewTransformer( - c.envCfg.ToConfig().BEBNamespace, + c.envCfg.ToConfig().EventMeshNamespace, c.envCfg.ToConfig().EventTypePrefix, applicationLister, ) @@ -116,7 +116,7 @@ func (c *Commander) Start() error { subscribedProcessor := &subscribed.Processor{ SubscriptionLister: &subLister, Prefix: c.envCfg.ToConfig().EventTypePrefix, - Namespace: c.envCfg.ToConfig().BEBNamespace, + Namespace: c.envCfg.ToConfig().EventMeshNamespace, Logger: c.logger, } diff --git a/pkg/env/beb_config.go b/pkg/env/eventmesh_config.go similarity index 68% rename from pkg/env/beb_config.go rename to pkg/env/eventmesh_config.go index 19471c7..0200202 100644 --- a/pkg/env/beb_config.go +++ b/pkg/env/eventmesh_config.go @@ -7,10 +7,10 @@ import ( ) // compile time check -var _ fmt.Stringer = &BEBConfig{} +var _ fmt.Stringer = &EventMeshConfig{} -// BEBConfig represents the environment config for the Event Publisher to BEB. -type BEBConfig struct { +// EventMeshConfig represents the environment config for the Event Publisher to EventMesh. +type EventMeshConfig struct { Port int `envconfig:"INGRESS_PORT" default:"8080"` ClientID string `envconfig:"CLIENT_ID" required:"true"` ClientSecret string `envconfig:"CLIENT_SECRET" required:"true"` @@ -19,22 +19,22 @@ type BEBConfig struct { MaxIdleConns int `envconfig:"MAX_IDLE_CONNS" default:"100"` MaxIdleConnsPerHost int `envconfig:"MAX_IDLE_CONNS_PER_HOST" default:"2"` RequestTimeout time.Duration `envconfig:"REQUEST_TIMEOUT" default:"5s"` - // BEBNamespace is the name of the namespace in BEB which is used as the event source for legacy events - BEBNamespace string `envconfig:"BEB_NAMESPACE" required:"true"` + // EventMeshNamespace is the name of the namespace in EventMesh which is used as the event source for legacy events + EventMeshNamespace string `envconfig:"BEB_NAMESPACE" required:"true"` // EventTypePrefix is the prefix of each event as per the eventing specification // It follows the eventType format: ... EventTypePrefix string `envconfig:"EVENT_TYPE_PREFIX" default:""` } // ConfigureTransport receives an HTTP transport and configure its max idle connection properties. -func (c *BEBConfig) ConfigureTransport(transport *http.Transport) { +func (c *EventMeshConfig) ConfigureTransport(transport *http.Transport) { transport.MaxIdleConns = c.MaxIdleConns transport.MaxIdleConnsPerHost = c.MaxIdleConnsPerHost } // String implements the fmt.Stringer interface -func (c *BEBConfig) String() string { - return fmt.Sprintf("BEBConfig{ Port: %v; TokenEndPoint: %v; EmsPublishURL: %v; "+ +func (c *EventMeshConfig) String() string { + return fmt.Sprintf("EventMeshConfig{ Port: %v; TokenEndPoint: %v; EmsPublishURL: %v; "+ "MaxIdleConns: %v; MaxIdleConnsPerHost: %v; RequestTimeout: %v; BEBNamespace: %v; EventTypePrefix: %v }", - c.Port, c.TokenEndpoint, c.EmsPublishURL, c.MaxIdleConns, c.MaxIdleConnsPerHost, c.RequestTimeout, c.BEBNamespace, c.EventTypePrefix) + c.Port, c.TokenEndpoint, c.EmsPublishURL, c.MaxIdleConns, c.MaxIdleConnsPerHost, c.RequestTimeout, c.EventMeshNamespace, c.EventTypePrefix) } diff --git a/pkg/env/beb_config_test.go b/pkg/env/eventmesh_config_test.go similarity index 85% rename from pkg/env/beb_config_test.go rename to pkg/env/eventmesh_config_test.go index 69e5949..2d7646d 100644 --- a/pkg/env/beb_config_test.go +++ b/pkg/env/eventmesh_config_test.go @@ -14,7 +14,7 @@ func TestConfigureTransport(t *testing.T) { ) transport := &http.Transport{} - cfg := BEBConfig{MaxIdleConns: maxIdleConnections, MaxIdleConnsPerHost: maxIdleConnectionsPerHost} + cfg := EventMeshConfig{MaxIdleConns: maxIdleConnections, MaxIdleConnsPerHost: maxIdleConnectionsPerHost} cfg.ConfigureTransport(transport) if transport.MaxIdleConns != maxIdleConnections { diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go index 459c9be..b0ce850 100644 --- a/pkg/env/nats_config.go +++ b/pkg/env/nats_config.go @@ -30,10 +30,10 @@ type NATSConfig struct { } // ToConfig converts to a default BEB BEBConfig -func (c *NATSConfig) ToConfig() *BEBConfig { - cfg := &BEBConfig{ - BEBNamespace: c.LegacyNamespace, - EventTypePrefix: c.EventTypePrefix, +func (c *NATSConfig) ToConfig() *EventMeshConfig { + cfg := &EventMeshConfig{ + EventMeshNamespace: c.LegacyNamespace, + EventTypePrefix: c.EventTypePrefix, } return cfg } diff --git a/pkg/oauth/client.go b/pkg/oauth/client.go index 0c07a2b..7ee34e0 100644 --- a/pkg/oauth/client.go +++ b/pkg/oauth/client.go @@ -12,7 +12,7 @@ import ( ) // NewClient returns a new HTTP client which have nested transports for handling oauth2 security, HTTP connection pooling, and tracing. -func NewClient(ctx context.Context, cfg *env.BEBConfig) *http.Client { +func NewClient(ctx context.Context, cfg *env.EventMeshConfig) *http.Client { // configure auth client config := Config(cfg) client := config.Client(ctx) diff --git a/pkg/oauth/client_test.go b/pkg/oauth/client_test.go index 4d829f9..3ac093b 100644 --- a/pkg/oauth/client_test.go +++ b/pkg/oauth/client_test.go @@ -22,7 +22,7 @@ func TestNewClient(t *testing.T) { maxIdleConnsPerHost = 200 ) - client := NewClient(context.Background(), &env.BEBConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) + client := NewClient(context.Background(), &env.EventMeshConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) defer client.CloseIdleConnections() ocTransport, ok := client.Transport.(*ochttp.Transport) diff --git a/pkg/oauth/config.go b/pkg/oauth/config.go index 3360949..bf55a70 100644 --- a/pkg/oauth/config.go +++ b/pkg/oauth/config.go @@ -7,7 +7,7 @@ import ( ) // Config returns a new oauth2 client credentials config instance. -func Config(cfg *env.BEBConfig) clientcredentials.Config { +func Config(cfg *env.EventMeshConfig) clientcredentials.Config { return clientcredentials.Config{ ClientID: cfg.ClientID, ClientSecret: cfg.ClientSecret, diff --git a/pkg/oauth/config_test.go b/pkg/oauth/config_test.go index 503f80d..c698c1e 100644 --- a/pkg/oauth/config_test.go +++ b/pkg/oauth/config_test.go @@ -9,7 +9,7 @@ import ( func TestConfig(t *testing.T) { t.Parallel() - cfg := &env.BEBConfig{ClientID: "someID", ClientSecret: "someSecret", TokenEndpoint: "someEndpoint"} + cfg := &env.EventMeshConfig{ClientID: "someID", ClientSecret: "someSecret", TokenEndpoint: "someEndpoint"} conf := Config(cfg) if cfg.ClientID != conf.ClientID { diff --git a/pkg/sender/eventmesh/eventmesh_test.go b/pkg/sender/eventmesh/eventmesh_test.go index 139310a..ae83837 100644 --- a/pkg/sender/eventmesh/eventmesh_test.go +++ b/pkg/sender/eventmesh/eventmesh_test.go @@ -30,7 +30,7 @@ const ( func TestNewHttpMessageSender(t *testing.T) { t.Parallel() - client := oauth.NewClient(context.Background(), &env.BEBConfig{}) + client := oauth.NewClient(context.Background(), &env.EventMeshConfig{}) defer client.CloseIdleConnections() msgSender := NewSender(eventsEndpoint, client) @@ -45,7 +45,7 @@ func TestNewHttpMessageSender(t *testing.T) { func TestNewRequestWithTarget(t *testing.T) { t.Parallel() - client := oauth.NewClient(context.Background(), &env.BEBConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) + client := oauth.NewClient(context.Background(), &env.EventMeshConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) defer client.CloseIdleConnections() msgSender := NewSender(eventsEndpoint, client) diff --git a/testing/env_config.go b/testing/env_config.go index af33876..5b0afb6 100644 --- a/testing/env_config.go +++ b/testing/env_config.go @@ -6,48 +6,48 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" ) -func NewEnvConfig(emsCEURL, authURL string, opts ...EnvConfigOption) *env.BEBConfig { - envConfig := &env.BEBConfig{Port: 8080, EmsPublishURL: emsCEURL, TokenEndpoint: authURL, RequestTimeout: time.Minute} +func NewEnvConfig(emsCEURL, authURL string, opts ...EnvConfigOption) *env.EventMeshConfig { + envConfig := &env.EventMeshConfig{Port: 8080, EmsPublishURL: emsCEURL, TokenEndpoint: authURL, RequestTimeout: time.Minute} for _, opt := range opts { opt(envConfig) } return envConfig } -type EnvConfigOption func(e *env.BEBConfig) +type EnvConfigOption func(e *env.EventMeshConfig) func WithPort(port int) EnvConfigOption { - return func(e *env.BEBConfig) { + return func(e *env.EventMeshConfig) { e.Port = port } } func WithMaxIdleConns(maxIdleConns int) EnvConfigOption { - return func(e *env.BEBConfig) { + return func(e *env.EventMeshConfig) { e.MaxIdleConns = maxIdleConns } } func WithMaxIdleConnsPerHost(maxIdleConnsPerHost int) EnvConfigOption { - return func(e *env.BEBConfig) { + return func(e *env.EventMeshConfig) { e.MaxIdleConnsPerHost = maxIdleConnsPerHost } } func WithRequestTimeout(requestTimeout time.Duration) EnvConfigOption { - return func(e *env.BEBConfig) { + return func(e *env.EventMeshConfig) { e.RequestTimeout = requestTimeout } } func WithBEBNamespace(bebNs string) EnvConfigOption { - return func(e *env.BEBConfig) { - e.BEBNamespace = bebNs + return func(e *env.EventMeshConfig) { + e.EventMeshNamespace = bebNs } } func WithEventTypePrefix(eventTypePrefix string) EnvConfigOption { - return func(e *env.BEBConfig) { + return func(e *env.EventMeshConfig) { e.EventTypePrefix = eventTypePrefix } } From c3353a92cf9fdb274486d5a69d7eaeb7f58e26df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jan 2023 10:55:12 +0100 Subject: [PATCH 146/194] gomod(deps): bump golang.org/x/oauth2 from 0.3.0 to 0.4.0 in /components/event-publisher-proxy (#16505) * gomod(deps): bump golang.org/x/oauth2 Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.3.0 to 0.4.0. - [Release notes](https://github.com/golang/oauth2/releases) - [Commits](https://github.com/golang/oauth2/compare/v0.3.0...v0.4.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 180730e..5948b03 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/stretchr/testify v1.8.1 go.opencensus.io v0.24.0 go.uber.org/zap v1.24.0 - golang.org/x/oauth2 v0.3.0 + golang.org/x/oauth2 v0.4.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 k8s.io/api v0.25.5 k8s.io/apimachinery v0.25.5 @@ -71,10 +71,10 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect - golang.org/x/net v0.4.0 // indirect - golang.org/x/sys v0.3.0 // indirect - golang.org/x/term v0.3.0 // indirect - golang.org/x/text v0.5.0 // indirect + golang.org/x/net v0.5.0 // indirect + golang.org/x/sys v0.4.0 // indirect + golang.org/x/term v0.4.0 // indirect + golang.org/x/text v0.6.0 // indirect golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index fc59da9..c97bf0f 100644 --- a/go.sum +++ b/go.sum @@ -412,8 +412,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -430,8 +430,8 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.3.0 h1:6l90koy8/LaBLmLu8jpHeHexzMwEita0zFfYlggy2F8= -golang.org/x/oauth2 v0.3.0/go.mod h1:rQrIauxkUhJ6CuwEXwymO2/eh4xz2ZWF1nBkcxS+tGk= +golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= +golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -497,13 +497,13 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/term v0.4.0 h1:O7UWfv5+A2qiuulQk30kVinPoMtoIPeVaKLEgLpVkvg= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -514,8 +514,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 62039b069f08265bfcc66be9281fb66b54462751 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Tue, 10 Jan 2023 14:46:00 +0100 Subject: [PATCH 147/194] improve application name parsing from request path (#16510) * slight improvement to application name parsing * bump image Co-authored-by: Friedrich --- pkg/legacy/helpers.go | 12 ++++++------ pkg/legacy/helpers_test.go | 8 +++++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pkg/legacy/helpers.go b/pkg/legacy/helpers.go index b57a6ff..8925707 100644 --- a/pkg/legacy/helpers.go +++ b/pkg/legacy/helpers.go @@ -27,16 +27,16 @@ const ( // ParseApplicationNameFromPath returns application name from the URL. // The format of the URL is: /:application-name/v1/... +// returns empty string if application-name cannot be found func ParseApplicationNameFromPath(path string) string { // Assumption: Clients(application validator which has a flag for the path (https://github.com/kyma-project/kyma/blob/main/components/application-connectivity-validator/cmd/applicationconnectivityvalidator/applicationconnectivityvalidator.go#L49) using this endpoint must be sending request to path /:application/v1/events // Hence it should be safe to return 0th index as the application name - pathSegments := make([]string, 0) - for _, segment := range strings.Split(path, "/") { - if strings.TrimSpace(segment) != "" { - pathSegments = append(pathSegments, segment) - } + path = strings.TrimLeft(path, "/") + application, _, ok := strings.Cut(path, "/") + if ok { + return application } - return pathSegments[0] + return "" } // is2XXStatusCode checks whether status code is a 2XX status code diff --git a/pkg/legacy/helpers_test.go b/pkg/legacy/helpers_test.go index 8a17f59..249fce1 100644 --- a/pkg/legacy/helpers_test.go +++ b/pkg/legacy/helpers_test.go @@ -16,11 +16,17 @@ func TestParseApplicationNameFromPath(t *testing.T) { name: "should return application when correct path is used", givenInputPath: "/application/v1/events", wantAppName: "application", - }, { + }, + { name: "should return application when extra slash is in the path", givenInputPath: "//application/v1/events", wantAppName: "application", }, + { + name: "should return empty string when no slash contained in cleaned up path", + givenInputPath: "//events", + wantAppName: "", + }, } for _, tc := range testCases { tc := tc From 849d014336f8c0f5f757664971304ffb0a2cd663 Mon Sep 17 00:00:00 2001 From: Mansur Uralov Date: Wed, 11 Jan 2023 11:31:18 +0100 Subject: [PATCH 148/194] Fix legacy event not clean appName issue (#16532) * Fix legacy event not clean appName issue * Don't validate app name while extracting request data, as it is checked during CE conversion * Bump Eventing Publisher Proxy PR Number --- pkg/handler/handler.go | 8 ++++---- pkg/legacy/legacy.go | 6 ------ pkg/legacy/legacy_test.go | 35 +++++++++++++++++++++++++---------- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 9b9041c..d6d7808 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -128,7 +128,7 @@ func (h *Handler) maxBytes(f http.HandlerFunc) http.HandlerFunc { } } -// handlePublishLegacyEventV1alpha1 handles the publishing of metrics. +// handleSendEventAndRecordMetricsLegacy handles the publishing of metrics. // It writes to the user request if any error occurs. // Otherwise, returns the result. func (h *Handler) handleSendEventAndRecordMetricsLegacy(writer http.ResponseWriter, request *http.Request, event *cev2event.Event) (sender.PublishResult, error) { @@ -148,10 +148,10 @@ func (h *Handler) handleSendEventAndRecordMetricsLegacy(writer http.ResponseWrit return result, nil } -// handlePublishLegacyEventV1alpha2 handles the publishing of events for Subscription v1alpha2 CRD. +// handlePublishLegacyEvent handles the publishing of events for Subscription v1alpha2 CRD. // It writes to the user request if any error occurs. // Otherwise, return the published event. -func (h *Handler) handlePublishLegacyEventV1alpha2(writer http.ResponseWriter, publishData *api.PublishRequestData, request *http.Request) (sender.PublishResult, *cev2event.Event) { +func (h *Handler) handlePublishLegacyEvent(writer http.ResponseWriter, publishData *api.PublishRequestData, request *http.Request) (sender.PublishResult, *cev2event.Event) { ceEvent, err := h.LegacyTransformer.TransformPublishRequestToCloudEvent(publishData) if err != nil { legacy.WriteJSONResponse(writer, legacy.ErrorResponse(http.StatusInternalServerError, err)) @@ -209,7 +209,7 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h // publish event for Subscription v1alpha2 if h.Options.EnableNewCRDVersion { - successResult, publishedEvent = h.handlePublishLegacyEventV1alpha2(writer, publishRequestData, request) + successResult, publishedEvent = h.handlePublishLegacyEvent(writer, publishRequestData, request) // if publishedEvent is nil, then it means that the publishing failed // and the response is already returned to the user if publishedEvent == nil { diff --git a/pkg/legacy/legacy.go b/pkg/legacy/legacy.go index 7fe1b5a..c54f4e1 100644 --- a/pkg/legacy/legacy.go +++ b/pkg/legacy/legacy.go @@ -108,13 +108,7 @@ func (t *Transformer) ExtractPublishRequestData(request *http.Request) (*apiv1.P return nil, checkResp, errors.New(checkResp.Error.Message) } - // validate the application name appName := ParseApplicationNameFromPath(request.URL.Path) - if !application.IsCleanName(appName) { - err := errors.New("application name should be cleaned from non-alphanumeric characters") - return nil, ErrorResponse(http.StatusInternalServerError, err), err - } - publishRequestData := &apiv1.PublishRequestData{ PublishEventParameters: parameters, ApplicationName: appName, diff --git a/pkg/legacy/legacy_test.go b/pkg/legacy/legacy_test.go index 1246361..48199e0 100644 --- a/pkg/legacy/legacy_test.go +++ b/pkg/legacy/legacy_test.go @@ -61,6 +61,15 @@ func TestTransformLegacyRequestsToCE(t *testing.T) { wantVersion: "v1", wantType: "pre1.pre2.pre3.app.object.do.v1", }, + { + name: "not clean app name", + givenPrefix: "pre1.pre2.pre3", + givenApplication: "no-app", + givenTypeLabel: "", + givenEventName: "object.do", + wantVersion: "v1", + wantType: "pre1.pre2.pre3.noapp.object.do.v1", + }, { name: "event name too many segments", givenPrefix: "pre1.pre2.pre3", @@ -257,21 +266,27 @@ func TestExtractPublishRequestData(t *testing.T) { wantErrorResponse: ErrorResponseMissingFieldEventType(), }, { - name: "should fail if application name is not cleaned from non-alphanumeric characters", + name: "should succeed if request body is valid", givenLegacyRequestFunc: func() (*http.Request, error) { - return legacytest.ValidLegacyRequest(givenVersion, "app^^*&", givenEventName) + return legacytest.ValidLegacyRequest(givenVersion, givenApplication, givenEventName) }, - wantErrorResponse: &legacyapi.PublishEventResponses{ - Error: &legacyapi.Error{ - Status: http.StatusInternalServerError, - Message: "application name should be cleaned from non-alphanumeric characters", + wantPublishRequestData: &legacyapi.PublishRequestData{ + PublishEventParameters: &legacyapi.PublishEventParametersV1{ + PublishrequestV1: legacyapi.PublishRequestV1{ + EventType: "object.do", + EventTypeVersion: "v1", + EventTime: "2020-04-02T21:37:00Z", + Data: "{\"legacy\":\"event\"}", + }, }, + ApplicationName: "app", + URLPath: "/app/v1/events", }, }, { - name: "should succeed if request body is valid", + name: "should succeed if app name has a special character", givenLegacyRequestFunc: func() (*http.Request, error) { - return legacytest.ValidLegacyRequest(givenVersion, givenApplication, givenEventName) + return legacytest.ValidLegacyRequest(givenVersion, "no-app", givenEventName) }, wantPublishRequestData: &legacyapi.PublishRequestData{ PublishEventParameters: &legacyapi.PublishEventParametersV1{ @@ -282,8 +297,8 @@ func TestExtractPublishRequestData(t *testing.T) { Data: "{\"legacy\":\"event\"}", }, }, - ApplicationName: "app", - URLPath: "/app/v1/events", + ApplicationName: "no-app", + URLPath: "/no-app/v1/events", }, }, } From ca87fa2df128d4d8daf034e4a44aa48e9e9cfaab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Jan 2023 12:13:11 +0100 Subject: [PATCH 149/194] gomod(deps): bump github.com/cloudevents/sdk-go/v2 from 2.12.0 to 2.13.0 in /components/event-publisher-proxy (#16520) * gomod(deps): bump github.com/cloudevents/sdk-go/v2 Bumps [github.com/cloudevents/sdk-go/v2](https://github.com/cloudevents/sdk-go) from 2.12.0 to 2.13.0. - [Release notes](https://github.com/cloudevents/sdk-go/releases) - [Commits](https://github.com/cloudevents/sdk-go/compare/v2.12.0...v2.13.0) --- updated-dependencies: - dependency-name: github.com/cloudevents/sdk-go/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5948b03..cefb9c6 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy go 1.19 require ( - github.com/cloudevents/sdk-go/v2 v2.12.0 + github.com/cloudevents/sdk-go/v2 v2.13.0 github.com/google/uuid v1.3.0 github.com/gorilla/mux v1.8.0 github.com/kelseyhightower/envconfig v1.4.0 diff --git a/go.sum b/go.sum index c97bf0f..62d8d07 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/v2 v2.12.0 h1:p1k+ysVOZtNiXfijnwB3WqZNA3y2cGOiKQygWkUHCEI= -github.com/cloudevents/sdk-go/v2 v2.12.0/go.mod h1:xDmKfzNjM8gBvjaF8ijFjM1VYOVUEeUfapHMUX1T5To= +github.com/cloudevents/sdk-go/v2 v2.13.0 h1:2zxDS8RyY1/wVPULGGbdgniGXSzLaRJVl136fLXGsYw= +github.com/cloudevents/sdk-go/v2 v2.13.0/go.mod h1:xDmKfzNjM8gBvjaF8ijFjM1VYOVUEeUfapHMUX1T5To= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= From 7e98e4c3b25737630f118c42ac47c7ac3b2c9c74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Jan 2023 16:25:12 +0100 Subject: [PATCH 150/194] gomod(deps): bump github.com/nats-io/nats-server/v2 from 2.9.10 to 2.9.11 in /components/event-publisher-proxy (#16512) * gomod(deps): bump github.com/nats-io/nats-server/v2 Bumps [github.com/nats-io/nats-server/v2](https://github.com/nats-io/nats-server) from 2.9.10 to 2.9.11. - [Release notes](https://github.com/nats-io/nats-server/releases) - [Changelog](https://github.com/nats-io/nats-server/blob/main/.goreleaser.yml) - [Commits](https://github.com/nats-io/nats-server/compare/v2.9.10...v2.9.11) --- updated-dependencies: - dependency-name: github.com/nats-io/nats-server/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update values.yaml Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 4 ++-- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index cefb9c6..f8ff83f 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f - github.com/nats-io/nats-server/v2 v2.9.10 + github.com/nats-io/nats-server/v2 v2.9.11 github.com/nats-io/nats.go v1.22.1 github.com/onsi/gomega v1.24.2 github.com/pkg/errors v0.9.1 @@ -70,7 +70,7 @@ require ( github.com/stretchr/objx v0.5.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.0.0-20220926161630-eccd6366d1be // indirect + golang.org/x/crypto v0.5.0 // indirect golang.org/x/net v0.5.0 // indirect golang.org/x/sys v0.4.0 // indirect golang.org/x/term v0.4.0 // indirect diff --git a/go.sum b/go.sum index 62d8d07..00c84d4 100644 --- a/go.sum +++ b/go.sum @@ -257,8 +257,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= -github.com/nats-io/nats-server/v2 v2.9.10 h1:LMC46Oi9E6BUx/xBsaCVZgofliAqKQzRPU6eKWkN8jE= -github.com/nats-io/nats-server/v2 v2.9.10/go.mod h1:AB6hAnGZDlYfqb7CTAm66ZKMZy9DpfierY1/PbpvI2g= +github.com/nats-io/nats-server/v2 v2.9.11 h1:4y5SwWvWI59V5mcqtuoqKq6L9NDUydOP3Ekwuwl8cZI= +github.com/nats-io/nats-server/v2 v2.9.11/go.mod h1:b0oVuxSlkvS3ZjMkncFeACGyZohbO4XhSqW1Lt7iRRY= github.com/nats-io/nats.go v1.22.1 h1:XzfqDspY0RNufzdrB8c4hFR+R3dahkxlpWe5+IWJzbE= github.com/nats-io/nats.go v1.22.1/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= From 97233e0fb05cd9b524dd446fed4d2e0416ab0a49 Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Thu, 12 Jan 2023 11:35:20 +0100 Subject: [PATCH 151/194] Cleanup event type from prefixes before forwarding event to the sink (#16496) * Cleanup event type from prefixes before forwarding event to the sink * image bump --- pkg/cloudevents/builder/eventmesh_test.go | 5 +++++ pkg/cloudevents/builder/generic.go | 3 +++ pkg/cloudevents/builder/generic_test.go | 5 +++++ pkg/cloudevents/builder/types.go | 4 ++++ pkg/handler/handler.go | 8 -------- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/pkg/cloudevents/builder/eventmesh_test.go b/pkg/cloudevents/builder/eventmesh_test.go index c4b5b30..c1a3630 100644 --- a/pkg/cloudevents/builder/eventmesh_test.go +++ b/pkg/cloudevents/builder/eventmesh_test.go @@ -129,6 +129,11 @@ func Test_EventMesh_Build(t *testing.T) { require.NoError(t, err) require.Equal(t, tc.wantSource, buildEvent.Source()) require.Equal(t, tc.wantType, buildEvent.Type()) + + // check that original type header exists + originalType, ok := buildEvent.Extensions()[OriginalTypeHeaderName] + require.True(t, ok) + require.Equal(t, tc.givenType, originalType) } }) } diff --git a/pkg/cloudevents/builder/generic.go b/pkg/cloudevents/builder/generic.go index e5feb24..2e28e05 100644 --- a/pkg/cloudevents/builder/generic.go +++ b/pkg/cloudevents/builder/generic.go @@ -56,6 +56,9 @@ func (gb *GenericBuilder) Build(event cev2event.Event) (*cev2event.Event, error) namedLogger.Debugf("using event type: %s", finalEventType) ceEvent := event.Clone() + // set original type header + ceEvent.SetExtension(OriginalTypeHeaderName, event.Type()) + // set prefixed type ceEvent.SetType(finalEventType) ceEvent.SetSource(cleanSource) diff --git a/pkg/cloudevents/builder/generic_test.go b/pkg/cloudevents/builder/generic_test.go index 8c20dc2..d710970 100644 --- a/pkg/cloudevents/builder/generic_test.go +++ b/pkg/cloudevents/builder/generic_test.go @@ -116,6 +116,11 @@ func Test_Build(t *testing.T) { require.NoError(t, err) require.Equal(t, tc.wantSource, buildEvent.Source()) require.Equal(t, tc.wantType, buildEvent.Type()) + + // check that original type header exists + originalType, ok := buildEvent.Extensions()[OriginalTypeHeaderName] + require.True(t, ok) + require.Equal(t, tc.givenType, originalType) } }) } diff --git a/pkg/cloudevents/builder/types.go b/pkg/cloudevents/builder/types.go index c811f54..06e8ff4 100644 --- a/pkg/cloudevents/builder/types.go +++ b/pkg/cloudevents/builder/types.go @@ -7,6 +7,10 @@ import ( "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" ) +const ( + OriginalTypeHeaderName = "originaltype" +) + type CloudEventBuilder interface { Build(event cev2event.Event) (*cev2event.Event, error) } diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index d6d7808..1b7928c 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -67,10 +67,6 @@ type Handler struct { OldEventTypePrefix string } -const ( - originalTypeHeaderName = "ce-original-type" -) - // NewHandler returns a new HTTP Handler instance. func NewHandler(receiver *receiver.HTTPMessageReceiver, sender sender.GenericSender, healthChecker health.Checker, requestTimeout time.Duration, legacyTransformer legacy.RequestToCETransformer, opts *options.Options, subscribedProcessor *subscribed.Processor, @@ -158,9 +154,6 @@ func (h *Handler) handlePublishLegacyEvent(writer http.ResponseWriter, publishDa return nil, nil } - // set original type header - ceEvent.SetExtension(originalTypeHeaderName, ceEvent.Type()) - // build a new cloud event instance as per specifications per backend event, err := h.ceBuilder.Build(*ceEvent) if err != nil { @@ -252,7 +245,6 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R } eventTypeOriginal := event.Type() - event.SetExtension(originalTypeHeaderName, eventTypeOriginal) if h.Options.EnableNewCRDVersion && !strings.HasPrefix(eventTypeOriginal, h.OldEventTypePrefix) { // build a new cloud event instance as per specifications per backend From d7991c8b196db4178cd43c9aa040e5bccb9918dc Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Tue, 24 Jan 2023 10:00:22 +0100 Subject: [PATCH 152/194] Dependencies bump for Eventing controller and EPP (#16632) * Lib bump for Eventing controller and EPP * image bump * bump k8s libs Co-authored-by: Friedrich --- Dockerfile | 2 +- go.mod | 24 ++++++++++++------------ go.sum | 30 +++++++++++++++--------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index 59799c1..a69dc0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.19.4-alpine3.17 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.19.5-alpine3.17 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy diff --git a/go.mod b/go.mod index f8ff83f..e2e1c57 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f github.com/nats-io/nats-server/v2 v2.9.11 - github.com/nats-io/nats.go v1.22.1 - github.com/onsi/gomega v1.24.2 + github.com/nats-io/nats.go v1.23.0 + github.com/onsi/gomega v1.25.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 github.com/stretchr/testify v1.8.1 @@ -19,9 +19,9 @@ require ( go.uber.org/zap v1.24.0 golang.org/x/oauth2 v0.4.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 - k8s.io/api v0.25.5 - k8s.io/apimachinery v0.25.5 - k8s.io/client-go v0.25.5 + k8s.io/api v0.25.6 + k8s.io/apimachinery v0.25.6 + k8s.io/client-go v0.25.6 sigs.k8s.io/controller-runtime v0.13.1 ) @@ -83,7 +83,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.25.0 // indirect - k8s.io/component-base v0.25.5 // indirect + k8s.io/component-base v0.25.6 // indirect k8s.io/klog/v2 v2.80.1 // indirect k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect @@ -94,12 +94,12 @@ require ( replace ( // keep all following packages at the same version - k8s.io/api => k8s.io/api v0.25.5 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.5 - k8s.io/apimachinery => k8s.io/apimachinery v0.25.5 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.5 - k8s.io/component-base => k8s.io/component-base v0.25.5 - k8s.io/kubectl => k8s.io/kubectl v0.25.5 + k8s.io/api => k8s.io/api v0.25.6 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.6 + k8s.io/apimachinery => k8s.io/apimachinery v0.25.6 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.6 + k8s.io/component-base => k8s.io/component-base v0.25.6 + k8s.io/kubectl => k8s.io/kubectl v0.25.6 ) replace ( diff --git a/go.sum b/go.sum index 00c84d4..20286d1 100644 --- a/go.sum +++ b/go.sum @@ -259,8 +259,8 @@ github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.9.11 h1:4y5SwWvWI59V5mcqtuoqKq6L9NDUydOP3Ekwuwl8cZI= github.com/nats-io/nats-server/v2 v2.9.11/go.mod h1:b0oVuxSlkvS3ZjMkncFeACGyZohbO4XhSqW1Lt7iRRY= -github.com/nats-io/nats.go v1.22.1 h1:XzfqDspY0RNufzdrB8c4hFR+R3dahkxlpWe5+IWJzbE= -github.com/nats-io/nats.go v1.22.1/go.mod h1:tLqubohF7t4z3du1QDPYJIQQyhb4wl6DhjxEajSI7UA= +github.com/nats-io/nats.go v1.23.0 h1:lR28r7IX44WjYgdiKz9GmUeW0uh/m33uD3yEjLZ2cOE= +github.com/nats-io/nats.go v1.23.0/go.mod h1:ki/Scsa23edbh8IRZbCuNXR9TDcbvfaSijKtaqQgw+Q= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -269,9 +269,9 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.6.1 h1:1xQPCjcqYw/J5LchOcp4/2q/jzJFjiAOc25chhnDw+Q= -github.com/onsi/gomega v1.24.2 h1:J/tulyYK6JwBldPViHJReihxxZ+22FHs0piGjQAvoUE= -github.com/onsi/gomega v1.24.2/go.mod h1:gs3J10IS7Z7r7eXRoNJIrNqU4ToQukCJhFtKrWgHWnk= +github.com/onsi/ginkgo/v2 v2.7.0 h1:/XxtEV3I3Eif/HobnVx9YmJgk8ENdRsuUmM+fLCFNow= +github.com/onsi/gomega v1.25.0 h1:Vw7br2PCDYijJHSfBOWhov+8cAnUf8MfMaIOV323l6Y= +github.com/onsi/gomega v1.25.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -745,16 +745,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.5 h1:mqyHf7aoaYMpdvO87mqpol+Qnsmo+y09S0PMIXwiZKo= -k8s.io/api v0.25.5/go.mod h1:RzplZX0Z8rV/WhSTfEvnyd91bBhBQTRWo85qBQwRmb8= -k8s.io/apiextensions-apiserver v0.25.5 h1:iHkMyFGzRgXO8AQlCYPVTVsKLqXvruswirIW8hRji+g= -k8s.io/apiextensions-apiserver v0.25.5/go.mod h1:TWAHgFssGm050Oe6MhN+Jaeav+ISEl9M/qWsPzq2s3k= -k8s.io/apimachinery v0.25.5 h1:SQomYHvv+aO43qdu3QKRf9YuI0oI8w3RrOQ1qPbAUGY= -k8s.io/apimachinery v0.25.5/go.mod h1:1S2i1QHkmxc8+EZCIxe/fX5hpldVXk4gvnJInMEb8D4= -k8s.io/client-go v0.25.5 h1:7QWVK0Ph4bLn0UwotPTc2FTgm8shreQXyvXnnHDd8rE= -k8s.io/client-go v0.25.5/go.mod h1:bOeoaUUdpyz3WDFGo+Xm3nOQFh2KuYXRDwrvbAPtFQA= -k8s.io/component-base v0.25.5 h1:tVni0kgpceq71MDMBSixp8Y621YGvTS/1zq3RABgX9A= -k8s.io/component-base v0.25.5/go.mod h1:9J+e9uIUwUOG2x5q5+aaOR0b8QI5OIqwqPAbeODkYpc= +k8s.io/api v0.25.6 h1:LwDY2H6kD/3R8TekJYYaJWOdekNdXDO44eVpX6sNtJA= +k8s.io/api v0.25.6/go.mod h1:bVp01KUcl8VUHFBTJMOknWNo7XvR0cMbeTTuFg1zCUs= +k8s.io/apiextensions-apiserver v0.25.6 h1:MwdaCpHtGVSM5SiA6Hm4g2w5voMNiPCwBjOqz9YTlrg= +k8s.io/apiextensions-apiserver v0.25.6/go.mod h1:aXw8Xmhf6/gfGx3y0xkj8o8evTZbfOFqZeWIigg4XsE= +k8s.io/apimachinery v0.25.6 h1:r6KIF2AHwLqFfZ0LcOA3I11SF62YZK83dxj1fn14NOQ= +k8s.io/apimachinery v0.25.6/go.mod h1:1S2i1QHkmxc8+EZCIxe/fX5hpldVXk4gvnJInMEb8D4= +k8s.io/client-go v0.25.6 h1:CHxACHi0DijmlYyUR7ooZoXnD5P8jYLgBHcxp775x/U= +k8s.io/client-go v0.25.6/go.mod h1:s9mMAGFYiH3Z66j7BESzu0GEradT9GQ2LjFf/YRrnyc= +k8s.io/component-base v0.25.6 h1:v3ci6FbXFcxpjyQJaaLq0MgzT3vyFzwUDWtO+KRv9Bk= +k8s.io/component-base v0.25.6/go.mod h1:k7DfcfJ8cOI6A2xTCfU5LxsnXV+lWw1ME8cRCHzIh6o= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= From 6d7134da29087096455e12a842ea9902cc97fa55 Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Tue, 24 Jan 2023 10:52:18 +0100 Subject: [PATCH 153/194] Fixed EPP to not clean application name twice (#16621) * Fixed EPP to not clean application name twice * image bump --- pkg/application/clean.go | 16 +++++++++ pkg/application/clean_test.go | 46 +++++++++++++++++++++++++ pkg/cloudevents/builder/generic.go | 2 +- pkg/cloudevents/builder/generic_test.go | 10 +++--- 4 files changed, 68 insertions(+), 6 deletions(-) diff --git a/pkg/application/clean.go b/pkg/application/clean.go index 93014e0..e7a3f28 100644 --- a/pkg/application/clean.go +++ b/pkg/application/clean.go @@ -33,6 +33,22 @@ func GetCleanTypeOrName(application *applicationv1alpha1.Application) string { return GetCleanName(applicationName) } +// GetTypeOrName returns the application name. +// if the application type label exists, it will be returned instead of the application name. +func GetTypeOrName(application *applicationv1alpha1.Application) string { + if application == nil { + return "" + } + applicationName := application.Name + for k, v := range application.Labels { + if strings.ToLower(k) == TypeLabel { + applicationName = v + break + } + } + return applicationName +} + // GetCleanName cleans the name form none-alphanumeric characters and returns the clean name. func GetCleanName(name string) string { return invalidApplicationNameSegment.ReplaceAllString(name, "") diff --git a/pkg/application/clean_test.go b/pkg/application/clean_test.go index 47c6fb5..de5f11c 100644 --- a/pkg/application/clean_test.go +++ b/pkg/application/clean_test.go @@ -3,6 +3,8 @@ package application import ( "testing" + "github.com/stretchr/testify/require" + applicationv1alpha1 "github.com/kyma-project/kyma/components/application-operator/pkg/apis/applicationconnector/v1alpha1" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" @@ -56,6 +58,50 @@ func TestCleanName(t *testing.T) { } } +func Test_GetTypeOrName(t *testing.T) { + testCases := []struct { + name string + givenApplication *applicationv1alpha1.Application + wantName string + }{ + // application type label is missing, then use the application name + { + name: "Should return application name if no labels", + givenApplication: applicationtest.NewApplication("alphanumeric0123", nil), + wantName: "alphanumeric0123", + }, + { + name: "Should return application name if label with right key does not exists", + givenApplication: applicationtest.NewApplication("alphanumeric0123", map[string]string{"ignore-me": "value"}), + wantName: "alphanumeric0123", + }, + { + name: "Should return application name as unclean", + givenApplication: applicationtest.NewApplication("with.!@#none-$%^alphanumeric_&*-characters", nil), + wantName: "with.!@#none-$%^alphanumeric_&*-characters", + }, + // application type label is available, then use it instead of the application name + { + name: "Should return application label instead of name", + givenApplication: applicationtest.NewApplication("alphanumeric0123", map[string]string{TypeLabel: "apptype"}), + wantName: "apptype", + }, + { + name: "Should return application label as unclean", + givenApplication: applicationtest.NewApplication("alphanumeric0123", map[string]string{TypeLabel: "apptype=with.!@#none-$%^alphanumeric_&*-characters"}), + wantName: "apptype=with.!@#none-$%^alphanumeric_&*-characters", + }, + } + + for _, tc := range testCases { + tc := tc + t.Run(tc.name, func(t *testing.T) { + t.Parallel() + require.Equal(t, tc.wantName, GetTypeOrName(tc.givenApplication)) + }) + } +} + func TestIsCleanName(t *testing.T) { testCases := []struct { givenName string diff --git a/pkg/cloudevents/builder/generic.go b/pkg/cloudevents/builder/generic.go index 2e28e05..81d77d0 100644 --- a/pkg/cloudevents/builder/generic.go +++ b/pkg/cloudevents/builder/generic.go @@ -74,7 +74,7 @@ func (gb *GenericBuilder) getFinalSubject(source, eventType string) string { func (gb *GenericBuilder) GetAppNameOrSource(source string, namedLogger *zap.SugaredLogger) string { var appName = source if appObj, err := gb.applicationLister.Get(source); err == nil && appObj != nil { - appName = application.GetCleanTypeOrName(appObj) + appName = application.GetTypeOrName(appObj) namedLogger.With("application", source).Debug("Using application name: %s as source.", appName) } else { namedLogger.With("application", source).Debug("Cannot find application.") diff --git a/pkg/cloudevents/builder/generic_test.go b/pkg/cloudevents/builder/generic_test.go index d710970..668c7c7 100644 --- a/pkg/cloudevents/builder/generic_test.go +++ b/pkg/cloudevents/builder/generic_test.go @@ -65,9 +65,9 @@ func Test_Build(t *testing.T) { givenSource: "appName1", givenType: "order.created.v1", givenApplicationName: "appName1", - givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, - wantType: "prefix.testapptype.order.created.v1", - wantSource: "testapptype", + givenApplicationLabels: map[string]string{application.TypeLabel: "t..est-apptype"}, + wantType: "prefix.test-apptype.order.created.v1", + wantSource: "test-apptype", }, { name: "should return error if empty type", @@ -156,11 +156,11 @@ func Test_GetAppNameOrSource(t *testing.T) { wantSource: "testapptype", }, { - name: "should return cleaned application label", + name: "should return non-clean application label", givenSource: "appName1", givenApplicationName: "appName1", givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, - wantSource: "testapptype", + wantSource: "t..e--s__t!!a@@p##p%%t^^y&&p**e", }, { name: "should return source name as application does not exists", From 9d2b2366d6e4aaacd4d007331666d74f3d432980 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Jan 2023 17:50:33 +0100 Subject: [PATCH 154/194] gomod(deps): bump github.com/onsi/gomega from 1.25.0 to 1.26.0 in /components/event-publisher-proxy (#16652) * gomod(deps): bump github.com/onsi/gomega Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.25.0 to 1.26.0. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.25.0...v1.26.0) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich Co-authored-by: Raymond Pinto <45314732+raypinto@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e2e1c57..e01ba4a 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f github.com/nats-io/nats-server/v2 v2.9.11 github.com/nats-io/nats.go v1.23.0 - github.com/onsi/gomega v1.25.0 + github.com/onsi/gomega v1.26.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 github.com/stretchr/testify v1.8.1 diff --git a/go.sum b/go.sum index 20286d1..35d896b 100644 --- a/go.sum +++ b/go.sum @@ -270,8 +270,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.7.0 h1:/XxtEV3I3Eif/HobnVx9YmJgk8ENdRsuUmM+fLCFNow= -github.com/onsi/gomega v1.25.0 h1:Vw7br2PCDYijJHSfBOWhov+8cAnUf8MfMaIOV323l6Y= -github.com/onsi/gomega v1.25.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= +github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= +github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= From 0cc32210ce4373b7cdee592fe7fb0c48365999f3 Mon Sep 17 00:00:00 2001 From: Raymond Pinto <45314732+raypinto@users.noreply.github.com> Date: Mon, 30 Jan 2023 10:39:15 +0100 Subject: [PATCH 155/194] validate source for valid URI (#16671) * validate source for valid URI * bump imgs * address feedback * fix tests * added comments --- pkg/cloudevents/builder/eventmesh_test.go | 16 +++++------ pkg/cloudevents/builder/generic.go | 5 +++- pkg/cloudevents/builder/generic_test.go | 33 ++++++++++++++++------- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/pkg/cloudevents/builder/eventmesh_test.go b/pkg/cloudevents/builder/eventmesh_test.go index c1a3630..c115d72 100644 --- a/pkg/cloudevents/builder/eventmesh_test.go +++ b/pkg/cloudevents/builder/eventmesh_test.go @@ -97,15 +97,13 @@ func Test_EventMesh_Build(t *testing.T) { // given // build cloud event - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventSource(tc.givenSource), - testingutils.WithCloudEventType(tc.givenType), - ) + builder := testingutils.NewCloudEventBuilder() payload, _ := builder.BuildStructured() newEvent := cloudevents.NewEvent() - newEvent.SetType(testingutils.CloudEventTypeWithPrefix) - err := json.Unmarshal([]byte(payload), &newEvent) + err = json.Unmarshal([]byte(payload), &newEvent) require.NoError(t, err) + newEvent.SetType(tc.givenType) + newEvent.SetSource(tc.givenSource) appLister := fake.NewApplicationListerOrDie( context.Background(), @@ -120,13 +118,13 @@ func Test_EventMesh_Build(t *testing.T) { ) // when - buildEvent, err := eventMeshBuilder.Build(newEvent) + buildEvent, buildErr := eventMeshBuilder.Build(newEvent) // then if tc.wantError { - require.Error(t, err) + require.Error(t, buildErr) } else { - require.NoError(t, err) + require.NoError(t, buildErr) require.Equal(t, tc.wantSource, buildEvent.Source()) require.Equal(t, tc.wantType, buildEvent.Type()) diff --git a/pkg/cloudevents/builder/generic.go b/pkg/cloudevents/builder/generic.go index 81d77d0..3021c63 100644 --- a/pkg/cloudevents/builder/generic.go +++ b/pkg/cloudevents/builder/generic.go @@ -60,7 +60,10 @@ func (gb *GenericBuilder) Build(event cev2event.Event) (*cev2event.Event, error) ceEvent.SetExtension(OriginalTypeHeaderName, event.Type()) // set prefixed type ceEvent.SetType(finalEventType) - ceEvent.SetSource(cleanSource) + // validate the final cloud event + if err = ceEvent.Validate(); err != nil { + return nil, err + } return &ceEvent, nil } diff --git a/pkg/cloudevents/builder/generic_test.go b/pkg/cloudevents/builder/generic_test.go index 668c7c7..6bf8388 100644 --- a/pkg/cloudevents/builder/generic_test.go +++ b/pkg/cloudevents/builder/generic_test.go @@ -67,7 +67,15 @@ func Test_Build(t *testing.T) { givenApplicationName: "appName1", givenApplicationLabels: map[string]string{application.TypeLabel: "t..est-apptype"}, wantType: "prefix.test-apptype.order.created.v1", - wantSource: "test-apptype", + wantSource: "appName1", + }, + { + name: "should return error for providing invalid uri reference as source", + givenSource: "a@@p##p%%", + givenType: "order.created.v1", + givenApplicationName: "appName1", + givenApplicationLabels: map[string]string{application.TypeLabel: "a@@p##p%%"}, + wantError: true, }, { name: "should return error if empty type", @@ -76,6 +84,13 @@ func Test_Build(t *testing.T) { givenApplicationName: "appName1", wantError: true, }, + { + name: "should return error if empty source", + givenSource: "", + givenType: "order.created.v1", + givenApplicationName: "appName1", + wantError: true, + }, } for _, testCase := range testCases { @@ -85,15 +100,13 @@ func Test_Build(t *testing.T) { // given // build cloud event - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventSource(tc.givenSource), - testingutils.WithCloudEventType(tc.givenType), - ) + builder := testingutils.NewCloudEventBuilder() payload, _ := builder.BuildStructured() newEvent := cloudevents.NewEvent() - newEvent.SetType(testingutils.CloudEventTypeWithPrefix) - err := json.Unmarshal([]byte(payload), &newEvent) + err = json.Unmarshal([]byte(payload), &newEvent) require.NoError(t, err) + newEvent.SetType(tc.givenType) + newEvent.SetSource(tc.givenSource) appLister := fake.NewApplicationListerOrDie( context.Background(), @@ -107,13 +120,13 @@ func Test_Build(t *testing.T) { } // when - buildEvent, err := genericBuilder.Build(newEvent) + buildEvent, buildErr := genericBuilder.Build(newEvent) // then if tc.wantError { - require.Error(t, err) + require.Error(t, buildErr) } else { - require.NoError(t, err) + require.NoError(t, buildErr) require.Equal(t, tc.wantSource, buildEvent.Source()) require.Equal(t, tc.wantType, buildEvent.Type()) From ffde3915ba046dd76d47a81a918b3bdfe61fc9f1 Mon Sep 17 00:00:00 2001 From: Mansur Uralov Date: Wed, 8 Feb 2023 12:50:10 +0100 Subject: [PATCH 156/194] Fix Eventing Metrics for new CRD (#16720) * Fix Eventing Metrics for new CRD * Use original event type without empty for EPP published event total metric * Use PR image for EPP * Set Event When Original Type Header Missing * Record normal event type when original header type is missing * Add Unit Tests for Metric Adaptation * Add / adapt unit tests for metric adaptation of new CRD * Fix linting errors --- pkg/handler/handler.go | 15 +++- pkg/handler/handler_test.go | 117 +++++++++++++++++++-------- pkg/handler/handler_v1alpha2_test.go | 6 +- 3 files changed, 102 insertions(+), 36 deletions(-) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 1b7928c..550c05c 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -317,7 +317,20 @@ func (h *Handler) sendEventAndRecordMetrics(ctx context.Context, event *cev2even h.collector.RecordBackendError() return nil, err } - h.collector.RecordEventType(event.Type(), event.Source(), result.HTTPStatus()) + originalEventType := event.Type() + originalTypeHeader, ok := event.Extensions()[builder.OriginalTypeHeaderName] + if !ok { + h.namedLogger().With().Warnw("event header doesn't exist", "header", + builder.OriginalTypeHeaderName) + } else { + originalEventType, ok = originalTypeHeader.(string) + if !ok { + h.namedLogger().With().Warnw("failed to convert event original event type extension value to string", + builder.OriginalTypeHeaderName, originalTypeHeader) + originalEventType = event.Type() + } + } + h.collector.RecordEventType(originalEventType, event.Source(), result.HTTPStatus()) h.collector.RecordBackendLatency(duration, result.HTTPStatus(), host) h.collector.RecordBackendRequests(result.HTTPStatus(), host) return result, nil diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index 04154af..c57d04a 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" "io" "net/http" "net/http/httptest" @@ -648,19 +649,42 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { header http.Header } type wants struct { - result sender.PublishResult - assertionFunc assert.ErrorAssertionFunc - metricErrors int - metricTotal int - metricLatency int - metricPublished int - metricLatencyTEF string + result sender.PublishResult + assertionFunc assert.ErrorAssertionFunc + metricErrors int + metricTotal int + metricLatency int + metricPublished int + metricLatencyTEF string + metricPublishedTotalTEF string } const bucketsFunc = "Buckets" latency := new(mocks.BucketsProvider) latency.On(bucketsFunc).Return(nil) latency.Test(t) + latencyMetricTEF := ` + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{code="204",destination_service="foo"} 0 + eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="foo"} 1 + ` + + ceEvent := CreateCloudEvent(t) + ceEventWithOriginalEventType := ceEvent.Clone() + ceEventWithOriginalEventType.SetExtension(builder.OriginalTypeHeaderName, testingutils.CloudEventNameAndVersion) tests := []struct { name string @@ -685,36 +709,61 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { args: args{ ctx: context.Background(), host: "foo", - event: &cev2event.Event{}, + event: ceEvent, }, wants: wants{ result: eventmesh.HTTPPublishResult{ Status: 204, Body: nil, }, - assertionFunc: assert.NoError, - metricErrors: 0, - metricTotal: 1, - metricLatency: 1, - metricPublished: 1, - metricLatencyTEF: ` - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{code="204",destination_service="foo"} 0 - eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="foo"} 1 -`, + assertionFunc: assert.NoError, + metricErrors: 0, + metricTotal: 1, + metricLatency: 1, + metricPublished: 1, + metricLatencyTEF: latencyMetricTEF, + metricPublishedTotalTEF: ` + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type="prefix.testapp1023.order.created.v1"} 1 + `, + }, + }, + { + name: "No Error - set original event type top published metric", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + SleepDuration: 0, + Result: eventmesh.HTTPPublishResult{ + Status: 204, + Body: nil, + }, + }, + Defaulter: nil, + collector: metrics.NewCollector(latency), + }, + args: args{ + ctx: context.Background(), + host: "foo", + event: &ceEventWithOriginalEventType, + }, + wants: wants{ + result: eventmesh.HTTPPublishResult{ + Status: 204, + Body: nil, + }, + assertionFunc: assert.NoError, + metricErrors: 0, + metricTotal: 1, + metricLatency: 1, + metricPublished: 1, + metricLatencyTEF: latencyMetricTEF, + metricPublishedTotalTEF: ` + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type="order.created.v1"} 1 + `, }, }, { @@ -745,10 +794,12 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { // given + logger, _ := eclogger.New("text", "debug") h := &Handler{ Sender: tt.fields.Sender, Defaulter: tt.fields.Defaulter, collector: tt.fields.collector, + Logger: logger, } // when @@ -764,6 +815,7 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { metricstest.EnsureMetricLatency(t, h.collector, tt.wants.metricLatency) metricstest.EnsureMetricEventTypePublished(t, h.collector, tt.wants.metricPublished) metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wants.metricLatencyTEF, "eventing_epp_backend_duration_milliseconds") + metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wants.metricPublishedTotalTEF, "eventing_epp_event_type_published_total") }) } } @@ -780,11 +832,12 @@ func TestHandler_sendEventAndRecordMetrics_TracingAndDefaults(t *testing.T) { latency := new(mocks.BucketsProvider) latency.On(bucketsFunc).Return(nil) latency.Test(t) - + logger, _ := eclogger.New("text", "debug") h := &Handler{ Sender: stub, Defaulter: nil, collector: metrics.NewCollector(latency), + Logger: logger, } header := http.Header{} headers := []string{"traceparent", "X-B3-TraceId", "X-B3-ParentSpanId", "X-B3-SpanId", "X-B3-Sampled", "X-B3-Flags"} diff --git a/pkg/handler/handler_v1alpha2_test.go b/pkg/handler/handler_v1alpha2_test.go index 744036b..e53f262 100644 --- a/pkg/handler/handler_v1alpha2_test.go +++ b/pkg/handler/handler_v1alpha2_test.go @@ -162,7 +162,7 @@ func TestHandler_publishCloudEventsV1Alpha2(t *testing.T) { wantTEF: ` # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="testapp1023",event_type="prefix.testapp1023.order.created.v1"} 1 + eventing_epp_event_type_published_total{code="204",event_source="testapp1023",event_type="order.created.v1"} 1 # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds # TYPE eventing_epp_backend_duration_milliseconds histogram eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 @@ -204,7 +204,7 @@ func TestHandler_publishCloudEventsV1Alpha2(t *testing.T) { wantTEF: ` # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="testapp1023",event_type="prefix.testapp1023.order.created.v1"} 1 + eventing_epp_event_type_published_total{code="204",event_source="testapp1023",event_type="order.created.v1"} 1 # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds # TYPE eventing_epp_backend_duration_milliseconds histogram eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 @@ -362,7 +362,7 @@ func TestHandler_publishLegacyEventsAsCEV1alpha2(t *testing.T) { wantTEF: ` # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="testapp",event_type="prefix.testapp.object.created.v1"} 1 + eventing_epp_event_type_published_total{code="204",event_source="testapp",event_type="object.created.v1"} 1 # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds # TYPE eventing_epp_backend_duration_milliseconds histogram From 0eae786d1f5165700fb62003c3bf61be58ed6486 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Mon, 13 Feb 2023 15:01:51 +0100 Subject: [PATCH 157/194] change epp linter config (#16553) * add new linter config * fix go cognit lint issue * fix godot lint issues * fix lint issues lll (where it made sense) * fix gomnd issues * fix variable naming * run tests in parallel * ignore shadowing `err` * remove namedreturns * fix more lint issues * bump image * fix review comments * change comment to explain the behaviour a bit clearer --- .golangci.yaml | 281 ++++++++++++++++++++++++ pkg/application/clean_test.go | 48 ++-- pkg/application/lister.go | 8 +- pkg/cloudevents/builder/eventmesh.go | 8 +- pkg/cloudevents/builder/generic.go | 7 +- pkg/cloudevents/eventtype/clean.go | 4 +- pkg/cloudevents/eventtype/clean_test.go | 1 + pkg/cloudevents/utils.go | 7 +- pkg/commander/beb/beb.go | 17 +- pkg/commander/commander.go | 2 +- pkg/env/eventmesh_config.go | 7 +- pkg/env/eventmesh_config_test.go | 6 +- pkg/env/nats_config.go | 6 +- pkg/handler/handler.go | 16 +- pkg/handler/handler_test.go | 83 +++++-- pkg/handler/handler_v1alpha2_test.go | 60 +++-- pkg/handler/health/health_test.go | 1 + pkg/informers/sync.go | 2 +- pkg/legacy/constants.go | 8 +- pkg/legacy/error_responses.go | 95 +++++--- pkg/legacy/helpers.go | 10 +- pkg/legacy/helpers_test.go | 1 + pkg/legacy/legacy.go | 15 +- pkg/legacy/legacy_test.go | 7 +- pkg/legacy/legacytest/test.go | 8 +- pkg/metrics/collector.go | 58 ++--- pkg/metrics/metricstest/metricstest.go | 3 +- pkg/oauth/client.go | 3 +- pkg/oauth/client_test.go | 9 +- pkg/options/options.go | 7 +- pkg/receiver/receiver_test.go | 4 +- pkg/sender/eventmesh/eventmesh_test.go | 3 +- pkg/sender/jetstream/jetstream.go | 2 +- pkg/signals/signals.go | 7 +- pkg/subscribed/helpers.go | 84 +++---- pkg/subscribed/helpers_test.go | 6 +- pkg/subscribed/response.go | 8 +- pkg/tracing/helpers_test.go | 1 + testing/env_config.go | 11 +- testing/mock_server.go | 2 +- testing/nats.go | 5 +- testing/utils.go | 11 +- 42 files changed, 696 insertions(+), 236 deletions(-) create mode 100644 .golangci.yaml diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 0000000..1afe962 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,281 @@ +# This code is licensed under the terms of the MIT license. + +## Golden config for golangci-lint v1.49.0 +# +# This is the best config for golangci-lint based on my experience and opinion. +# It is very strict, but not extremely strict. +# Feel free to adopt and change it for your needs. + +run: + # Timeout for analysis, e.g. 30s, 5m. + # Default: 1m + timeout: 3m + + +# This file contains only configs which differ from defaults. +# All possible options can be found here https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml +linters-settings: + cyclop: + # The maximal code complexity to report. + # Default: 10 + max-complexity: 30 + # The maximal average package complexity. + # If it's higher than 0.0 (float) the check is enabled + # Default: 0.0 + package-average: 10.0 + + errcheck: + # Report about not checking of errors in type assertions: `a := b.(MyStruct)`. + # Such cases aren't reported by default. + # Default: false + check-type-assertions: true + + funlen: + # Checks the number of lines in a function. + # If lower than 0, disable the check. + # Default: 60 + lines: 100 + # Checks the number of statements in a function. + # If lower than 0, disable the check. + # Default: 40 + statements: 50 + + gocognit: + # Minimal code complexity to report + # Default: 30 (but we recommend 10-20) + min-complexity: 20 + + gocritic: + # Settings passed to gocritic. + # The settings key is the name of a supported gocritic checker. + # The list of supported checkers can be find in https://go-critic.github.io/overview. + settings: + captLocal: + # Whether to restrict checker to params only. + # Default: true + paramsOnly: false + underef: + # Whether to skip (*x).method() calls where x is a pointer receiver. + # Default: true + skipRecvDeref: false + + gomnd: + # List of function patterns to exclude from analysis. + # Values always ignored: `time.Date` + # Default: [] + ignored-functions: + - os.Chmod + - os.Mkdir + - os.MkdirAll + - os.OpenFile + - os.WriteFile + - prometheus.ExponentialBuckets + - prometheus.ExponentialBucketsRange + - prometheus.LinearBuckets + - strconv.FormatFloat + - strconv.FormatInt + - strconv.FormatUint + - strconv.ParseFloat + - strconv.ParseInt + - strconv.ParseUint + + gomodguard: + blocked: + # List of blocked modules. + # Default: [] + modules: + - github.com/golang/protobuf: + recommendations: + - google.golang.org/protobuf + reason: "see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules" + - github.com/satori/go.uuid: + recommendations: + - github.com/google/uuid + reason: "satori's package is not maintained" + - github.com/gofrs/uuid: + recommendations: + - github.com/google/uuid + reason: "see recommendation from dev-infra team: https://confluence.gtforge.com/x/gQI6Aw" + + govet: + # Enable all analyzers. + # Default: false + enable-all: true + # Disable analyzers by name. + # Run `go tool vet help` to see all analyzers. + # Default: [] + disable: + - fieldalignment # too strict + # Settings per analyzer. + settings: + shadow: + # Whether to be strict about shadowing; can be noisy. + # Default: false + strict: false + + nakedret: + # Make an issue if func has more lines of code than this setting, and it has naked returns. + # Default: 30 + max-func-lines: 0 + + nolintlint: + # Exclude following linters from requiring an explanation. + # Default: [] + allow-no-explanation: [ funlen, gocognit, lll ] + # Enable to require an explanation of nonzero length after each nolint directive. + # Default: false + require-explanation: true + # Enable to require nolint directives to mention the specific linter being suppressed. + # Default: false + require-specific: true + + rowserrcheck: + # database/sql is always checked + # Default: [] + packages: + - github.com/jmoiron/sqlx + + tenv: + # The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures. + # Otherwise, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked. + # Default: false + all: true + + +linters: + disable-all: true + enable: + ## enabled by default + - errcheck # checking for unchecked errors, these unchecked errors can be critical bugs in some cases + - gosimple # specializes in simplifying a code + - govet # reports suspicious constructs, such as Printf calls whose arguments do not align with the format string + - ineffassign # detects when assignments to existing variables are not used + - staticcheck # is a go vet on steroids, applying a ton of static analysis checks + - typecheck # like the front-end of a Go compiler, parses and type-checks Go code + - unused # checks for unused constants, variables, functions and types + ## disabled by default + - asasalint # checks for pass []any as any in variadic func(...any) + - asciicheck # checks that your code does not contain non-ASCII identifiers + - bidichk # checks for dangerous unicode character sequences + - bodyclose # checks whether HTTP response body is closed successfully + #- contextcheck # checks the function whether use a non-inherited context # TODO: enable after golangci-lint uses https://github.com/sylvia7788/contextcheck/releases/tag/v1.0.7 + - cyclop # checks function and package cyclomatic complexity + - dupl # tool for code clone detection + - durationcheck # checks for two durations multiplied together + - errname # checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error + - errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13 + - execinquery # checks query string in Query function which reads your Go src files and warning it finds + - exhaustive # checks exhaustiveness of enum switch statements + - exportloopref # checks for pointers to enclosing loop variables + - forbidigo # forbids identifiers + - funlen # tool for detection of long functions + - gochecknoglobals # checks that no global variables exist + - gochecknoinits # checks that no init functions are present in Go code + - gocognit # computes and checks the cognitive complexity of functions + - goconst # finds repeated strings that could be replaced by a constant + - gocritic # provides diagnostics that check for bugs, performance and style issues + - gocyclo # computes and checks the cyclomatic complexity of functions + - godot # checks if comments end in a period + - goimports # in addition to fixing imports, goimports also formats your code in the same style as gofmt + - gomnd # detects magic numbers + ## - gomoddirectives # manages the use of 'replace', 'retract', and 'excludes' directives in go.mod + - gomodguard # allow and block lists linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations + - goprintffuncname # checks that printf-like functions are named with f at the end + - gosec # inspects source code for security problems + - lll # reports long lines + - makezero # finds slice declarations with non-zero initial length + - nakedret # finds naked returns in functions greater than a specified function length + - nestif # reports deeply nested if statements + - nilerr # finds the code that returns nil even if it checks that the error is not nil + - nilnil # checks that there is no simultaneous return of nil error and an invalid value + - noctx # finds sending http request without context.Context + - nolintlint # reports ill-formed or insufficient nolint directives + - nonamedreturns # reports all named returns + - nosprintfhostport # checks for misuse of Sprintf to construct a host with port in a URL + - predeclared # finds code that shadows one of Go's predeclared identifiers + - promlinter # checks Prometheus metrics naming via promlint + - reassign # checks that package variables are not reassigned + - revive # fast, configurable, extensible, flexible, and beautiful linter for Go, drop-in replacement of golint + - rowserrcheck # checks whether Err of rows is checked successfully + - sqlclosecheck # checks that sql.Rows and sql.Stmt are closed + - stylecheck # is a replacement for golint + - tenv # detects using os.Setenv instead of t.Setenv since Go1.17 + # - testpackage # makes you use a separate _test package + - tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes + - unconvert # removes unnecessary type conversions + - unparam # reports unused function parameters + - usestdlibvars # detects the possibility to use variables/constants from the Go standard library + - wastedassign # finds wasted assignment statements + - whitespace # detects leading and trailing whitespace + + ## you may want to enable + #- decorder # checks declaration order and count of types, constants, variables and functions + #- exhaustruct # checks if all structure fields are initialized + #- gci # controls golang package import order and makes it always deterministic + #- godox # detects FIXME, TODO and other comment keywords + #- goheader # checks is file header matches to pattern + #- interfacebloat # checks the number of methods inside an interface + #- ireturn # accept interfaces, return concrete types + #- prealloc # [premature optimization, but can be used in some cases] finds slice declarations that could potentially be preallocated + #- varnamelen # [great idea, but too many false positives] checks that the length of a variable's name matches its scope + #- wrapcheck # checks that errors returned from external packages are wrapped + + ## disabled + #- containedctx # detects struct contained context.Context field + #- depguard # [replaced by gomodguard] checks if package imports are in a list of acceptable packages + #- dogsled # checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) + #- errchkjson # [don't see profit + I'm against of omitting errors like in the first example https://github.com/breml/errchkjson] checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted + #- forcetypeassert # [replaced by errcheck] finds forced type assertions + #- goerr113 # [too strict] checks the errors handling expressions + #- gofmt # [replaced by goimports] checks whether code was gofmt-ed + #- gofumpt # [replaced by goimports, gofumports is not available yet] checks whether code was gofumpt-ed + #- grouper # analyzes expression groups + #- importas # enforces consistent import aliases + #- logrlint # [owner archived repository] checks logr arguments + #- maintidx # measures the maintainability index of each function + #- misspell # [useless] finds commonly misspelled English words in comments + #- nlreturn # [too strict and mostly code is not more readable] checks for a new line before return and branch statements to increase code clarity + #- paralleltest # [too many false positives] detects missing usage of t.Parallel() method in your Go test + #- tagliatelle # checks the struct tags + #- thelper # detects golang test helpers without t.Helper() call and checks the consistency of test helpers + #- wsl # [too strict and mostly code is not more readable] whitespace linter forces you to use empty lines + + ## deprecated + #- deadcode # [deprecated, replaced by unused] finds unused code + #- exhaustivestruct # [deprecated, replaced by exhaustruct] checks if all struct's fields are initialized + #- golint # [deprecated, replaced by revive] golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes + #- ifshort # [deprecated] checks that your code uses short syntax for if-statements whenever possible + #- interfacer # [deprecated] suggests narrower interface types + #- maligned # [deprecated, replaced by govet fieldalignment] detects Go structs that would take less memory if their fields were sorted + #- nosnakecase # [deprecated, replaced by revive var-naming] detects snake case of variable naming and function name + #- scopelint # [deprecated, replaced by exportloopref] checks for unpinned variables in go programs + #- structcheck # [deprecated, replaced by unused] finds unused struct fields + #- varcheck # [deprecated, replaced by unused] finds unused global variables and constants + + +issues: + # Maximum count of issues with the same text. + # Set to 0 to disable. + # Default: 3 + max-same-issues: 50 + + exclude-rules: + - source: "^//\\s*go:generate\\s" + linters: [ lll ] + - source: "(noinspection|TODO)" + linters: [ godot ] + - source: "//noinspection" + linters: [ gocritic ] + - source: "^\\s+if _, ok := err\\.\\([^.]+\\.InternalError\\); ok {" + linters: [ errorlint ] + - path: "_test\\.go" + linters: + - bodyclose + - dupl + - funlen + - goconst + - gosec + - noctx + - wrapcheck + - text: 'shadow: declaration of "(err|ctx)" shadows declaration at' + linters: [ govet ] diff --git a/pkg/application/clean_test.go b/pkg/application/clean_test.go index de5f11c..16cb9aa 100644 --- a/pkg/application/clean_test.go +++ b/pkg/application/clean_test.go @@ -17,37 +17,53 @@ func TestCleanName(t *testing.T) { }{ // application type label is missing, then use the application name { - givenApplication: applicationtest.NewApplication("alphanumeric0123", nil), - wantName: "alphanumeric0123", + givenApplication: applicationtest.NewApplication( + "alphanumeric0123", + nil), + wantName: "alphanumeric0123", }, { - givenApplication: applicationtest.NewApplication("alphanumeric0123", map[string]string{"ignore-me": "value"}), - wantName: "alphanumeric0123", + givenApplication: applicationtest.NewApplication( + "alphanumeric0123", + map[string]string{"ignore-me": "value"}), + wantName: "alphanumeric0123", }, { - givenApplication: applicationtest.NewApplication("with.!@#none-$%^alphanumeric_&*-characters", nil), - wantName: "withnonealphanumericcharacters", + givenApplication: applicationtest.NewApplication( + "with.!@#none-$%^alphanumeric_&*-characters", + nil), + wantName: "withnonealphanumericcharacters", }, { - givenApplication: applicationtest.NewApplication("with.!@#none-$%^alphanumeric_&*-characters", map[string]string{"ignore-me": "value"}), - wantName: "withnonealphanumericcharacters", + givenApplication: applicationtest.NewApplication( + "with.!@#none-$%^alphanumeric_&*-characters", + map[string]string{"ignore-me": "value"}), + wantName: "withnonealphanumericcharacters", }, // application type label is available, then use it instead of the application name { - givenApplication: applicationtest.NewApplication("alphanumeric0123", map[string]string{TypeLabel: "apptype"}), - wantName: "apptype", + givenApplication: applicationtest.NewApplication( + "alphanumeric0123", + map[string]string{TypeLabel: "apptype"}), + wantName: "apptype", }, { - givenApplication: applicationtest.NewApplication("with.!@#none-$%^alphanumeric_&*-characters", map[string]string{TypeLabel: "apptype"}), - wantName: "apptype", + givenApplication: applicationtest.NewApplication( + "with.!@#none-$%^alphanumeric_&*-characters", + map[string]string{TypeLabel: "apptype"}), + wantName: "apptype", }, { - givenApplication: applicationtest.NewApplication("alphanumeric0123", map[string]string{TypeLabel: "apptype=with.!@#none-$%^alphanumeric_&*-characters"}), - wantName: "apptypewithnonealphanumericcharacters", + givenApplication: applicationtest.NewApplication( + "alphanumeric0123", + map[string]string{TypeLabel: "apptype=with.!@#none-$%^alphanumeric_&*-characters"}), + wantName: "apptypewithnonealphanumericcharacters", }, { - givenApplication: applicationtest.NewApplication("with.!@#none-$%^alphanumeric_&*-characters", map[string]string{TypeLabel: "apptype=with.!@#none-$%^alphanumeric_&*-characters"}), - wantName: "apptypewithnonealphanumericcharacters", + givenApplication: applicationtest.NewApplication( + "with.!@#none-$%^alphanumeric_&*-characters", + map[string]string{TypeLabel: "apptype=with.!@#none-$%^alphanumeric_&*-characters"}), + wantName: "apptypewithnonealphanumericcharacters", }, } diff --git a/pkg/application/lister.go b/pkg/application/lister.go index 7d4fc8f..93ec16a 100644 --- a/pkg/application/lister.go +++ b/pkg/application/lister.go @@ -39,17 +39,17 @@ func (l Lister) Get(name string) (*applicationv1alpha1.Application, error) { return nil, err } - applicationUnstructured, ok := object.(*unstructured.Unstructured) + u, ok := object.(*unstructured.Unstructured) if !ok { return nil, errors.New("failed to convert runtime object to unstructured") } - application := &applicationv1alpha1.Application{} - if err := runtime.DefaultUnstructuredConverter.FromUnstructured(applicationUnstructured.Object, application); err != nil { + a := &applicationv1alpha1.Application{} + if err := runtime.DefaultUnstructuredConverter.FromUnstructured(u.Object, a); err != nil { return nil, err } - return application, nil + return a, nil } func GroupVersionResource() schema.GroupVersionResource { diff --git a/pkg/cloudevents/builder/eventmesh.go b/pkg/cloudevents/builder/eventmesh.go index 980870d..80553f8 100644 --- a/pkg/cloudevents/builder/eventmesh.go +++ b/pkg/cloudevents/builder/eventmesh.go @@ -3,17 +3,19 @@ package builder import ( cev2event "github.com/cloudevents/sdk-go/v2/event" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/eventing-controller/logger" "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" ) // Perform a compile-time check. var _ CloudEventBuilder = &EventMeshBuilder{} -func NewEventMeshBuilder(typePrefix string, eventMeshNamespace string, cleaner cleaner.Cleaner, applicationLister *application.Lister, logger *logger.Logger) CloudEventBuilder { +func NewEventMeshBuilder(prefix string, eventMeshNamespace string, cleaner cleaner.Cleaner, + applicationLister *application.Lister, logger *logger.Logger) CloudEventBuilder { genericBuilder := GenericBuilder{ - typePrefix: typePrefix, + typePrefix: prefix, applicationLister: applicationLister, logger: logger, cleaner: cleaner, diff --git a/pkg/cloudevents/builder/generic.go b/pkg/cloudevents/builder/generic.go index 3021c63..71ff161 100644 --- a/pkg/cloudevents/builder/generic.go +++ b/pkg/cloudevents/builder/generic.go @@ -6,10 +6,11 @@ import ( cev2event "github.com/cloudevents/sdk-go/v2/event" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/eventing-controller/logger" "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" "go.uber.org/zap" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" ) // Perform a compile-time check. @@ -68,12 +69,12 @@ func (gb *GenericBuilder) Build(event cev2event.Event) (*cev2event.Event, error) return &ceEvent, nil } -// getFinalSubject return the final prefixed event type +// getFinalSubject returns the final prefixed event type. func (gb *GenericBuilder) getFinalSubject(source, eventType string) string { return fmt.Sprintf("%s.%s.%s", gb.typePrefix, source, eventType) } -// GetAppNameOrSource returns the application name if exists, otherwise returns source name +// GetAppNameOrSource returns the application name if exists, otherwise returns source name. func (gb *GenericBuilder) GetAppNameOrSource(source string, namedLogger *zap.SugaredLogger) string { var appName = source if appObj, err := gb.applicationLister.Get(source); err == nil && appObj != nil { diff --git a/pkg/cloudevents/eventtype/clean.go b/pkg/cloudevents/eventtype/clean.go index c17080e..bc40fa5 100644 --- a/pkg/cloudevents/eventtype/clean.go +++ b/pkg/cloudevents/eventtype/clean.go @@ -15,7 +15,9 @@ var ( // invalidEventTypeSegment used to match and replace none-alphanumeric characters in the event-type segments // as per SAP Event spec https://github.tools.sap/CentralEngineering/sap-event-specification#type. invalidEventTypeSegment = regexp.MustCompile("[^a-zA-Z0-9.]") +) +const ( // cleanerName used as the logger name. cleanerName = "event-type-cleaner" ) @@ -30,7 +32,7 @@ type cleaner struct { logger *logger.Logger } -// compile-time check +// compile-time check. var _ Cleaner = &cleaner{} func NewCleaner(eventTypePrefix string, applicationLister *application.Lister, logger *logger.Logger) Cleaner { diff --git a/pkg/cloudevents/eventtype/clean_test.go b/pkg/cloudevents/eventtype/clean_test.go index 832dc0d..7ce6bde 100644 --- a/pkg/cloudevents/eventtype/clean_test.go +++ b/pkg/cloudevents/eventtype/clean_test.go @@ -13,6 +13,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" ) +//nolint:lll // we need long lines here as the event types can get very long func TestCleaner(t *testing.T) { t.Parallel() testCases := []struct { diff --git a/pkg/cloudevents/utils.go b/pkg/cloudevents/utils.go index 0bfb372..6e5eb67 100644 --- a/pkg/cloudevents/utils.go +++ b/pkg/cloudevents/utils.go @@ -11,7 +11,12 @@ import ( ) // WriteRequestWithHeaders writes a CloudEvent HTTP request with the given message and adds the given headers to it. -func WriteRequestWithHeaders(ctx context.Context, message binding.Message, req *http.Request, headers http.Header, transformers ...binding.Transformer) error { +func WriteRequestWithHeaders( + ctx context.Context, + message binding.Message, + req *http.Request, + headers http.Header, + transformers ...binding.Transformer) error { err := cehttp.WriteRequest(ctx, message, req, transformers...) if err != nil { return errors.Wrap(err, "failed to write Request") diff --git a/pkg/commander/beb/beb.go b/pkg/commander/beb/beb.go index 76fa772..f056832 100644 --- a/pkg/commander/beb/beb.go +++ b/pkg/commander/beb/beb.go @@ -127,8 +127,21 @@ func (c *Commander) Start() error { applicationLister, c.logger) // start handler which blocks until it receives a shutdown signal - if err := handler.NewHandler(messageReceiver, messageSender, health.NewChecker(), c.envCfg.RequestTimeout, legacyTransformer, c.opts, - subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleanerV1, ceBuilder, c.envCfg.EventTypePrefix, env.EventMeshBackend).Start(ctx); err != nil { + if err := handler.NewHandler( + messageReceiver, + messageSender, + health.NewChecker(), + c.envCfg.RequestTimeout, + legacyTransformer, + c.opts, + subscribedProcessor, + c.logger, + c.metricsCollector, + eventTypeCleanerV1, + ceBuilder, + c.envCfg.EventTypePrefix, + env.EventMeshBackend, + ).Start(ctx); err != nil { return xerrors.Errorf("failed to start handler for %s : %v", bebCommanderName, err) } c.namedLogger().Info("Event Publisher was shut down") diff --git a/pkg/commander/commander.go b/pkg/commander/commander.go index 577690d..f43872c 100644 --- a/pkg/commander/commander.go +++ b/pkg/commander/commander.go @@ -1,6 +1,6 @@ package commander -// Commander defines the interface of different implementations +// Commander defines the interface of different implementations. type Commander interface { // Init allows main() to pass flag values to the commander instance. Init() error diff --git a/pkg/env/eventmesh_config.go b/pkg/env/eventmesh_config.go index 0200202..f9c0dea 100644 --- a/pkg/env/eventmesh_config.go +++ b/pkg/env/eventmesh_config.go @@ -6,7 +6,7 @@ import ( "time" ) -// compile time check +// compile time check. var _ fmt.Stringer = &EventMeshConfig{} // EventMeshConfig represents the environment config for the Event Publisher to EventMesh. @@ -32,9 +32,10 @@ func (c *EventMeshConfig) ConfigureTransport(transport *http.Transport) { transport.MaxIdleConnsPerHost = c.MaxIdleConnsPerHost } -// String implements the fmt.Stringer interface +// String implements the fmt.Stringer interface. func (c *EventMeshConfig) String() string { return fmt.Sprintf("EventMeshConfig{ Port: %v; TokenEndPoint: %v; EmsPublishURL: %v; "+ "MaxIdleConns: %v; MaxIdleConnsPerHost: %v; RequestTimeout: %v; BEBNamespace: %v; EventTypePrefix: %v }", - c.Port, c.TokenEndpoint, c.EmsPublishURL, c.MaxIdleConns, c.MaxIdleConnsPerHost, c.RequestTimeout, c.EventMeshNamespace, c.EventTypePrefix) + c.Port, c.TokenEndpoint, c.EmsPublishURL, c.MaxIdleConns, + c.MaxIdleConnsPerHost, c.RequestTimeout, c.EventMeshNamespace, c.EventTypePrefix) } diff --git a/pkg/env/eventmesh_config_test.go b/pkg/env/eventmesh_config_test.go index 2d7646d..7b1f215 100644 --- a/pkg/env/eventmesh_config_test.go +++ b/pkg/env/eventmesh_config_test.go @@ -18,9 +18,11 @@ func TestConfigureTransport(t *testing.T) { cfg.ConfigureTransport(transport) if transport.MaxIdleConns != maxIdleConnections { - t.Errorf("HTTP Transport MaxIdleConns is misconfigured want: %d but got: %d", maxIdleConnections, transport.MaxIdleConns) + t.Errorf("HTTP Transport MaxIdleConns is misconfigured want: %d but got: %d", + maxIdleConnections, transport.MaxIdleConns) } if transport.MaxIdleConnsPerHost != maxIdleConnectionsPerHost { - t.Errorf("HTTP Transport MaxIdleConnsPerHost is misconfigured want: %d but got: %d", maxIdleConnectionsPerHost, transport.MaxIdleConnsPerHost) + t.Errorf("HTTP Transport MaxIdleConnsPerHost is misconfigured want: %d but got: %d", + maxIdleConnectionsPerHost, transport.MaxIdleConnsPerHost) } } diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go index b0ce850..9ade0b2 100644 --- a/pkg/env/nats_config.go +++ b/pkg/env/nats_config.go @@ -5,7 +5,7 @@ import ( "time" ) -// compile time check +// compile time check. var _ fmt.Stringer = &NATSConfig{} const JetStreamSubjectPrefix = "kyma" @@ -29,7 +29,7 @@ type NATSConfig struct { JSStreamName string `envconfig:"JS_STREAM_NAME" default:"kyma"` } -// ToConfig converts to a default BEB BEBConfig +// ToConfig converts to a default BEB BEBConfig. func (c *NATSConfig) ToConfig() *EventMeshConfig { cfg := &EventMeshConfig{ EventMeshNamespace: c.LegacyNamespace, @@ -38,7 +38,7 @@ func (c *NATSConfig) ToConfig() *EventMeshConfig { return cfg } -// String implements the fmt.Stringer interface +// String implements the fmt.Stringer interface. func (c *NATSConfig) String() string { return fmt.Sprintf("%#v", c) } diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 550c05c..ec96577 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -68,11 +68,11 @@ type Handler struct { } // NewHandler returns a new HTTP Handler instance. -func NewHandler(receiver *receiver.HTTPMessageReceiver, sender sender.GenericSender, healthChecker health.Checker, requestTimeout time.Duration, - legacyTransformer legacy.RequestToCETransformer, opts *options.Options, subscribedProcessor *subscribed.Processor, - logger *logger.Logger, collector metrics.PublishingMetricsCollector, eventTypeCleaner eventtype.Cleaner, - ceBuilder builder.CloudEventBuilder, oldEventTypePrefix string, activeBackend env.ActiveBackend) *Handler { - +func NewHandler(receiver *receiver.HTTPMessageReceiver, sender sender.GenericSender, healthChecker health.Checker, + requestTimeout time.Duration, legacyTransformer legacy.RequestToCETransformer, opts *options.Options, + subscribedProcessor *subscribed.Processor, logger *logger.Logger, collector metrics.PublishingMetricsCollector, + eventTypeCleaner eventtype.Cleaner, ceBuilder builder.CloudEventBuilder, oldEventTypePrefix string, + activeBackend env.ActiveBackend) *Handler { return &Handler{ Receiver: receiver, Sender: sender, @@ -116,7 +116,8 @@ func (h *Handler) Start(ctx context.Context) error { return h.Receiver.StartListen(ctx, h.router, h.Logger) } -// maxBytes installs a MaxBytesReader onto the request, so that incoming request larger than a given size will cause an error. +// maxBytes installs a MaxBytesReader onto the request, so that incoming request that is larger than a given size +// will cause an error. func (h *Handler) maxBytes(f http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { r.Body = http.MaxBytesReader(w, r.Body, h.Options.MaxRequestSize) @@ -127,7 +128,8 @@ func (h *Handler) maxBytes(f http.HandlerFunc) http.HandlerFunc { // handleSendEventAndRecordMetricsLegacy handles the publishing of metrics. // It writes to the user request if any error occurs. // Otherwise, returns the result. -func (h *Handler) handleSendEventAndRecordMetricsLegacy(writer http.ResponseWriter, request *http.Request, event *cev2event.Event) (sender.PublishResult, error) { +func (h *Handler) handleSendEventAndRecordMetricsLegacy( + writer http.ResponseWriter, request *http.Request, event *cev2event.Event) (sender.PublishResult, error) { result, err := h.sendEventAndRecordMetrics(request.Context(), event, h.Sender.URL(), request.Header) if err != nil { h.namedLogger().Error(err) diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index c57d04a..367d0d1 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -1,3 +1,4 @@ +//nolint:lll // this test uses many long lines directly from prometheus output package handler import ( @@ -207,6 +208,7 @@ func TestHandler_publishCloudEvents(t *testing.T) { request: CreateValidStructuredRequest(t), }, wantStatus: 204, + wantTEF: ` # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel # TYPE eventing_epp_event_type_published_total counter @@ -249,6 +251,7 @@ func TestHandler_publishCloudEvents(t *testing.T) { request: CreateValidBinaryRequest(t), }, wantStatus: 204, + wantTEF: ` # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel # TYPE eventing_epp_event_type_published_total counter @@ -329,6 +332,7 @@ func TestHandler_publishCloudEvents(t *testing.T) { request: CreateValidBinaryRequest(t), }, wantStatus: 500, + wantTEF: ` # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server # TYPE eventing_epp_backend_errors_total counter @@ -419,15 +423,19 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { }, BackendURL: "FOO", }, - LegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", NewApplicationListerOrDie(context.Background(), "testapp")), - collector: metrics.NewCollector(latency), - eventTypeCleaner: eventtypetest.CleanerStub{}, + LegacyTransformer: legacy.NewTransformer( + "namespace", + "im.a.prefix", + NewApplicationListerOrDie(context.Background(), "testapp")), + collector: metrics.NewCollector(latency), + eventTypeCleaner: eventtypetest.CleanerStub{}, }, args: args{ request: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), }, wantStatus: 200, wantOk: true, + wantTEF: ` # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel # TYPE eventing_epp_event_type_published_total counter @@ -462,9 +470,12 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrBackendTargetNotFound), BackendURL: "FOO", }, - LegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", NewApplicationListerOrDie(context.Background(), "testapp")), - collector: metrics.NewCollector(latency), - eventTypeCleaner: eventtypetest.CleanerStub{}, + LegacyTransformer: legacy.NewTransformer( + "namespace", + "im.a.prefix", + NewApplicationListerOrDie(context.Background(), "testapp")), + collector: metrics.NewCollector(latency), + eventTypeCleaner: eventtypetest.CleanerStub{}, }, args: args{ request: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), @@ -484,9 +495,12 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrInsufficientStorage), BackendURL: "FOO", }, - LegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", NewApplicationListerOrDie(context.Background(), "testapp")), - collector: metrics.NewCollector(latency), - eventTypeCleaner: eventtypetest.CleanerStub{}, + LegacyTransformer: legacy.NewTransformer( + "namespace", + "im.a.prefix", + NewApplicationListerOrDie(context.Background(), "testapp")), + collector: metrics.NewCollector(latency), + eventTypeCleaner: eventtypetest.CleanerStub{}, }, args: args{ request: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), @@ -506,9 +520,12 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { Err: fmt.Errorf("i cannot send"), BackendURL: "FOO", }, - LegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", NewApplicationListerOrDie(context.Background(), "testapp")), - collector: metrics.NewCollector(latency), - eventTypeCleaner: eventtypetest.CleanerStub{}, + LegacyTransformer: legacy.NewTransformer( + "namespace", + "im.a.prefix", + NewApplicationListerOrDie(context.Background(), "testapp")), + collector: metrics.NewCollector(latency), + eventTypeCleaner: eventtypetest.CleanerStub{}, }, args: args{ request: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), @@ -530,16 +547,20 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { }, BackendURL: "FOO", }, - LegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", NewApplicationListerOrDie(context.Background(), "testapp")), - collector: metrics.NewCollector(latency), - eventTypeCleaner: eventtypetest.CleanerStub{}, + LegacyTransformer: legacy.NewTransformer( + "namespace", + "im.a.prefix", + NewApplicationListerOrDie(context.Background(), "testapp")), + collector: metrics.NewCollector(latency), + eventTypeCleaner: eventtypetest.CleanerStub{}, }, args: args{ request: legacytest.InvalidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), }, wantStatus: 400, wantOk: false, - wantTEF: "", // this is a client error. We do record an error metric for requests that cannot even be decoded correctly. + // this is a client error. We do record an error metric for requests that cannot even be decoded correctly. + wantTEF: "", }, } for _, tt := range tests { @@ -577,7 +598,6 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { } metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wantTEF) - }) } } @@ -879,7 +899,14 @@ func CreateCloudEvent(t *testing.T) *cev2event.Event { // CreateValidStructuredRequest creates a structured cloudevent as http request. func CreateValidStructuredRequest(t *testing.T) *http.Request { t.Helper() - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"specversion\":\"1.0\",\"type\":\"sap.kyma.custom.testapp1023.order.created.v1\",\"source\":\"/default/sap.kyma/id\",\"id\":\"8945ec08-256b-11eb-9928-acde48001122\",\"data\":{\"foo\":\"bar\"}}")) + s := `{ + "specversion":"1.0", + "type":"sap.kyma.custom.testapp1023.order.created.v1", + "source":"/default/sap.kyma/id", + "id":"8945ec08-256b-11eb-9928-acde48001122", + "data":{"foo":"bar"} + }` + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader(s)) req.Header.Add("Content-Type", "application/cloudevents+json") return req } @@ -887,7 +914,8 @@ func CreateValidStructuredRequest(t *testing.T) *http.Request { // CreateBrokenRequest creates a structured cloudevent request that cannot be parsed. func CreateBrokenRequest(t *testing.T) *http.Request { t.Helper() - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("I AM JUST A BROKEN REQUEST")) + reader := strings.NewReader("I AM JUST A BROKEN REQUEST") + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) req.Header.Add("Content-Type", "application/cloudevents+json") return req } @@ -895,7 +923,16 @@ func CreateBrokenRequest(t *testing.T) *http.Request { // CreateInvalidStructuredRequest creates an invalid structured cloudevent as http request. The `type` is missing. func CreateInvalidStructuredRequest(t *testing.T) *http.Request { t.Helper() - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"specversion\":\"1.0\",\"source\":\"/default/sap.kyma/id\",\"id\":\"8945ec08-256b-11eb-9928-acde48001122\",\"data\":{\"foo\":\"bar\"}}")) + s := `{ + "specversion":"1.0", + "source":"/default/sap.kyma/id", + "id":"8945ec08-256b-11eb-9928-acde48001122", + "data": { + "foo":"bar" + } + }` + reader := strings.NewReader(s) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) req.Header.Add("Content-Type", "application/cloudevents+json") return req } @@ -903,7 +940,8 @@ func CreateInvalidStructuredRequest(t *testing.T) *http.Request { // CreateValidBinaryRequest creates a valid binary cloudevent as http request. func CreateValidBinaryRequest(t *testing.T) *http.Request { t.Helper() - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"foo\":\"bar\"}")) + reader := strings.NewReader(`{"foo":"bar"}`) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) req.Header.Add("Ce-Specversion", "1.0") req.Header.Add("Ce-Type", "sap.kyma.custom.testapp1023.order.created.v1") req.Header.Add("Ce-Source", "/default/sap.kyma/id") @@ -914,7 +952,8 @@ func CreateValidBinaryRequest(t *testing.T) *http.Request { // CreateInvalidBinaryRequest creates an invalid binary cloudevent as http request. The `type` is missing. func CreateInvalidBinaryRequest(t *testing.T) *http.Request { t.Helper() - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"foo\":\"bar\"}")) + reader := strings.NewReader(`{"foo":"bar"}`) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) req.Header.Add("Content-Type", "application/json") req.Header.Add("Ce-Specversion", "1.0") req.Header.Add("Ce-Source", "/default/sap.kyma/id") diff --git a/pkg/handler/handler_v1alpha2_test.go b/pkg/handler/handler_v1alpha2_test.go index e53f262..4a6baf1 100644 --- a/pkg/handler/handler_v1alpha2_test.go +++ b/pkg/handler/handler_v1alpha2_test.go @@ -1,3 +1,4 @@ +//nolint:lll // output directly from prometheus package handler import ( @@ -10,18 +11,20 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/legacytest" - "github.com/stretchr/testify/require" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" eclogger "github.com/kyma-project/kyma/components/eventing-controller/logger" "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" "github.com/stretchr/testify/assert" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype/eventtypetest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" @@ -344,7 +347,7 @@ func TestHandler_publishLegacyEventsAsCEV1alpha2(t *testing.T) { givenLegacyTransformer legacy.RequestToCETransformer givenCollector metrics.PublishingMetricsCollector givenRequest *http.Request - wantHttpStatus int + wantHTTPStatus int wantTEF string }{ { @@ -358,7 +361,7 @@ func TestHandler_publishLegacyEventsAsCEV1alpha2(t *testing.T) { givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), givenCollector: metrics.NewCollector(latency), givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - wantHttpStatus: http.StatusOK, + wantHTTPStatus: http.StatusOK, wantTEF: ` # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel # TYPE eventing_epp_event_type_published_total counter @@ -395,7 +398,7 @@ func TestHandler_publishLegacyEventsAsCEV1alpha2(t *testing.T) { givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), givenCollector: metrics.NewCollector(latency), givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - wantHttpStatus: http.StatusBadGateway, + wantHTTPStatus: http.StatusBadGateway, wantTEF: ` # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server # TYPE eventing_epp_backend_errors_total counter @@ -411,7 +414,7 @@ func TestHandler_publishLegacyEventsAsCEV1alpha2(t *testing.T) { givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), givenCollector: metrics.NewCollector(latency), givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - wantHttpStatus: 507, + wantHTTPStatus: 507, wantTEF: ` # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server # TYPE eventing_epp_backend_errors_total counter @@ -427,7 +430,7 @@ func TestHandler_publishLegacyEventsAsCEV1alpha2(t *testing.T) { givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), givenCollector: metrics.NewCollector(latency), givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - wantHttpStatus: 500, + wantHTTPStatus: 500, wantTEF: ` # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server # TYPE eventing_epp_backend_errors_total counter @@ -445,8 +448,9 @@ func TestHandler_publishLegacyEventsAsCEV1alpha2(t *testing.T) { givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), givenCollector: metrics.NewCollector(latency), givenRequest: legacytest.InvalidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - wantHttpStatus: 400, - wantTEF: "", // this is a client error. We do record an error metric for requests that cannot even be decoded correctly. + wantHTTPStatus: 400, + // this is a client error. We do record an error metric for requests that cannot even be decoded correctly. + wantTEF: "", }, } for _, tt := range tests { @@ -473,11 +477,11 @@ func TestHandler_publishLegacyEventsAsCEV1alpha2(t *testing.T) { h.publishLegacyEventsAsCE(writer, tt.givenRequest) // then - require.Equal(t, tt.wantHttpStatus, writer.Result().StatusCode) + require.Equal(t, tt.wantHTTPStatus, writer.Result().StatusCode) body, err := io.ReadAll(writer.Result().Body) require.NoError(t, err) - if tt.wantHttpStatus == http.StatusOK { + if tt.wantHTTPStatus == http.StatusOK { ok := &api.PublishResponse{} err = json.Unmarshal(body, ok) require.NoError(t, err) @@ -495,7 +499,16 @@ func TestHandler_publishLegacyEventsAsCEV1alpha2(t *testing.T) { // CreateValidStructuredRequestV1Alpha2 creates a structured cloudevent as http request. func CreateValidStructuredRequestV1Alpha2(t *testing.T) *http.Request { t.Helper() - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"specversion\":\"1.0\",\"type\":\"order.created.v1\",\"source\":\"testapp1023\",\"id\":\"8945ec08-256b-11eb-9928-acde48001122\",\"data\":{\"foo\":\"bar\"}}")) + reader := strings.NewReader(`{ + "specversion":"1.0", + "type":"order.created.v1", + "source":"testapp1023", + "id":"8945ec08-256b-11eb-9928-acde48001122", + "data":{ + "foo":"bar" + } + }`) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) req.Header.Add("Content-Type", "application/cloudevents+json") return req } @@ -503,15 +516,24 @@ func CreateValidStructuredRequestV1Alpha2(t *testing.T) *http.Request { // CreateBrokenRequestV1Alpha2 creates a structured cloudevent request that cannot be parsed. func CreateBrokenRequestV1Alpha2(t *testing.T) *http.Request { t.Helper() - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("I AM JUST A BROKEN REQUEST")) + reader := strings.NewReader("I AM JUST A BROKEN REQUEST") + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) req.Header.Add("Content-Type", "application/cloudevents+json") return req } -// CreateInvalidStructuredRequestV1Alpha2 creates an invalid structured cloudevent as http request. The `type` is missing. +// CreateInvalidStructuredRequestV1Alpha2 creates an invalid structured cloudevent as http request. +// The `type` is missing. func CreateInvalidStructuredRequestV1Alpha2(t *testing.T) *http.Request { t.Helper() - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"specversion\":\"1.0\",\"source\":\"testapp1023\",\"id\":\"8945ec08-256b-11eb-9928-acde48001122\",\"data\":{\"foo\":\"bar\"}}")) + reader := strings.NewReader(`{ + "specversion":"1.0", + "source":"testapp1023", + "id":"8945ec08-256b-11eb-9928-acde48001122", + "data":{ + "foo":"bar" + }}`) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) req.Header.Add("Content-Type", "application/cloudevents+json") return req } @@ -519,7 +541,7 @@ func CreateInvalidStructuredRequestV1Alpha2(t *testing.T) *http.Request { // CreateValidBinaryRequestV1Alpha2 creates a valid binary cloudevent as http request. func CreateValidBinaryRequestV1Alpha2(t *testing.T) *http.Request { t.Helper() - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"foo\":\"bar\"}")) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader(`{"foo":"bar"}`)) req.Header.Add("Ce-Specversion", "1.0") req.Header.Add("Ce-Type", "order.created.v1") req.Header.Add("Ce-Source", "testapp1023") @@ -530,7 +552,7 @@ func CreateValidBinaryRequestV1Alpha2(t *testing.T) *http.Request { // CreateInvalidBinaryRequestV1Alpha2 creates an invalid binary cloudevent as http request. The `type` is missing. func CreateInvalidBinaryRequestV1Alpha2(t *testing.T) *http.Request { t.Helper() - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader("{\"foo\":\"bar\"}")) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader(`{"foo":"bar"}`)) req.Header.Add("Content-Type", "application/json") req.Header.Add("Ce-Specversion", "1.0") req.Header.Add("Ce-Source", "testapp1023") diff --git a/pkg/handler/health/health_test.go b/pkg/handler/health/health_test.go index d986ab4..54b0916 100644 --- a/pkg/handler/health/health_test.go +++ b/pkg/handler/health/health_test.go @@ -10,6 +10,7 @@ import ( ) func TestChecker(t *testing.T) { + t.Parallel() testCases := []struct { name string useCustomLivenessCheck bool // use the givenCustomLivenessCheck instead of the default one diff --git a/pkg/informers/sync.go b/pkg/informers/sync.go index a6f27b6..e9648e9 100644 --- a/pkg/informers/sync.go +++ b/pkg/informers/sync.go @@ -16,7 +16,7 @@ const ( type waitForCacheSyncFunc func(stopCh <-chan struct{}) map[schema.GroupVersionResource]bool -// WaitForCacheSyncOrDie waits for the cache to sync. If sync fails everything stops +// WaitForCacheSyncOrDie waits for the cache to sync. If sync fails everything stops. func WaitForCacheSyncOrDie(ctx context.Context, dc dynamicinformer.DynamicSharedInformerFactory, logger *logger.Logger) { dc.Start(ctx.Done()) diff --git a/pkg/legacy/constants.go b/pkg/legacy/constants.go index 2a8ee86..2ded4c3 100644 --- a/pkg/legacy/constants.go +++ b/pkg/legacy/constants.go @@ -1,12 +1,12 @@ package legacy -// Allowed patterns for the Event components +// Allowed patterns for the Event components. const ( AllowedEventTypeVersionChars = `[a-zA-Z0-9]+` AllowedEventIDChars = `^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$` ) -// Error messages +// Error messages. const ( ErrorMessageBadPayload = "Bad payload syntax" ErrorMessageRequestBodyTooLarge = "Request body too large" @@ -14,7 +14,7 @@ const ( ErrorMessageInvalidField = "Invalid field" ) -// Error type definition +// Error type definitions. const ( ErrorTypeBadPayload = "bad_payload_syntax" ErrorTypeRequestBodyTooLarge = "request_body_too_large" @@ -23,7 +23,7 @@ const ( ErrorTypeInvalidField = "invalid_field" ) -// Field definition +// Field definitions. const ( FieldEventID = "event-id" FieldEventTime = "event-time" diff --git a/pkg/legacy/error_responses.go b/pkg/legacy/error_responses.go index 0de2c7f..7e618b3 100644 --- a/pkg/legacy/error_responses.go +++ b/pkg/legacy/error_responses.go @@ -6,78 +6,113 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" ) -// An HTTPErrorResponse represents an error with a status code and an error message +// An HTTPErrorResponse represents an error with a status code and an error message. type HTTPErrorResponse struct { Code int `json:"code"` Error string `json:"error"` } -// ErrorResponseBadRequest returns an error of type PublishEventResponses with BadRequest status code -func ErrorResponseBadRequest(moreInfo string) (response *api.PublishEventResponses) { +// ErrorResponseBadRequest returns an error of type PublishEventResponses with BadRequest status code. +func ErrorResponseBadRequest(moreInfo string) *api.PublishEventResponses { var details []api.ErrorDetail - apiError := api.Error{Status: http.StatusBadRequest, Type: ErrorTypeBadPayload, Message: ErrorMessageBadPayload, MoreInfo: moreInfo, Details: details} + apiError := api.Error{ + Status: http.StatusBadRequest, + Type: ErrorTypeBadPayload, + Message: ErrorMessageBadPayload, + MoreInfo: moreInfo, + Details: details, + } return &api.PublishEventResponses{Ok: nil, Error: &apiError} } -// ErrorResponseRequestBodyTooLarge returns an error of type PublishEventResponses with BadRequest status code -func ErrorResponseRequestBodyTooLarge(moreInfo string) (response *api.PublishEventResponses) { +// ErrorResponseRequestBodyTooLarge returns an error of type PublishEventResponses with BadRequest status code. +func ErrorResponseRequestBodyTooLarge(moreInfo string) *api.PublishEventResponses { var details []api.ErrorDetail - apiError := api.Error{Status: http.StatusRequestEntityTooLarge, Type: ErrorTypeRequestBodyTooLarge, Message: ErrorMessageRequestBodyTooLarge, MoreInfo: moreInfo, Details: details} + apiError := api.Error{ + Status: http.StatusRequestEntityTooLarge, + Type: ErrorTypeRequestBodyTooLarge, + Message: ErrorMessageRequestBodyTooLarge, + MoreInfo: moreInfo, + Details: details, + } return &api.PublishEventResponses{Ok: nil, Error: &apiError} } -// ErrorResponseMissingFieldEventType returns an error of type PublishEventResponses for missing EventType field -func ErrorResponseMissingFieldEventType() (response *api.PublishEventResponses) { +// ErrorResponseMissingFieldEventType returns an error of type PublishEventResponses for missing EventType field. +func ErrorResponseMissingFieldEventType() *api.PublishEventResponses { return CreateMissingFieldError(FieldEventType) } -// ErrorResponseMissingFieldEventTypeVersion returns an error of type PublishEventResponses for missing EventTypeVersion field -func ErrorResponseMissingFieldEventTypeVersion() (response *api.PublishEventResponses) { +// ErrorResponseMissingFieldEventTypeVersion returns an error of type PublishEventResponses +// for missing EventTypeVersion field. +func ErrorResponseMissingFieldEventTypeVersion() *api.PublishEventResponses { return CreateMissingFieldError(FieldEventTypeVersion) } -// ErrorResponseWrongEventTypeVersion returns an error of type PublishEventResponses for wrong EventTypeVersion field -func ErrorResponseWrongEventTypeVersion() (response *api.PublishEventResponses) { +// ErrorResponseWrongEventTypeVersion returns an error of type PublishEventResponses for wrong EventTypeVersion field. +func ErrorResponseWrongEventTypeVersion() *api.PublishEventResponses { return CreateInvalidFieldError(FieldEventTypeVersion) } -// ErrorResponseMissingFieldEventTime returns an error of type PublishEventResponses for missing EventTime field -func ErrorResponseMissingFieldEventTime() (response *api.PublishEventResponses) { +// ErrorResponseMissingFieldEventTime returns an error of type PublishEventResponses for missing EventTime field. +func ErrorResponseMissingFieldEventTime() *api.PublishEventResponses { return CreateMissingFieldError(FieldEventTime) } -// ErrorResponseWrongEventTime returns an error of type PublishEventResponses for wrong EventTime field -func ErrorResponseWrongEventTime() (response *api.PublishEventResponses) { +// ErrorResponseWrongEventTime returns an error of type PublishEventResponses for wrong EventTime field. +func ErrorResponseWrongEventTime() *api.PublishEventResponses { return CreateInvalidFieldError(FieldEventTime) } -// ErrorResponseWrongEventID returns an error of type PublishEventResponses for wrong EventID field -func ErrorResponseWrongEventID() (response *api.PublishEventResponses) { +// ErrorResponseWrongEventID returns an error of type PublishEventResponses for wrong EventID field. +func ErrorResponseWrongEventID() *api.PublishEventResponses { return CreateInvalidFieldError(FieldEventID) } -// ErrorResponseMissingFieldData returns an error of type PublishEventResponses for missing Data field -func ErrorResponseMissingFieldData() (response *api.PublishEventResponses) { +// ErrorResponseMissingFieldData returns an error of type PublishEventResponses for missing Data field. +func ErrorResponseMissingFieldData() *api.PublishEventResponses { return CreateMissingFieldError(FieldData) } -// ErrorResponse returns an error of type PublishEventResponses with the given status and error +// ErrorResponse returns an error of type PublishEventResponses with the given status and error. func ErrorResponse(status int, err error) *api.PublishEventResponses { return &api.PublishEventResponses{Error: &api.Error{Status: status, Message: err.Error()}} } -// CreateMissingFieldError create an error for a missing field -func CreateMissingFieldError(field interface{}) (response *api.PublishEventResponses) { - apiErrorDetail := api.ErrorDetail{Field: field.(string), Type: ErrorTypeMissingField, Message: ErrorMessageMissingField, MoreInfo: ""} +// CreateMissingFieldError creates an error for a missing field. +func CreateMissingFieldError(field interface{}) *api.PublishEventResponses { + apiErrorDetail := api.ErrorDetail{ + Field: field.(string), + Type: ErrorTypeMissingField, + Message: ErrorMessageMissingField, + MoreInfo: "", + } details := []api.ErrorDetail{apiErrorDetail} - apiError := api.Error{Status: http.StatusBadRequest, Type: ErrorTypeValidationViolation, Message: ErrorMessageMissingField, MoreInfo: "", Details: details} + apiError := api.Error{ + Status: http.StatusBadRequest, + Type: ErrorTypeValidationViolation, + Message: ErrorMessageMissingField, + MoreInfo: "", + Details: details, + } return &api.PublishEventResponses{Ok: nil, Error: &apiError} } -// CreateInvalidFieldError creates an error for an invalid field -func CreateInvalidFieldError(field interface{}) (response *api.PublishEventResponses) { - apiErrorDetail := api.ErrorDetail{Field: field.(string), Type: ErrorTypeInvalidField, Message: ErrorMessageInvalidField, MoreInfo: ""} +// CreateInvalidFieldError creates an error for an invalid field. +func CreateInvalidFieldError(field interface{}) *api.PublishEventResponses { + apiErrorDetail := api.ErrorDetail{ + Field: field.(string), + Type: ErrorTypeInvalidField, + Message: ErrorMessageInvalidField, + MoreInfo: "", + } details := []api.ErrorDetail{apiErrorDetail} - apiError := api.Error{Status: http.StatusBadRequest, Type: ErrorTypeValidationViolation, Message: ErrorMessageInvalidField, MoreInfo: "", Details: details} + apiError := api.Error{ + Status: http.StatusBadRequest, + Type: ErrorTypeValidationViolation, + Message: ErrorMessageInvalidField, + MoreInfo: "", + Details: details, + } return &api.PublishEventResponses{Ok: nil, Error: &apiError} } diff --git a/pkg/legacy/helpers.go b/pkg/legacy/helpers.go index 8925707..2e66e8e 100644 --- a/pkg/legacy/helpers.go +++ b/pkg/legacy/helpers.go @@ -15,11 +15,11 @@ import ( const ( // eventTypeFormat is driven by BEB specification. // An EventType must have at least 4 segments separated by dots in the form of: - // ... + // `...`. eventTypeFormat = "%s.%s.%s.%s" // eventTypeFormatWithoutPrefix must have at least 3 segments separated by dots in the form of: - // .. + // `..`. eventTypeFormatWithoutPrefix = "%s.%s.%s" legacyEventsName = "legacy-events" @@ -27,10 +27,8 @@ const ( // ParseApplicationNameFromPath returns application name from the URL. // The format of the URL is: /:application-name/v1/... -// returns empty string if application-name cannot be found +// returns empty string if application-name cannot be found. func ParseApplicationNameFromPath(path string) string { - // Assumption: Clients(application validator which has a flag for the path (https://github.com/kyma-project/kyma/blob/main/components/application-connectivity-validator/cmd/applicationconnectivityvalidator/applicationconnectivityvalidator.go#L49) using this endpoint must be sending request to path /:application/v1/events - // Hence it should be safe to return 0th index as the application name path = strings.TrimLeft(path, "/") application, _, ok := strings.Cut(path, "/") if ok { @@ -39,7 +37,7 @@ func ParseApplicationNameFromPath(path string) string { return "" } -// is2XXStatusCode checks whether status code is a 2XX status code +// is2XXStatusCode checks whether status code is a 2XX status code. func is2XXStatusCode(statusCode int) bool { return statusCode >= http.StatusOK && statusCode < http.StatusMultipleChoices } diff --git a/pkg/legacy/helpers_test.go b/pkg/legacy/helpers_test.go index 249fce1..b69cab9 100644 --- a/pkg/legacy/helpers_test.go +++ b/pkg/legacy/helpers_test.go @@ -7,6 +7,7 @@ import ( ) func TestParseApplicationNameFromPath(t *testing.T) { + t.Parallel() testCases := []struct { name string givenInputPath string diff --git a/pkg/legacy/legacy.go b/pkg/legacy/legacy.go index c54f4e1..82c0cd7 100644 --- a/pkg/legacy/legacy.go +++ b/pkg/legacy/legacy.go @@ -18,8 +18,8 @@ import ( ) var ( - isValidEventTypeVersion = regexp.MustCompile(AllowedEventTypeVersionChars).MatchString - isValidEventID = regexp.MustCompile(AllowedEventIDChars).MatchString + validEventTypeVersion = regexp.MustCompile(AllowedEventTypeVersionChars) + validEventID = regexp.MustCompile(AllowedEventIDChars) ) const ( @@ -59,17 +59,16 @@ func (t *Transformer) checkParameters(parameters *apiv1.PublishEventParametersV1 if len(parameters.PublishrequestV1.EventTypeVersion) == 0 { return ErrorResponseMissingFieldEventTypeVersion() } - if !isValidEventTypeVersion(parameters.PublishrequestV1.EventTypeVersion) { + if !validEventTypeVersion.MatchString(parameters.PublishrequestV1.EventTypeVersion) { return ErrorResponseWrongEventTypeVersion() } if len(parameters.PublishrequestV1.EventTime) == 0 { - return ErrorResponseMissingFieldEventTime() } if _, err := time.Parse(time.RFC3339, parameters.PublishrequestV1.EventTime); err != nil { return ErrorResponseWrongEventTime() } - if len(parameters.PublishrequestV1.EventID) > 0 && !isValidEventID(parameters.PublishrequestV1.EventID) { + if len(parameters.PublishrequestV1.EventID) > 0 && !validEventID.MatchString(parameters.PublishrequestV1.EventID) { return ErrorResponseWrongEventID() } if parameters.PublishrequestV1.Data == nil { @@ -240,10 +239,10 @@ func (t *Transformer) convertPublishRequestToCloudEvent(appName string, publishR } // combineEventNameSegments returns an eventName with exactly two segments separated by "." if the given event-type -// has more than two segments separated by "." (e.g. "Account.Order.Created" becomes "AccountOrder.Created") +// has two or more segments separated by "." (e.g. "Account.Order.Created" becomes "AccountOrder.Created"). func combineEventNameSegments(eventName string) string { parts := strings.Split(eventName, ".") - if len(parts) > 2 { + if len(parts) > 1 { businessObject := strings.Join(parts[0:len(parts)-1], "") operation := parts[len(parts)-1] eventName = fmt.Sprintf("%s.%s", businessObject, operation) @@ -251,7 +250,7 @@ func combineEventNameSegments(eventName string) string { return eventName } -// removeNonAlphanumeric returns an eventName without any non-alphanumerical character besides dot (".") +// removeNonAlphanumeric returns an eventName without any non-alphanumerical character besides dot ("."). func removeNonAlphanumeric(eventType string) string { return regexp.MustCompile("[^a-zA-Z0-9.]+").ReplaceAllString(eventType, "") } diff --git a/pkg/legacy/legacy_test.go b/pkg/legacy/legacy_test.go index 48199e0..fb10f2d 100644 --- a/pkg/legacy/legacy_test.go +++ b/pkg/legacy/legacy_test.go @@ -28,8 +28,9 @@ const ( ) // TestTransformLegacyRequestsToCE ensures that TransformLegacyRequestsToCE transforms a http request containing -// a legacy request to a valid cloud event by creating mock http requests +// a legacy request to a valid cloud event by creating mock http requests. func TestTransformLegacyRequestsToCE(t *testing.T) { + t.Parallel() testCases := []struct { name string // the event type has the structure @@ -172,6 +173,7 @@ func TestConvertPublishRequestToCloudEvent(t *testing.T) { } func TestCombineEventTypeSegments(t *testing.T) { + t.Parallel() testCases := []struct { name string givenEventType string @@ -202,6 +204,7 @@ func TestCombineEventTypeSegments(t *testing.T) { } func TestRemoveNonAlphanumeric(t *testing.T) { + t.Parallel() testCases := []struct { name string givenEventType string @@ -240,6 +243,7 @@ func TestRemoveNonAlphanumeric(t *testing.T) { } func TestExtractPublishRequestData(t *testing.T) { + t.Parallel() const givenVersion = "v1" const givenPrefix = "pre1.pre2.pre3" const givenApplication = "app" @@ -335,6 +339,7 @@ func TestExtractPublishRequestData(t *testing.T) { } func TestTransformPublishRequestToCloudEvent(t *testing.T) { + t.Parallel() const givenVersion = "v1" const givenPrefix = "pre1.pre2.pre3" const givenApplication = "app" diff --git a/pkg/legacy/legacytest/test.go b/pkg/legacy/legacytest/test.go index e5eaf32..d5f0deb 100644 --- a/pkg/legacy/legacytest/test.go +++ b/pkg/legacy/legacytest/test.go @@ -2,6 +2,7 @@ package legacytest import ( "bytes" + "context" "encoding/json" "fmt" "net/http" @@ -22,7 +23,7 @@ func InvalidLegacyRequest(version, appname, eventType string) (*http.Request, er } url := fmt.Sprintf("http://localhost:8080/%s/%s/events", appname, version) - return http.NewRequest(http.MethodPost, url, bytes.NewBuffer(body)) + return http.NewRequestWithContext(context.Background(), http.MethodPost, url, bytes.NewBuffer(body)) } func ValidLegacyRequest(version, appname, eventType string) (*http.Request, error) { @@ -37,7 +38,7 @@ func ValidLegacyRequest(version, appname, eventType string) (*http.Request, erro } url := fmt.Sprintf("http://localhost:8080/%s/%s/events", appname, version) - return http.NewRequest(http.MethodPost, url, bytes.NewBuffer(body)) + return http.NewRequestWithContext(context.Background(), http.MethodPost, url, bytes.NewBuffer(body)) } func InvalidLegacyRequestOrDie(t *testing.T, version, appname, eventType string) *http.Request { @@ -47,6 +48,7 @@ func InvalidLegacyRequestOrDie(t *testing.T, version, appname, eventType string) } func ValidLegacyRequestOrDie(t *testing.T, version, appname, eventType string) *http.Request { + t.Helper() r, err := ValidLegacyRequest(version, appname, eventType) assert.NoError(t, err) return r @@ -54,5 +56,5 @@ func ValidLegacyRequestOrDie(t *testing.T, version, appname, eventType string) * func InvalidLegacyRequestWithEmptyBody(version, appname string) (*http.Request, error) { url := fmt.Sprintf("http://localhost:8080/%s/%s/events", appname, version) - return http.NewRequest(http.MethodPost, url, nil) + return http.NewRequestWithContext(context.Background(), http.MethodPost, url, nil) } diff --git a/pkg/metrics/collector.go b/pkg/metrics/collector.go index 12dc2e4..7acedba 100644 --- a/pkg/metrics/collector.go +++ b/pkg/metrics/collector.go @@ -13,47 +13,47 @@ import ( ) const ( - // BackendErrorsKey name of the backendErrors metric + // BackendErrorsKey name of the backendErrors metric. BackendErrorsKey = "eventing_epp_backend_errors_total" - // backendErrorsHelp help text for the backendErrors metric + // backendErrorsHelp help text for the backendErrors metric. backendErrorsHelp = "The total number of backend errors while sending events to the messaging server" - // BackendLatencyKey name of the backendLatencyHelp metric + // BackendLatencyKey name of the backendLatencyHelp metric. BackendLatencyKey = "eventing_epp_backend_duration_milliseconds" - // backendLatencyHelp help text for the backendLatencyHelp metric + // backendLatencyHelp help text for the backendLatencyHelp metric. backendLatencyHelp = "The duration of sending events to the messaging server in milliseconds" - // BackendRequestsKey name of the eventRequests metric + // BackendRequestsKey name of the eventRequests metric. BackendRequestsKey = "eventing_epp_backend_requests_total" - // backendRequestsHelp help text for event backendRequests metric + // backendRequestsHelp help text for event backendRequests metric. backendRequestsHelp = "The total number of backend requests" - // durationKey name of the duration metric + // durationKey name of the duration metric. durationKey = "eventing_epp_requests_duration_milliseconds" - // durationHelp help text for the duration metric + // durationHelp help text for the duration metric. durationHelp = "The duration of processing an incoming request (includes sending to the backend)" - // RequestsKey name of the Requests metric + // RequestsKey name of the Requests metric. RequestsKey = "eventing_epp_requests_total" - // requestsHelp help text for event requests metric + // requestsHelp help text for event requests metric. requestsHelp = "The total number of requests" - // EventTypePublishedMetricKey name of the eventTypeLabel metric + // EventTypePublishedMetricKey name of the eventTypeLabel metric. EventTypePublishedMetricKey = "eventing_epp_event_type_published_total" - // eventTypePublishedMetricHelp help text for the eventTypeLabel metric + // eventTypePublishedMetricHelp help text for the eventTypeLabel metric. eventTypePublishedMetricHelp = "The total number of events published for a given eventTypeLabel" - // methodLabel label for the method used in the http request + // methodLabel label for the method used in the http request. methodLabel = "method" - // responseCodeLabel name of the status code labels used by multiple metrics + // responseCodeLabel name of the status code labels used by multiple metrics. responseCodeLabel = "code" - // pathLabel name of the path service label + // pathLabel name of the path service label. pathLabel = "path" - // destSvcLabel name of the destination service label used by multiple metrics + // destSvcLabel name of the destination service label used by multiple metrics. destSvcLabel = "destination_service" - // eventTypeLabel name of the event type label used by metrics + // eventTypeLabel name of the event type label used by metrics. eventTypeLabel = "event_type" - // eventSourceLabel name of the event source label used by metrics + // eventSourceLabel name of the event source label used by metrics. eventSourceLabel = "event_source" ) @@ -70,7 +70,7 @@ type PublishingMetricsCollector interface { var _ PublishingMetricsCollector = &Collector{} -// Collector implements the prometheus.Collector interface +// Collector implements the prometheus.Collector interface. type Collector struct { backendErrors *prometheus.CounterVec backendLatency *prometheus.HistogramVec @@ -82,7 +82,7 @@ type Collector struct { eventType *prometheus.CounterVec } -// NewCollector a new instance of Collector +// NewCollector creates a new instance of Collector. func NewCollector(latency histogram.BucketsProvider) *Collector { return &Collector{ backendErrors: prometheus.NewCounterVec( @@ -92,6 +92,7 @@ func NewCollector(latency histogram.BucketsProvider) *Collector { }, []string{}, ), + //nolint:promlinter // we follow the same pattern as istio. so a millisecond unit if fine here backendLatency: prometheus.NewHistogramVec( prometheus.HistogramOpts{ Name: BackendLatencyKey, @@ -116,6 +117,7 @@ func NewCollector(latency histogram.BucketsProvider) *Collector { []string{eventTypeLabel, eventSourceLabel, responseCodeLabel}, ), + //nolint:promlinter // we follow the same pattern as istio. so a millisecond unit if fine here duration: prometheus.NewHistogramVec( prometheus.HistogramOpts{ Name: durationKey, @@ -133,7 +135,7 @@ func NewCollector(latency histogram.BucketsProvider) *Collector { } } -// Describe implements the prometheus.Collector interface Describe method +// Describe implements the prometheus.Collector interface Describe method. func (c *Collector) Describe(ch chan<- *prometheus.Desc) { c.backendErrors.Describe(ch) c.backendLatency.Describe(ch) @@ -143,7 +145,7 @@ func (c *Collector) Describe(ch chan<- *prometheus.Desc) { c.duration.Describe(ch) } -// Collect implements the prometheus.Collector interface Collect method +// Collect implements the prometheus.Collector interface Collect method. func (c *Collector) Collect(ch chan<- prometheus.Metric) { c.backendErrors.Collect(ch) c.backendLatency.Collect(ch) @@ -153,27 +155,28 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) { c.duration.Collect(ch) } -// RecordError records an error metric +// RecordBackendError records an error while sending to the eventing backend. func (c *Collector) RecordBackendError() { c.backendErrors.WithLabelValues().Inc() } -// RecordLatency records a backendLatencyHelp metric +// RecordLatency records a backendLatencyHelp metric. func (c *Collector) RecordBackendLatency(duration time.Duration, statusCode int, destSvc string) { c.backendLatency.WithLabelValues(fmt.Sprint(statusCode), destSvc).Observe(float64(duration.Milliseconds())) } -// RecordEventType records an eventType metric +// RecordEventType records an eventType metric. func (c *Collector) RecordEventType(eventType, eventSource string, statusCode int) { c.eventType.WithLabelValues(eventType, eventSource, fmt.Sprint(statusCode)).Inc() } -// RecordRequests records an eventRequests metric +// RecordRequests records an eventRequests metric. func (c *Collector) RecordBackendRequests(statusCode int, destSvc string) { c.backendRequests.WithLabelValues(fmt.Sprint(statusCode), destSvc).Inc() } -// MetricsMiddleware returns a http.Handler that can be used as middleware in gorilla.mux to track latencies for all handled paths in the gorilla router +// MetricsMiddleware returns a http.Handler that can be used as middleware in gorilla.mux to track +// latencies for all handled paths in the gorilla router. func (c *Collector) MetricsMiddleware() mux.MiddlewareFunc { return func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -184,6 +187,5 @@ func (c *Collector) MetricsMiddleware() mux.MiddlewareFunc { promhttp.InstrumentHandlerCounter(c.requests.MustCurryWith(prometheus.Labels{pathLabel: path}), next), ).ServeHTTP(w, r) }) - } } diff --git a/pkg/metrics/metricstest/metricstest.go b/pkg/metrics/metricstest/metricstest.go index e443863..d9bd4fb 100644 --- a/pkg/metrics/metricstest/metricstest.go +++ b/pkg/metrics/metricstest/metricstest.go @@ -38,7 +38,8 @@ func ensureMetricCount(t *testing.T, collector metrics.PublishingMetricsCollecto } } -// EnsureMetricMatchesTextExpositionFormat ensures that metrics collected by the given collector match the given metric output in TextExpositionFormat. +// EnsureMetricMatchesTextExpositionFormat ensures that metrics collected by the given collector +// match the given metric output in TextExpositionFormat. // This is useful to compare metrics with their given labels. func EnsureMetricMatchesTextExpositionFormat(t *testing.T, collector metrics.PublishingMetricsCollector, tef string, metricNames ...string) { if err := testutil.CollectAndCompare(collector, strings.NewReader(tef), metricNames...); err != nil { diff --git a/pkg/oauth/client.go b/pkg/oauth/client.go index 7ee34e0..f2653ab 100644 --- a/pkg/oauth/client.go +++ b/pkg/oauth/client.go @@ -11,7 +11,8 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/tracing/propagation/tracecontextb3" ) -// NewClient returns a new HTTP client which have nested transports for handling oauth2 security, HTTP connection pooling, and tracing. +// NewClient returns a new HTTP client which have nested transports for handling oauth2 security, +// HTTP connection pooling, and tracing. func NewClient(ctx context.Context, cfg *env.EventMeshConfig) *http.Client { // configure auth client config := Config(cfg) diff --git a/pkg/oauth/client_test.go b/pkg/oauth/client_test.go index 3ac093b..0cc2b32 100644 --- a/pkg/oauth/client_test.go +++ b/pkg/oauth/client_test.go @@ -22,7 +22,8 @@ func TestNewClient(t *testing.T) { maxIdleConnsPerHost = 200 ) - client := NewClient(context.Background(), &env.EventMeshConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) + cfg := &env.EventMeshConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost} + client := NewClient(context.Background(), cfg) defer client.CloseIdleConnections() ocTransport, ok := client.Transport.(*ochttp.Transport) @@ -41,10 +42,12 @@ func TestNewClient(t *testing.T) { } if httpTransport.MaxIdleConns != maxIdleConns { - t.Errorf("HTTP Client Transport MaxIdleConns is misconfigured want: %d but got: %d", maxIdleConns, httpTransport.MaxIdleConns) + t.Errorf("HTTP Client Transport MaxIdleConns is misconfigured want: %d but got: %d", + maxIdleConns, httpTransport.MaxIdleConns) } if httpTransport.MaxIdleConnsPerHost != maxIdleConnsPerHost { - t.Errorf("HTTP Client Transport MaxIdleConnsPerHost is misconfigured want: %d but got: %d", maxIdleConnsPerHost, httpTransport.MaxIdleConnsPerHost) + t.Errorf("HTTP Client Transport MaxIdleConnsPerHost is misconfigured want: %d but got: %d", + maxIdleConnsPerHost, httpTransport.MaxIdleConnsPerHost) } } diff --git a/pkg/options/options.go b/pkg/options/options.go index 2ce8425..7e53d63 100644 --- a/pkg/options/options.go +++ b/pkg/options/options.go @@ -8,6 +8,9 @@ import ( ) const ( + maxRequestSize = 65536 + metricEndpointPort = ":9090" + // All the available arguments. argMaxRequestSize = "max-request-size" argMetricsAddress = "metrics-addr" @@ -31,8 +34,8 @@ func New() *Options { } func (o *Options) Parse() error { - flag.Int64Var(&o.MaxRequestSize, argMaxRequestSize, 65536, "The maximum request size in bytes.") - flag.StringVar(&o.MetricsAddress, argMetricsAddress, ":9090", "The address the metric endpoint binds to.") + flag.Int64Var(&o.MaxRequestSize, argMaxRequestSize, maxRequestSize, "The maximum request size in bytes.") + flag.StringVar(&o.MetricsAddress, argMetricsAddress, metricEndpointPort, "The address the metric endpoint binds to.") flag.Parse() if err := envconfig.Process("", &o.Env); err != nil { diff --git a/pkg/receiver/receiver_test.go b/pkg/receiver/receiver_test.go index 1d84edf..d67f411 100644 --- a/pkg/receiver/receiver_test.go +++ b/pkg/receiver/receiver_test.go @@ -12,7 +12,7 @@ import ( testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) -// a mocked http.Handler +// a mocked http.Handler. type testHandler struct{} func (h *testHandler) ServeHTTP(http.ResponseWriter, *http.Request) {} @@ -27,7 +27,7 @@ func TestNewHttpMessageReceiver(t *testing.T) { } } -// Test that the receiver shutdown when receiving stop signal +// Test that the receiver shutdown when receiving stop signal. func TestStartListener(t *testing.T) { timeout := time.Second * 10 r := fixtureReceiver() diff --git a/pkg/sender/eventmesh/eventmesh_test.go b/pkg/sender/eventmesh/eventmesh_test.go index ae83837..0f0a0a7 100644 --- a/pkg/sender/eventmesh/eventmesh_test.go +++ b/pkg/sender/eventmesh/eventmesh_test.go @@ -45,7 +45,8 @@ func TestNewHttpMessageSender(t *testing.T) { func TestNewRequestWithTarget(t *testing.T) { t.Parallel() - client := oauth.NewClient(context.Background(), &env.EventMeshConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost}) + cfg := &env.EventMeshConfig{MaxIdleConns: maxIdleConns, MaxIdleConnsPerHost: maxIdleConnsPerHost} + client := oauth.NewClient(context.Background(), cfg) defer client.CloseIdleConnections() msgSender := NewSender(eventsEndpoint, client) diff --git a/pkg/sender/jetstream/jetstream.go b/pkg/sender/jetstream/jetstream.go index 52bf187..04e638b 100644 --- a/pkg/sender/jetstream/jetstream.go +++ b/pkg/sender/jetstream/jetstream.go @@ -31,7 +31,7 @@ const ( noSpaceLeftErrMessage = "no space left on device" ) -// compile time check +// compile time check. var _ sender.GenericSender = &Sender{} var _ health.Checker = &Sender{} diff --git a/pkg/signals/signals.go b/pkg/signals/signals.go index 31c7aaa..f6e8c0e 100644 --- a/pkg/signals/signals.go +++ b/pkg/signals/signals.go @@ -20,14 +20,15 @@ var ( // SetupSignalHandler registered for SIGTERM and SIGINT. A stop channel is returned // which is closed on one of these signals. If a second signal is caught, the program // is terminated with exit code 1. -func SetupSignalHandler() (stopCh <-chan struct{}) { +func SetupSignalHandler() <-chan struct{} { close(onlyOneSignalHandler) // panics when called twice return setupStopChannel() } -func setupStopChannel() (stopCh <-chan struct{}) { +func setupStopChannel() <-chan struct{} { stop := make(chan struct{}) + //nolint:gomnd // sending a signal will trigger a graceful shutdown, sending a second signal will force stop osSignal := make(chan os.Signal, 2) signal.Notify(osSignal, shutdownSignals...) go func() { @@ -52,6 +53,8 @@ func NewContext() context.Context { } // Deadline implements context.Context. +// +//nolint:nakedret,nonamedreturns //same implementation in the std library func (scc *signalContext) Deadline() (deadline time.Time, ok bool) { return } diff --git a/pkg/subscribed/helpers.go b/pkg/subscribed/helpers.go index 91c7645..f2b32cc 100644 --- a/pkg/subscribed/helpers.go +++ b/pkg/subscribed/helpers.go @@ -33,7 +33,7 @@ var ( ) // ConvertRuntimeObjToSubscriptionV1alpha1 converts a runtime.Object to a v1alpha1 version of Subscription object -// by converting to unstructured in between +// by converting to unstructured in between. func ConvertRuntimeObjToSubscriptionV1alpha1(sObj runtime.Object) (*eventingv1alpha1.Subscription, error) { sub := &eventingv1alpha1.Subscription{} if subUnstructured, ok := sObj.(*unstructured.Unstructured); ok { @@ -45,7 +45,8 @@ func ConvertRuntimeObjToSubscriptionV1alpha1(sObj runtime.Object) (*eventingv1al return sub, nil } -// ConvertRuntimeObjToSubscription converts a runtime.Object to a Subscription object by converting to unstructured in between +// ConvertRuntimeObjToSubscription converts a runtime.Object to a Subscription object +// by converting to unstructured in between. func ConvertRuntimeObjToSubscription(sObj runtime.Object) (*eventingv1alpha2.Subscription, error) { sub := &eventingv1alpha2.Subscription{} if subUnstructured, ok := sObj.(*unstructured.Unstructured); ok { @@ -57,7 +58,7 @@ func ConvertRuntimeObjToSubscription(sObj runtime.Object) (*eventingv1alpha2.Sub return sub, nil } -// GenerateSubscriptionInfFactory generates DynamicSharedInformerFactory for Subscription +// GenerateSubscriptionInfFactory generates DynamicSharedInformerFactory for Subscription. func GenerateSubscriptionInfFactory(k8sConfig *rest.Config, enableNewCrd bool) dynamicinformer.DynamicSharedInformerFactory { subDynamicClient := dynamic.NewForConfigOrDie(k8sConfig) dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(subDynamicClient, @@ -73,7 +74,7 @@ func GenerateSubscriptionInfFactory(k8sConfig *rest.Config, enableNewCrd bool) d return dFilteredSharedInfFactory } -// ConvertEventsMapToSlice converts a map of Events to a slice of Events +// ConvertEventsMapToSlice converts a map of Events to a slice of Events. func ConvertEventsMapToSlice(eventsMap map[Event]bool) []Event { result := make([]Event, 0) for k := range eventsMap { @@ -82,7 +83,7 @@ func ConvertEventsMapToSlice(eventsMap map[Event]bool) []Event { return result } -// AddUniqueEventsToResult returns a map of unique Events which also contains the events eventsSubSet +// AddUniqueEventsToResult returns a map of unique Events which also contains the events eventsSubSet. func AddUniqueEventsToResult(eventsSubSet []Event, uniqEvents map[Event]bool) map[Event]bool { if len(uniqEvents) == 0 { uniqEvents = make(map[Event]bool) @@ -97,7 +98,7 @@ func AddUniqueEventsToResult(eventsSubSet []Event, uniqEvents map[Event]bool) ma // FilterEventTypeVersions returns a slice of Events: // if the event source matches the appName for typeMatching standard -// if the . is present in the eventType for typeMatching exact +// if the . is present in the eventType for typeMatching exact. func FilterEventTypeVersions(eventTypePrefix, appName string, subscription *eventingv1alpha2.Subscription) []Event { events := make([]Event, 0) prefixAndAppName := fmt.Sprintf("%s.%s.", eventTypePrefix, appName) @@ -121,7 +122,7 @@ func FilterEventTypeVersions(eventTypePrefix, appName string, subscription *even return events } -// it receives event and type version, e.g. order.created.v1 and returns {Name: order.created, Version: v1} +// it receives event and type version, e.g. order.created.v1 and returns `{Name: order.created, Version: v1}`. func buildEvent(eventTypeAndVersion string) Event { lastDotIndex := strings.LastIndex(eventTypeAndVersion, ".") eventName := eventTypeAndVersion[:lastDotIndex] @@ -135,7 +136,7 @@ func buildEvent(eventTypeAndVersion string) Event { // FilterEventTypeVersionsV1alpha1 returns a slice of Events for v1alpha1 version of Subscription resource: // 1. if the eventType matches the format: .. // E.g. sap.kyma.custom.varkes.order.created.v0 -// 2. if the eventSource matches BEBNamespace name +// 2. if the eventSource matches BEBNamespace name. func FilterEventTypeVersionsV1alpha1(eventTypePrefix, bebNs, appName string, filters *eventingv1alpha1.BEBFilters) []Event { events := make([]Event, 0) if filters == nil { @@ -146,43 +147,46 @@ func FilterEventTypeVersionsV1alpha1(eventTypePrefix, bebNs, appName string, fil continue } - var prefix string - if len(strings.TrimSpace(eventTypePrefix)) == 0 { - prefix = strings.ToLower(fmt.Sprintf("%s.", appName)) - } else { - prefix = strings.ToLower(fmt.Sprintf("%s.%s.", eventTypePrefix, appName)) + prefix := preparePrefix(eventTypePrefix, appName) + + if filter.EventSource == nil || filter.EventType == nil { + continue } - if filter.EventSource != nil && filter.EventType != nil { - // TODO revisit the filtration logic as part of https://github.com/kyma-project/kyma/issues/10761 + // TODO revisit the filtration logic as part of https://github.com/kyma-project/kyma/issues/10761 - // filter by event-source if exists - if len(strings.TrimSpace(filter.EventSource.Value)) > 0 && !strings.EqualFold(filter.EventSource.Value, bebNs) { - continue - } + // filter by event-source if exists + if len(strings.TrimSpace(filter.EventSource.Value)) > 0 && !strings.EqualFold(filter.EventSource.Value, bebNs) { + continue + } - if strings.HasPrefix(filter.EventType.Value, prefix) { - eventTypeVersion := strings.ReplaceAll(filter.EventType.Value, prefix, "") - eventTypeVersionArr := strings.Split(eventTypeVersion, ".") - version := eventTypeVersionArr[len(eventTypeVersionArr)-1] - eventType := "" - for i, part := range eventTypeVersionArr { - if i == 0 { - eventType = part - continue - } - // Adding the segments till last but 1 as the last one is the version - if i < (len(eventTypeVersionArr) - 1) { - eventType = fmt.Sprintf("%s.%s", eventType, part) - } - } - event := Event{ - Name: eventType, - Version: version, - } - events = append(events, event) - } + if !strings.HasPrefix(filter.EventType.Value, prefix) { + continue } + + // remove the prefix + eventTypeVersion := strings.TrimPrefix(filter.EventType.Value, prefix) + + eventTypeVersionArr := strings.Split(eventTypeVersion, ".") + + // join all segments except the last to form the eventType + eventType := strings.Join(eventTypeVersionArr[:len(eventTypeVersionArr)-1], ".") + + // the last segment is the version + version := eventTypeVersionArr[len(eventTypeVersionArr)-1] + + event := Event{ + Name: eventType, + Version: version, + } + events = append(events, event) } return events } + +func preparePrefix(eventTypePrefix string, appName string) string { + if len(strings.TrimSpace(eventTypePrefix)) == 0 { + return strings.ToLower(fmt.Sprintf("%s.", appName)) + } + return strings.ToLower(fmt.Sprintf("%s.%s.", eventTypePrefix, appName)) +} diff --git a/pkg/subscribed/helpers_test.go b/pkg/subscribed/helpers_test.go index 56497c2..0241d32 100644 --- a/pkg/subscribed/helpers_test.go +++ b/pkg/subscribed/helpers_test.go @@ -10,6 +10,7 @@ import ( ) func TestFilterEventTypeVersions(t *testing.T) { + t.Parallel() testCases := []struct { name string appName string @@ -115,6 +116,7 @@ func TestFilterEventTypeVersions(t *testing.T) { } func TestBuildEventType(t *testing.T) { + t.Parallel() testCases := []struct { name string appName string @@ -151,6 +153,7 @@ func TestBuildEventType(t *testing.T) { } func TestFilterEventTypeVersionsV1alpha1(t *testing.T) { + t.Parallel() testCases := []struct { name string appName string @@ -230,6 +233,7 @@ func TestFilterEventTypeVersionsV1alpha1(t *testing.T) { } func TestConvertEventsMapToSlice(t *testing.T) { + t.Parallel() testCases := []struct { name string inputMap map[Event]bool @@ -274,6 +278,7 @@ func TestConvertEventsMapToSlice(t *testing.T) { } func TestAddUniqueEventsToResult(t *testing.T) { + t.Parallel() testCases := []struct { name string eventsSubSet []Event @@ -353,7 +358,6 @@ func WithOneBEBFilter(bebFilters *eventingv1alpha1.BEBFilters) { bebFilters.Filters = []*eventingv1alpha1.BEBFilter{ NewBEBFilter(evSource, evType), } - } func WithMultipleBEBFiltersFromSameSource(bebFilters *eventingv1alpha1.BEBFilters) { diff --git a/pkg/subscribed/response.go b/pkg/subscribed/response.go index de56a29..92414fe 100644 --- a/pkg/subscribed/response.go +++ b/pkg/subscribed/response.go @@ -13,7 +13,7 @@ import ( const responseName = "response" -// RespondWithBody sends http response with json body +// RespondWithBody sends http response with json body. func RespondWithBody(w http.ResponseWriter, events Events, httpCode int) { respond(w, httpCode) if err := json.NewEncoder(w).Encode(events); err != nil { @@ -21,7 +21,7 @@ func RespondWithBody(w http.ResponseWriter, events Events, httpCode int) { } } -// RespondWithErrorAndLog logs error and sends http response with error json body +// RespondWithErrorAndLog logs error and sends http response with error json body. func RespondWithErrorAndLog(e error, w http.ResponseWriter) { namedLogger().Error(e.Error()) respond(w, http.StatusInternalServerError) @@ -40,12 +40,12 @@ func respond(w http.ResponseWriter, httpCode int) { namedLogger().Infof("Response code from \"subscribed\" request: HTTP %d", httpCode) } -// Events represents collection of all events with subscriptions +// Events represents collection of all events with subscriptions. type Events struct { EventsInfo []Event `json:"eventsInfo"` } -// Event represents basic information about event +// Event represents basic information about event. type Event struct { Name string `json:"name"` Version string `json:"version"` diff --git a/pkg/tracing/helpers_test.go b/pkg/tracing/helpers_test.go index b7398ee..6e350ac 100644 --- a/pkg/tracing/helpers_test.go +++ b/pkg/tracing/helpers_test.go @@ -10,6 +10,7 @@ import ( ) func TestAddTracingContextToCEExtensions(t *testing.T) { + t.Parallel() g := NewGomegaWithT(t) testCases := []struct { name string diff --git a/testing/env_config.go b/testing/env_config.go index 5b0afb6..32d9f7a 100644 --- a/testing/env_config.go +++ b/testing/env_config.go @@ -6,8 +6,17 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" ) +const ( + defaultPort = 8080 +) + func NewEnvConfig(emsCEURL, authURL string, opts ...EnvConfigOption) *env.EventMeshConfig { - envConfig := &env.EventMeshConfig{Port: 8080, EmsPublishURL: emsCEURL, TokenEndpoint: authURL, RequestTimeout: time.Minute} + envConfig := &env.EventMeshConfig{ + Port: defaultPort, + EmsPublishURL: emsCEURL, + TokenEndpoint: authURL, + RequestTimeout: time.Minute, + } for _, opt := range opts { opt(envConfig) } diff --git a/testing/mock_server.go b/testing/mock_server.go index ca14230..f52f33c 100644 --- a/testing/mock_server.go +++ b/testing/mock_server.go @@ -8,7 +8,7 @@ import ( "time" ) -// Validator is used to validate incoming requests to the mock server +// Validator is used to validate incoming requests to the mock server. type Validator func(r *http.Request) error type MockServer struct { diff --git a/testing/nats.go b/testing/nats.go index 837450e..698c84b 100644 --- a/testing/nats.go +++ b/testing/nats.go @@ -13,7 +13,8 @@ import ( ) const ( - StreamName = "kyma" + StreamName = "kyma" + maxReconnects = 3 ) func StartNATSServer() *server.Server { @@ -30,7 +31,7 @@ func StartNATSServer() *server.Server { func ConnectToNATSServer(url string) (*nats.Conn, error) { return pkgnats.Connect(url, pkgnats.WithRetryOnFailedConnect(true), - pkgnats.WithMaxReconnects(3), + pkgnats.WithMaxReconnects(maxReconnects), pkgnats.WithReconnectWait(time.Second), ) } diff --git a/testing/utils.go b/testing/utils.go index b601a25..d7a78ca 100644 --- a/testing/utils.go +++ b/testing/utils.go @@ -12,7 +12,7 @@ import ( eventingv1alpha1 "github.com/kyma-project/kyma/components/eventing-controller/api/v1alpha1" ) -// binary cloudevent headers +// binary cloudevent headers. const ( CeIDHeader = "ce-id" CeTypeHeader = "ce-type" @@ -22,9 +22,9 @@ const ( type SubscriptionOpt func(*eventingv1alpha1.Subscription) -// GeneratePortOrDie generates a random 5 digit port or fail +// GeneratePortOrDie generates a random 5 digit port or fail. func GeneratePortOrDie() int { - tick := time.NewTicker(time.Second / 2) + tick := time.NewTicker(500 * time.Millisecond) //nolint:gomnd //the tickerinterval is only required here defer tick.Stop() timeout := time.NewTimer(time.Minute) @@ -54,6 +54,7 @@ func GeneratePortOrDie() int { } func generatePort() (int, error) { + table := [...]byte{'1', '2', '3', '4', '5', '6', '7', '8', '9'} max := 4 // Add 4 as prefix to make it 5 digits but less than 65535 add4AsPrefix := "4" @@ -77,9 +78,7 @@ func generatePort() (int, error) { return num, nil } -var table = [...]byte{'1', '2', '3', '4', '5', '6', '7', '8', '9'} - -// isPortAvailable returns true if the port is available for use, otherwise returns false +// isPortAvailable returns true if the port is available for use, otherwise returns false. func isPortAvailable(port int) bool { address := fmt.Sprintf("localhost:%d", port) listener, err := net.Listen("tcp", address) From 798d69e4daa19c847b9b9973c6c12b8c19c12626 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 12:01:55 +0100 Subject: [PATCH 158/194] gomod(deps): bump golang.org/x/oauth2 from 0.4.0 to 0.5.0 in /components/event-publisher-proxy (#16777) * gomod(deps): bump golang.org/x/oauth2 Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.4.0 to 0.5.0. - [Release notes](https://github.com/golang/oauth2/releases) - [Commits](https://github.com/golang/oauth2/compare/v0.4.0...v0.5.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index e01ba4a..8549ef2 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/stretchr/testify v1.8.1 go.opencensus.io v0.24.0 go.uber.org/zap v1.24.0 - golang.org/x/oauth2 v0.4.0 + golang.org/x/oauth2 v0.5.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 k8s.io/api v0.25.6 k8s.io/apimachinery v0.25.6 @@ -71,10 +71,10 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.5.0 // indirect - golang.org/x/net v0.5.0 // indirect - golang.org/x/sys v0.4.0 // indirect - golang.org/x/term v0.4.0 // indirect - golang.org/x/text v0.6.0 // indirect + golang.org/x/net v0.6.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/term v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 35d896b..0730a03 100644 --- a/go.sum +++ b/go.sum @@ -412,8 +412,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0 h1:L4ZwwTvKW9gr0ZMS1yrHD9GZhIuVjOBBnaKH+SPQK0Q= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -430,8 +430,8 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= -golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= +golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s= +golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -497,13 +497,13 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.4.0 h1:O7UWfv5+A2qiuulQk30kVinPoMtoIPeVaKLEgLpVkvg= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -514,8 +514,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 0462f49afb9cdf67ead5482a7b332099c4718bce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Feb 2023 01:15:24 +0100 Subject: [PATCH 159/194] gomod(deps): bump github.com/nats-io/nats-server/v2 from 2.9.11 to 2.9.14 in /components/event-publisher-proxy (#16757) * gomod(deps): bump github.com/nats-io/nats-server/v2 Bumps [github.com/nats-io/nats-server/v2](https://github.com/nats-io/nats-server) from 2.9.11 to 2.9.14. - [Release notes](https://github.com/nats-io/nats-server/releases) - [Changelog](https://github.com/nats-io/nats-server/blob/main/.goreleaser.yml) - [Commits](https://github.com/nats-io/nats-server/compare/v2.9.11...v2.9.14) --- updated-dependencies: - dependency-name: github.com/nats-io/nats-server/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 6 +++--- go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 8549ef2..a582293 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f - github.com/nats-io/nats-server/v2 v2.9.11 + github.com/nats-io/nats-server/v2 v2.9.14 github.com/nats-io/nats.go v1.23.0 github.com/onsi/gomega v1.26.0 github.com/pkg/errors v0.9.1 @@ -50,7 +50,7 @@ require ( github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.11 // indirect + github.com/klauspost/compress v1.15.15 // indirect github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect @@ -75,7 +75,7 @@ require ( golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect - golang.org/x/time v0.0.0-20220922220347-f3bd1da661af // indirect + golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect diff --git a/go.sum b/go.sum index 0730a03..2749304 100644 --- a/go.sum +++ b/go.sum @@ -220,8 +220,8 @@ github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dv github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= -github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= +github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -257,8 +257,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= -github.com/nats-io/nats-server/v2 v2.9.11 h1:4y5SwWvWI59V5mcqtuoqKq6L9NDUydOP3Ekwuwl8cZI= -github.com/nats-io/nats-server/v2 v2.9.11/go.mod h1:b0oVuxSlkvS3ZjMkncFeACGyZohbO4XhSqW1Lt7iRRY= +github.com/nats-io/nats-server/v2 v2.9.14 h1:n2GscWVgXpA14vQSRP/MM1SGi4wyazR9l19/gWxqgXQ= +github.com/nats-io/nats-server/v2 v2.9.14/go.mod h1:40ZwFm4npKdFBhOdY7rkh3YyI1oI91FzLvlYyB7HfzM= github.com/nats-io/nats.go v1.23.0 h1:lR28r7IX44WjYgdiKz9GmUeW0uh/m33uD3yEjLZ2cOE= github.com/nats-io/nats.go v1.23.0/go.mod h1:ki/Scsa23edbh8IRZbCuNXR9TDcbvfaSijKtaqQgw+Q= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= @@ -519,8 +519,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220922220347-f3bd1da661af h1:Yx9k8YCG3dvF87UAn2tu2HQLf2dt/eR1bXxpLMWeH+Y= -golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= From be36de729f40daa82f93319e282b1d0c50ac8338 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 19 Feb 2023 00:02:58 +0100 Subject: [PATCH 160/194] gomod(deps): bump github.com/onsi/gomega from 1.26.0 to 1.27.1 in /components/event-publisher-proxy (#16836) * gomod(deps): bump github.com/onsi/gomega Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.26.0 to 1.27.1. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.26.0...v1.27.1) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 4 ++-- go.sum | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index a582293..ff3505b 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f github.com/nats-io/nats-server/v2 v2.9.14 github.com/nats-io/nats.go v1.23.0 - github.com/onsi/gomega v1.26.0 + github.com/onsi/gomega v1.27.1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 github.com/stretchr/testify v1.8.1 @@ -71,7 +71,7 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.5.0 // indirect - golang.org/x/net v0.6.0 // indirect + golang.org/x/net v0.7.0 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect diff --git a/go.sum b/go.sum index 2749304..c3715be 100644 --- a/go.sum +++ b/go.sum @@ -269,9 +269,9 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.7.0 h1:/XxtEV3I3Eif/HobnVx9YmJgk8ENdRsuUmM+fLCFNow= -github.com/onsi/gomega v1.26.0 h1:03cDLK28U6hWvCAns6NeydX3zIm4SF3ci69ulidS32Q= -github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= +github.com/onsi/ginkgo/v2 v2.8.1 h1:xFTEVwOFa1D/Ty24Ws1npBWkDYEV9BqZrsDxVrVkrrU= +github.com/onsi/gomega v1.27.1 h1:rfztXRbg6nv/5f+Raen9RcGoSecHIFgBBLQK3Wdj754= +github.com/onsi/gomega v1.27.1/go.mod h1:aHX5xOykVYzWOV4WqQy0sy8BQptgukenXpCXfadcIAw= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -412,8 +412,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0 h1:L4ZwwTvKW9gr0ZMS1yrHD9GZhIuVjOBBnaKH+SPQK0Q= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= From f7f7c08803fe8796f70a25733b83c2672007eb6f Mon Sep 17 00:00:00 2001 From: Friedrich Date: Thu, 23 Feb 2023 09:30:33 +0100 Subject: [PATCH 161/194] Enable subscription v1alpha2 (#16849) * Add a deprecation warning for subscription v1alpha1. * Enable new CRD (Subscription v1alpha2). * Make subscription v1alpha2 default in make target `copy-crd`. * Run `make copy crd` in components/eventing-controller. * Enable subscription v1alpha2 FI tests. * Format to bring joy to the linter. * Bump the images. * stored v1alpha1 CRD separately for integration tests * reverse v1alpha2 in fi tests. --------- Co-authored-by: Muhammad Faizan --- pkg/options/options.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/options/options.go b/pkg/options/options.go index 7e53d63..1de947f 100644 --- a/pkg/options/options.go +++ b/pkg/options/options.go @@ -14,6 +14,7 @@ const ( // All the available arguments. argMaxRequestSize = "max-request-size" argMetricsAddress = "metrics-addr" + // All the available environment variables. envEnableNewCRDVersion = "ENABLE_NEW_CRD_VERSION" ) From 6149403278726b0bd1f5737bdfcd4e2b46c998c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Mar 2023 16:39:10 +0100 Subject: [PATCH 162/194] gomod(deps): bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /components/event-publisher-proxy (#16934) * gomod(deps): bump github.com/stretchr/testify Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.1 to 1.8.2. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.8.1...v1.8.2) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index ff3505b..a69d373 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/onsi/gomega v1.27.1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 - github.com/stretchr/testify v1.8.1 + github.com/stretchr/testify v1.8.2 go.opencensus.io v0.24.0 go.uber.org/zap v1.24.0 golang.org/x/oauth2 v0.5.0 diff --git a/go.sum b/go.sum index c3715be..24a58ce 100644 --- a/go.sum +++ b/go.sum @@ -305,8 +305,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From e8a714fd062f0da32877da892d2fc893af879b74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Mar 2023 18:01:18 +0100 Subject: [PATCH 163/194] gomod(deps): bump github.com/onsi/gomega from 1.27.1 to 1.27.2 in /components/event-publisher-proxy (#16950) * gomod(deps): bump github.com/onsi/gomega Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.1 to 1.27.2. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.27.1...v1.27.2) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 2 +- go.sum | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index a69d373..6efe33b 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f github.com/nats-io/nats-server/v2 v2.9.14 github.com/nats-io/nats.go v1.23.0 - github.com/onsi/gomega v1.27.1 + github.com/onsi/gomega v1.27.2 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 github.com/stretchr/testify v1.8.2 diff --git a/go.sum b/go.sum index 24a58ce..626d0a8 100644 --- a/go.sum +++ b/go.sum @@ -115,6 +115,7 @@ github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -190,6 +191,7 @@ github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -269,9 +271,9 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.8.1 h1:xFTEVwOFa1D/Ty24Ws1npBWkDYEV9BqZrsDxVrVkrrU= -github.com/onsi/gomega v1.27.1 h1:rfztXRbg6nv/5f+Raen9RcGoSecHIFgBBLQK3Wdj754= -github.com/onsi/gomega v1.27.1/go.mod h1:aHX5xOykVYzWOV4WqQy0sy8BQptgukenXpCXfadcIAw= +github.com/onsi/ginkgo/v2 v2.8.4 h1:gf5mIQ8cLFieruNLAdgijHF1PYfLphKm2dxxcUtcqK0= +github.com/onsi/gomega v1.27.2 h1:SKU0CXeKE/WVgIV1T61kSa3+IRE8Ekrv9rdXDwwTqnY= +github.com/onsi/gomega v1.27.2/go.mod h1:5mR3phAHpkAVIDkHEUBY6HGVsU+cpcEscrGPB4oPlZI= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -577,6 +579,7 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 95b25ea932e999a57ccbf4af3f0f7a6a5441c12d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Mar 2023 08:56:10 +0100 Subject: [PATCH 164/194] gomod(deps): bump github.com/nats-io/nats.go from 1.23.0 to 1.24.0 in /components/event-publisher-proxy (#16935) * gomod(deps): bump github.com/nats-io/nats.go Bumps [github.com/nats-io/nats.go](https://github.com/nats-io/nats.go) from 1.23.0 to 1.24.0. - [Release notes](https://github.com/nats-io/nats.go/releases) - [Commits](https://github.com/nats-io/nats.go/compare/v1.23.0...v1.24.0) --- updated-dependencies: - dependency-name: github.com/nats-io/nats.go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 6efe33b..9489ecc 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f github.com/nats-io/nats-server/v2 v2.9.14 - github.com/nats-io/nats.go v1.23.0 + github.com/nats-io/nats.go v1.24.0 github.com/onsi/gomega v1.27.2 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 diff --git a/go.sum b/go.sum index 626d0a8..8a61515 100644 --- a/go.sum +++ b/go.sum @@ -261,8 +261,8 @@ github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.9.14 h1:n2GscWVgXpA14vQSRP/MM1SGi4wyazR9l19/gWxqgXQ= github.com/nats-io/nats-server/v2 v2.9.14/go.mod h1:40ZwFm4npKdFBhOdY7rkh3YyI1oI91FzLvlYyB7HfzM= -github.com/nats-io/nats.go v1.23.0 h1:lR28r7IX44WjYgdiKz9GmUeW0uh/m33uD3yEjLZ2cOE= -github.com/nats-io/nats.go v1.23.0/go.mod h1:ki/Scsa23edbh8IRZbCuNXR9TDcbvfaSijKtaqQgw+Q= +github.com/nats-io/nats.go v1.24.0 h1:CRiD8L5GOQu/DcfkmgBcTTIQORMwizF+rPk6T0RaHVQ= +github.com/nats-io/nats.go v1.24.0/go.mod h1:dVQF+BK3SzUZpwyzHedXsvH3EO38aVKuOPkkHlv5hXA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= From 22245641c1a1ce65dcda8aa52135295da99fe476 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Mar 2023 15:11:07 +0100 Subject: [PATCH 165/194] gomod(deps): bump github.com/nats-io/nats-server/v2 from 2.9.14 to 2.9.15 in /components/event-publisher-proxy (#16983) * gomod(deps): bump github.com/nats-io/nats-server/v2 Bumps [github.com/nats-io/nats-server/v2](https://github.com/nats-io/nats-server) from 2.9.14 to 2.9.15. - [Release notes](https://github.com/nats-io/nats-server/releases) - [Changelog](https://github.com/nats-io/nats-server/blob/main/.goreleaser.yml) - [Commits](https://github.com/nats-io/nats-server/compare/v2.9.14...v2.9.15) --- updated-dependencies: - dependency-name: github.com/nats-io/nats-server/v2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 6 +++--- go.sum | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 9489ecc..4e1d533 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f - github.com/nats-io/nats-server/v2 v2.9.14 + github.com/nats-io/nats-server/v2 v2.9.15 github.com/nats-io/nats.go v1.24.0 github.com/onsi/gomega v1.27.2 github.com/pkg/errors v0.9.1 @@ -50,7 +50,7 @@ require ( github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.15 // indirect + github.com/klauspost/compress v1.16.0 // indirect github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect @@ -70,7 +70,7 @@ require ( github.com/stretchr/objx v0.5.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.5.0 // indirect + golang.org/x/crypto v0.6.0 // indirect golang.org/x/net v0.7.0 // indirect golang.org/x/sys v0.5.0 // indirect golang.org/x/term v0.5.0 // indirect diff --git a/go.sum b/go.sum index 8a61515..5bbc802 100644 --- a/go.sum +++ b/go.sum @@ -222,8 +222,8 @@ github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dv github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= -github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= +github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= +github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -259,8 +259,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= -github.com/nats-io/nats-server/v2 v2.9.14 h1:n2GscWVgXpA14vQSRP/MM1SGi4wyazR9l19/gWxqgXQ= -github.com/nats-io/nats-server/v2 v2.9.14/go.mod h1:40ZwFm4npKdFBhOdY7rkh3YyI1oI91FzLvlYyB7HfzM= +github.com/nats-io/nats-server/v2 v2.9.15 h1:MuwEJheIwpvFgqvbs20W8Ish2azcygjf4Z0liVu2I4c= +github.com/nats-io/nats-server/v2 v2.9.15/go.mod h1:QlCTy115fqpx4KSOPFIxSV7DdI6OxtZsGOL1JLdeRlE= github.com/nats-io/nats.go v1.24.0 h1:CRiD8L5GOQu/DcfkmgBcTTIQORMwizF+rPk6T0RaHVQ= github.com/nats-io/nats.go v1.24.0/go.mod h1:dVQF+BK3SzUZpwyzHedXsvH3EO38aVKuOPkkHlv5hXA= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= From adf3cd6ca9576ca6a87f4ba6ee46a8af8025ea8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 17:38:32 +0100 Subject: [PATCH 166/194] gomod(deps): bump golang.org/x/oauth2 from 0.5.0 to 0.6.0 in /components/event-publisher-proxy (#16998) * gomod(deps): bump golang.org/x/oauth2 Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.5.0 to 0.6.0. - [Release notes](https://github.com/golang/oauth2/releases) - [Commits](https://github.com/golang/oauth2/compare/v0.5.0...v0.6.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 4e1d533..2ffb7f5 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/stretchr/testify v1.8.2 go.opencensus.io v0.24.0 go.uber.org/zap v1.24.0 - golang.org/x/oauth2 v0.5.0 + golang.org/x/oauth2 v0.6.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 k8s.io/api v0.25.6 k8s.io/apimachinery v0.25.6 @@ -71,10 +71,10 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/term v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/term v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 5bbc802..7310c27 100644 --- a/go.sum +++ b/go.sum @@ -415,8 +415,8 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -433,8 +433,8 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s= -golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= +golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -500,13 +500,13 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -517,8 +517,8 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 5d0bba4a88d069d57194b4413c0f59918432b824 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 11:56:27 +0100 Subject: [PATCH 167/194] docker(deps): bump kyma-project/external/golang from 1.19.5-alpine3.17 to 1.20.1-alpine3.17 in /components/event-publisher-proxy (#17067) * docker(deps): bump kyma-project/external/golang Bumps kyma-project/external/golang from 1.19.5-alpine3.17 to 1.20.1-alpine3.17. --- updated-dependencies: - dependency-name: kyma-project/external/golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a69dc0b..30fd586 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.19.5-alpine3.17 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.20.1-alpine3.17 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From 437835b8e7671b14abdd05472ebf34067281d59e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 19:24:20 +0100 Subject: [PATCH 168/194] docker(deps): bump kyma-project/external/golang from 1.20.1-alpine3.17 to 1.20.2-alpine3.17 in /components/event-publisher-proxy (#17082) * docker(deps): bump kyma-project/external/golang Bumps kyma-project/external/golang from 1.20.1-alpine3.17 to 1.20.2-alpine3.17. --- updated-dependencies: - dependency-name: kyma-project/external/golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 30fd586..c0a61d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.20.1-alpine3.17 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.20.2-alpine3.17 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From 173051ad9f56c84a010b1dcec61d48980e9887e2 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Wed, 15 Mar 2023 16:28:57 +0100 Subject: [PATCH 169/194] Update k8s dependencies in Eventing. (#17083) * Bump k8s dependencies in epp. * Upgrade k8s dependencies in ec. * Bump images. --- go.mod | 20 ++++++++++---------- go.sum | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 2ffb7f5..9b60982 100644 --- a/go.mod +++ b/go.mod @@ -19,9 +19,9 @@ require ( go.uber.org/zap v1.24.0 golang.org/x/oauth2 v0.6.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 - k8s.io/api v0.25.6 - k8s.io/apimachinery v0.25.6 - k8s.io/client-go v0.25.6 + k8s.io/api v0.25.7 + k8s.io/apimachinery v0.25.7 + k8s.io/client-go v0.25.7 sigs.k8s.io/controller-runtime v0.13.1 ) @@ -83,7 +83,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.25.0 // indirect - k8s.io/component-base v0.25.6 // indirect + k8s.io/component-base v0.25.7 // indirect k8s.io/klog/v2 v2.80.1 // indirect k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect @@ -94,12 +94,12 @@ require ( replace ( // keep all following packages at the same version - k8s.io/api => k8s.io/api v0.25.6 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.6 - k8s.io/apimachinery => k8s.io/apimachinery v0.25.6 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.6 - k8s.io/component-base => k8s.io/component-base v0.25.6 - k8s.io/kubectl => k8s.io/kubectl v0.25.6 + k8s.io/api => k8s.io/api v0.25.7 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.7 + k8s.io/apimachinery => k8s.io/apimachinery v0.25.7 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.7 + k8s.io/component-base => k8s.io/component-base v0.25.7 + k8s.io/kubectl => k8s.io/kubectl v0.25.7 ) replace ( diff --git a/go.sum b/go.sum index 7310c27..058bd61 100644 --- a/go.sum +++ b/go.sum @@ -749,16 +749,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.6 h1:LwDY2H6kD/3R8TekJYYaJWOdekNdXDO44eVpX6sNtJA= -k8s.io/api v0.25.6/go.mod h1:bVp01KUcl8VUHFBTJMOknWNo7XvR0cMbeTTuFg1zCUs= -k8s.io/apiextensions-apiserver v0.25.6 h1:MwdaCpHtGVSM5SiA6Hm4g2w5voMNiPCwBjOqz9YTlrg= -k8s.io/apiextensions-apiserver v0.25.6/go.mod h1:aXw8Xmhf6/gfGx3y0xkj8o8evTZbfOFqZeWIigg4XsE= -k8s.io/apimachinery v0.25.6 h1:r6KIF2AHwLqFfZ0LcOA3I11SF62YZK83dxj1fn14NOQ= -k8s.io/apimachinery v0.25.6/go.mod h1:1S2i1QHkmxc8+EZCIxe/fX5hpldVXk4gvnJInMEb8D4= -k8s.io/client-go v0.25.6 h1:CHxACHi0DijmlYyUR7ooZoXnD5P8jYLgBHcxp775x/U= -k8s.io/client-go v0.25.6/go.mod h1:s9mMAGFYiH3Z66j7BESzu0GEradT9GQ2LjFf/YRrnyc= -k8s.io/component-base v0.25.6 h1:v3ci6FbXFcxpjyQJaaLq0MgzT3vyFzwUDWtO+KRv9Bk= -k8s.io/component-base v0.25.6/go.mod h1:k7DfcfJ8cOI6A2xTCfU5LxsnXV+lWw1ME8cRCHzIh6o= +k8s.io/api v0.25.7 h1:r+J8U7CPhPNNTvyow1yw6IzdLt6nBCvPQEW8Cdglep8= +k8s.io/api v0.25.7/go.mod h1:9epkK0wROSVQJKaKW3eY/thGtfbILsLqweTq99qKynk= +k8s.io/apiextensions-apiserver v0.25.7 h1:JcQRpJuUb+fq9yuLVOJvnPb2exTOpndihw6cm5SYSdY= +k8s.io/apiextensions-apiserver v0.25.7/go.mod h1:OospDXJZREut4pOtZhvz4tvKMWxJHbcf8HFtlafN7gc= +k8s.io/apimachinery v0.25.7 h1:kDtoW8uvDkwKc9Lq2sablqWTMZUloRjJVZWURFrdAiI= +k8s.io/apimachinery v0.25.7/go.mod h1:ZTl0drTQaFi5gMM3snYI5tWV1XJmRH1gfnDx2QCLsxk= +k8s.io/client-go v0.25.7 h1:yERmM57CweHC13+wRek/LjScnL5kw6EnVvjoGwS6F7Y= +k8s.io/client-go v0.25.7/go.mod h1:+msAWrAey/u++r/ij0HISJs3QA+RrqXsIa/LqBAT23o= +k8s.io/component-base v0.25.7 h1:xGWvweUXGK5TA+92Qr51hzYw1cM/QpZNMz1vhtcM6NQ= +k8s.io/component-base v0.25.7/go.mod h1:yoYUxxtHH0ysjUwqQ3xpvoD9t1+ENbX5EYgsW+lif+Y= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= From 5e7d07b15fc214e020a9d2049b5de2fc6dd03db8 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Wed, 22 Mar 2023 22:22:10 +0100 Subject: [PATCH 170/194] Clean the replaces in eventing. (#17124) * use go 1.20 in ec * bump crypto replace in ec * use go 1.20 in epp * bump crypto replace in epp * bump replace for k8s.io/utils in epp * remove replace for k8s.io/utils from epp * remove replace for github.com/opencontainers/runc in epp * bump replace apigateway in epp * bump images --- go.mod | 8 +++----- go.sum | 21 ++++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 9b60982..0670cb0 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy -go 1.19 +go 1.20 require ( github.com/cloudevents/sdk-go/v2 v2.13.0 @@ -103,9 +103,7 @@ replace ( ) replace ( - github.com/kyma-incubator/api-gateway => github.com/kyma-project/api-gateway v0.0.0-20220819093753-296e6704d413 - github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.0-rc93 + github.com/kyma-incubator/api-gateway => github.com/kyma-project/api-gateway v0.0.0-20230321131415-ea1b79aa2ddb github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.14.0 - golang.org/x/crypto => golang.org/x/crypto v0.3.0 - k8s.io/utils => k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 + golang.org/x/crypto => golang.org/x/crypto v0.7.0 ) diff --git a/go.sum b/go.sum index 058bd61..5d081bd 100644 --- a/go.sum +++ b/go.sum @@ -231,7 +231,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kyma-project/api-gateway v0.0.0-20220819093753-296e6704d413 h1:fkGKNOFbltycpdQ7yCGfa+7MpH9X18F09x+n7Tgfp7A= +github.com/kyma-project/api-gateway v0.0.0-20230321131415-ea1b79aa2ddb h1:5Bp1Z3d0+h1aWNK+mcZeQESlLpHVezpOOyD5urDpYmk= github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 h1:7CVA4isawiebZGBPeaRwFyxNLb36ZWgmfiSpJSUgI+c= github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 h1:XxhNPU8Z1eknyepGqg21ajEisuTeknKydHiZ6m5Qp3k= @@ -338,8 +338,8 @@ go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95a go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A= -golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= +golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -376,6 +376,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -414,7 +415,7 @@ golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -448,6 +449,7 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -499,12 +501,12 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -516,7 +518,7 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -580,6 +582,7 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -764,8 +767,8 @@ k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= -k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc= -k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4= +k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= From 73ee3966fda9c0a92f06b0f23721cef3e1e0b5af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Apr 2023 12:09:00 +0200 Subject: [PATCH 171/194] gomod(deps): bump github.com/nats-io/nats.go from 1.24.0 to 1.25.0 in /components/event-publisher-proxy (#17192) * gomod(deps): bump github.com/nats-io/nats.go Bumps [github.com/nats-io/nats.go](https://github.com/nats-io/nats.go) from 1.24.0 to 1.25.0. - [Release notes](https://github.com/nats-io/nats.go/releases) - [Commits](https://github.com/nats-io/nats.go/compare/v1.24.0...v1.25.0) --- updated-dependencies: - dependency-name: github.com/nats-io/nats.go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 4 ++-- go.sum | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 0670cb0..b511afb 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f github.com/nats-io/nats-server/v2 v2.9.15 - github.com/nats-io/nats.go v1.24.0 + github.com/nats-io/nats.go v1.25.0 github.com/onsi/gomega v1.27.2 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 @@ -60,7 +60,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nats-io/jwt/v2 v2.3.0 // indirect - github.com/nats-io/nkeys v0.3.0 // indirect + github.com/nats-io/nkeys v0.4.4 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect diff --git a/go.sum b/go.sum index 5d081bd..13927ad 100644 --- a/go.sum +++ b/go.sum @@ -261,10 +261,11 @@ github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= github.com/nats-io/nats-server/v2 v2.9.15 h1:MuwEJheIwpvFgqvbs20W8Ish2azcygjf4Z0liVu2I4c= github.com/nats-io/nats-server/v2 v2.9.15/go.mod h1:QlCTy115fqpx4KSOPFIxSV7DdI6OxtZsGOL1JLdeRlE= -github.com/nats-io/nats.go v1.24.0 h1:CRiD8L5GOQu/DcfkmgBcTTIQORMwizF+rPk6T0RaHVQ= -github.com/nats-io/nats.go v1.24.0/go.mod h1:dVQF+BK3SzUZpwyzHedXsvH3EO38aVKuOPkkHlv5hXA= -github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= +github.com/nats-io/nats.go v1.25.0 h1:t5/wCPGciR7X3Mu8QOi4jiJaXaWM8qtkLu4lzGZvYHE= +github.com/nats-io/nats.go v1.25.0/go.mod h1:D2WALIhz7V8M0pH8Scx8JZXlg6Oqz5VG+nQkK8nJdvg= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= +github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= +github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= From 14322e188704615de9794f91efed0dc47728d1cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Apr 2023 11:55:21 +0200 Subject: [PATCH 172/194] gomod(deps): bump github.com/onsi/gomega from 1.27.2 to 1.27.6 in /components/event-publisher-proxy (#17222) * gomod(deps): bump github.com/onsi/gomega Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.27.2 to 1.27.6. - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.27.2...v1.27.6) --- updated-dependencies: - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 4 ++-- go.sum | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index b511afb..f7f6c93 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f github.com/nats-io/nats-server/v2 v2.9.15 github.com/nats-io/nats.go v1.25.0 - github.com/onsi/gomega v1.27.2 + github.com/onsi/gomega v1.27.6 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 github.com/stretchr/testify v1.8.2 @@ -43,7 +43,7 @@ require ( github.com/go-openapi/swag v0.19.14 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.1.0 // indirect diff --git a/go.sum b/go.sum index 13927ad..81ac6ae 100644 --- a/go.sum +++ b/go.sum @@ -115,7 +115,7 @@ github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -149,8 +149,9 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -272,9 +273,9 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.8.4 h1:gf5mIQ8cLFieruNLAdgijHF1PYfLphKm2dxxcUtcqK0= -github.com/onsi/gomega v1.27.2 h1:SKU0CXeKE/WVgIV1T61kSa3+IRE8Ekrv9rdXDwwTqnY= -github.com/onsi/gomega v1.27.2/go.mod h1:5mR3phAHpkAVIDkHEUBY6HGVsU+cpcEscrGPB4oPlZI= +github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU= +github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= +github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -582,8 +583,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 426fd3c8a779ead6223de97695a4b853b53ce1d0 Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Tue, 25 Apr 2023 10:54:59 +0200 Subject: [PATCH 173/194] Bump pkgs in EC and EPP as per dependerbot (#17369) * Bump pkgs in EC and EPP * image bump * revert nats bump --- Dockerfile | 2 +- go.mod | 18 +++++++++--------- go.sum | 29 ++++++++++++++++------------- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index c0a61d1..292b1e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.20.2-alpine3.17 as builder +FROM eu.gcr.io/kyma-project/external/golang:1.20.3-alpine3.17 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy diff --git a/go.mod b/go.mod index f7f6c93..758c6b7 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy go 1.20 require ( - github.com/cloudevents/sdk-go/v2 v2.13.0 + github.com/cloudevents/sdk-go/v2 v2.14.0 github.com/google/uuid v1.3.0 github.com/gorilla/mux v1.8.0 github.com/kelseyhightower/envconfig v1.4.0 @@ -17,7 +17,7 @@ require ( github.com/stretchr/testify v1.8.2 go.opencensus.io v0.24.0 go.uber.org/zap v1.24.0 - golang.org/x/oauth2 v0.6.0 + golang.org/x/oauth2 v0.7.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 k8s.io/api v0.25.7 k8s.io/apimachinery v0.25.7 @@ -50,7 +50,7 @@ require ( github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.16.0 // indirect + github.com/klauspost/compress v1.16.4 // indirect github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect @@ -59,7 +59,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/nats-io/jwt/v2 v2.3.0 // indirect + github.com/nats-io/jwt/v2 v2.4.1 // indirect github.com/nats-io/nkeys v0.4.4 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -70,11 +70,11 @@ require ( github.com/stretchr/objx v0.5.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.8.0 // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect + golang.org/x/crypto v0.8.0 // indirect + golang.org/x/net v0.9.0 // indirect + golang.org/x/sys v0.7.0 // indirect + golang.org/x/term v0.7.0 // indirect + golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 81ac6ae..46c3442 100644 --- a/go.sum +++ b/go.sum @@ -66,8 +66,8 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go/v2 v2.13.0 h1:2zxDS8RyY1/wVPULGGbdgniGXSzLaRJVl136fLXGsYw= -github.com/cloudevents/sdk-go/v2 v2.13.0/go.mod h1:xDmKfzNjM8gBvjaF8ijFjM1VYOVUEeUfapHMUX1T5To= +github.com/cloudevents/sdk-go/v2 v2.14.0 h1:Nrob4FwVgi5L4tV9lhjzZcjYqFVyJzsA56CwPaPfv6s= +github.com/cloudevents/sdk-go/v2 v2.14.0/go.mod h1:xDmKfzNjM8gBvjaF8ijFjM1VYOVUEeUfapHMUX1T5To= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -223,8 +223,8 @@ github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dv github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.0 h1:iULayQNOReoYUe+1qtKOqw9CwJv3aNQu8ivo7lw1HU4= -github.com/klauspost/compress v1.16.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.4 h1:91KN02FnsOYhuunwU4ssRe8lc2JosWmizWa91B5v1PU= +github.com/klauspost/compress v1.16.4/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -258,13 +258,12 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt/v2 v2.3.0 h1:z2mA1a7tIf5ShggOFlR1oBPgd6hGqcDYsISxZByUzdI= -github.com/nats-io/jwt/v2 v2.3.0/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= +github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4= +github.com/nats-io/jwt/v2 v2.4.1/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI= github.com/nats-io/nats-server/v2 v2.9.15 h1:MuwEJheIwpvFgqvbs20W8Ish2azcygjf4Z0liVu2I4c= github.com/nats-io/nats-server/v2 v2.9.15/go.mod h1:QlCTy115fqpx4KSOPFIxSV7DdI6OxtZsGOL1JLdeRlE= github.com/nats-io/nats.go v1.25.0 h1:t5/wCPGciR7X3Mu8QOi4jiJaXaWM8qtkLu4lzGZvYHE= github.com/nats-io/nats.go v1.25.0/go.mod h1:D2WALIhz7V8M0pH8Scx8JZXlg6Oqz5VG+nQkK8nJdvg= -github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -418,8 +417,9 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -436,8 +436,8 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= -golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= +golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -504,13 +504,15 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= +golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -521,8 +523,9 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 2be2c3cdc95d0364e8e9660a42b07b3220b9d908 Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Wed, 3 May 2023 12:17:05 +0200 Subject: [PATCH 174/194] Cleanup v1alpha1 Subscription codebase in EPP (#17395) * Cleanup all v1alpha1 in EPP * image bump * lint fix --- go.mod | 4 +- go.sum | 8 +- pkg/commander/beb/beb.go | 8 +- pkg/commander/nats/nats.go | 8 +- pkg/handler/handler.go | 35 +- pkg/handler/handler_test.go | 831 ++++++------------------- pkg/handler/handler_v1alpha1_test.go | 772 +++++++++++++++++++++++ pkg/handler/handler_v1alpha2_test.go | 561 ----------------- pkg/options/options.go | 17 +- pkg/sender/jetstream/jetstream.go | 9 +- pkg/sender/jetstream/jetstream_test.go | 13 +- pkg/subscribed/helpers.go | 8 +- pkg/subscribed/processor.go | 34 +- 13 files changed, 1020 insertions(+), 1288 deletions(-) create mode 100644 pkg/handler/handler_v1alpha1_test.go delete mode 100644 pkg/handler/handler_v1alpha2_test.go diff --git a/go.mod b/go.mod index 758c6b7..c8fad5b 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230426090856-c122afc6c6b9 github.com/nats-io/nats-server/v2 v2.9.15 github.com/nats-io/nats.go v1.25.0 github.com/onsi/gomega v1.27.6 @@ -36,7 +36,7 @@ require ( github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/zapr v1.2.3 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.19.5 // indirect diff --git a/go.sum b/go.sum index 46c3442..f413b69 100644 --- a/go.sum +++ b/go.sum @@ -103,8 +103,8 @@ github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= @@ -237,8 +237,8 @@ github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 h github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 h1:XxhNPU8Z1eknyepGqg21ajEisuTeknKydHiZ6m5Qp3k= github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455/go.mod h1:18VKkunC8gEMKAIX3/64rXDq3XNk82CfHQ2G1kZPSQM= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f h1:p6AwRi+RTCynwtUJ3ihvb1QlLAzWchC3J2FWDIAdVjo= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20221221134059-d9a237e9ad4f/go.mod h1:qbrPobautjB9Mu0jV6+wPcc3LToy0+iiffiY+cQvb2Q= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230426090856-c122afc6c6b9 h1:fBfmBw7ehn+6bRfERgOecU6ExUnSMMrRX4kC6LdPV3g= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230426090856-c122afc6c6b9/go.mod h1:DmZjh7+uHPR7uI72TESY9mpwuIgLNmBm4YdiDIALt3k= 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.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= diff --git a/pkg/commander/beb/beb.go b/pkg/commander/beb/beb.go index f056832..1b9990e 100644 --- a/pkg/commander/beb/beb.go +++ b/pkg/commander/beb/beb.go @@ -98,13 +98,9 @@ func (c *Commander) Start() error { ) // Configure Subscription Lister - subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig, c.opts.EnableNewCRDVersion) + subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig) var subLister cache.GenericLister - if c.opts.EnableNewCRDVersion { - subLister = subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() - } else { - subLister = subDynamicSharedInfFactory.ForResource(subscribed.GVRV1alpha1).Lister() - } + subLister = subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() subscribedProcessor := &subscribed.Processor{ SubscriptionLister: &subLister, Prefix: c.envCfg.EventTypePrefix, diff --git a/pkg/commander/nats/nats.go b/pkg/commander/nats/nats.go index 1280040..fe58386 100644 --- a/pkg/commander/nats/nats.go +++ b/pkg/commander/nats/nats.go @@ -106,13 +106,9 @@ func (c *Commander) Start() error { ) // configure Subscription Lister - subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig, c.opts.EnableNewCRDVersion) + subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig) var subLister cache.GenericLister - if c.opts.EnableNewCRDVersion { - subLister = subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() - } else { - subLister = subDynamicSharedInfFactory.ForResource(subscribed.GVRV1alpha1).Lister() - } + subLister = subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() subscribedProcessor := &subscribed.Processor{ SubscriptionLister: &subLister, Prefix: c.envCfg.ToConfig().EventTypePrefix, diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index ec96577..eab5531 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -96,15 +96,9 @@ func (h *Handler) setupMux() { router.Use(h.collector.MetricsMiddleware()) router.HandleFunc(PublishEndpoint, h.maxBytes(h.publishCloudEvents)).Methods(http.MethodPost) router.HandleFunc(LegacyEndpointPattern, h.maxBytes(h.publishLegacyEventsAsCE)).Methods(http.MethodPost) - if h.Options.EnableNewCRDVersion { - router.HandleFunc( - SubscribedEndpointPattern, - h.maxBytes(h.SubscribedProcessor.ExtractEventsFromSubscriptions)).Methods(http.MethodGet) - } else { - router.HandleFunc( - SubscribedEndpointPattern, - h.maxBytes(h.SubscribedProcessor.ExtractEventsFromSubscriptionsV1alpha1)).Methods(http.MethodGet) - } + router.HandleFunc( + SubscribedEndpointPattern, + h.maxBytes(h.SubscribedProcessor.ExtractEventsFromSubscriptions)).Methods(http.MethodGet) router.HandleFunc(health.ReadinessURI, h.maxBytes(h.HealthChecker.ReadinessCheck)) router.HandleFunc(health.LivenessURI, h.maxBytes(h.HealthChecker.LivenessCheck)) h.router = router @@ -202,22 +196,20 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h return } - // publish event for Subscription v1alpha2 - if h.Options.EnableNewCRDVersion { - successResult, publishedEvent = h.handlePublishLegacyEvent(writer, publishRequestData, request) - // if publishedEvent is nil, then it means that the publishing failed - // and the response is already returned to the user - if publishedEvent == nil { - return - } + // publish event for Subscription + successResult, publishedEvent = h.handlePublishLegacyEvent(writer, publishRequestData, request) + // if publishedEvent is nil, then it means that the publishing failed + // and the response is already returned to the user + if publishedEvent == nil { + return } // publish event for Subscription v1alpha1 - // In case of EnableNewCRDVersion is true and the active backend is JetStream + // In case: the active backend is JetStream // then we will publish event on both possible subjects // i.e. with prefix (`sap.kyma.custom`) and without prefix // this behaviour will be deprecated when we remove support for JetStream with Subscription `exact` typeMatching - if !h.Options.EnableNewCRDVersion || h.activeBackend == env.JetStreamBackend { + if h.activeBackend == env.JetStreamBackend { successResult, publishedEvent = h.handlePublishLegacyEventV1alpha1(writer, publishRequestData, request) // if publishedEvent is nil, then it means that the publishing failed // and the response is already returned to the user @@ -248,7 +240,8 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R eventTypeOriginal := event.Type() - if h.Options.EnableNewCRDVersion && !strings.HasPrefix(eventTypeOriginal, h.OldEventTypePrefix) { + //nolint:nestif // it will be improved when v1alpha1 is deprecated. + if !strings.HasPrefix(eventTypeOriginal, h.OldEventTypePrefix) { // build a new cloud event instance as per specifications per backend event, err = h.ceBuilder.Build(*event) if err != nil { @@ -322,7 +315,7 @@ func (h *Handler) sendEventAndRecordMetrics(ctx context.Context, event *cev2even originalEventType := event.Type() originalTypeHeader, ok := event.Extensions()[builder.OriginalTypeHeaderName] if !ok { - h.namedLogger().With().Warnw("event header doesn't exist", "header", + h.namedLogger().With().Debugw("event header doesn't exist", "header", builder.OriginalTypeHeaderName) } else { originalEventType, ok = originalTypeHeader.(string) diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index 367d0d1..e646004 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -1,33 +1,32 @@ -//nolint:lll // this test uses many long lines directly from prometheus output +//nolint:lll // output directly from prometheus package handler import ( "context" "encoding/json" - "errors" "fmt" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" "io" "net/http" "net/http/httptest" "strings" "testing" - "time" - cloudevents "github.com/cloudevents/sdk-go/v2" - "github.com/cloudevents/sdk-go/v2/client" - cev2event "github.com/cloudevents/sdk-go/v2/event" + "github.com/stretchr/testify/require" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/legacytest" + eclogger "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" "github.com/stretchr/testify/assert" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype/eventtypetest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/legacytest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/histogram/mocks" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" @@ -37,136 +36,6 @@ import ( testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) -func Test_extractCloudEventFromRequest(t *testing.T) { - type args struct { - request *http.Request - } - type wants struct { - event *cev2event.Event - errorAssertionFunc assert.ErrorAssertionFunc - } - tests := []struct { - name string - args args - wantType string - wants wants - }{ - { - name: "Valid event", - args: args{ - request: CreateValidStructuredRequest(t), - }, - wantType: fmt.Sprintf("sap.kyma.custom.%s", testingutils.CloudEventType), - wants: wants{ - event: CreateCloudEvent(t), - errorAssertionFunc: assert.NoError, - }, - }, - { - name: "Invalid event", - args: args{ - request: CreateInvalidStructuredRequest(t), - }, - wants: wants{ - event: nil, - errorAssertionFunc: assert.Error, - }, - }, - { - name: "Entirely broken Request", - args: args{ - request: CreateBrokenRequest(t), - }, - wants: wants{ - event: nil, - errorAssertionFunc: assert.Error, - }, - }, - { - name: "Valid event", - args: args{ - request: CreateValidBinaryRequest(t), - }, - wantType: fmt.Sprintf("sap.kyma.custom.%s", testingutils.CloudEventType), - wants: wants{ - event: CreateCloudEvent(t), - errorAssertionFunc: assert.NoError, - }, - }, - { - name: "Invalid event", - args: args{ - request: CreateInvalidBinaryRequest(t), - }, - wants: wants{ - event: nil, - errorAssertionFunc: assert.Error, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - gotEvent, err := extractCloudEventFromRequest(tt.args.request) - if tt.wantType != "" { - tt.wants.event.SetType(tt.wantType) - } - if !tt.wants.errorAssertionFunc(t, err, fmt.Sprintf("extractCloudEventFromRequest(%v)", tt.args.request)) { - return - } - assert.Equalf(t, tt.wants.event, gotEvent, "extractCloudEventFromRequest(%v)", tt.args.request) - }) - } -} - -func Test_writeResponse(t *testing.T) { - type args struct { - statusCode int - respBody []byte - } - tests := []struct { - name string - args args - assertionFunc assert.ErrorAssertionFunc - }{ - { - name: "Response and body", - args: args{ - statusCode: 200, - respBody: []byte("foo"), - }, - assertionFunc: assert.NoError, - }, - { - name: "Response and no body", - args: args{ - statusCode: 200, - respBody: nil, - }, - assertionFunc: assert.NoError, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // given - writer := httptest.NewRecorder() - - // when - err := writeResponse(writer, tt.args.statusCode, tt.args.respBody) - - // then - tt.assertionFunc(t, err, fmt.Sprintf("writeResponse(%v, %v)", tt.args.statusCode, tt.args.respBody)) - assert.Equal(t, tt.args.statusCode, writer.Result().StatusCode) - body, err := io.ReadAll(writer.Result().Body) - assert.NoError(t, err) - if tt.args.respBody != nil { - assert.Equal(t, tt.args.respBody, body) - } else { - assert.Equal(t, []byte(""), body) - } - }) - } -} - func TestHandler_publishCloudEvents(t *testing.T) { type fields struct { Sender sender.GenericSender @@ -190,6 +59,91 @@ func TestHandler_publishCloudEvents(t *testing.T) { wantBody []byte wantTEF string }{ + { + name: "Publish structured Cloudevent for Subscription v1alpha1", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + Result: eventmesh.HTTPPublishResult{ + Status: 204, + Body: []byte(""), + }, + BackendURL: "FOO", + }, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidStructuredRequestV1Alpha1(t), + }, + wantStatus: 204, + wantTEF: ` + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 + `, + }, + { + name: "Publish binary Cloudevent for Subscription v1alpha1", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + Result: eventmesh.HTTPPublishResult{ + Status: 204, + Body: []byte(""), + }, + BackendURL: "FOO", + }, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidBinaryRequestV1Alpha1(t), + }, + wantStatus: 204, + wantTEF: ` + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 + eventing_epp_backend_duration_milliseconds_count{destination_service="FOO",code="204"} 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 + `, + }, { name: "Publish structured Cloudevent", fields: fields{ @@ -208,11 +162,10 @@ func TestHandler_publishCloudEvents(t *testing.T) { request: CreateValidStructuredRequest(t), }, wantStatus: 204, - wantTEF: ` # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 + eventing_epp_event_type_published_total{code="204",event_source="testapp1023",event_type="order.created.v1"} 1 # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds # TYPE eventing_epp_backend_duration_milliseconds histogram eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 @@ -251,11 +204,10 @@ func TestHandler_publishCloudEvents(t *testing.T) { request: CreateValidBinaryRequest(t), }, wantStatus: 204, - wantTEF: ` # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 + eventing_epp_event_type_published_total{code="204",event_source="testapp1023",event_type="order.created.v1"} 1 # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds # TYPE eventing_epp_backend_duration_milliseconds histogram eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 @@ -302,23 +254,6 @@ func TestHandler_publishCloudEvents(t *testing.T) { }, wantStatus: 400, }, - { - name: "Publish binary CloudEvent but cannot clean", - fields: fields{ - Sender: &GenericSenderStub{}, - collector: metrics.NewCollector(latency), - eventTypeCleaner: &eventtypetest.CleanerStub{ - CleanType: "", - Error: fmt.Errorf("I cannot clean"), - }, - }, - args: args{ - request: CreateValidBinaryRequest(t), - }, - wantStatus: 400, - wantBody: []byte("I cannot clean"), - wantTEF: "", // client error will not be recorded as EPP internal error. So no metric will be updated. - }, { name: "Publish binary CloudEvent but cannot send", fields: fields{ @@ -332,7 +267,6 @@ func TestHandler_publishCloudEvents(t *testing.T) { request: CreateValidBinaryRequest(t), }, wantStatus: 500, - wantTEF: ` # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server # TYPE eventing_epp_backend_errors_total counter @@ -365,12 +299,19 @@ func TestHandler_publishCloudEvents(t *testing.T) { logger, err := eclogger.New("text", "debug") assert.NoError(t, err) + app := applicationtest.NewApplication("appName1", nil) + appLister := fake.NewApplicationListerOrDie(context.Background(), app) + + ceBuilder := builder.NewGenericBuilder("prefix", cleaner.NewJetStreamCleaner(logger), appLister, logger) + h := &Handler{ - Sender: tt.fields.Sender, - Logger: logger, - collector: tt.fields.collector, - eventTypeCleaner: tt.fields.eventTypeCleaner, - Options: &options.Options{}, + Sender: tt.fields.Sender, + Logger: logger, + collector: tt.fields.collector, + eventTypeCleaner: tt.fields.eventTypeCleaner, + ceBuilder: ceBuilder, + Options: &options.Options{}, + OldEventTypePrefix: testingutils.OldEventTypePrefix, } writer := httptest.NewRecorder() @@ -391,55 +332,38 @@ func TestHandler_publishCloudEvents(t *testing.T) { } func TestHandler_publishLegacyEventsAsCE(t *testing.T) { - type fields struct { - Sender sender.GenericSender - LegacyTransformer legacy.RequestToCETransformer - collector metrics.PublishingMetricsCollector - eventTypeCleaner eventtype.Cleaner - } - type args struct { - request *http.Request - } + // define common given variables + appLister := NewApplicationListerOrDie(context.Background(), "testapp") - const bucketsFunc = "Buckets" + // set mock for latency metrics latency := new(mocks.BucketsProvider) - latency.On(bucketsFunc).Return(nil) - latency.Test(t) + latency.On("Buckets").Return(nil) tests := []struct { - name string - fields fields - args args - wantStatus int - wantOk bool - wantTEF string + name string + givenSender sender.GenericSender + givenLegacyTransformer legacy.RequestToCETransformer + givenCollector metrics.PublishingMetricsCollector + givenRequest *http.Request + wantHTTPStatus int + wantTEF string }{ { name: "Send valid legacy event", - fields: fields{ - Sender: &GenericSenderStub{ - Result: eventmesh.HTTPPublishResult{ - Status: 204, - }, - BackendURL: "FOO", + givenSender: &GenericSenderStub{ + Result: eventmesh.HTTPPublishResult{ + Status: 204, }, - LegacyTransformer: legacy.NewTransformer( - "namespace", - "im.a.prefix", - NewApplicationListerOrDie(context.Background(), "testapp")), - collector: metrics.NewCollector(latency), - eventTypeCleaner: eventtypetest.CleanerStub{}, + BackendURL: "FOO", }, - args: args{ - request: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - }, - wantStatus: 200, - wantOk: true, - + givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), + givenCollector: metrics.NewCollector(latency), + givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + wantHTTPStatus: http.StatusOK, wantTEF: ` # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="namespace",event_type="im.a.prefix.testapp.object.created.v1"} 1 + eventing_epp_event_type_published_total{code="204",event_source="testapp",event_type="object.created.v1"} 1 # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds # TYPE eventing_epp_backend_duration_milliseconds histogram @@ -465,23 +389,14 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { }, { name: "Send valid legacy event but cannot send to backend due to target not found (e.g. stream missing)", - fields: fields{ - Sender: &GenericSenderStub{ - Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrBackendTargetNotFound), - BackendURL: "FOO", - }, - LegacyTransformer: legacy.NewTransformer( - "namespace", - "im.a.prefix", - NewApplicationListerOrDie(context.Background(), "testapp")), - collector: metrics.NewCollector(latency), - eventTypeCleaner: eventtypetest.CleanerStub{}, - }, - args: args{ - request: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - }, - wantStatus: http.StatusBadGateway, - wantOk: false, + givenSender: &GenericSenderStub{ + Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrBackendTargetNotFound), + BackendURL: "FOO", + }, + givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), + givenCollector: metrics.NewCollector(latency), + givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + wantHTTPStatus: http.StatusBadGateway, wantTEF: ` # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server # TYPE eventing_epp_backend_errors_total counter @@ -490,23 +405,14 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { }, { name: "Send valid legacy event but cannot send to backend due to full storage", - fields: fields{ - Sender: &GenericSenderStub{ - Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrInsufficientStorage), - BackendURL: "FOO", - }, - LegacyTransformer: legacy.NewTransformer( - "namespace", - "im.a.prefix", - NewApplicationListerOrDie(context.Background(), "testapp")), - collector: metrics.NewCollector(latency), - eventTypeCleaner: eventtypetest.CleanerStub{}, - }, - args: args{ - request: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - }, - wantStatus: 507, - wantOk: false, + givenSender: &GenericSenderStub{ + Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrInsufficientStorage), + BackendURL: "FOO", + }, + givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), + givenCollector: metrics.NewCollector(latency), + givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + wantHTTPStatus: 507, wantTEF: ` # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server # TYPE eventing_epp_backend_errors_total counter @@ -515,23 +421,14 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { }, { name: "Send valid legacy event but cannot send to backend", - fields: fields{ - Sender: &GenericSenderStub{ - Err: fmt.Errorf("i cannot send"), - BackendURL: "FOO", - }, - LegacyTransformer: legacy.NewTransformer( - "namespace", - "im.a.prefix", - NewApplicationListerOrDie(context.Background(), "testapp")), - collector: metrics.NewCollector(latency), - eventTypeCleaner: eventtypetest.CleanerStub{}, - }, - args: args{ - request: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - }, - wantStatus: 500, - wantOk: false, + givenSender: &GenericSenderStub{ + Err: fmt.Errorf("i cannot send"), + BackendURL: "FOO", + }, + givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), + givenCollector: metrics.NewCollector(latency), + givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + wantHTTPStatus: 500, wantTEF: ` # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server # TYPE eventing_epp_backend_errors_total counter @@ -540,25 +437,16 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { }, { name: "Send invalid legacy event", - fields: fields{ - Sender: &GenericSenderStub{ - Result: eventmesh.HTTPPublishResult{ - Status: 204, - }, - BackendURL: "FOO", + givenSender: &GenericSenderStub{ + Result: eventmesh.HTTPPublishResult{ + Status: 204, }, - LegacyTransformer: legacy.NewTransformer( - "namespace", - "im.a.prefix", - NewApplicationListerOrDie(context.Background(), "testapp")), - collector: metrics.NewCollector(latency), - eventTypeCleaner: eventtypetest.CleanerStub{}, - }, - args: args{ - request: legacytest.InvalidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + BackendURL: "FOO", }, - wantStatus: 400, - wantOk: false, + givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), + givenCollector: metrics.NewCollector(latency), + givenRequest: legacytest.InvalidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), + wantHTTPStatus: 400, // this is a client error. We do record an error metric for requests that cannot even be decoded correctly. wantTEF: "", }, @@ -567,34 +455,36 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { t.Run(tt.name, func(t *testing.T) { // given logger, err := eclogger.New("text", "debug") - assert.NoError(t, err) + require.NoError(t, err) + + ceBuilder := builder.NewGenericBuilder("prefix", cleaner.NewJetStreamCleaner(logger), appLister, logger) h := &Handler{ - Sender: tt.fields.Sender, + Sender: tt.givenSender, Logger: logger, - LegacyTransformer: tt.fields.LegacyTransformer, - collector: tt.fields.collector, - eventTypeCleaner: tt.fields.eventTypeCleaner, + LegacyTransformer: tt.givenLegacyTransformer, + collector: tt.givenCollector, + ceBuilder: ceBuilder, Options: &options.Options{}, } writer := httptest.NewRecorder() // when - h.publishLegacyEventsAsCE(writer, tt.args.request) + h.publishLegacyEventsAsCE(writer, tt.givenRequest) // then - assert.Equal(t, tt.wantStatus, writer.Result().StatusCode) + require.Equal(t, tt.wantHTTPStatus, writer.Result().StatusCode) body, err := io.ReadAll(writer.Result().Body) - assert.NoError(t, err) + require.NoError(t, err) - if tt.wantOk { + if tt.wantHTTPStatus == http.StatusOK { ok := &api.PublishResponse{} err = json.Unmarshal(body, ok) - assert.NoError(t, err) + require.NoError(t, err) } else { nok := &api.Error{} err = json.Unmarshal(body, nok) - assert.NoError(t, err) + require.NoError(t, err) } metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wantTEF) @@ -602,311 +492,19 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { } } -func TestHandler_maxBytes(t *testing.T) { - type fields struct { - maxBytes int - } - tests := []struct { - name string - fields fields - wantStatus int - }{ - { - name: "request small enough", - fields: fields{ - maxBytes: 10000, - }, - wantStatus: 200, - }, - { - name: "request too large", - fields: fields{ - maxBytes: 1, - }, - wantStatus: 400, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // given - h := &Handler{ - Options: &options.Options{ - MaxRequestSize: int64(tt.fields.maxBytes), - }, - } - writer := httptest.NewRecorder() - var mberr *http.MaxBytesError - f := func(writer http.ResponseWriter, r *http.Request) { - _, err := io.ReadAll(r.Body) - if errors.As(err, &mberr) { - writer.WriteHeader(http.StatusBadRequest) - } - writer.WriteHeader(http.StatusOK) - } - - // when - h.maxBytes(f)(writer, &http.Request{ - Method: http.MethodPost, - Body: io.NopCloser(strings.NewReader(strings.Repeat("#", 5))), - }) - - // then - assert.Equal(t, tt.wantStatus, writer.Result().StatusCode) - }) - } -} - -func TestHandler_sendEventAndRecordMetrics(t *testing.T) { - type fields struct { - Sender sender.GenericSender - Defaulter client.EventDefaulter - collector metrics.PublishingMetricsCollector - } - type args struct { - ctx context.Context - host string - event *cev2event.Event - header http.Header - } - type wants struct { - result sender.PublishResult - assertionFunc assert.ErrorAssertionFunc - metricErrors int - metricTotal int - metricLatency int - metricPublished int - metricLatencyTEF string - metricPublishedTotalTEF string - } - - const bucketsFunc = "Buckets" - latency := new(mocks.BucketsProvider) - latency.On(bucketsFunc).Return(nil) - latency.Test(t) - latencyMetricTEF := ` - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{code="204",destination_service="foo"} 0 - eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="foo"} 1 - ` - - ceEvent := CreateCloudEvent(t) - ceEventWithOriginalEventType := ceEvent.Clone() - ceEventWithOriginalEventType.SetExtension(builder.OriginalTypeHeaderName, testingutils.CloudEventNameAndVersion) - - tests := []struct { - name string - fields fields - args args - wants wants - }{ - { - name: "No Error", - fields: fields{ - Sender: &GenericSenderStub{ - Err: nil, - SleepDuration: 0, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: nil, - }, - }, - Defaulter: nil, - collector: metrics.NewCollector(latency), - }, - args: args{ - ctx: context.Background(), - host: "foo", - event: ceEvent, - }, - wants: wants{ - result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: nil, - }, - assertionFunc: assert.NoError, - metricErrors: 0, - metricTotal: 1, - metricLatency: 1, - metricPublished: 1, - metricLatencyTEF: latencyMetricTEF, - metricPublishedTotalTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type="prefix.testapp1023.order.created.v1"} 1 - `, - }, - }, - { - name: "No Error - set original event type top published metric", - fields: fields{ - Sender: &GenericSenderStub{ - Err: nil, - SleepDuration: 0, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: nil, - }, - }, - Defaulter: nil, - collector: metrics.NewCollector(latency), - }, - args: args{ - ctx: context.Background(), - host: "foo", - event: &ceEventWithOriginalEventType, - }, - wants: wants{ - result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: nil, - }, - assertionFunc: assert.NoError, - metricErrors: 0, - metricTotal: 1, - metricLatency: 1, - metricPublished: 1, - metricLatencyTEF: latencyMetricTEF, - metricPublishedTotalTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type="order.created.v1"} 1 - `, - }, - }, - { - name: "Sending not successful, error returned", - fields: fields{ - Sender: &GenericSenderStub{ - Err: errors.New("i failed"), - SleepDuration: 5, - }, - Defaulter: nil, - collector: metrics.NewCollector(latency), - }, - args: args{ - ctx: context.Background(), - host: "foo", - event: &cev2event.Event{}, - }, - wants: wants{ - result: nil, - assertionFunc: assert.Error, - metricErrors: 1, - metricTotal: 0, - metricLatency: 0, - metricPublished: 0, - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // given - logger, _ := eclogger.New("text", "debug") - h := &Handler{ - Sender: tt.fields.Sender, - Defaulter: tt.fields.Defaulter, - collector: tt.fields.collector, - Logger: logger, - } - - // when - got, err := h.sendEventAndRecordMetrics(tt.args.ctx, tt.args.event, tt.args.host, tt.args.header) - - // then - if !tt.wants.assertionFunc(t, err, fmt.Sprintf("sendEventAndRecordMetrics(%v, %v, %v)", tt.args.ctx, tt.args.host, tt.args.event)) { - return - } - assert.Equalf(t, tt.wants.result, got, "sendEventAndRecordMetrics(%v, %v, %v)", tt.args.ctx, tt.args.host, tt.args.event) - metricstest.EnsureMetricErrors(t, h.collector, tt.wants.metricErrors) - metricstest.EnsureMetricTotalRequests(t, h.collector, tt.wants.metricTotal) - metricstest.EnsureMetricLatency(t, h.collector, tt.wants.metricLatency) - metricstest.EnsureMetricEventTypePublished(t, h.collector, tt.wants.metricPublished) - metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wants.metricLatencyTEF, "eventing_epp_backend_duration_milliseconds") - metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wants.metricPublishedTotalTEF, "eventing_epp_event_type_published_total") - }) - } -} - -func TestHandler_sendEventAndRecordMetrics_TracingAndDefaults(t *testing.T) { - // given - stub := &GenericSenderStub{ - Err: nil, - SleepDuration: 0, - Result: eventmesh.HTTPPublishResult{Status: http.StatusInternalServerError}, - } - - const bucketsFunc = "Buckets" - latency := new(mocks.BucketsProvider) - latency.On(bucketsFunc).Return(nil) - latency.Test(t) - logger, _ := eclogger.New("text", "debug") - h := &Handler{ - Sender: stub, - Defaulter: nil, - collector: metrics.NewCollector(latency), - Logger: logger, - } - header := http.Header{} - headers := []string{"traceparent", "X-B3-TraceId", "X-B3-ParentSpanId", "X-B3-SpanId", "X-B3-Sampled", "X-B3-Flags"} - - for _, v := range headers { - header.Add(v, v) - } - expectedExtensions := map[string]interface{}{ - "traceparent": "traceparent", - "b3traceid": "X-B3-TraceId", - "b3parentspanid": "X-B3-ParentSpanId", - "b3spanid": "X-B3-SpanId", - "b3sampled": "X-B3-Sampled", - "b3flags": "X-B3-Flags", - } - // when - _, err := h.sendEventAndRecordMetrics(context.Background(), CreateCloudEvent(t), "", header) - - // then - assert.NoError(t, err) - assert.Equal(t, expectedExtensions, stub.ReceivedEvent.Context.GetExtensions()) -} - -func CreateCloudEvent(t *testing.T) *cev2event.Event { - builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(testingutils.CloudEventTypeWithPrefix), - ) - payload, _ := builder.BuildStructured() - newEvent := cloudevents.NewEvent() - err := json.Unmarshal([]byte(payload), &newEvent) - assert.NoError(t, err) - newEvent.SetType(testingutils.CloudEventTypeWithPrefix) - err = newEvent.SetData("", map[string]interface{}{"foo": "bar"}) - assert.NoError(t, err) - - return &newEvent -} - -// CreateValidStructuredRequest creates a structured cloudevent as http request. +// CreateValidStructuredRequestV1Alpha2 creates a structured cloudevent as http request. func CreateValidStructuredRequest(t *testing.T) *http.Request { t.Helper() - s := `{ - "specversion":"1.0", - "type":"sap.kyma.custom.testapp1023.order.created.v1", - "source":"/default/sap.kyma/id", - "id":"8945ec08-256b-11eb-9928-acde48001122", - "data":{"foo":"bar"} - }` - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader(s)) + reader := strings.NewReader(`{ + "specversion":"1.0", + "type":"order.created.v1", + "source":"testapp1023", + "id":"8945ec08-256b-11eb-9928-acde48001122", + "data":{ + "foo":"bar" + } + }`) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) req.Header.Add("Content-Type", "application/cloudevents+json") return req } @@ -920,67 +518,40 @@ func CreateBrokenRequest(t *testing.T) *http.Request { return req } -// CreateInvalidStructuredRequest creates an invalid structured cloudevent as http request. The `type` is missing. +// CreateInvalidStructuredRequestV1Alpha2 creates an invalid structured cloudevent as http request. +// The `type` is missing. func CreateInvalidStructuredRequest(t *testing.T) *http.Request { t.Helper() - s := `{ - "specversion":"1.0", - "source":"/default/sap.kyma/id", - "id":"8945ec08-256b-11eb-9928-acde48001122", - "data": { - "foo":"bar" - } - }` - reader := strings.NewReader(s) + reader := strings.NewReader(`{ + "specversion":"1.0", + "source":"testapp1023", + "id":"8945ec08-256b-11eb-9928-acde48001122", + "data":{ + "foo":"bar" + }}`) req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) req.Header.Add("Content-Type", "application/cloudevents+json") return req } -// CreateValidBinaryRequest creates a valid binary cloudevent as http request. +// CreateValidBinaryRequestV1Alpha2 creates a valid binary cloudevent as http request. func CreateValidBinaryRequest(t *testing.T) *http.Request { t.Helper() - reader := strings.NewReader(`{"foo":"bar"}`) - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader(`{"foo":"bar"}`)) req.Header.Add("Ce-Specversion", "1.0") - req.Header.Add("Ce-Type", "sap.kyma.custom.testapp1023.order.created.v1") - req.Header.Add("Ce-Source", "/default/sap.kyma/id") + req.Header.Add("Ce-Type", "order.created.v1") + req.Header.Add("Ce-Source", "testapp1023") req.Header.Add("Ce-ID", "8945ec08-256b-11eb-9928-acde48001122") return req } -// CreateInvalidBinaryRequest creates an invalid binary cloudevent as http request. The `type` is missing. +// CreateInvalidBinaryRequestV1Alpha2 creates an invalid binary cloudevent as http request. The `type` is missing. func CreateInvalidBinaryRequest(t *testing.T) *http.Request { t.Helper() - reader := strings.NewReader(`{"foo":"bar"}`) - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader(`{"foo":"bar"}`)) req.Header.Add("Content-Type", "application/json") req.Header.Add("Ce-Specversion", "1.0") - req.Header.Add("Ce-Source", "/default/sap.kyma/id") + req.Header.Add("Ce-Source", "testapp1023") req.Header.Add("Ce-ID", "8945ec08-256b-11eb-9928-acde48001122") return req } - -type GenericSenderStub struct { - Err error - SleepDuration time.Duration - Result sender.PublishResult - ReceivedEvent *cev2event.Event - BackendURL string -} - -func (g *GenericSenderStub) Send(_ context.Context, event *cev2event.Event) (sender.PublishResult, error) { - g.ReceivedEvent = event - time.Sleep(g.SleepDuration) - return g.Result, g.Err -} - -func (g *GenericSenderStub) URL() string { - return g.BackendURL -} - -func NewApplicationListerOrDie(ctx context.Context, appName string) *application.Lister { - app := applicationtest.NewApplication(appName, nil) - appLister := fake.NewApplicationListerOrDie(ctx, app) - return appLister -} diff --git a/pkg/handler/handler_v1alpha1_test.go b/pkg/handler/handler_v1alpha1_test.go new file mode 100644 index 0000000..c0247fd --- /dev/null +++ b/pkg/handler/handler_v1alpha1_test.go @@ -0,0 +1,772 @@ +//nolint:lll // this test uses many long lines directly from prometheus output +package handler + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/http/httptest" + "strings" + "testing" + "time" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" + + cloudevents "github.com/cloudevents/sdk-go/v2" + "github.com/cloudevents/sdk-go/v2/client" + cev2event "github.com/cloudevents/sdk-go/v2/event" + eclogger "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/stretchr/testify/assert" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype/eventtypetest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/histogram/mocks" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/eventmesh" + testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" +) + +func Test_extractCloudEventFromRequest(t *testing.T) { + type args struct { + request *http.Request + } + type wants struct { + event *cev2event.Event + errorAssertionFunc assert.ErrorAssertionFunc + } + tests := []struct { + name string + args args + wantType string + wants wants + }{ + { + name: "Valid event", + args: args{ + request: CreateValidStructuredRequestV1Alpha1(t), + }, + wantType: fmt.Sprintf("sap.kyma.custom.%s", testingutils.CloudEventType), + wants: wants{ + event: CreateCloudEvent(t), + errorAssertionFunc: assert.NoError, + }, + }, + { + name: "Invalid event", + args: args{ + request: CreateInvalidStructuredRequestV1Alpha1(t), + }, + wants: wants{ + event: nil, + errorAssertionFunc: assert.Error, + }, + }, + { + name: "Entirely broken Request", + args: args{ + request: CreateBrokenRequestV1Alpha1(t), + }, + wants: wants{ + event: nil, + errorAssertionFunc: assert.Error, + }, + }, + { + name: "Valid event", + args: args{ + request: CreateValidBinaryRequestV1Alpha1(t), + }, + wantType: fmt.Sprintf("sap.kyma.custom.%s", testingutils.CloudEventType), + wants: wants{ + event: CreateCloudEvent(t), + errorAssertionFunc: assert.NoError, + }, + }, + { + name: "Invalid event", + args: args{ + request: CreateInvalidBinaryRequestV1Alpha1(t), + }, + wants: wants{ + event: nil, + errorAssertionFunc: assert.Error, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotEvent, err := extractCloudEventFromRequest(tt.args.request) + if tt.wantType != "" { + tt.wants.event.SetType(tt.wantType) + } + if !tt.wants.errorAssertionFunc(t, err, fmt.Sprintf("extractCloudEventFromRequest(%v)", tt.args.request)) { + return + } + assert.Equalf(t, tt.wants.event, gotEvent, "extractCloudEventFromRequest(%v)", tt.args.request) + }) + } +} + +func Test_writeResponse(t *testing.T) { + type args struct { + statusCode int + respBody []byte + } + tests := []struct { + name string + args args + assertionFunc assert.ErrorAssertionFunc + }{ + { + name: "Response and body", + args: args{ + statusCode: 200, + respBody: []byte("foo"), + }, + assertionFunc: assert.NoError, + }, + { + name: "Response and no body", + args: args{ + statusCode: 200, + respBody: nil, + }, + assertionFunc: assert.NoError, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // given + writer := httptest.NewRecorder() + + // when + err := writeResponse(writer, tt.args.statusCode, tt.args.respBody) + + // then + tt.assertionFunc(t, err, fmt.Sprintf("writeResponse(%v, %v)", tt.args.statusCode, tt.args.respBody)) + assert.Equal(t, tt.args.statusCode, writer.Result().StatusCode) + body, err := io.ReadAll(writer.Result().Body) + assert.NoError(t, err) + if tt.args.respBody != nil { + assert.Equal(t, tt.args.respBody, body) + } else { + assert.Equal(t, []byte(""), body) + } + }) + } +} + +func TestHandler_publishCloudEvents_v1alpha1(t *testing.T) { + type fields struct { + Sender sender.GenericSender + collector metrics.PublishingMetricsCollector + eventTypeCleaner eventtype.Cleaner + } + type args struct { + request *http.Request + } + + const bucketsFunc = "Buckets" + latency := new(mocks.BucketsProvider) + latency.On(bucketsFunc).Return(nil) + latency.Test(t) + + tests := []struct { + name string + fields fields + args args + wantStatus int + wantBody []byte + wantTEF string + }{ + { + name: "Publish structured Cloudevent", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + Result: eventmesh.HTTPPublishResult{ + Status: 204, + Body: []byte(""), + }, + BackendURL: "FOO", + }, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidStructuredRequestV1Alpha1(t), + }, + wantStatus: 204, + + wantTEF: ` + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 + `, + }, + { + name: "Publish binary Cloudevent", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + Result: eventmesh.HTTPPublishResult{ + Status: 204, + Body: []byte(""), + }, + BackendURL: "FOO", + }, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidBinaryRequestV1Alpha1(t), + }, + wantStatus: 204, + + wantTEF: ` + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 + eventing_epp_backend_duration_milliseconds_count{destination_service="FOO",code="204"} 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 + `, + }, + { + name: "Publish invalid structured CloudEvent", + fields: fields{ + Sender: &GenericSenderStub{}, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateInvalidStructuredRequestV1Alpha1(t), + }, + wantStatus: 400, + wantBody: []byte("type: MUST be a non-empty string\n"), + }, + { + name: "Publish invalid binary CloudEvent", + fields: fields{ + Sender: &GenericSenderStub{}, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateInvalidBinaryRequestV1Alpha1(t), + }, + wantStatus: 400, + }, + { + name: "Publish binary CloudEvent but cannot clean", + fields: fields{ + Sender: &GenericSenderStub{}, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{ + CleanType: "", + Error: fmt.Errorf("I cannot clean"), + }, + }, + args: args{ + request: CreateValidBinaryRequestV1Alpha1(t), + }, + wantStatus: 400, + wantBody: []byte("I cannot clean"), + wantTEF: "", // client error will not be recorded as EPP internal error. So no metric will be updated. + }, + { + name: "Publish binary CloudEvent but cannot send", + fields: fields{ + Sender: &GenericSenderStub{ + Err: fmt.Errorf("I cannot send"), + }, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidBinaryRequestV1Alpha1(t), + }, + wantStatus: 500, + + wantTEF: ` + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 + `, + }, + { + name: "Publish binary CloudEvent but backend is full", + fields: fields{ + Sender: &GenericSenderStub{ + Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrInsufficientStorage), + }, + collector: metrics.NewCollector(latency), + eventTypeCleaner: &eventtypetest.CleanerStub{}, + }, + args: args{ + request: CreateValidBinaryRequestV1Alpha1(t), + }, + wantStatus: 507, + wantTEF: ` + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 + `, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // given + logger, err := eclogger.New("text", "debug") + assert.NoError(t, err) + + h := &Handler{ + Sender: tt.fields.Sender, + Logger: logger, + collector: tt.fields.collector, + eventTypeCleaner: tt.fields.eventTypeCleaner, + Options: &options.Options{}, + } + writer := httptest.NewRecorder() + + // when + h.publishCloudEvents(writer, tt.args.request) + + // then + assert.Equal(t, tt.wantStatus, writer.Result().StatusCode) + body, err := io.ReadAll(writer.Result().Body) + assert.NoError(t, err) + if tt.wantBody != nil { + assert.Equal(t, tt.wantBody, body) + } + + metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wantTEF) + }) + } +} + +func TestHandler_maxBytes(t *testing.T) { + type fields struct { + maxBytes int + } + tests := []struct { + name string + fields fields + wantStatus int + }{ + { + name: "request small enough", + fields: fields{ + maxBytes: 10000, + }, + wantStatus: 200, + }, + { + name: "request too large", + fields: fields{ + maxBytes: 1, + }, + wantStatus: 400, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // given + h := &Handler{ + Options: &options.Options{ + MaxRequestSize: int64(tt.fields.maxBytes), + }, + } + writer := httptest.NewRecorder() + var mberr *http.MaxBytesError + f := func(writer http.ResponseWriter, r *http.Request) { + _, err := io.ReadAll(r.Body) + if errors.As(err, &mberr) { + writer.WriteHeader(http.StatusBadRequest) + } + writer.WriteHeader(http.StatusOK) + } + + // when + h.maxBytes(f)(writer, &http.Request{ + Method: http.MethodPost, + Body: io.NopCloser(strings.NewReader(strings.Repeat("#", 5))), + }) + + // then + assert.Equal(t, tt.wantStatus, writer.Result().StatusCode) + }) + } +} + +func TestHandler_sendEventAndRecordMetrics(t *testing.T) { + type fields struct { + Sender sender.GenericSender + Defaulter client.EventDefaulter + collector metrics.PublishingMetricsCollector + } + type args struct { + ctx context.Context + host string + event *cev2event.Event + header http.Header + } + type wants struct { + result sender.PublishResult + assertionFunc assert.ErrorAssertionFunc + metricErrors int + metricTotal int + metricLatency int + metricPublished int + metricLatencyTEF string + metricPublishedTotalTEF string + } + + const bucketsFunc = "Buckets" + latency := new(mocks.BucketsProvider) + latency.On(bucketsFunc).Return(nil) + latency.Test(t) + latencyMetricTEF := ` + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="foo",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{code="204",destination_service="foo"} 0 + eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="foo"} 1 + ` + + ceEvent := CreateCloudEvent(t) + ceEventWithOriginalEventType := ceEvent.Clone() + ceEventWithOriginalEventType.SetExtension(builder.OriginalTypeHeaderName, testingutils.CloudEventNameAndVersion) + + tests := []struct { + name string + fields fields + args args + wants wants + }{ + { + name: "No Error", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + SleepDuration: 0, + Result: eventmesh.HTTPPublishResult{ + Status: 204, + Body: nil, + }, + }, + Defaulter: nil, + collector: metrics.NewCollector(latency), + }, + args: args{ + ctx: context.Background(), + host: "foo", + event: ceEvent, + }, + wants: wants{ + result: eventmesh.HTTPPublishResult{ + Status: 204, + Body: nil, + }, + assertionFunc: assert.NoError, + metricErrors: 0, + metricTotal: 1, + metricLatency: 1, + metricPublished: 1, + metricLatencyTEF: latencyMetricTEF, + metricPublishedTotalTEF: ` + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type="prefix.testapp1023.order.created.v1"} 1 + `, + }, + }, + { + name: "No Error - set original event type top published metric", + fields: fields{ + Sender: &GenericSenderStub{ + Err: nil, + SleepDuration: 0, + Result: eventmesh.HTTPPublishResult{ + Status: 204, + Body: nil, + }, + }, + Defaulter: nil, + collector: metrics.NewCollector(latency), + }, + args: args{ + ctx: context.Background(), + host: "foo", + event: &ceEventWithOriginalEventType, + }, + wants: wants{ + result: eventmesh.HTTPPublishResult{ + Status: 204, + Body: nil, + }, + assertionFunc: assert.NoError, + metricErrors: 0, + metricTotal: 1, + metricLatency: 1, + metricPublished: 1, + metricLatencyTEF: latencyMetricTEF, + metricPublishedTotalTEF: ` + # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type="order.created.v1"} 1 + `, + }, + }, + { + name: "Sending not successful, error returned", + fields: fields{ + Sender: &GenericSenderStub{ + Err: errors.New("i failed"), + SleepDuration: 5, + }, + Defaulter: nil, + collector: metrics.NewCollector(latency), + }, + args: args{ + ctx: context.Background(), + host: "foo", + event: &cev2event.Event{}, + }, + wants: wants{ + result: nil, + assertionFunc: assert.Error, + metricErrors: 1, + metricTotal: 0, + metricLatency: 0, + metricPublished: 0, + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // given + logger, _ := eclogger.New("text", "debug") + h := &Handler{ + Sender: tt.fields.Sender, + Defaulter: tt.fields.Defaulter, + collector: tt.fields.collector, + Logger: logger, + } + + // when + got, err := h.sendEventAndRecordMetrics(tt.args.ctx, tt.args.event, tt.args.host, tt.args.header) + + // then + if !tt.wants.assertionFunc(t, err, fmt.Sprintf("sendEventAndRecordMetrics(%v, %v, %v)", tt.args.ctx, tt.args.host, tt.args.event)) { + return + } + assert.Equalf(t, tt.wants.result, got, "sendEventAndRecordMetrics(%v, %v, %v)", tt.args.ctx, tt.args.host, tt.args.event) + metricstest.EnsureMetricErrors(t, h.collector, tt.wants.metricErrors) + metricstest.EnsureMetricTotalRequests(t, h.collector, tt.wants.metricTotal) + metricstest.EnsureMetricLatency(t, h.collector, tt.wants.metricLatency) + metricstest.EnsureMetricEventTypePublished(t, h.collector, tt.wants.metricPublished) + metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wants.metricLatencyTEF, "eventing_epp_backend_duration_milliseconds") + metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wants.metricPublishedTotalTEF, "eventing_epp_event_type_published_total") + }) + } +} + +func TestHandler_sendEventAndRecordMetrics_TracingAndDefaults(t *testing.T) { + // given + stub := &GenericSenderStub{ + Err: nil, + SleepDuration: 0, + Result: eventmesh.HTTPPublishResult{Status: http.StatusInternalServerError}, + } + + const bucketsFunc = "Buckets" + latency := new(mocks.BucketsProvider) + latency.On(bucketsFunc).Return(nil) + latency.Test(t) + logger, _ := eclogger.New("text", "debug") + h := &Handler{ + Sender: stub, + Defaulter: nil, + collector: metrics.NewCollector(latency), + Logger: logger, + } + header := http.Header{} + headers := []string{"traceparent", "X-B3-TraceId", "X-B3-ParentSpanId", "X-B3-SpanId", "X-B3-Sampled", "X-B3-Flags"} + + for _, v := range headers { + header.Add(v, v) + } + expectedExtensions := map[string]interface{}{ + "traceparent": "traceparent", + "b3traceid": "X-B3-TraceId", + "b3parentspanid": "X-B3-ParentSpanId", + "b3spanid": "X-B3-SpanId", + "b3sampled": "X-B3-Sampled", + "b3flags": "X-B3-Flags", + } + // when + _, err := h.sendEventAndRecordMetrics(context.Background(), CreateCloudEvent(t), "", header) + + // then + assert.NoError(t, err) + assert.Equal(t, expectedExtensions, stub.ReceivedEvent.Context.GetExtensions()) +} + +func CreateCloudEvent(t *testing.T) *cev2event.Event { + builder := testingutils.NewCloudEventBuilder( + testingutils.WithCloudEventType(testingutils.CloudEventTypeWithPrefix), + ) + payload, _ := builder.BuildStructured() + newEvent := cloudevents.NewEvent() + err := json.Unmarshal([]byte(payload), &newEvent) + assert.NoError(t, err) + newEvent.SetType(testingutils.CloudEventTypeWithPrefix) + err = newEvent.SetData("", map[string]interface{}{"foo": "bar"}) + assert.NoError(t, err) + + return &newEvent +} + +// CreateValidStructuredRequestV1Alpha1 creates a structured cloudevent as http request. +func CreateValidStructuredRequestV1Alpha1(t *testing.T) *http.Request { + t.Helper() + s := `{ + "specversion":"1.0", + "type":"sap.kyma.custom.testapp1023.order.created.v1", + "source":"/default/sap.kyma/id", + "id":"8945ec08-256b-11eb-9928-acde48001122", + "data":{"foo":"bar"} + }` + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader(s)) + req.Header.Add("Content-Type", "application/cloudevents+json") + return req +} + +// CreateBrokenRequestV1Alpha1 creates a structured cloudevent request that cannot be parsed. +func CreateBrokenRequestV1Alpha1(t *testing.T) *http.Request { + t.Helper() + reader := strings.NewReader("I AM JUST A BROKEN REQUEST") + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) + req.Header.Add("Content-Type", "application/cloudevents+json") + return req +} + +// CreateInvalidStructuredRequestV1Alpha1 creates an invalid structured cloudevent as http request. The `type` is missing. +func CreateInvalidStructuredRequestV1Alpha1(t *testing.T) *http.Request { + t.Helper() + s := `{ + "specversion":"1.0", + "source":"/default/sap.kyma/id", + "id":"8945ec08-256b-11eb-9928-acde48001122", + "data": { + "foo":"bar" + } + }` + reader := strings.NewReader(s) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) + req.Header.Add("Content-Type", "application/cloudevents+json") + return req +} + +// CreateValidBinaryRequestV1Alpha1 creates a valid binary cloudevent as http request. +func CreateValidBinaryRequestV1Alpha1(t *testing.T) *http.Request { + t.Helper() + reader := strings.NewReader(`{"foo":"bar"}`) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) + req.Header.Add("Ce-Specversion", "1.0") + req.Header.Add("Ce-Type", "sap.kyma.custom.testapp1023.order.created.v1") + req.Header.Add("Ce-Source", "/default/sap.kyma/id") + req.Header.Add("Ce-ID", "8945ec08-256b-11eb-9928-acde48001122") + return req +} + +// CreateInvalidBinaryRequestV1Alpha1 creates an invalid binary cloudevent as http request. The `type` is missing. +func CreateInvalidBinaryRequestV1Alpha1(t *testing.T) *http.Request { + t.Helper() + reader := strings.NewReader(`{"foo":"bar"}`) + req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) + req.Header.Add("Content-Type", "application/json") + req.Header.Add("Ce-Specversion", "1.0") + req.Header.Add("Ce-Source", "/default/sap.kyma/id") + req.Header.Add("Ce-ID", "8945ec08-256b-11eb-9928-acde48001122") + return req +} + +type GenericSenderStub struct { + Err error + SleepDuration time.Duration + Result sender.PublishResult + ReceivedEvent *cev2event.Event + BackendURL string +} + +func (g *GenericSenderStub) Send(_ context.Context, event *cev2event.Event) (sender.PublishResult, error) { + g.ReceivedEvent = event + time.Sleep(g.SleepDuration) + return g.Result, g.Err +} + +func (g *GenericSenderStub) URL() string { + return g.BackendURL +} + +func NewApplicationListerOrDie(ctx context.Context, appName string) *application.Lister { + app := applicationtest.NewApplication(appName, nil) + appLister := fake.NewApplicationListerOrDie(ctx, app) + return appLister +} diff --git a/pkg/handler/handler_v1alpha2_test.go b/pkg/handler/handler_v1alpha2_test.go deleted file mode 100644 index 4a6baf1..0000000 --- a/pkg/handler/handler_v1alpha2_test.go +++ /dev/null @@ -1,561 +0,0 @@ -//nolint:lll // output directly from prometheus -package handler - -import ( - "context" - "encoding/json" - "fmt" - "io" - "net/http" - "net/http/httptest" - "strings" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/legacytest" - - eclogger "github.com/kyma-project/kyma/components/eventing-controller/logger" - "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" - "github.com/stretchr/testify/assert" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/applicationtest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application/fake" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" - - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype/eventtypetest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/histogram/mocks" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/eventmesh" - testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" -) - -func TestHandler_publishCloudEventsV1Alpha2(t *testing.T) { - type fields struct { - Sender sender.GenericSender - collector metrics.PublishingMetricsCollector - eventTypeCleaner eventtype.Cleaner - } - type args struct { - request *http.Request - } - - const bucketsFunc = "Buckets" - latency := new(mocks.BucketsProvider) - latency.On(bucketsFunc).Return(nil) - latency.Test(t) - - tests := []struct { - name string - fields fields - args args - wantStatus int - wantBody []byte - wantTEF string - }{ - { - name: "Publish structured Cloudevent for Subscription v1alpha1", - fields: fields{ - Sender: &GenericSenderStub{ - Err: nil, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: []byte(""), - }, - BackendURL: "FOO", - }, - collector: metrics.NewCollector(latency), - eventTypeCleaner: &eventtypetest.CleanerStub{}, - }, - args: args{ - request: CreateValidStructuredRequest(t), - }, - wantStatus: 204, - wantTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 - `, - }, - { - name: "Publish binary Cloudevent for Subscription v1alpha1", - fields: fields{ - Sender: &GenericSenderStub{ - Err: nil, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: []byte(""), - }, - BackendURL: "FOO", - }, - collector: metrics.NewCollector(latency), - eventTypeCleaner: &eventtypetest.CleanerStub{}, - }, - args: args{ - request: CreateValidBinaryRequest(t), - }, - wantStatus: 204, - wantTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 - eventing_epp_backend_duration_milliseconds_count{destination_service="FOO",code="204"} 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 - `, - }, - { - name: "Publish structured Cloudevent", - fields: fields{ - Sender: &GenericSenderStub{ - Err: nil, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: []byte(""), - }, - BackendURL: "FOO", - }, - collector: metrics.NewCollector(latency), - eventTypeCleaner: &eventtypetest.CleanerStub{}, - }, - args: args{ - request: CreateValidStructuredRequestV1Alpha2(t), - }, - wantStatus: 204, - wantTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="testapp1023",event_type="order.created.v1"} 1 - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 - `, - }, - { - name: "Publish binary Cloudevent", - fields: fields{ - Sender: &GenericSenderStub{ - Err: nil, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: []byte(""), - }, - BackendURL: "FOO", - }, - collector: metrics.NewCollector(latency), - eventTypeCleaner: &eventtypetest.CleanerStub{}, - }, - args: args{ - request: CreateValidBinaryRequestV1Alpha2(t), - }, - wantStatus: 204, - wantTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="testapp1023",event_type="order.created.v1"} 1 - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 - eventing_epp_backend_duration_milliseconds_count{destination_service="FOO",code="204"} 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 - `, - }, - { - name: "Publish invalid structured CloudEvent", - fields: fields{ - Sender: &GenericSenderStub{}, - collector: metrics.NewCollector(latency), - eventTypeCleaner: &eventtypetest.CleanerStub{}, - }, - args: args{ - request: CreateInvalidStructuredRequestV1Alpha2(t), - }, - wantStatus: 400, - wantBody: []byte("type: MUST be a non-empty string\n"), - }, - { - name: "Publish invalid binary CloudEvent", - fields: fields{ - Sender: &GenericSenderStub{}, - collector: metrics.NewCollector(latency), - eventTypeCleaner: &eventtypetest.CleanerStub{}, - }, - args: args{ - request: CreateInvalidBinaryRequestV1Alpha2(t), - }, - wantStatus: 400, - }, - { - name: "Publish binary CloudEvent but cannot send", - fields: fields{ - Sender: &GenericSenderStub{ - Err: fmt.Errorf("I cannot send"), - }, - collector: metrics.NewCollector(latency), - eventTypeCleaner: &eventtypetest.CleanerStub{}, - }, - args: args{ - request: CreateValidBinaryRequestV1Alpha2(t), - }, - wantStatus: 500, - wantTEF: ` - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 - `, - }, - { - name: "Publish binary CloudEvent but backend is full", - fields: fields{ - Sender: &GenericSenderStub{ - Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrInsufficientStorage), - }, - collector: metrics.NewCollector(latency), - eventTypeCleaner: &eventtypetest.CleanerStub{}, - }, - args: args{ - request: CreateValidBinaryRequestV1Alpha2(t), - }, - wantStatus: 507, - wantTEF: ` - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 - `, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // given - logger, err := eclogger.New("text", "debug") - assert.NoError(t, err) - - app := applicationtest.NewApplication("appName1", nil) - appLister := fake.NewApplicationListerOrDie(context.Background(), app) - - ceBuilder := builder.NewGenericBuilder("prefix", cleaner.NewJetStreamCleaner(logger), appLister, logger) - - h := &Handler{ - Sender: tt.fields.Sender, - Logger: logger, - collector: tt.fields.collector, - eventTypeCleaner: tt.fields.eventTypeCleaner, - ceBuilder: ceBuilder, - Options: &options.Options{ - Env: options.Env{EnableNewCRDVersion: true}, - }, - OldEventTypePrefix: testingutils.OldEventTypePrefix, - } - writer := httptest.NewRecorder() - - // when - h.publishCloudEvents(writer, tt.args.request) - - // then - assert.Equal(t, tt.wantStatus, writer.Result().StatusCode) - body, err := io.ReadAll(writer.Result().Body) - assert.NoError(t, err) - if tt.wantBody != nil { - assert.Equal(t, tt.wantBody, body) - } - - metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wantTEF) - }) - } -} - -func TestHandler_publishLegacyEventsAsCEV1alpha2(t *testing.T) { - // define common given variables - appLister := NewApplicationListerOrDie(context.Background(), "testapp") - - // set mock for latency metrics - latency := new(mocks.BucketsProvider) - latency.On("Buckets").Return(nil) - - tests := []struct { - name string - givenSender sender.GenericSender - givenLegacyTransformer legacy.RequestToCETransformer - givenCollector metrics.PublishingMetricsCollector - givenRequest *http.Request - wantHTTPStatus int - wantTEF string - }{ - { - name: "Send valid legacy event", - givenSender: &GenericSenderStub{ - Result: eventmesh.HTTPPublishResult{ - Status: 204, - }, - BackendURL: "FOO", - }, - givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), - givenCollector: metrics.NewCollector(latency), - givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - wantHTTPStatus: http.StatusOK, - wantTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="testapp",event_type="object.created.v1"} 1 - - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 - eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 - - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 - `, - }, - { - name: "Send valid legacy event but cannot send to backend due to target not found (e.g. stream missing)", - givenSender: &GenericSenderStub{ - Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrBackendTargetNotFound), - BackendURL: "FOO", - }, - givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), - givenCollector: metrics.NewCollector(latency), - givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - wantHTTPStatus: http.StatusBadGateway, - wantTEF: ` - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 - `, - }, - { - name: "Send valid legacy event but cannot send to backend due to full storage", - givenSender: &GenericSenderStub{ - Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrInsufficientStorage), - BackendURL: "FOO", - }, - givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), - givenCollector: metrics.NewCollector(latency), - givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - wantHTTPStatus: 507, - wantTEF: ` - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 - `, - }, - { - name: "Send valid legacy event but cannot send to backend", - givenSender: &GenericSenderStub{ - Err: fmt.Errorf("i cannot send"), - BackendURL: "FOO", - }, - givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), - givenCollector: metrics.NewCollector(latency), - givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - wantHTTPStatus: 500, - wantTEF: ` - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 - `, - }, - { - name: "Send invalid legacy event", - givenSender: &GenericSenderStub{ - Result: eventmesh.HTTPPublishResult{ - Status: 204, - }, - BackendURL: "FOO", - }, - givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), - givenCollector: metrics.NewCollector(latency), - givenRequest: legacytest.InvalidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - wantHTTPStatus: 400, - // this is a client error. We do record an error metric for requests that cannot even be decoded correctly. - wantTEF: "", - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - // given - logger, err := eclogger.New("text", "debug") - require.NoError(t, err) - - ceBuilder := builder.NewGenericBuilder("prefix", cleaner.NewJetStreamCleaner(logger), appLister, logger) - - h := &Handler{ - Sender: tt.givenSender, - Logger: logger, - LegacyTransformer: tt.givenLegacyTransformer, - collector: tt.givenCollector, - ceBuilder: ceBuilder, - Options: &options.Options{ - Env: options.Env{EnableNewCRDVersion: true}, - }, - } - writer := httptest.NewRecorder() - - // when - h.publishLegacyEventsAsCE(writer, tt.givenRequest) - - // then - require.Equal(t, tt.wantHTTPStatus, writer.Result().StatusCode) - body, err := io.ReadAll(writer.Result().Body) - require.NoError(t, err) - - if tt.wantHTTPStatus == http.StatusOK { - ok := &api.PublishResponse{} - err = json.Unmarshal(body, ok) - require.NoError(t, err) - } else { - nok := &api.Error{} - err = json.Unmarshal(body, nok) - require.NoError(t, err) - } - - metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wantTEF) - }) - } -} - -// CreateValidStructuredRequestV1Alpha2 creates a structured cloudevent as http request. -func CreateValidStructuredRequestV1Alpha2(t *testing.T) *http.Request { - t.Helper() - reader := strings.NewReader(`{ - "specversion":"1.0", - "type":"order.created.v1", - "source":"testapp1023", - "id":"8945ec08-256b-11eb-9928-acde48001122", - "data":{ - "foo":"bar" - } - }`) - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) - req.Header.Add("Content-Type", "application/cloudevents+json") - return req -} - -// CreateBrokenRequestV1Alpha2 creates a structured cloudevent request that cannot be parsed. -func CreateBrokenRequestV1Alpha2(t *testing.T) *http.Request { - t.Helper() - reader := strings.NewReader("I AM JUST A BROKEN REQUEST") - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) - req.Header.Add("Content-Type", "application/cloudevents+json") - return req -} - -// CreateInvalidStructuredRequestV1Alpha2 creates an invalid structured cloudevent as http request. -// The `type` is missing. -func CreateInvalidStructuredRequestV1Alpha2(t *testing.T) *http.Request { - t.Helper() - reader := strings.NewReader(`{ - "specversion":"1.0", - "source":"testapp1023", - "id":"8945ec08-256b-11eb-9928-acde48001122", - "data":{ - "foo":"bar" - }}`) - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", reader) - req.Header.Add("Content-Type", "application/cloudevents+json") - return req -} - -// CreateValidBinaryRequestV1Alpha2 creates a valid binary cloudevent as http request. -func CreateValidBinaryRequestV1Alpha2(t *testing.T) *http.Request { - t.Helper() - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader(`{"foo":"bar"}`)) - req.Header.Add("Ce-Specversion", "1.0") - req.Header.Add("Ce-Type", "order.created.v1") - req.Header.Add("Ce-Source", "testapp1023") - req.Header.Add("Ce-ID", "8945ec08-256b-11eb-9928-acde48001122") - return req -} - -// CreateInvalidBinaryRequestV1Alpha2 creates an invalid binary cloudevent as http request. The `type` is missing. -func CreateInvalidBinaryRequestV1Alpha2(t *testing.T) *http.Request { - t.Helper() - req := httptest.NewRequest(http.MethodPost, "http://localhost/publish", strings.NewReader(`{"foo":"bar"}`)) - req.Header.Add("Content-Type", "application/json") - req.Header.Add("Ce-Specversion", "1.0") - req.Header.Add("Ce-Source", "testapp1023") - req.Header.Add("Ce-ID", "8945ec08-256b-11eb-9928-acde48001122") - return req -} diff --git a/pkg/options/options.go b/pkg/options/options.go index 1de947f..180d1dd 100644 --- a/pkg/options/options.go +++ b/pkg/options/options.go @@ -3,8 +3,6 @@ package options import ( "flag" "fmt" - - "github.com/kelseyhightower/envconfig" ) const ( @@ -14,20 +12,11 @@ const ( // All the available arguments. argMaxRequestSize = "max-request-size" argMetricsAddress = "metrics-addr" - - // All the available environment variables. - envEnableNewCRDVersion = "ENABLE_NEW_CRD_VERSION" ) type Options struct { MaxRequestSize int64 MetricsAddress string - Env -} - -// Env represents the controller environment variables. -type Env struct { - EnableNewCRDVersion bool `envconfig:"ENABLE_NEW_CRD_VERSION" default:"false"` } func New() *Options { @@ -39,16 +28,12 @@ func (o *Options) Parse() error { flag.StringVar(&o.MetricsAddress, argMetricsAddress, metricEndpointPort, "The address the metric endpoint binds to.") flag.Parse() - if err := envconfig.Process("", &o.Env); err != nil { - return err - } return nil } func (o Options) String() string { - return fmt.Sprintf("--%s=%v --%s=%v %s=%v", + return fmt.Sprintf("--%s=%v --%s=%v", argMaxRequestSize, o.MaxRequestSize, argMetricsAddress, o.MetricsAddress, - envEnableNewCRDVersion, o.EnableNewCRDVersion, ) } diff --git a/pkg/sender/jetstream/jetstream.go b/pkg/sender/jetstream/jetstream.go index 04e638b..0e7c142 100644 --- a/pkg/sender/jetstream/jetstream.go +++ b/pkg/sender/jetstream/jetstream.go @@ -8,6 +8,8 @@ import ( "net/http" "strings" + "github.com/nats-io/nats.go" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/eventing-controller/logger" @@ -20,8 +22,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/eventmesh" - - "github.com/nats-io/nats.go" ) const ( @@ -125,11 +125,12 @@ func (s *Sender) eventToNATSMsg(event *event.Event) (*nats.Msg, error) { // getJsSubjectToPublish appends stream name to subject if needed. func (s *Sender) getJsSubjectToPublish(subject string) string { - // if subscription CRD v1alpha2 is enabled then do not append prefix. - if s.opts.EnableNewCRDVersion && !strings.HasPrefix(subject, s.envCfg.EventTypePrefix) { + // do not append prefix, if event type prefix is not present. + if !strings.HasPrefix(subject, s.envCfg.EventTypePrefix) { return subject } + // append prefix, for v1alpha1 subscriptions. return fmt.Sprintf("%s.%s", env.JetStreamSubjectPrefix, subject) } diff --git a/pkg/sender/jetstream/jetstream_test.go b/pkg/sender/jetstream/jetstream_test.go index e39f372..3cc530b 100644 --- a/pkg/sender/jetstream/jetstream_test.go +++ b/pkg/sender/jetstream/jetstream_test.go @@ -151,12 +151,13 @@ func setupTestEnvironment(t *testing.T) *TestEnvironment { // createCloudEvent build a cloud event. func createCloudEvent(t *testing.T) *event.Event { + jsType := fmt.Sprintf("%s.%s", testingutils.StreamName, testingutils.CloudEventTypeWithPrefix) builder := testingutils.NewCloudEventBuilder( - testingutils.WithCloudEventType(testingutils.CloudEventTypeWithPrefix), + testingutils.WithCloudEventType(jsType), ) payload, _ := builder.BuildStructured() newEvent := cloudevents.NewEvent() - newEvent.SetType(testingutils.CloudEventTypeWithPrefix) + newEvent.SetType(jsType) err := json.Unmarshal([]byte(payload), &newEvent) assert.NoError(t, err) @@ -264,9 +265,7 @@ func TestSender_getJsSubjectToPublish(t *testing.T) { subject: "sap.kyma.custom.noapp.order.created.v1", want: "kyma.sap.kyma.custom.noapp.order.created.v1", fields: fields{ - opts: &options.Options{ - Env: options.Env{EnableNewCRDVersion: true}, - }, + opts: &options.Options{}, }, }, { @@ -274,9 +273,7 @@ func TestSender_getJsSubjectToPublish(t *testing.T) { subject: "kyma.noapp.order.created.v1", want: "kyma.noapp.order.created.v1", fields: fields{ - opts: &options.Options{ - Env: options.Env{EnableNewCRDVersion: true}, - }, + opts: &options.Options{}, }, }, } diff --git a/pkg/subscribed/helpers.go b/pkg/subscribed/helpers.go index f2b32cc..d19048d 100644 --- a/pkg/subscribed/helpers.go +++ b/pkg/subscribed/helpers.go @@ -59,18 +59,14 @@ func ConvertRuntimeObjToSubscription(sObj runtime.Object) (*eventingv1alpha2.Sub } // GenerateSubscriptionInfFactory generates DynamicSharedInformerFactory for Subscription. -func GenerateSubscriptionInfFactory(k8sConfig *rest.Config, enableNewCrd bool) dynamicinformer.DynamicSharedInformerFactory { +func GenerateSubscriptionInfFactory(k8sConfig *rest.Config) dynamicinformer.DynamicSharedInformerFactory { subDynamicClient := dynamic.NewForConfigOrDie(k8sConfig) dFilteredSharedInfFactory := dynamicinformer.NewFilteredDynamicSharedInformerFactory(subDynamicClient, informers.DefaultResyncPeriod, v1.NamespaceAll, nil, ) - if enableNewCrd { - dFilteredSharedInfFactory.ForResource(GVR) - } else { - dFilteredSharedInfFactory.ForResource(GVRV1alpha1) - } + dFilteredSharedInfFactory.ForResource(GVR) return dFilteredSharedInfFactory } diff --git a/pkg/subscribed/processor.go b/pkg/subscribed/processor.go index 7561558..4e8c678 100644 --- a/pkg/subscribed/processor.go +++ b/pkg/subscribed/processor.go @@ -24,7 +24,6 @@ type Processor struct { func (p Processor) extractEventsFromSubscriptions( writer http.ResponseWriter, request *http.Request, - enableNewCRDVersion bool, ) { eventsMap := make(map[Event]bool) subsList, err := (*p.SubscriptionLister).List(labels.Everything()) @@ -36,28 +35,15 @@ func (p Processor) extractEventsFromSubscriptions( appName := legacy.ParseApplicationNameFromPath(request.URL.Path) for _, sObj := range subsList { - if enableNewCRDVersion { - sub, err := ConvertRuntimeObjToSubscription(sObj) + sub, err := ConvertRuntimeObjToSubscription(sObj) - if err != nil { - p.namedLogger().Errorw("Failed to convert a runtime obj to a Subscription", "error", err) - continue - } - if sub.Spec.Types != nil { - eventsForSub := FilterEventTypeVersions(p.Prefix, appName, sub) - eventsMap = AddUniqueEventsToResult(eventsForSub, eventsMap) - } - } else { - sub, err := ConvertRuntimeObjToSubscriptionV1alpha1(sObj) - - if err != nil { - p.namedLogger().Errorw("Failed to convert a runtime obj to a Subscription", "error", err) - continue - } - if sub.Spec.Filter != nil { - eventsForSub := FilterEventTypeVersionsV1alpha1(p.Prefix, p.Namespace, appName, sub.Spec.Filter) - eventsMap = AddUniqueEventsToResult(eventsForSub, eventsMap) - } + if err != nil { + p.namedLogger().Errorw("Failed to convert a runtime obj to a Subscription", "error", err) + continue + } + if sub.Spec.Types != nil { + eventsForSub := FilterEventTypeVersions(p.Prefix, appName, sub) + eventsMap = AddUniqueEventsToResult(eventsForSub, eventsMap) } } events := ConvertEventsMapToSlice(eventsMap) @@ -67,11 +53,11 @@ func (p Processor) extractEventsFromSubscriptions( } func (p Processor) ExtractEventsFromSubscriptions(writer http.ResponseWriter, request *http.Request) { - p.extractEventsFromSubscriptions(writer, request, true) + p.extractEventsFromSubscriptions(writer, request) } func (p Processor) ExtractEventsFromSubscriptionsV1alpha1(writer http.ResponseWriter, request *http.Request) { - p.extractEventsFromSubscriptions(writer, request, false) + p.extractEventsFromSubscriptions(writer, request) } func (p Processor) namedLogger() *zap.SugaredLogger { From c76ca98c0b81a132244cd6d56200787c20ea7427 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 May 2023 12:29:08 +0200 Subject: [PATCH 175/194] gomod(deps): bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /components/event-publisher-proxy (#17538) * gomod(deps): bump github.com/stretchr/testify Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.8.2 to 1.8.3. - [Release notes](https://github.com/stretchr/testify/releases) - [Commits](https://github.com/stretchr/testify/compare/v1.8.2...v1.8.3) --- updated-dependencies: - dependency-name: github.com/stretchr/testify dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Muhammad Faizan --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c8fad5b..dd97d67 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/onsi/gomega v1.27.6 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 - github.com/stretchr/testify v1.8.2 + github.com/stretchr/testify v1.8.3 go.opencensus.io v0.24.0 go.uber.org/zap v1.24.0 golang.org/x/oauth2 v0.7.0 diff --git a/go.sum b/go.sum index f413b69..891b82d 100644 --- a/go.sum +++ b/go.sum @@ -309,8 +309,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= From 2ae731fda7b6d0f7d94f1ecbc1dc8ed560ec052e Mon Sep 17 00:00:00 2001 From: Friedrich Date: Fri, 9 Jun 2023 13:28:15 +0200 Subject: [PATCH 176/194] rename to eventmesh in epp (#17593) * rename package pkg/commander/beb * rename var names * rename var names * go fmt for happy linter * undo deletion of `require` * fix some comments * rename some var names * go fmt * bump image * rename package s * rename var * rename func * rename funcs * use updated eventing-controller --- cmd/event-publisher-proxy/main.go | 10 ++-- go.mod | 2 +- go.sum | 4 +- pkg/cloudevents/utils_test.go | 4 +- .../{beb/beb.go => eventmesh/eventmesh.go} | 16 +++--- pkg/env/eventmesh_config.go | 8 +-- pkg/env/nats_config.go | 2 +- pkg/{ems => eventmesh}/types.go | 2 +- pkg/legacy/legacy.go | 14 ++--- pkg/legacy/legacy_test.go | 6 +- pkg/sender/eventmesh/eventmesh.go | 4 +- pkg/subscribed/helpers_test.go | 56 +++++++++---------- testing/env_config.go | 12 ++-- 13 files changed, 70 insertions(+), 70 deletions(-) rename pkg/commander/{beb/beb.go => eventmesh/eventmesh.go} (92%) rename pkg/{ems => eventmesh}/types.go (90%) diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index 03365e9..372d8f4 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -8,7 +8,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/commander" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/commander/beb" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/commander/eventmesh" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/commander/nats" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/latency" @@ -16,8 +16,8 @@ import ( ) const ( - backendBEB = "beb" - backendNATS = "nats" + backendEventMesh = "beb" + backendNATS = "nats" ) type Config struct { @@ -62,8 +62,8 @@ func main() { // Instantiate configured commander. var c commander.Commander switch cfg.Backend { - case backendBEB: - c = beb.NewCommander(opts, metricsCollector, logger) + case backendEventMesh: + c = eventmesh.NewCommander(opts, metricsCollector, logger) case backendNATS: c = nats.NewCommander(opts, metricsCollector, logger) default: diff --git a/go.mod b/go.mod index dd97d67..b53d890 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230426090856-c122afc6c6b9 + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230605123955-9a13db476af1 github.com/nats-io/nats-server/v2 v2.9.15 github.com/nats-io/nats.go v1.25.0 github.com/onsi/gomega v1.27.6 diff --git a/go.sum b/go.sum index 891b82d..008391f 100644 --- a/go.sum +++ b/go.sum @@ -237,8 +237,8 @@ github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 h github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 h1:XxhNPU8Z1eknyepGqg21ajEisuTeknKydHiZ6m5Qp3k= github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455/go.mod h1:18VKkunC8gEMKAIX3/64rXDq3XNk82CfHQ2G1kZPSQM= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230426090856-c122afc6c6b9 h1:fBfmBw7ehn+6bRfERgOecU6ExUnSMMrRX4kC6LdPV3g= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230426090856-c122afc6c6b9/go.mod h1:DmZjh7+uHPR7uI72TESY9mpwuIgLNmBm4YdiDIALt3k= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230605123955-9a13db476af1 h1:n1hh/o2ku8VLGG50rnjwCYkJPcQzs2xCDg9awLf4NB8= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230605123955-9a13db476af1/go.mod h1:DmZjh7+uHPR7uI72TESY9mpwuIgLNmBm4YdiDIALt3k= 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.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= diff --git a/pkg/cloudevents/utils_test.go b/pkg/cloudevents/utils_test.go index dd3e406..e49a354 100644 --- a/pkg/cloudevents/utils_test.go +++ b/pkg/cloudevents/utils_test.go @@ -11,7 +11,7 @@ import ( cehttp "github.com/cloudevents/sdk-go/v2/protocol/http" "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/ems" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/eventmesh" ) func TestWriteRequestWithHeaders(t *testing.T) { @@ -24,7 +24,7 @@ func TestWriteRequestWithHeaders(t *testing.T) { defer func() { _ = message.Finish(nil) }() additionalHeaders := http.Header{ - "qos": []string{string(ems.QosAtLeastOnce)}, + "qos": []string{string(eventmesh.QosAtLeastOnce)}, "accept": []string{internal.ContentTypeApplicationJSON}, "key1": []string{"value1", "value2"}, "key2": []string{"value3"}, diff --git a/pkg/commander/beb/beb.go b/pkg/commander/eventmesh/eventmesh.go similarity index 92% rename from pkg/commander/beb/beb.go rename to pkg/commander/eventmesh/eventmesh.go index 1b9990e..fe38755 100644 --- a/pkg/commander/beb/beb.go +++ b/pkg/commander/eventmesh/eventmesh.go @@ -1,4 +1,4 @@ -package beb +package eventmesh import ( "context" @@ -34,8 +34,8 @@ import ( ) const ( - bebBackend = "beb" - bebCommanderName = bebBackend + "-commander" + backend = "beb" + commanderName = backend + "-commander" ) // Commander implements the Commander interface. @@ -47,7 +47,7 @@ type Commander struct { opts *options.Options } -// NewCommander creates the Commander for publisher to BEB. +// NewCommander creates the Commander for publisher to EventMesh. func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, logger *logger.Logger) *Commander { return &Commander{ metricsCollector: metricsCollector, @@ -60,7 +60,7 @@ func NewCommander(opts *options.Options, metricsCollector *metrics.Collector, lo // Init implements the Commander interface and initializes the publisher to BEB. func (c *Commander) Init() error { if err := envconfig.Process("", c.envCfg); err != nil { - return xerrors.Errorf("failed to read configuration for %s : %v", bebCommanderName, err) + return xerrors.Errorf("failed to read configuration for %s : %v", commanderName, err) } return nil } @@ -81,7 +81,7 @@ func (c *Commander) Start() error { defer client.CloseIdleConnections() // configure message sender - messageSender := eventmesh.NewSender(c.envCfg.EmsPublishURL, client) + messageSender := eventmesh.NewSender(c.envCfg.EventMeshPublishURL, client) // cluster config k8sConfig := config.GetConfigOrDie() @@ -138,7 +138,7 @@ func (c *Commander) Start() error { c.envCfg.EventTypePrefix, env.EventMeshBackend, ).Start(ctx); err != nil { - return xerrors.Errorf("failed to start handler for %s : %v", bebCommanderName, err) + return xerrors.Errorf("failed to start handler for %s : %v", commanderName, err) } c.namedLogger().Info("Event Publisher was shut down") return nil @@ -151,5 +151,5 @@ func (c *Commander) Stop() error { } func (c *Commander) namedLogger() *zap.SugaredLogger { - return c.logger.WithContext().Named(bebCommanderName).With("backend", bebBackend) + return c.logger.WithContext().Named(commanderName).With("backend", backend) } diff --git a/pkg/env/eventmesh_config.go b/pkg/env/eventmesh_config.go index f9c0dea..b03c03c 100644 --- a/pkg/env/eventmesh_config.go +++ b/pkg/env/eventmesh_config.go @@ -15,13 +15,13 @@ type EventMeshConfig struct { ClientID string `envconfig:"CLIENT_ID" required:"true"` ClientSecret string `envconfig:"CLIENT_SECRET" required:"true"` TokenEndpoint string `envconfig:"TOKEN_ENDPOINT" required:"true"` - EmsPublishURL string `envconfig:"EMS_PUBLISH_URL" required:"true"` + EventMeshPublishURL string `envconfig:"EMS_PUBLISH_URL" required:"true"` MaxIdleConns int `envconfig:"MAX_IDLE_CONNS" default:"100"` MaxIdleConnsPerHost int `envconfig:"MAX_IDLE_CONNS_PER_HOST" default:"2"` RequestTimeout time.Duration `envconfig:"REQUEST_TIMEOUT" default:"5s"` - // EventMeshNamespace is the name of the namespace in EventMesh which is used as the event source for legacy events + // EventMeshNamespace is the name of the namespace in EventMesh which is used as the event source for legacy events. EventMeshNamespace string `envconfig:"BEB_NAMESPACE" required:"true"` - // EventTypePrefix is the prefix of each event as per the eventing specification + // EventTypePrefix is the prefix of each event as per the eventing specification. // It follows the eventType format: ... EventTypePrefix string `envconfig:"EVENT_TYPE_PREFIX" default:""` } @@ -36,6 +36,6 @@ func (c *EventMeshConfig) ConfigureTransport(transport *http.Transport) { func (c *EventMeshConfig) String() string { return fmt.Sprintf("EventMeshConfig{ Port: %v; TokenEndPoint: %v; EmsPublishURL: %v; "+ "MaxIdleConns: %v; MaxIdleConnsPerHost: %v; RequestTimeout: %v; BEBNamespace: %v; EventTypePrefix: %v }", - c.Port, c.TokenEndpoint, c.EmsPublishURL, c.MaxIdleConns, + c.Port, c.TokenEndpoint, c.EventMeshPublishURL, c.MaxIdleConns, c.MaxIdleConnsPerHost, c.RequestTimeout, c.EventMeshNamespace, c.EventTypePrefix) } diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go index 9ade0b2..89a7660 100644 --- a/pkg/env/nats_config.go +++ b/pkg/env/nats_config.go @@ -29,7 +29,7 @@ type NATSConfig struct { JSStreamName string `envconfig:"JS_STREAM_NAME" default:"kyma"` } -// ToConfig converts to a default BEB BEBConfig. +// ToConfig converts to a default EventMeshConfig. func (c *NATSConfig) ToConfig() *EventMeshConfig { cfg := &EventMeshConfig{ EventMeshNamespace: c.LegacyNamespace, diff --git a/pkg/ems/types.go b/pkg/eventmesh/types.go similarity index 90% rename from pkg/ems/types.go rename to pkg/eventmesh/types.go index 73c535d..2415d78 100644 --- a/pkg/ems/types.go +++ b/pkg/eventmesh/types.go @@ -1,4 +1,4 @@ -package ems +package eventmesh type Qos string diff --git a/pkg/legacy/legacy.go b/pkg/legacy/legacy.go index 82c0cd7..73d6f4c 100644 --- a/pkg/legacy/legacy.go +++ b/pkg/legacy/legacy.go @@ -35,16 +35,16 @@ type RequestToCETransformer interface { } type Transformer struct { - bebNamespace string - eventTypePrefix string - applicationLister *application.Lister + eventMeshNamespace string + eventTypePrefix string + applicationLister *application.Lister } func NewTransformer(bebNamespace string, eventTypePrefix string, applicationLister *application.Lister) *Transformer { return &Transformer{ - bebNamespace: bebNamespace, - eventTypePrefix: eventTypePrefix, - applicationLister: applicationLister, + eventMeshNamespace: bebNamespace, + eventTypePrefix: eventTypePrefix, + applicationLister: applicationLister, } } @@ -232,7 +232,7 @@ func (t *Transformer) convertPublishRequestToCloudEvent(appName string, publishR prefix := removeNonAlphanumeric(t.eventTypePrefix) eventType := formatEventType(prefix, appName, eventName, publishRequest.PublishrequestV1.EventTypeVersion) event.SetType(eventType) - event.SetSource(t.bebNamespace) + event.SetSource(t.eventMeshNamespace) event.SetExtension(eventTypeVersionExtensionKey, publishRequest.PublishrequestV1.EventTypeVersion) event.SetDataContentType(internal.ContentTypeApplicationJSON) return &event, nil diff --git a/pkg/legacy/legacy_test.go b/pkg/legacy/legacy_test.go index fb10f2d..dd3d495 100644 --- a/pkg/legacy/legacy_test.go +++ b/pkg/legacy/legacy_test.go @@ -151,16 +151,16 @@ func TestConvertPublishRequestToCloudEvent(t *testing.T) { }, } - wantBEBNamespace := testingutils.MessagingNamespace + wantEventMeshNamespace := testingutils.MessagingNamespace wantEventID := givenEventID wantEventType := formatEventType(givenEventTypePrefix, givenApplicationName, eventTypeMultiSegmentCombined, givenLegacyEventVersion) wantTimeNowFormatted, _ := time.Parse(time.RFC3339, givenTimeNow) wantDataContentType := internal.ContentTypeApplicationJSON - legacyTransformer := NewTransformer(wantBEBNamespace, givenEventTypePrefix, nil) + legacyTransformer := NewTransformer(wantEventMeshNamespace, givenEventTypePrefix, nil) gotEvent, err := legacyTransformer.convertPublishRequestToCloudEvent(givenApplicationName, givenPublishReqParams) require.NoError(t, err) - assert.Equal(t, wantBEBNamespace, gotEvent.Context.GetSource()) + assert.Equal(t, wantEventMeshNamespace, gotEvent.Context.GetSource()) assert.Equal(t, wantEventID, gotEvent.Context.GetID()) assert.Equal(t, wantEventType, gotEvent.Context.GetType()) assert.Equal(t, wantTimeNowFormatted, gotEvent.Context.GetTime()) diff --git a/pkg/sender/eventmesh/eventmesh.go b/pkg/sender/eventmesh/eventmesh.go index 06cf9a9..cb830a4 100644 --- a/pkg/sender/eventmesh/eventmesh.go +++ b/pkg/sender/eventmesh/eventmesh.go @@ -10,7 +10,7 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/ems" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/eventmesh" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" ) @@ -21,7 +21,7 @@ var ( // additionalHeaders are the required headers by EMS for publish requests. // Any alteration or removal of those headers might cause publish requests to fail. additionalHeaders = http.Header{ - "qos": []string{string(ems.QosAtLeastOnce)}, + "qos": []string{string(eventmesh.QosAtLeastOnce)}, "Accept": []string{internal.ContentTypeApplicationJSON}, } ) diff --git a/pkg/subscribed/helpers_test.go b/pkg/subscribed/helpers_test.go index 0241d32..946e9a6 100644 --- a/pkg/subscribed/helpers_test.go +++ b/pkg/subscribed/helpers_test.go @@ -174,7 +174,7 @@ func TestFilterEventTypeVersionsV1alpha1(t *testing.T) { appName: "foovarkes", eventTypePrefix: "foo.prefix.custom", bebNs: "/default/foo.kyma/kt1", - filters: NewBEBFilters(WithOneBEBFilter), + filters: NewEventMeshFilters(WithOneEventMeshFilter), expectedEvents: []Event{ NewEvent("order.created", "v1"), }, @@ -183,7 +183,7 @@ func TestFilterEventTypeVersionsV1alpha1(t *testing.T) { appName: "foovarkes", eventTypePrefix: "foo.prefix.custom", bebNs: "/default/foo.kyma/kt1", - filters: NewBEBFilters(WithMultipleBEBFiltersFromSameSource), + filters: NewEventMeshFilters(WithMultipleEventMeshFiltersFromSameSource), expectedEvents: []Event{ NewEvent("order.created", "v1"), NewEvent("order.created", "v1"), @@ -194,14 +194,14 @@ func TestFilterEventTypeVersionsV1alpha1(t *testing.T) { appName: "foovarkes", eventTypePrefix: "foo.prefix.custom", bebNs: "foo-dont-match", - filters: NewBEBFilters(WithMultipleBEBFiltersFromSameSource), + filters: NewEventMeshFilters(WithMultipleEventMeshFiltersFromSameSource), expectedEvents: []Event{}, }, { name: "should return 2 events(out of multiple) which matches two sources (bebNamespace and empty)", appName: "foovarkes", eventTypePrefix: "foo.prefix.custom", bebNs: "foo-match", - filters: NewBEBFilters(WithMultipleBEBFiltersFromDiffSource), + filters: NewEventMeshFilters(WithMultipleEventMeshFiltersFromDiffSource), expectedEvents: []Event{ NewEvent("order.created", "v1"), NewEvent("order.created", "v1"), @@ -211,7 +211,7 @@ func TestFilterEventTypeVersionsV1alpha1(t *testing.T) { appName: "foovarkes", eventTypePrefix: "foo.prefix.custom", bebNs: "/default/foo.kyma/kt1", - filters: NewBEBFilters(WithMultipleBEBFiltersFromDiffEventTypePrefix), + filters: NewEventMeshFilters(WithMultipleEventMeshFiltersFromDiffEventTypePrefix), expectedEvents: []Event{ NewEvent("order.created", "v1"), NewEvent("order.created", "v1"), @@ -341,9 +341,9 @@ func TestAddUniqueEventsToResult(t *testing.T) { } } -type BEBFilterOption func(filter *eventingv1alpha1.BEBFilters) +type EventMeshFilterOption func(filter *eventingv1alpha1.BEBFilters) -func NewBEBFilters(opts ...BEBFilterOption) *eventingv1alpha1.BEBFilters { +func NewEventMeshFilters(opts ...EventMeshFilterOption) *eventingv1alpha1.BEBFilters { newFilters := &eventingv1alpha1.BEBFilters{} for _, opt := range opts { opt(newFilters) @@ -352,51 +352,51 @@ func NewBEBFilters(opts ...BEBFilterOption) *eventingv1alpha1.BEBFilters { return newFilters } -func WithOneBEBFilter(bebFilters *eventingv1alpha1.BEBFilters) { +func WithOneEventMeshFilter(filters *eventingv1alpha1.BEBFilters) { evSource := "/default/foo.kyma/kt1" evType := "foo.prefix.custom.foovarkes.order.created.v1" - bebFilters.Filters = []*eventingv1alpha1.BEBFilter{ - NewBEBFilter(evSource, evType), + filters.Filters = []*eventingv1alpha1.EventMeshFilter{ + NewEventMeshFilter(evSource, evType), } } -func WithMultipleBEBFiltersFromSameSource(bebFilters *eventingv1alpha1.BEBFilters) { +func WithMultipleEventMeshFiltersFromSameSource(filters *eventingv1alpha1.BEBFilters) { evSource := "/default/foo.kyma/kt1" evType := "foo.prefix.custom.foovarkes.order.created.v1" - bebFilters.Filters = []*eventingv1alpha1.BEBFilter{ - NewBEBFilter(evSource, evType), - NewBEBFilter(evSource, evType), - NewBEBFilter(evSource, evType), + filters.Filters = []*eventingv1alpha1.EventMeshFilter{ + NewEventMeshFilter(evSource, evType), + NewEventMeshFilter(evSource, evType), + NewEventMeshFilter(evSource, evType), } } -func WithMultipleBEBFiltersFromDiffSource(bebFilters *eventingv1alpha1.BEBFilters) { +func WithMultipleEventMeshFiltersFromDiffSource(filters *eventingv1alpha1.BEBFilters) { evSource1 := "foo-match" evSource2 := "/default/foo.different/kt1" evSource3 := "/default/foo.different2/kt1" evSource4 := "" evType := "foo.prefix.custom.foovarkes.order.created.v1" - bebFilters.Filters = []*eventingv1alpha1.BEBFilter{ - NewBEBFilter(evSource1, evType), - NewBEBFilter(evSource2, evType), - NewBEBFilter(evSource3, evType), - NewBEBFilter(evSource4, evType), + filters.Filters = []*eventingv1alpha1.EventMeshFilter{ + NewEventMeshFilter(evSource1, evType), + NewEventMeshFilter(evSource2, evType), + NewEventMeshFilter(evSource3, evType), + NewEventMeshFilter(evSource4, evType), } } -func WithMultipleBEBFiltersFromDiffEventTypePrefix(bebFilters *eventingv1alpha1.BEBFilters) { +func WithMultipleEventMeshFiltersFromDiffEventTypePrefix(filters *eventingv1alpha1.BEBFilters) { evSource := "/default/foo.kyma/kt1" evType1 := "foo.prefix.custom.foovarkes.order.created.v1" evType2 := "foo.prefixdifferent.custom.foovarkes.order.created.v1" - bebFilters.Filters = []*eventingv1alpha1.BEBFilter{ - NewBEBFilter(evSource, evType1), - NewBEBFilter(evSource, evType2), - NewBEBFilter(evSource, evType1), + filters.Filters = []*eventingv1alpha1.EventMeshFilter{ + NewEventMeshFilter(evSource, evType1), + NewEventMeshFilter(evSource, evType2), + NewEventMeshFilter(evSource, evType1), } } -func NewBEBFilter(evSource, evType string) *eventingv1alpha1.BEBFilter { - return &eventingv1alpha1.BEBFilter{ +func NewEventMeshFilter(evSource, evType string) *eventingv1alpha1.EventMeshFilter { + return &eventingv1alpha1.EventMeshFilter{ EventSource: &eventingv1alpha1.Filter{ Property: "source", Value: evSource, diff --git a/testing/env_config.go b/testing/env_config.go index 32d9f7a..be40285 100644 --- a/testing/env_config.go +++ b/testing/env_config.go @@ -12,10 +12,10 @@ const ( func NewEnvConfig(emsCEURL, authURL string, opts ...EnvConfigOption) *env.EventMeshConfig { envConfig := &env.EventMeshConfig{ - Port: defaultPort, - EmsPublishURL: emsCEURL, - TokenEndpoint: authURL, - RequestTimeout: time.Minute, + Port: defaultPort, + EventMeshPublishURL: emsCEURL, + TokenEndpoint: authURL, + RequestTimeout: time.Minute, } for _, opt := range opts { opt(envConfig) @@ -49,9 +49,9 @@ func WithRequestTimeout(requestTimeout time.Duration) EnvConfigOption { } } -func WithBEBNamespace(bebNs string) EnvConfigOption { +func WithNamespace(namespace string) EnvConfigOption { return func(e *env.EventMeshConfig) { - e.EventMeshNamespace = bebNs + e.EventMeshNamespace = namespace } } From a96a122e520f1916bfb6ec27b05134230f2c355e Mon Sep 17 00:00:00 2001 From: Carina Kothe <69976260+grischperl@users.noreply.github.com> Date: Fri, 9 Jun 2023 21:54:09 +0200 Subject: [PATCH 177/194] Bump dependencies (#17638) * Bump dependencies * Update values --- go.mod | 16 ++++++++-------- go.sum | 36 ++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/go.mod b/go.mod index b53d890..305c907 100644 --- a/go.mod +++ b/go.mod @@ -9,15 +9,15 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230605123955-9a13db476af1 - github.com/nats-io/nats-server/v2 v2.9.15 - github.com/nats-io/nats.go v1.25.0 - github.com/onsi/gomega v1.27.6 + github.com/nats-io/nats-server/v2 v2.9.17 + github.com/nats-io/nats.go v1.26.0 + github.com/onsi/gomega v1.27.8 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 github.com/stretchr/testify v1.8.3 go.opencensus.io v0.24.0 go.uber.org/zap v1.24.0 - golang.org/x/oauth2 v0.7.0 + golang.org/x/oauth2 v0.8.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 k8s.io/api v0.25.7 k8s.io/apimachinery v0.25.7 @@ -50,7 +50,7 @@ require ( github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.16.4 // indirect + github.com/klauspost/compress v1.16.5 // indirect github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect @@ -71,9 +71,9 @@ require ( go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.8.0 // indirect - golang.org/x/net v0.9.0 // indirect - golang.org/x/sys v0.7.0 // indirect - golang.org/x/term v0.7.0 // indirect + golang.org/x/net v0.10.0 // indirect + golang.org/x/sys v0.8.0 // indirect + golang.org/x/term v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect diff --git a/go.sum b/go.sum index 008391f..54b71c9 100644 --- a/go.sum +++ b/go.sum @@ -223,8 +223,8 @@ github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dv github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.4 h1:91KN02FnsOYhuunwU4ssRe8lc2JosWmizWa91B5v1PU= -github.com/klauspost/compress v1.16.4/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= +github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -260,10 +260,10 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4= github.com/nats-io/jwt/v2 v2.4.1/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI= -github.com/nats-io/nats-server/v2 v2.9.15 h1:MuwEJheIwpvFgqvbs20W8Ish2azcygjf4Z0liVu2I4c= -github.com/nats-io/nats-server/v2 v2.9.15/go.mod h1:QlCTy115fqpx4KSOPFIxSV7DdI6OxtZsGOL1JLdeRlE= -github.com/nats-io/nats.go v1.25.0 h1:t5/wCPGciR7X3Mu8QOi4jiJaXaWM8qtkLu4lzGZvYHE= -github.com/nats-io/nats.go v1.25.0/go.mod h1:D2WALIhz7V8M0pH8Scx8JZXlg6Oqz5VG+nQkK8nJdvg= +github.com/nats-io/nats-server/v2 v2.9.17 h1:gFpUQ3hqIDJrnqog+Bl5vaXg+RhhYEZIElasEuRn2tw= +github.com/nats-io/nats-server/v2 v2.9.17/go.mod h1:eQysm3xDZmIjfkjr7DuD9DjRFpnxQc2vKVxtEg0Dp6s= +github.com/nats-io/nats.go v1.26.0 h1:fWJTYPnZ8DzxIaqIHOAMfColuznchnd5Ab5dbJpgPIE= +github.com/nats-io/nats.go v1.26.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -272,9 +272,9 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.9.2 h1:BA2GMJOtfGAfagzYtrAlufIP0lq6QERkFmHLMLPwFSU= -github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= -github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg= +github.com/onsi/ginkgo/v2 v2.9.7 h1:06xGQy5www2oN160RtEZoTvnP2sPhEfePYmCDc2szss= +github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= +github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -418,8 +418,8 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -436,8 +436,8 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -505,14 +505,14 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -587,7 +587,7 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From 0485ba80a9847c846bccde0a0c5ee23ea35918be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Jun 2023 21:59:47 +0200 Subject: [PATCH 178/194] gomod(deps): bump github.com/nats-io/nats.go from 1.26.0 to 1.27.0 in /components/event-publisher-proxy (#17646) * gomod(deps): bump github.com/nats-io/nats.go Bumps [github.com/nats-io/nats.go](https://github.com/nats-io/nats.go) from 1.26.0 to 1.27.0. - [Release notes](https://github.com/nats-io/nats.go/releases) - [Commits](https://github.com/nats-io/nats.go/compare/v1.26.0...v1.27.0) --- updated-dependencies: - dependency-name: github.com/nats-io/nats.go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 305c907..64d0fc0 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230605123955-9a13db476af1 github.com/nats-io/nats-server/v2 v2.9.17 - github.com/nats-io/nats.go v1.26.0 + github.com/nats-io/nats.go v1.27.0 github.com/onsi/gomega v1.27.8 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 diff --git a/go.sum b/go.sum index 54b71c9..4964b92 100644 --- a/go.sum +++ b/go.sum @@ -262,8 +262,8 @@ github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4= github.com/nats-io/jwt/v2 v2.4.1/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI= github.com/nats-io/nats-server/v2 v2.9.17 h1:gFpUQ3hqIDJrnqog+Bl5vaXg+RhhYEZIElasEuRn2tw= github.com/nats-io/nats-server/v2 v2.9.17/go.mod h1:eQysm3xDZmIjfkjr7DuD9DjRFpnxQc2vKVxtEg0Dp6s= -github.com/nats-io/nats.go v1.26.0 h1:fWJTYPnZ8DzxIaqIHOAMfColuznchnd5Ab5dbJpgPIE= -github.com/nats-io/nats.go v1.26.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= +github.com/nats-io/nats.go v1.27.0 h1:3o9fsPhmoKm+yK7rekH2GtWoE+D9jFbw8N3/ayI1C00= +github.com/nats-io/nats.go v1.27.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= From 69cf52373b798172d32a8bb00e32ed49ccd0fa12 Mon Sep 17 00:00:00 2001 From: Marco Bebway Date: Tue, 20 Jun 2023 11:09:59 +0200 Subject: [PATCH 179/194] Update Eventing deps (#17682) * Update eventing-controller deps * Update event-publisher-proxy deps * Update images --- go.mod | 18 +++++++++--------- go.sum | 28 ++++++++++++++-------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index 64d0fc0..90c6f73 100644 --- a/go.mod +++ b/go.mod @@ -9,15 +9,15 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230605123955-9a13db476af1 - github.com/nats-io/nats-server/v2 v2.9.17 + github.com/nats-io/nats-server/v2 v2.9.18 github.com/nats-io/nats.go v1.27.0 github.com/onsi/gomega v1.27.8 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.14.0 - github.com/stretchr/testify v1.8.3 + github.com/prometheus/client_golang v1.16.0 + github.com/stretchr/testify v1.8.4 go.opencensus.io v0.24.0 go.uber.org/zap v1.24.0 - golang.org/x/oauth2 v0.8.0 + golang.org/x/oauth2 v0.9.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 k8s.io/api v0.25.7 k8s.io/apimachinery v0.25.7 @@ -70,11 +70,11 @@ require ( github.com/stretchr/objx v0.5.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.8.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/term v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/crypto v0.10.0 // indirect + golang.org/x/net v0.11.0 // indirect + golang.org/x/sys v0.9.0 // indirect + golang.org/x/term v0.9.0 // indirect + golang.org/x/text v0.10.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index 4964b92..f3344f2 100644 --- a/go.sum +++ b/go.sum @@ -260,8 +260,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4= github.com/nats-io/jwt/v2 v2.4.1/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI= -github.com/nats-io/nats-server/v2 v2.9.17 h1:gFpUQ3hqIDJrnqog+Bl5vaXg+RhhYEZIElasEuRn2tw= -github.com/nats-io/nats-server/v2 v2.9.17/go.mod h1:eQysm3xDZmIjfkjr7DuD9DjRFpnxQc2vKVxtEg0Dp6s= +github.com/nats-io/nats-server/v2 v2.9.18 h1:00muGH0qu/7NAw1b/2eFcpIvdHcTghj6PFjUVhy8zEo= +github.com/nats-io/nats-server/v2 v2.9.18/go.mod h1:aTb/xtLCGKhfTFLxP591CMWfkdgBmcUUSkiSOe5A3gw= github.com/nats-io/nats.go v1.27.0 h1:3o9fsPhmoKm+yK7rekH2GtWoE+D9jFbw8N3/ayI1C00= github.com/nats-io/nats.go v1.27.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= @@ -309,8 +309,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -418,8 +418,8 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -436,8 +436,8 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= +golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -505,14 +505,14 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= +golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= +golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -524,8 +524,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= +golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From a08d871f046281a1d26238abbd85b7a7dd40ac86 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Fri, 30 Jun 2023 16:17:34 +0200 Subject: [PATCH 180/194] Bump golang in eventing (#17768) * bump the golang version in eventing * take the right image * bump images * change directory --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 292b1e4..18f8f66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM eu.gcr.io/kyma-project/external/golang:1.20.3-alpine3.17 as builder +FROM europe-docker.pkg.dev/kyma-project/prod/external/golang:1.20.5-alpine3.18 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From 56f82b3b691eafefe059764ca1f9a3d287e2136d Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Fri, 7 Jul 2023 08:53:18 +0200 Subject: [PATCH 181/194] Dependencies bump for Eventing (#17794) * Dependencies bump for Eventing * bumped prometheus client * updated replaces * image bump --- go.mod | 31 ++++++++++++++----------------- go.sum | 57 +++++++++++++++++++++++---------------------------------- 2 files changed, 37 insertions(+), 51 deletions(-) diff --git a/go.mod b/go.mod index 90c6f73..d5a8e84 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230605123955-9a13db476af1 - github.com/nats-io/nats-server/v2 v2.9.18 - github.com/nats-io/nats.go v1.27.0 + github.com/nats-io/nats-server/v2 v2.9.19 + github.com/nats-io/nats.go v1.27.1 github.com/onsi/gomega v1.27.8 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.16.0 @@ -19,9 +19,9 @@ require ( go.uber.org/zap v1.24.0 golang.org/x/oauth2 v0.9.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 - k8s.io/api v0.25.7 - k8s.io/apimachinery v0.25.7 - k8s.io/client-go v0.25.7 + k8s.io/api v0.27.3 + k8s.io/apimachinery v0.27.3 + k8s.io/client-go v0.27.3 sigs.k8s.io/controller-runtime v0.13.1 ) @@ -83,7 +83,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.25.0 // indirect - k8s.io/component-base v0.25.7 // indirect + k8s.io/component-base v0.25.11 // indirect k8s.io/klog/v2 v2.80.1 // indirect k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect @@ -94,16 +94,13 @@ require ( replace ( // keep all following packages at the same version - k8s.io/api => k8s.io/api v0.25.7 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.7 - k8s.io/apimachinery => k8s.io/apimachinery v0.25.7 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.7 - k8s.io/component-base => k8s.io/component-base v0.25.7 - k8s.io/kubectl => k8s.io/kubectl v0.25.7 + k8s.io/api => k8s.io/api v0.25.11 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.11 + k8s.io/apimachinery => k8s.io/apimachinery v0.25.11 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.11 + k8s.io/client-go => k8s.io/client-go v0.25.11 + k8s.io/component-base => k8s.io/component-base v0.25.11 + k8s.io/kubectl => k8s.io/kubectl v0.25.11 ) -replace ( - github.com/kyma-incubator/api-gateway => github.com/kyma-project/api-gateway v0.0.0-20230321131415-ea1b79aa2ddb - github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.14.0 - golang.org/x/crypto => golang.org/x/crypto v0.7.0 -) +replace github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.14.0 diff --git a/go.sum b/go.sum index f3344f2..4e7111d 100644 --- a/go.sum +++ b/go.sum @@ -232,7 +232,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kyma-project/api-gateway v0.0.0-20230321131415-ea1b79aa2ddb h1:5Bp1Z3d0+h1aWNK+mcZeQESlLpHVezpOOyD5urDpYmk= +github.com/kyma-incubator/api-gateway v0.0.0-20220819093753-296e6704d413 h1:Np4jOrlYMJcgklgrvVwXWfFMCtlg06SDAaxk9SIX7xE= github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 h1:7CVA4isawiebZGBPeaRwFyxNLb36ZWgmfiSpJSUgI+c= github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 h1:XxhNPU8Z1eknyepGqg21ajEisuTeknKydHiZ6m5Qp3k= @@ -260,10 +260,10 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4= github.com/nats-io/jwt/v2 v2.4.1/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI= -github.com/nats-io/nats-server/v2 v2.9.18 h1:00muGH0qu/7NAw1b/2eFcpIvdHcTghj6PFjUVhy8zEo= -github.com/nats-io/nats-server/v2 v2.9.18/go.mod h1:aTb/xtLCGKhfTFLxP591CMWfkdgBmcUUSkiSOe5A3gw= -github.com/nats-io/nats.go v1.27.0 h1:3o9fsPhmoKm+yK7rekH2GtWoE+D9jFbw8N3/ayI1C00= -github.com/nats-io/nats.go v1.27.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= +github.com/nats-io/nats-server/v2 v2.9.19 h1:OF9jSKZGo425C/FcVVIvNgpd36CUe7aVTTXEZRJk6kA= +github.com/nats-io/nats-server/v2 v2.9.19/go.mod h1:aTb/xtLCGKhfTFLxP591CMWfkdgBmcUUSkiSOe5A3gw= +github.com/nats-io/nats.go v1.27.1 h1:OuYnal9aKVSnOzLQIzf7554OXMCG7KbaTkCSBHRcSoo= +github.com/nats-io/nats.go v1.27.1/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -317,7 +317,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -339,8 +338,13 @@ go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95a go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -376,13 +380,12 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -415,9 +418,6 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -450,8 +450,6 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -502,15 +500,10 @@ golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -522,8 +515,6 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -585,8 +576,6 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -757,16 +746,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.7 h1:r+J8U7CPhPNNTvyow1yw6IzdLt6nBCvPQEW8Cdglep8= -k8s.io/api v0.25.7/go.mod h1:9epkK0wROSVQJKaKW3eY/thGtfbILsLqweTq99qKynk= -k8s.io/apiextensions-apiserver v0.25.7 h1:JcQRpJuUb+fq9yuLVOJvnPb2exTOpndihw6cm5SYSdY= -k8s.io/apiextensions-apiserver v0.25.7/go.mod h1:OospDXJZREut4pOtZhvz4tvKMWxJHbcf8HFtlafN7gc= -k8s.io/apimachinery v0.25.7 h1:kDtoW8uvDkwKc9Lq2sablqWTMZUloRjJVZWURFrdAiI= -k8s.io/apimachinery v0.25.7/go.mod h1:ZTl0drTQaFi5gMM3snYI5tWV1XJmRH1gfnDx2QCLsxk= -k8s.io/client-go v0.25.7 h1:yERmM57CweHC13+wRek/LjScnL5kw6EnVvjoGwS6F7Y= -k8s.io/client-go v0.25.7/go.mod h1:+msAWrAey/u++r/ij0HISJs3QA+RrqXsIa/LqBAT23o= -k8s.io/component-base v0.25.7 h1:xGWvweUXGK5TA+92Qr51hzYw1cM/QpZNMz1vhtcM6NQ= -k8s.io/component-base v0.25.7/go.mod h1:yoYUxxtHH0ysjUwqQ3xpvoD9t1+ENbX5EYgsW+lif+Y= +k8s.io/api v0.25.11 h1:4mjYDfE3yp22jrytjH0knwgzjXKkxHX4D01ZCAazvZM= +k8s.io/api v0.25.11/go.mod h1:bK4UvD4bthtutNlvensrfBX21PRQ/vs2cIYggHkOOAo= +k8s.io/apiextensions-apiserver v0.25.11 h1:qZY0kCt0tW3QHPKcogp3k4zrlZhe9f8H6EJOr7sNRbA= +k8s.io/apiextensions-apiserver v0.25.11/go.mod h1:wsXndE5H00YrPUF/H6KuuNwW2VyYKnKsh8/R9eq4KMs= +k8s.io/apimachinery v0.25.11 h1:2EhfdrSAMvBxsswvOGCEymKk4ZnHZkranuZqdR0rsO4= +k8s.io/apimachinery v0.25.11/go.mod h1:IFwbcNi3gKkfDhuy0VYu3+BwbxbiIov3p6FR8ge1Epc= +k8s.io/client-go v0.25.11 h1:DJQ141UsbNRI6wYSlcYLP5J5BW5Wq7Bgm42Ztq2SW70= +k8s.io/client-go v0.25.11/go.mod h1:41Xs7p1SfhoReUnmjjYCfCNWFiq4xSkexwJfbxF2F7A= +k8s.io/component-base v0.25.11 h1:3QmISCE9n9CJkVpTA4spQO1IZCrLlOwbKdzSN9dqZZA= +k8s.io/component-base v0.25.11/go.mod h1:wFR4pfB+xTc6FBak+RoWRNeTmelGE4XWJP/xVOvn3vM= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= From e57edcd14d22df63b67a11a77ef3c1d3d435b8f2 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Mon, 10 Jul 2023 16:25:19 +0200 Subject: [PATCH 182/194] record backend-errors with latency in epp (#17802) * record metrics for failed backend requests * fix some previously missed tests * bump image * change image folder --- pkg/handler/handler.go | 6 ++ pkg/handler/handler_test.go | 115 ++++++++++++++++++++++++--- pkg/handler/handler_v1alpha1_test.go | 60 +++++++++++++- 3 files changed, 169 insertions(+), 12 deletions(-) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index eab5531..c3d98e2 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -309,6 +309,12 @@ func (h *Handler) sendEventAndRecordMetrics(ctx context.Context, event *cev2even result, err := h.Sender.Send(ctx, event) duration := time.Since(start) if err != nil { + status := 500 + if result != nil { + status = result.HTTPStatus() + } + h.collector.RecordBackendLatency(duration, status, host) + h.collector.RecordBackendRequests(status, host) h.collector.RecordBackendError() return nil, err } diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index e646004..075885f 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -268,10 +268,29 @@ func TestHandler_publishCloudEvents(t *testing.T) { }, wantStatus: 500, wantTEF: ` + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service=""} 0 + eventing_epp_backend_duration_milliseconds_count{code="500",destination_service=""} 1 # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server # TYPE eventing_epp_backend_errors_total counter eventing_epp_backend_errors_total 1 - `, + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="500",destination_service=""} 1 +`, }, { name: "Publish binary CloudEvent but backend is full", @@ -287,9 +306,28 @@ func TestHandler_publishCloudEvents(t *testing.T) { }, wantStatus: 507, wantTEF: ` + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service=""} 0 + eventing_epp_backend_duration_milliseconds_count{code="500",destination_service=""} 1 # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server # TYPE eventing_epp_backend_errors_total counter eventing_epp_backend_errors_total 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="500",destination_service=""} 1 `, }, } @@ -398,9 +436,28 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), wantHTTPStatus: http.StatusBadGateway, wantTEF: ` - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service="FOO"} 0 + eventing_epp_backend_duration_milliseconds_count{code="500",destination_service="FOO"} 1 + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="500",destination_service="FOO"} 1 `, }, { @@ -414,9 +471,28 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), wantHTTPStatus: 507, wantTEF: ` - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service="FOO"} 0 + eventing_epp_backend_duration_milliseconds_count{code="500",destination_service="FOO"} 1 + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="500",destination_service="FOO"} 1 `, }, { @@ -430,9 +506,28 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), wantHTTPStatus: 500, wantTEF: ` - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service="FOO"} 0 + eventing_epp_backend_duration_milliseconds_count{code="500",destination_service="FOO"} 1 + # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="500",destination_service="FOO"} 1 `, }, { diff --git a/pkg/handler/handler_v1alpha1_test.go b/pkg/handler/handler_v1alpha1_test.go index c0247fd..275fbe5 100644 --- a/pkg/handler/handler_v1alpha1_test.go +++ b/pkg/handler/handler_v1alpha1_test.go @@ -332,9 +332,28 @@ func TestHandler_publishCloudEvents_v1alpha1(t *testing.T) { wantStatus: 500, wantTEF: ` + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service=""} 0 + eventing_epp_backend_duration_milliseconds_count{code="500",destination_service=""} 1 # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server # TYPE eventing_epp_backend_errors_total counter eventing_epp_backend_errors_total 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="500",destination_service=""} 1 `, }, { @@ -351,9 +370,28 @@ func TestHandler_publishCloudEvents_v1alpha1(t *testing.T) { }, wantStatus: 507, wantTEF: ` + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service=""} 0 + eventing_epp_backend_duration_milliseconds_count{code="500",destination_service=""} 1 # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server # TYPE eventing_epp_backend_errors_total counter eventing_epp_backend_errors_total 1 + # HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="500",destination_service=""} 1 `, }, } @@ -591,9 +629,27 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { result: nil, assertionFunc: assert.Error, metricErrors: 1, - metricTotal: 0, - metricLatency: 0, + metricTotal: 1, + metricLatency: 1, metricPublished: 0, + metricLatencyTEF: ` + # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service="foo"} 0 + eventing_epp_backend_duration_milliseconds_count{code="500",destination_service="foo"} 1 + `, }, }, } From 98611e7f3e8f106159b5caca07d6f6b7c3039509 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 11:46:09 +0200 Subject: [PATCH 183/194] gomod(deps): bump golang.org/x/oauth2 from 0.9.0 to 0.10.0 in /components/event-publisher-proxy (#17803) * gomod(deps): bump golang.org/x/oauth2 Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.9.0 to 0.10.0. - [Commits](https://github.com/golang/oauth2/compare/v0.9.0...v0.10.0) --- updated-dependencies: - dependency-name: golang.org/x/oauth2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- go.mod | 14 +++++++------- go.sum | 27 ++++++++++++++------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index d5a8e84..7f76323 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/stretchr/testify v1.8.4 go.opencensus.io v0.24.0 go.uber.org/zap v1.24.0 - golang.org/x/oauth2 v0.9.0 + golang.org/x/oauth2 v0.10.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 k8s.io/api v0.27.3 k8s.io/apimachinery v0.27.3 @@ -70,15 +70,15 @@ require ( github.com/stretchr/objx v0.5.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.10.0 // indirect - golang.org/x/net v0.11.0 // indirect - golang.org/x/sys v0.9.0 // indirect - golang.org/x/term v0.9.0 // indirect - golang.org/x/text v0.10.0 // indirect + golang.org/x/crypto v0.11.0 // indirect + golang.org/x/net v0.12.0 // indirect + golang.org/x/sys v0.10.0 // indirect + golang.org/x/term v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.28.1 // indirect + google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 4e7111d..d040167 100644 --- a/go.sum +++ b/go.sum @@ -343,8 +343,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -418,8 +418,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= -golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -436,8 +436,8 @@ golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= -golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= @@ -500,12 +500,12 @@ golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.9.0 h1:GRRCnKYhdQrD8kfRAdQ6Zcw1P0OcELxGLKJvtjVMZ28= -golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= +golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= +golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -515,8 +515,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= -golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -716,8 +716,9 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 468ba300ccc2339737068bc3212ca3011567394f Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Mon, 17 Jul 2023 10:41:52 +0200 Subject: [PATCH 184/194] simplify sender interface (#17822) * simplify sender interface previously the sender had to return - a PublishResult - an Error The problem here was that PublishResult was treated as an error indicator for the eventMesh Backend, and the error was for other senders such as the on Nats The new interface just expects an Error to be returned in case of an error. Any successful call will result in a 204 response with an empty message. This means now the sender has to map its errors or error responses onto an error object, and any other function in the chain can just treat all errors equally. * remove redundant local variable * bump images * fix lint issues * add missing files * improve readability of tests * fix linter * remove redundant metrics * empty commit * add more logging in case of errors during send * add missing log --- pkg/commander/eventmesh/eventmesh.go | 4 +- pkg/commander/nats/nats.go | 18 +- pkg/handler/handler.go | 128 +++++----- pkg/handler/handler_test.go | 301 ++--------------------- pkg/handler/handler_v1alpha1_test.go | 194 +++------------ pkg/metrics/collector.go | 45 +--- pkg/metrics/collector_test.go | 4 - pkg/metrics/metricstest/metricstest.go | 59 ++++- pkg/sender/common/backendpublisherror.go | 55 +++++ pkg/sender/eventmesh/eventmesh.go | 56 +++-- pkg/sender/eventmesh/eventmesh_test.go | 60 ++--- pkg/sender/jetstream/jetstream.go | 66 +++-- pkg/sender/jetstream/jetstream_test.go | 16 +- pkg/sender/sender.go | 17 +- 14 files changed, 351 insertions(+), 672 deletions(-) create mode 100644 pkg/sender/common/backendpublisherror.go diff --git a/pkg/commander/eventmesh/eventmesh.go b/pkg/commander/eventmesh/eventmesh.go index fe38755..fc2132d 100644 --- a/pkg/commander/eventmesh/eventmesh.go +++ b/pkg/commander/eventmesh/eventmesh.go @@ -81,7 +81,7 @@ func (c *Commander) Start() error { defer client.CloseIdleConnections() // configure message sender - messageSender := eventmesh.NewSender(c.envCfg.EventMeshPublishURL, client) + messageSender := eventmesh.NewSender(c.envCfg.EventMeshPublishURL, client, c.logger) // cluster config k8sConfig := config.GetConfigOrDie() @@ -123,7 +123,7 @@ func (c *Commander) Start() error { applicationLister, c.logger) // start handler which blocks until it receives a shutdown signal - if err := handler.NewHandler( + if err := handler.New( messageReceiver, messageSender, health.NewChecker(), diff --git a/pkg/commander/nats/nats.go b/pkg/commander/nats/nats.go index fe58386..e49e173 100644 --- a/pkg/commander/nats/nats.go +++ b/pkg/commander/nats/nats.go @@ -132,8 +132,22 @@ func (c *Commander) Start() error { applicationLister, c.logger) // start handler which blocks until it receives a shutdown signal - if err := handler.NewHandler(messageReceiver, messageSender, messageSender, c.envCfg.RequestTimeout, legacyTransformer, c.opts, - subscribedProcessor, c.logger, c.metricsCollector, eventTypeCleanerV1, ceBuilder, c.envCfg.EventTypePrefix, env.JetStreamBackend).Start(ctx); err != nil { + h := handler.New( + messageReceiver, + messageSender, + messageSender, + c.envCfg.RequestTimeout, + legacyTransformer, + c.opts, + subscribedProcessor, + c.logger, + c.metricsCollector, + eventTypeCleanerV1, + ceBuilder, + c.envCfg.EventTypePrefix, + env.JetStreamBackend, + ) + if err := h.Start(ctx); err != nil { return xerrors.Errorf("failed to start handler for %s : %v", natsCommanderName, err) } diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index c3d98e2..20e1da5 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -67,26 +67,29 @@ type Handler struct { OldEventTypePrefix string } -// NewHandler returns a new HTTP Handler instance. -func NewHandler(receiver *receiver.HTTPMessageReceiver, sender sender.GenericSender, healthChecker health.Checker, +// New returns a new HTTP Handler instance. +func New(receiver *receiver.HTTPMessageReceiver, sender sender.GenericSender, healthChecker health.Checker, requestTimeout time.Duration, legacyTransformer legacy.RequestToCETransformer, opts *options.Options, subscribedProcessor *subscribed.Processor, logger *logger.Logger, collector metrics.PublishingMetricsCollector, eventTypeCleaner eventtype.Cleaner, ceBuilder builder.CloudEventBuilder, oldEventTypePrefix string, activeBackend env.ActiveBackend) *Handler { return &Handler{ + Name: "", Receiver: receiver, Sender: sender, HealthChecker: healthChecker, - RequestTimeout: requestTimeout, + Defaulter: nil, LegacyTransformer: legacyTransformer, + RequestTimeout: requestTimeout, SubscribedProcessor: subscribedProcessor, Logger: logger, Options: opts, collector: collector, eventTypeCleaner: eventTypeCleaner, ceBuilder: ceBuilder, - OldEventTypePrefix: oldEventTypePrefix, + router: nil, activeBackend: activeBackend, + OldEventTypePrefix: oldEventTypePrefix, } } @@ -123,84 +126,81 @@ func (h *Handler) maxBytes(f http.HandlerFunc) http.HandlerFunc { // It writes to the user request if any error occurs. // Otherwise, returns the result. func (h *Handler) handleSendEventAndRecordMetricsLegacy( - writer http.ResponseWriter, request *http.Request, event *cev2event.Event) (sender.PublishResult, error) { - result, err := h.sendEventAndRecordMetrics(request.Context(), event, h.Sender.URL(), request.Header) + writer http.ResponseWriter, request *http.Request, event *cev2event.Event) error { + err := h.sendEventAndRecordMetrics(request.Context(), event, h.Sender.URL(), request.Header) if err != nil { h.namedLogger().Error(err) httpStatus := http.StatusInternalServerError - if errors.Is(err, sender.ErrInsufficientStorage) { - httpStatus = http.StatusInsufficientStorage - } else if errors.Is(err, sender.ErrBackendTargetNotFound) { - httpStatus = http.StatusBadGateway + var pubErr sender.PublishError + if errors.As(err, &pubErr) { + httpStatus = pubErr.Code() } h.LegacyTransformer.WriteCEResponseAsLegacyResponse(writer, httpStatus, event, err.Error()) - return nil, err + return err } - h.namedLogger().Debug(result) - return result, nil + return nil } // handlePublishLegacyEvent handles the publishing of events for Subscription v1alpha2 CRD. // It writes to the user request if any error occurs. // Otherwise, return the published event. -func (h *Handler) handlePublishLegacyEvent(writer http.ResponseWriter, publishData *api.PublishRequestData, request *http.Request) (sender.PublishResult, *cev2event.Event) { - ceEvent, err := h.LegacyTransformer.TransformPublishRequestToCloudEvent(publishData) +func (h *Handler) handlePublishLegacyEvent(w http.ResponseWriter, r *http.Request, + data *api.PublishRequestData) (*cev2event.Event, error) { + ceEvent, err := h.LegacyTransformer.TransformPublishRequestToCloudEvent(data) if err != nil { - legacy.WriteJSONResponse(writer, legacy.ErrorResponse(http.StatusInternalServerError, err)) + legacy.WriteJSONResponse(w, legacy.ErrorResponse(http.StatusInternalServerError, err)) return nil, nil } // build a new cloud event instance as per specifications per backend event, err := h.ceBuilder.Build(*ceEvent) if err != nil { - legacy.WriteJSONResponse(writer, legacy.ErrorResponseBadRequest(err.Error())) - return nil, nil + legacy.WriteJSONResponse(w, legacy.ErrorResponseBadRequest(err.Error())) + return nil, err } - result, err := h.handleSendEventAndRecordMetricsLegacy(writer, request, event) + err = h.handleSendEventAndRecordMetricsLegacy(w, r, event) if err != nil { - return nil, nil + return nil, err } - return result, event + return event, err } // handlePublishLegacyEventV1alpha1 handles the publishing of events for Subscription v1alpha1 CRD. // It writes to the user request if any error occurs. // Otherwise, return the published event. -func (h *Handler) handlePublishLegacyEventV1alpha1(writer http.ResponseWriter, publishData *api.PublishRequestData, request *http.Request) (sender.PublishResult, *cev2event.Event) { - event, _ := h.LegacyTransformer.WriteLegacyRequestsToCE(writer, publishData) +func (h *Handler) handlePublishLegacyEventV1alpha1(w http.ResponseWriter, r *http.Request, + data *api.PublishRequestData) (*cev2event.Event, error) { + event, _ := h.LegacyTransformer.WriteLegacyRequestsToCE(w, data) if event == nil { h.namedLogger().Error("Failed to transform legacy event to CloudEvent, event is nil") return nil, nil } - result, err := h.handleSendEventAndRecordMetricsLegacy(writer, request, event) + err := h.handleSendEventAndRecordMetricsLegacy(w, r, event) if err != nil { - return nil, nil + return nil, err } - return result, event + return event, err } // publishLegacyEventsAsCE converts an incoming request in legacy event format to a cloudevent and dispatches it using // the configured GenericSender. -func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *http.Request) { - var publishedEvent *cev2event.Event - var successResult sender.PublishResult - +func (h *Handler) publishLegacyEventsAsCE(w http.ResponseWriter, r *http.Request) { // extract publish data from request - publishRequestData, errResp, _ := h.LegacyTransformer.ExtractPublishRequestData(request) + publishRequestData, errResp, _ := h.LegacyTransformer.ExtractPublishRequestData(r) if errResp != nil { - legacy.WriteJSONResponse(writer, errResp) + legacy.WriteJSONResponse(w, errResp) return } // publish event for Subscription - successResult, publishedEvent = h.handlePublishLegacyEvent(writer, publishRequestData, request) + publishedEvent, err := h.handlePublishLegacyEvent(w, r, publishRequestData) // if publishedEvent is nil, then it means that the publishing failed // and the response is already returned to the user - if publishedEvent == nil { + if err != nil { return } @@ -210,28 +210,28 @@ func (h *Handler) publishLegacyEventsAsCE(writer http.ResponseWriter, request *h // i.e. with prefix (`sap.kyma.custom`) and without prefix // this behaviour will be deprecated when we remove support for JetStream with Subscription `exact` typeMatching if h.activeBackend == env.JetStreamBackend { - successResult, publishedEvent = h.handlePublishLegacyEventV1alpha1(writer, publishRequestData, request) + publishedEvent, err = h.handlePublishLegacyEventV1alpha1(w, r, publishRequestData) // if publishedEvent is nil, then it means that the publishing failed // and the response is already returned to the user - if publishedEvent == nil { + if err != nil { return } } // return success response to user // change response as per old error codes - h.LegacyTransformer.WriteCEResponseAsLegacyResponse(writer, successResult.HTTPStatus(), publishedEvent, string(successResult.ResponseBody())) + h.LegacyTransformer.WriteCEResponseAsLegacyResponse(w, http.StatusNoContent, publishedEvent, "") } // publishCloudEvents validates an incoming cloudevent and dispatches it using // the configured GenericSender. -func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.Request) { - ctx := request.Context() +func (h *Handler) publishCloudEvents(w http.ResponseWriter, r *http.Request) { + ctx := r.Context() - event, err := extractCloudEventFromRequest(request) + event, err := extractCloudEventFromRequest(r) if err != nil { h.namedLogger().With().Error(err) - e := writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) + e := writeResponse(w, http.StatusBadRequest, []byte(err.Error())) if e != nil { h.namedLogger().Error(e) } @@ -245,7 +245,7 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R // build a new cloud event instance as per specifications per backend event, err = h.ceBuilder.Build(*event) if err != nil { - e := writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) + e := writeResponse(w, http.StatusBadRequest, []byte(err.Error())) if e != nil { h.namedLogger().Error(e) } @@ -255,7 +255,7 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R eventTypeClean, err := h.eventTypeCleaner.Clean(eventTypeOriginal) if err != nil { h.namedLogger().Error(err) - e := writeResponse(writer, http.StatusBadRequest, []byte(err.Error())) + e := writeResponse(w, http.StatusBadRequest, []byte(err.Error())) if e != nil { h.namedLogger().Error(e) } @@ -264,27 +264,26 @@ func (h *Handler) publishCloudEvents(writer http.ResponseWriter, request *http.R event.SetType(eventTypeClean) } - result, err := h.sendEventAndRecordMetrics(ctx, event, h.Sender.URL(), request.Header) + err = h.sendEventAndRecordMetrics(ctx, event, h.Sender.URL(), r.Header) if err != nil { httpStatus := http.StatusInternalServerError - if errors.Is(err, sender.ErrInsufficientStorage) { - httpStatus = http.StatusInsufficientStorage + var pubErr sender.PublishError + if errors.As(err, &pubErr) { + httpStatus = pubErr.Code() } - writer.WriteHeader(httpStatus) + w.WriteHeader(httpStatus) h.namedLogger().With().Error(err) return } - h.namedLogger().With().Debug(result) - - err = writeResponse(writer, result.HTTPStatus(), result.ResponseBody()) + err = writeResponse(w, http.StatusNoContent, []byte("")) if err != nil { h.namedLogger().With().Error(err) } } // extractCloudEventFromRequest converts an incoming CloudEvent request to an Event. -func extractCloudEventFromRequest(request *http.Request) (*cev2event.Event, error) { - message := cev2http.NewMessageFromHttpRequest(request) +func extractCloudEventFromRequest(r *http.Request) (*cev2event.Event, error) { + message := cev2http.NewMessageFromHttpRequest(r) defer func() { _ = message.Finish(nil) }() event, err := binding.ToEvent(context.Background(), message) @@ -300,23 +299,23 @@ func extractCloudEventFromRequest(request *http.Request) (*cev2event.Event, erro } // sendEventAndRecordMetrics dispatches an Event and records metrics based on dispatch success. -func (h *Handler) sendEventAndRecordMetrics(ctx context.Context, event *cev2event.Event, host string, header http.Header) (sender.PublishResult, error) { +func (h *Handler) sendEventAndRecordMetrics(ctx context.Context, event *cev2event.Event, + host string, header http.Header) error { ctx, cancel := context.WithTimeout(ctx, h.RequestTimeout) defer cancel() h.applyDefaults(ctx, event) tracing.AddTracingContextToCEExtensions(header, event) start := time.Now() - result, err := h.Sender.Send(ctx, event) + err := h.Sender.Send(ctx, event) duration := time.Since(start) if err != nil { - status := 500 - if result != nil { - status = result.HTTPStatus() + var pubErr sender.PublishError + code := 500 + if errors.As(err, &pubErr) { + code = pubErr.Code() } - h.collector.RecordBackendLatency(duration, status, host) - h.collector.RecordBackendRequests(status, host) - h.collector.RecordBackendError() - return nil, err + h.collector.RecordBackendLatency(duration, code, host) + return err } originalEventType := event.Type() originalTypeHeader, ok := event.Extensions()[builder.OriginalTypeHeaderName] @@ -331,10 +330,9 @@ func (h *Handler) sendEventAndRecordMetrics(ctx context.Context, event *cev2even originalEventType = event.Type() } } - h.collector.RecordEventType(originalEventType, event.Source(), result.HTTPStatus()) - h.collector.RecordBackendLatency(duration, result.HTTPStatus(), host) - h.collector.RecordBackendRequests(result.HTTPStatus(), host) - return result, nil + h.collector.RecordEventType(originalEventType, event.Source(), http.StatusNoContent) + h.collector.RecordBackendLatency(duration, http.StatusNoContent, host) + return nil } // writeResponse writes the HTTP response given the status code and response body. diff --git a/pkg/handler/handler_test.go b/pkg/handler/handler_test.go index 075885f..cf96c93 100644 --- a/pkg/handler/handler_test.go +++ b/pkg/handler/handler_test.go @@ -4,7 +4,6 @@ package handler import ( "context" "encoding/json" - "fmt" "io" "net/http" "net/http/httptest" @@ -16,6 +15,8 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/legacytest" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/common" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/jetstream" eclogger "github.com/kyma-project/kyma/components/eventing-controller/logger" "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" @@ -32,7 +33,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/eventmesh" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) @@ -63,11 +63,7 @@ func TestHandler_publishCloudEvents(t *testing.T) { name: "Publish structured Cloudevent for Subscription v1alpha1", fields: fields{ Sender: &GenericSenderStub{ - Err: nil, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: []byte(""), - }, + Err: nil, BackendURL: "FOO", }, collector: metrics.NewCollector(latency), @@ -77,39 +73,14 @@ func TestHandler_publishCloudEvents(t *testing.T) { request: CreateValidStructuredRequestV1Alpha1(t), }, wantStatus: 204, - wantTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 - `, + wantTEF: metricstest.MakeTEFBackendDuration(204, "FOO") + + metricstest.MakeTEFEventTypePublished(204, "/default/sap.kyma/id", ""), }, { name: "Publish binary Cloudevent for Subscription v1alpha1", fields: fields{ Sender: &GenericSenderStub{ - Err: nil, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: []byte(""), - }, + Err: nil, BackendURL: "FOO", }, collector: metrics.NewCollector(latency), @@ -119,40 +90,14 @@ func TestHandler_publishCloudEvents(t *testing.T) { request: CreateValidBinaryRequestV1Alpha1(t), }, wantStatus: 204, - wantTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 - eventing_epp_backend_duration_milliseconds_count{destination_service="FOO",code="204"} 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 - `, + wantTEF: metricstest.MakeTEFBackendDuration(204, "FOO") + + metricstest.MakeTEFEventTypePublished(204, "/default/sap.kyma/id", ""), }, { name: "Publish structured Cloudevent", fields: fields{ Sender: &GenericSenderStub{ - Err: nil, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: []byte(""), - }, + Err: nil, BackendURL: "FOO", }, collector: metrics.NewCollector(latency), @@ -162,39 +107,14 @@ func TestHandler_publishCloudEvents(t *testing.T) { request: CreateValidStructuredRequest(t), }, wantStatus: 204, - wantTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="testapp1023",event_type="order.created.v1"} 1 - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 - `, + wantTEF: metricstest.MakeTEFBackendDuration(204, "FOO") + + metricstest.MakeTEFEventTypePublished(204, "testapp1023", "order.created.v1"), }, { name: "Publish binary Cloudevent", fields: fields{ Sender: &GenericSenderStub{ - Err: nil, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: []byte(""), - }, + Err: nil, BackendURL: "FOO", }, collector: metrics.NewCollector(latency), @@ -204,30 +124,8 @@ func TestHandler_publishCloudEvents(t *testing.T) { request: CreateValidBinaryRequest(t), }, wantStatus: 204, - wantTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="testapp1023",event_type="order.created.v1"} 1 - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 - eventing_epp_backend_duration_milliseconds_count{destination_service="FOO",code="204"} 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 - `, + wantTEF: metricstest.MakeTEFBackendDuration(204, "FOO") + + metricstest.MakeTEFEventTypePublished(204, "testapp1023", "order.created.v1"), }, { name: "Publish invalid structured CloudEvent", @@ -258,7 +156,7 @@ func TestHandler_publishCloudEvents(t *testing.T) { name: "Publish binary CloudEvent but cannot send", fields: fields{ Sender: &GenericSenderStub{ - Err: fmt.Errorf("I cannot send"), + Err: common.BackendPublishError{}, }, collector: metrics.NewCollector(latency), eventTypeCleaner: &eventtypetest.CleanerStub{}, @@ -267,36 +165,13 @@ func TestHandler_publishCloudEvents(t *testing.T) { request: CreateValidBinaryRequest(t), }, wantStatus: 500, - wantTEF: ` - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service=""} 0 - eventing_epp_backend_duration_milliseconds_count{code="500",destination_service=""} 1 - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="500",destination_service=""} 1 -`, + wantTEF: metricstest.MakeTEFBackendDuration(500, ""), }, { name: "Publish binary CloudEvent but backend is full", fields: fields{ Sender: &GenericSenderStub{ - Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrInsufficientStorage), + Err: jetstream.ErrNoSpaceLeftOnDevice, }, collector: metrics.NewCollector(latency), eventTypeCleaner: &eventtypetest.CleanerStub{}, @@ -305,30 +180,7 @@ func TestHandler_publishCloudEvents(t *testing.T) { request: CreateValidBinaryRequest(t), }, wantStatus: 507, - wantTEF: ` - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service=""} 0 - eventing_epp_backend_duration_milliseconds_count{code="500",destination_service=""} 1 - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="500",destination_service=""} 1 - `, + wantTEF: metricstest.MakeTEFBackendDuration(507, ""), }, } for _, tt := range tests { @@ -389,153 +241,54 @@ func TestHandler_publishLegacyEventsAsCE(t *testing.T) { { name: "Send valid legacy event", givenSender: &GenericSenderStub{ - Result: eventmesh.HTTPPublishResult{ - Status: 204, - }, BackendURL: "FOO", }, givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), givenCollector: metrics.NewCollector(latency), givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), wantHTTPStatus: http.StatusOK, - wantTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="testapp",event_type="object.created.v1"} 1 - - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 - eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 - - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 - `, + wantTEF: metricstest.MakeTEFBackendDuration(204, "FOO") + + metricstest.MakeTEFEventTypePublished(204, "testapp", "object.created.v1"), }, { name: "Send valid legacy event but cannot send to backend due to target not found (e.g. stream missing)", givenSender: &GenericSenderStub{ - Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrBackendTargetNotFound), + Err: common.ErrBackendTargetNotFound, BackendURL: "FOO", }, givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), givenCollector: metrics.NewCollector(latency), givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), - wantHTTPStatus: http.StatusBadGateway, - wantTEF: ` - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service="FOO"} 0 - eventing_epp_backend_duration_milliseconds_count{code="500",destination_service="FOO"} 1 - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="500",destination_service="FOO"} 1 - `, + wantHTTPStatus: http.StatusNotFound, + wantTEF: metricstest.MakeTEFBackendDuration(404, "FOO"), }, { name: "Send valid legacy event but cannot send to backend due to full storage", givenSender: &GenericSenderStub{ - Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrInsufficientStorage), + Err: common.ErrInsufficientStorage, BackendURL: "FOO", }, givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), givenCollector: metrics.NewCollector(latency), givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), wantHTTPStatus: 507, - wantTEF: ` - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service="FOO"} 0 - eventing_epp_backend_duration_milliseconds_count{code="500",destination_service="FOO"} 1 - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="500",destination_service="FOO"} 1 - `, + wantTEF: metricstest.MakeTEFBackendDuration(507, "FOO"), }, { name: "Send valid legacy event but cannot send to backend", givenSender: &GenericSenderStub{ - Err: fmt.Errorf("i cannot send"), + Err: common.BackendPublishError{}, BackendURL: "FOO", }, givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), givenCollector: metrics.NewCollector(latency), givenRequest: legacytest.ValidLegacyRequestOrDie(t, "v1", "testapp", "object.created"), wantHTTPStatus: 500, - wantTEF: ` - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service="FOO"} 0 - eventing_epp_backend_duration_milliseconds_count{code="500",destination_service="FOO"} 1 - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="500",destination_service="FOO"} 1 - `, + wantTEF: metricstest.MakeTEFBackendDuration(500, "FOO"), }, { name: "Send invalid legacy event", givenSender: &GenericSenderStub{ - Result: eventmesh.HTTPPublishResult{ - Status: 204, - }, BackendURL: "FOO", }, givenLegacyTransformer: legacy.NewTransformer("namespace", "im.a.prefix", appLister), diff --git a/pkg/handler/handler_v1alpha1_test.go b/pkg/handler/handler_v1alpha1_test.go index 275fbe5..5031bbc 100644 --- a/pkg/handler/handler_v1alpha1_test.go +++ b/pkg/handler/handler_v1alpha1_test.go @@ -14,6 +14,7 @@ import ( "time" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/common" cloudevents "github.com/cloudevents/sdk-go/v2" "github.com/cloudevents/sdk-go/v2/client" @@ -31,7 +32,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/metricstest" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/eventmesh" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) @@ -192,11 +192,7 @@ func TestHandler_publishCloudEvents_v1alpha1(t *testing.T) { name: "Publish structured Cloudevent", fields: fields{ Sender: &GenericSenderStub{ - Err: nil, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: []byte(""), - }, + Err: nil, BackendURL: "FOO", }, collector: metrics.NewCollector(latency), @@ -206,40 +202,14 @@ func TestHandler_publishCloudEvents_v1alpha1(t *testing.T) { request: CreateValidStructuredRequestV1Alpha1(t), }, wantStatus: 204, - - wantTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_count{code="204",destination_service="FOO"} 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 - `, + wantTEF: metricstest.MakeTEFBackendDuration(204, "FOO") + + metricstest.MakeTEFEventTypePublished(204, "/default/sap.kyma/id", ""), }, { name: "Publish binary Cloudevent", fields: fields{ Sender: &GenericSenderStub{ - Err: nil, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: []byte(""), - }, + Err: nil, BackendURL: "FOO", }, collector: metrics.NewCollector(latency), @@ -249,31 +219,8 @@ func TestHandler_publishCloudEvents_v1alpha1(t *testing.T) { request: CreateValidBinaryRequestV1Alpha1(t), }, wantStatus: 204, - - wantTEF: ` - # HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel - # TYPE eventing_epp_event_type_published_total counter - eventing_epp_event_type_published_total{code="204",event_source="/default/sap.kyma/id",event_type=""} 1 - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="204",destination_service="FOO",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{destination_service="FOO",code="204"} 0 - eventing_epp_backend_duration_milliseconds_count{destination_service="FOO",code="204"} 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="204",destination_service="FOO"} 1 - `, + wantTEF: metricstest.MakeTEFBackendDuration(204, "FOO") + + metricstest.MakeTEFEventTypePublished(204, "/default/sap.kyma/id", ""), }, { name: "Publish invalid structured CloudEvent", @@ -321,7 +268,7 @@ func TestHandler_publishCloudEvents_v1alpha1(t *testing.T) { name: "Publish binary CloudEvent but cannot send", fields: fields{ Sender: &GenericSenderStub{ - Err: fmt.Errorf("I cannot send"), + Err: common.BackendPublishError{}, }, collector: metrics.NewCollector(latency), eventTypeCleaner: &eventtypetest.CleanerStub{}, @@ -330,37 +277,13 @@ func TestHandler_publishCloudEvents_v1alpha1(t *testing.T) { request: CreateValidBinaryRequestV1Alpha1(t), }, wantStatus: 500, - - wantTEF: ` - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service=""} 0 - eventing_epp_backend_duration_milliseconds_count{code="500",destination_service=""} 1 - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="500",destination_service=""} 1 - `, + wantTEF: metricstest.MakeTEFBackendDuration(500, ""), }, { name: "Publish binary CloudEvent but backend is full", fields: fields{ Sender: &GenericSenderStub{ - Err: fmt.Errorf("oh no, i cannot send: %w", sender.ErrInsufficientStorage), + Err: common.ErrInsufficientStorage, }, collector: metrics.NewCollector(latency), eventTypeCleaner: &eventtypetest.CleanerStub{}, @@ -368,31 +291,8 @@ func TestHandler_publishCloudEvents_v1alpha1(t *testing.T) { args: args{ request: CreateValidBinaryRequestV1Alpha1(t), }, - wantStatus: 507, - wantTEF: ` - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service=""} 0 - eventing_epp_backend_duration_milliseconds_count{code="500",destination_service=""} 1 - # HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server - # TYPE eventing_epp_backend_errors_total counter - eventing_epp_backend_errors_total 1 - # HELP eventing_epp_backend_requests_total The total number of backend requests - # TYPE eventing_epp_backend_requests_total counter - eventing_epp_backend_requests_total{code="500",destination_service=""} 1 - `, + wantStatus: http.StatusInsufficientStorage, + wantTEF: metricstest.MakeTEFBackendDuration(507, ""), }, } for _, tt := range tests { @@ -493,7 +393,7 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { header http.Header } type wants struct { - result sender.PublishResult + result sender.PublishError assertionFunc assert.ErrorAssertionFunc metricErrors int metricTotal int @@ -542,10 +442,6 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { Sender: &GenericSenderStub{ Err: nil, SleepDuration: 0, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: nil, - }, }, Defaulter: nil, collector: metrics.NewCollector(latency), @@ -556,10 +452,6 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { event: ceEvent, }, wants: wants{ - result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: nil, - }, assertionFunc: assert.NoError, metricErrors: 0, metricTotal: 1, @@ -579,10 +471,6 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { Sender: &GenericSenderStub{ Err: nil, SleepDuration: 0, - Result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: nil, - }, }, Defaulter: nil, collector: metrics.NewCollector(latency), @@ -593,10 +481,6 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { event: &ceEventWithOriginalEventType, }, wants: wants{ - result: eventmesh.HTTPPublishResult{ - Status: 204, - Body: nil, - }, assertionFunc: assert.NoError, metricErrors: 0, metricTotal: 1, @@ -614,7 +498,7 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { name: "Sending not successful, error returned", fields: fields{ Sender: &GenericSenderStub{ - Err: errors.New("i failed"), + Err: common.BackendPublishError{}, SleepDuration: 5, }, Defaulter: nil, @@ -626,30 +510,13 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { event: &cev2event.Event{}, }, wants: wants{ - result: nil, - assertionFunc: assert.Error, - metricErrors: 1, - metricTotal: 1, - metricLatency: 1, - metricPublished: 0, - metricLatencyTEF: ` - # HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds - # TYPE eventing_epp_backend_duration_milliseconds histogram - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.005"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.01"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.025"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.05"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.25"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="0.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="1"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="2.5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="5"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="10"} 1 - eventing_epp_backend_duration_milliseconds_bucket{code="500",destination_service="foo",le="+Inf"} 1 - eventing_epp_backend_duration_milliseconds_sum{code="500",destination_service="foo"} 0 - eventing_epp_backend_duration_milliseconds_count{code="500",destination_service="foo"} 1 - `, + result: nil, + assertionFunc: assert.Error, + metricErrors: 1, + metricTotal: 1, + metricLatency: 1, + metricPublished: 0, + metricLatencyTEF: metricstest.MakeTEFBackendDuration(500, "foo"), }, }, } @@ -665,15 +532,12 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { } // when - got, err := h.sendEventAndRecordMetrics(tt.args.ctx, tt.args.event, tt.args.host, tt.args.header) + err := h.sendEventAndRecordMetrics(tt.args.ctx, tt.args.event, tt.args.host, tt.args.header) // then if !tt.wants.assertionFunc(t, err, fmt.Sprintf("sendEventAndRecordMetrics(%v, %v, %v)", tt.args.ctx, tt.args.host, tt.args.event)) { return } - assert.Equalf(t, tt.wants.result, got, "sendEventAndRecordMetrics(%v, %v, %v)", tt.args.ctx, tt.args.host, tt.args.event) - metricstest.EnsureMetricErrors(t, h.collector, tt.wants.metricErrors) - metricstest.EnsureMetricTotalRequests(t, h.collector, tt.wants.metricTotal) metricstest.EnsureMetricLatency(t, h.collector, tt.wants.metricLatency) metricstest.EnsureMetricEventTypePublished(t, h.collector, tt.wants.metricPublished) metricstest.EnsureMetricMatchesTextExpositionFormat(t, h.collector, tt.wants.metricLatencyTEF, "eventing_epp_backend_duration_milliseconds") @@ -685,9 +549,8 @@ func TestHandler_sendEventAndRecordMetrics(t *testing.T) { func TestHandler_sendEventAndRecordMetrics_TracingAndDefaults(t *testing.T) { // given stub := &GenericSenderStub{ - Err: nil, SleepDuration: 0, - Result: eventmesh.HTTPPublishResult{Status: http.StatusInternalServerError}, + Err: common.BackendPublishError{HTTPCode: http.StatusInternalServerError}, } const bucketsFunc = "Buckets" @@ -716,10 +579,10 @@ func TestHandler_sendEventAndRecordMetrics_TracingAndDefaults(t *testing.T) { "b3flags": "X-B3-Flags", } // when - _, err := h.sendEventAndRecordMetrics(context.Background(), CreateCloudEvent(t), "", header) + err := h.sendEventAndRecordMetrics(context.Background(), CreateCloudEvent(t), "", header) // then - assert.NoError(t, err) + assert.Error(t, err) assert.Equal(t, expectedExtensions, stub.ReceivedEvent.Context.GetExtensions()) } @@ -804,17 +667,16 @@ func CreateInvalidBinaryRequestV1Alpha1(t *testing.T) *http.Request { } type GenericSenderStub struct { - Err error SleepDuration time.Duration - Result sender.PublishResult + Err sender.PublishError ReceivedEvent *cev2event.Event BackendURL string } -func (g *GenericSenderStub) Send(_ context.Context, event *cev2event.Event) (sender.PublishResult, error) { +func (g *GenericSenderStub) Send(_ context.Context, event *cev2event.Event) sender.PublishError { g.ReceivedEvent = event time.Sleep(g.SleepDuration) - return g.Result, g.Err + return g.Err } func (g *GenericSenderStub) URL() string { diff --git a/pkg/metrics/collector.go b/pkg/metrics/collector.go index 7acedba..de9c0d1 100644 --- a/pkg/metrics/collector.go +++ b/pkg/metrics/collector.go @@ -13,21 +13,11 @@ import ( ) const ( - // BackendErrorsKey name of the backendErrors metric. - BackendErrorsKey = "eventing_epp_backend_errors_total" - // backendErrorsHelp help text for the backendErrors metric. - backendErrorsHelp = "The total number of backend errors while sending events to the messaging server" - // BackendLatencyKey name of the backendLatencyHelp metric. BackendLatencyKey = "eventing_epp_backend_duration_milliseconds" // backendLatencyHelp help text for the backendLatencyHelp metric. backendLatencyHelp = "The duration of sending events to the messaging server in milliseconds" - // BackendRequestsKey name of the eventRequests metric. - BackendRequestsKey = "eventing_epp_backend_requests_total" - // backendRequestsHelp help text for event backendRequests metric. - backendRequestsHelp = "The total number of backend requests" - // durationKey name of the duration metric. durationKey = "eventing_epp_requests_duration_milliseconds" // durationHelp help text for the duration metric. @@ -61,10 +51,8 @@ const ( // for recording epp specific metrics. type PublishingMetricsCollector interface { prometheus.Collector - RecordBackendError() RecordBackendLatency(duration time.Duration, statusCode int, destSvc string) RecordEventType(eventType, eventSource string, statusCode int) - RecordBackendRequests(statusCode int, destSvc string) MetricsMiddleware() mux.MiddlewareFunc } @@ -72,9 +60,7 @@ var _ PublishingMetricsCollector = &Collector{} // Collector implements the prometheus.Collector interface. type Collector struct { - backendErrors *prometheus.CounterVec - backendLatency *prometheus.HistogramVec - backendRequests *prometheus.CounterVec + backendLatency *prometheus.HistogramVec duration *prometheus.HistogramVec requests *prometheus.CounterVec @@ -85,13 +71,6 @@ type Collector struct { // NewCollector creates a new instance of Collector. func NewCollector(latency histogram.BucketsProvider) *Collector { return &Collector{ - backendErrors: prometheus.NewCounterVec( - prometheus.CounterOpts{ - Name: BackendErrorsKey, - Help: backendErrorsHelp, - }, - []string{}, - ), //nolint:promlinter // we follow the same pattern as istio. so a millisecond unit if fine here backendLatency: prometheus.NewHistogramVec( prometheus.HistogramOpts{ @@ -101,14 +80,6 @@ func NewCollector(latency histogram.BucketsProvider) *Collector { }, []string{responseCodeLabel, destSvcLabel}, ), - backendRequests: prometheus.NewCounterVec( - prometheus.CounterOpts{ - Name: BackendRequestsKey, - Help: backendRequestsHelp, - }, - []string{responseCodeLabel, destSvcLabel}, - ), - eventType: prometheus.NewCounterVec( prometheus.CounterOpts{ Name: EventTypePublishedMetricKey, @@ -137,9 +108,7 @@ func NewCollector(latency histogram.BucketsProvider) *Collector { // Describe implements the prometheus.Collector interface Describe method. func (c *Collector) Describe(ch chan<- *prometheus.Desc) { - c.backendErrors.Describe(ch) c.backendLatency.Describe(ch) - c.backendRequests.Describe(ch) c.eventType.Describe(ch) c.requests.Describe(ch) c.duration.Describe(ch) @@ -147,19 +116,12 @@ func (c *Collector) Describe(ch chan<- *prometheus.Desc) { // Collect implements the prometheus.Collector interface Collect method. func (c *Collector) Collect(ch chan<- prometheus.Metric) { - c.backendErrors.Collect(ch) c.backendLatency.Collect(ch) - c.backendRequests.Collect(ch) c.eventType.Collect(ch) c.requests.Collect(ch) c.duration.Collect(ch) } -// RecordBackendError records an error while sending to the eventing backend. -func (c *Collector) RecordBackendError() { - c.backendErrors.WithLabelValues().Inc() -} - // RecordLatency records a backendLatencyHelp metric. func (c *Collector) RecordBackendLatency(duration time.Duration, statusCode int, destSvc string) { c.backendLatency.WithLabelValues(fmt.Sprint(statusCode), destSvc).Observe(float64(duration.Milliseconds())) @@ -170,11 +132,6 @@ func (c *Collector) RecordEventType(eventType, eventSource string, statusCode in c.eventType.WithLabelValues(eventType, eventSource, fmt.Sprint(statusCode)).Inc() } -// RecordRequests records an eventRequests metric. -func (c *Collector) RecordBackendRequests(statusCode int, destSvc string) { - c.backendRequests.WithLabelValues(fmt.Sprint(statusCode), destSvc).Inc() -} - // MetricsMiddleware returns a http.Handler that can be used as middleware in gorilla.mux to track // latencies for all handled paths in the gorilla router. func (c *Collector) MetricsMiddleware() mux.MiddlewareFunc { diff --git a/pkg/metrics/collector_test.go b/pkg/metrics/collector_test.go index 41393a9..9ad4d67 100644 --- a/pkg/metrics/collector_test.go +++ b/pkg/metrics/collector_test.go @@ -18,13 +18,9 @@ func TestNewCollector(t *testing.T) { // then assert.NotNil(t, collector) - assert.NotNil(t, collector.backendErrors) - assert.NotNil(t, collector.backendErrors.MetricVec) assert.NotNil(t, collector.backendLatency) assert.NotNil(t, collector.backendLatency.MetricVec) assert.NotNil(t, collector.eventType) assert.NotNil(t, collector.eventType.MetricVec) - assert.NotNil(t, collector.backendRequests) - assert.NotNil(t, collector.backendRequests.MetricVec) latency.AssertExpectations(t) } diff --git a/pkg/metrics/metricstest/metricstest.go b/pkg/metrics/metricstest/metricstest.go index d9bd4fb..8d29fe9 100644 --- a/pkg/metrics/metricstest/metricstest.go +++ b/pkg/metrics/metricstest/metricstest.go @@ -2,6 +2,7 @@ package metricstest import ( + "strconv" "strings" "testing" "time" @@ -12,11 +13,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" ) -// EnsureMetricErrors ensures metric eventing_epp_backend_errors_total exists. -func EnsureMetricErrors(t *testing.T, collector metrics.PublishingMetricsCollector, count int) { - ensureMetricCount(t, collector, metrics.BackendErrorsKey, count) -} - // EnsureMetricLatency ensures metric eventing_epp_backend_duration_seconds exists. func EnsureMetricLatency(t *testing.T, collector metrics.PublishingMetricsCollector, count int) { ensureMetricCount(t, collector, metrics.BackendLatencyKey, count) @@ -27,11 +23,6 @@ func EnsureMetricEventTypePublished(t *testing.T, collector metrics.PublishingMe ensureMetricCount(t, collector, metrics.EventTypePublishedMetricKey, count) } -// EnsureMetricTotalRequests ensures metric eventing_epp_backend_requests_total exists. -func EnsureMetricTotalRequests(t *testing.T, collector metrics.PublishingMetricsCollector, count int) { - ensureMetricCount(t, collector, metrics.BackendRequestsKey, count) -} - func ensureMetricCount(t *testing.T, collector metrics.PublishingMetricsCollector, metric string, expectedCount int) { if count := testutil.CollectAndCount(collector, metric); count != expectedCount { t.Fatalf("invalid count for metric:%s, want:%d, got:%d", metric, expectedCount, count) @@ -67,3 +58,51 @@ func (p PublishingMetricsCollectorStub) RecordEventType(_, _ string, _ int) { func (p PublishingMetricsCollectorStub) RecordRequests(_ int, _ string) { } + +//nolint:lll // that's how TEF has to look like +func MakeTEFBackendDuration(code int, service string) string { + tef := strings.ReplaceAll(`# HELP eventing_epp_backend_duration_milliseconds The duration of sending events to the messaging server in milliseconds + # TYPE eventing_epp_backend_duration_milliseconds histogram + eventing_epp_backend_duration_milliseconds_bucket{code="%%code%%",destination_service="%%service%%",le="0.005"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="%%code%%",destination_service="%%service%%",le="0.01"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="%%code%%",destination_service="%%service%%",le="0.025"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="%%code%%",destination_service="%%service%%",le="0.05"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="%%code%%",destination_service="%%service%%",le="0.1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="%%code%%",destination_service="%%service%%",le="0.25"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="%%code%%",destination_service="%%service%%",le="0.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="%%code%%",destination_service="%%service%%",le="1"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="%%code%%",destination_service="%%service%%",le="2.5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="%%code%%",destination_service="%%service%%",le="5"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="%%code%%",destination_service="%%service%%",le="10"} 1 + eventing_epp_backend_duration_milliseconds_bucket{code="%%code%%",destination_service="%%service%%",le="+Inf"} 1 + eventing_epp_backend_duration_milliseconds_sum{code="%%code%%",destination_service="%%service%%"} 0 + eventing_epp_backend_duration_milliseconds_count{code="%%code%%",destination_service="%%service%%"} 1 + `, "%%code%%", strconv.Itoa(code)) + return strings.ReplaceAll(tef, "%%service%%", service) +} + +func MakeTEFBackendRequests(code int, service string) string { + tef := strings.ReplaceAll(`# HELP eventing_epp_backend_requests_total The total number of backend requests + # TYPE eventing_epp_backend_requests_total counter + eventing_epp_backend_requests_total{code="%%code%%",destination_service="%%service%%"} 1 + `, "%%code%%", strconv.Itoa(code)) + return strings.ReplaceAll(tef, "%%service%%", service) +} + +//nolint:lll // that's how TEF has to look like +func MakeTEFBackendErrors() string { + return `# HELP eventing_epp_backend_errors_total The total number of backend errors while sending events to the messaging server + # TYPE eventing_epp_backend_errors_total counter + eventing_epp_backend_errors_total 1 + ` +} + +//nolint:lll // that's how TEF has to look like +func MakeTEFEventTypePublished(code int, source, eventtype string) string { + tef := strings.ReplaceAll(`# HELP eventing_epp_event_type_published_total The total number of events published for a given eventTypeLabel + # TYPE eventing_epp_event_type_published_total counter + eventing_epp_event_type_published_total{code="204",event_source="%%source%%",event_type="%%type%%"} 1 + `, "%%code%%", strconv.Itoa(code)) + tef = strings.ReplaceAll(tef, "%%source%%", source) + return strings.ReplaceAll(tef, "%%type%%", eventtype) +} diff --git a/pkg/sender/common/backendpublisherror.go b/pkg/sender/common/backendpublisherror.go new file mode 100644 index 0000000..b7d6520 --- /dev/null +++ b/pkg/sender/common/backendpublisherror.go @@ -0,0 +1,55 @@ +package common + +import ( + "net/http" + + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" +) + +var _ sender.PublishError = &BackendPublishError{} + +//nolint:lll //reads better this way +var ( + ErrInsufficientStorage = BackendPublishError{HTTPCode: http.StatusInsufficientStorage, Info: "insufficient storage on backend"} + ErrBackendTargetNotFound = BackendPublishError{HTTPCode: http.StatusNotFound, Info: "publishing target on backend not found"} + ErrClientNoConnection = BackendPublishError{HTTPCode: http.StatusBadGateway, Info: "no connection to backend"} + ErrInternalBackendError = BackendPublishError{HTTPCode: http.StatusInternalServerError, Info: "internal error on backend"} + ErrClientConversionFailed = BackendPublishError{HTTPCode: http.StatusBadRequest, Info: "conversion to target format failed"} +) + +type BackendPublishError struct { + HTTPCode int + Info string + err error +} + +func (e BackendPublishError) Error() string { + return e.Info +} + +func (e *BackendPublishError) Unwrap() error { + return e.err +} + +func (e *BackendPublishError) Wrap(wrappedError error) { + e.err = wrappedError +} + +func (e BackendPublishError) Code() int { + if e.HTTPCode == 0 { + return http.StatusInternalServerError + } + return e.HTTPCode +} + +func (e BackendPublishError) Message() string { + return e.Info +} + +func (e *BackendPublishError) Is(target error) bool { + t, ok := target.(*BackendPublishError) //nolint:errorlint //we dont want to check the error chain here + if !ok { + return false + } + return (e.HTTPCode == t.HTTPCode) && (e.Info == t.Info) +} diff --git a/pkg/sender/eventmesh/eventmesh.go b/pkg/sender/eventmesh/eventmesh.go index cb830a4..97e20cd 100644 --- a/pkg/sender/eventmesh/eventmesh.go +++ b/pkg/sender/eventmesh/eventmesh.go @@ -8,11 +8,15 @@ import ( "github.com/cloudevents/sdk-go/v2/binding" cev2event "github.com/cloudevents/sdk-go/v2/event" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "go.uber.org/zap" + "github.com/kyma-project/kyma/components/event-publisher-proxy/internal" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/eventmesh" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/common" ) var _ sender.GenericSender = &Sender{} @@ -26,37 +30,32 @@ var ( } ) +const ( + backend = "eventmesh" + handlerName = "eventmesh-handler" +) + // Sender is responsible for sending messages over HTTP. type Sender struct { Client *http.Client Target string + logger *logger.Logger } func (s *Sender) URL() string { return s.Target } -type HTTPPublishResult struct { - Status int - Body []byte -} - -func (h HTTPPublishResult) HTTPStatus() int { - return h.Status -} - -func (h HTTPPublishResult) ResponseBody() []byte { - return h.Body -} - func (s *Sender) Checker() *health.ConfigurableChecker { return &health.ConfigurableChecker{} } -func (s *Sender) Send(ctx context.Context, event *cev2event.Event) (sender.PublishResult, error) { +func (s *Sender) Send(ctx context.Context, event *cev2event.Event) sender.PublishError { request, err := s.NewRequestWithTarget(ctx, s.Target) if err != nil { - return nil, err + e := common.ErrInternalBackendError + e.Wrap(err) + return e } message := binding.ToMessage(event) @@ -64,27 +63,42 @@ func (s *Sender) Send(ctx context.Context, event *cev2event.Event) (sender.Publi err = cloudevents.WriteRequestWithHeaders(ctx, message, request, additionalHeaders) if err != nil { - return nil, err + s.namedLogger().Error("error", err) + e := common.ErrInternalBackendError + e.Wrap(err) + return e } resp, err := s.Client.Do(request) if err != nil { - return nil, err + s.namedLogger().Error("error", err) + e := common.ErrInternalBackendError + e.Wrap(err) + return e + } + if resp.StatusCode >= http.StatusOK && resp.StatusCode < http.StatusMultipleChoices { + return nil } body, err := io.ReadAll(resp.Body) defer func() { _ = resp.Body.Close() }() if err != nil { - return nil, err + s.namedLogger().Error("error", err) + return common.ErrInternalBackendError } - return HTTPPublishResult{Status: resp.StatusCode, Body: body}, nil + s.namedLogger().Error("error", string(body), "code", resp.StatusCode) + return common.BackendPublishError{HTTPCode: resp.StatusCode, Info: string(body)} } // NewSender returns a new Sender instance with the given target and client. -func NewSender(target string, client *http.Client) *Sender { - return &Sender{Client: client, Target: target} +func NewSender(target string, c *http.Client, l *logger.Logger) *Sender { + return &Sender{Client: c, Target: target, logger: l} } // NewRequestWithTarget returns a new HTTP POST request with the given context and target. func (s *Sender) NewRequestWithTarget(ctx context.Context, target string) (*http.Request, error) { return http.NewRequestWithContext(ctx, http.MethodPost, target, nil) } + +func (s *Sender) namedLogger() *zap.SugaredLogger { + return s.logger.WithContext().Named(handlerName).With("backend", backend) +} diff --git a/pkg/sender/eventmesh/eventmesh_test.go b/pkg/sender/eventmesh/eventmesh_test.go index 0f0a0a7..65a283d 100644 --- a/pkg/sender/eventmesh/eventmesh_test.go +++ b/pkg/sender/eventmesh/eventmesh_test.go @@ -5,15 +5,17 @@ import ( "net/http" "net/http/httptest" "net/url" - "reflect" "testing" "time" + "github.com/kyma-project/kyma/components/eventing-controller/logger" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/oauth" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/common" testing2 "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) @@ -32,8 +34,9 @@ func TestNewHttpMessageSender(t *testing.T) { client := oauth.NewClient(context.Background(), &env.EventMeshConfig{}) defer client.CloseIdleConnections() - - msgSender := NewSender(eventsEndpoint, client) + mockedLogger, err := logger.New("json", "info") + require.NoError(t, err) + msgSender := NewSender(eventsEndpoint, client, mockedLogger) if msgSender.Target != eventsEndpoint { t.Errorf("Message sender target is misconfigured want: %s but got: %s", eventsEndpoint, msgSender.Target) } @@ -49,7 +52,9 @@ func TestNewRequestWithTarget(t *testing.T) { client := oauth.NewClient(context.Background(), cfg) defer client.CloseIdleConnections() - msgSender := NewSender(eventsEndpoint, client) + mockedLogger, err := logger.New("json", "info") + require.NoError(t, err) + msgSender := NewSender(eventsEndpoint, client, mockedLogger) type ctxKey struct{} const ctxValue = "testValue" @@ -98,7 +103,7 @@ func TestSender_Send_Error(t *testing.T) { name string fields fields args args - want sender.PublishResult + want sender.PublishError wantErr bool }{ { @@ -122,20 +127,16 @@ func TestSender_Send_Error(t *testing.T) { mux.HandleFunc(eventsEndpoint, hOk.ServeHTTP) mux.HandleFunc(eventsHTTP400Endpoint, hFail.ServeHTTP) server := httptest.NewServer(mux) - s := &Sender{ - Client: server.Client(), - Target: tt.fields.Target, - } + mockedLogger, err := logger.New("json", "info") + require.NoError(t, err) + s := NewSender(tt.fields.Target, server.Client(), mockedLogger) ctx, cancel := context.WithTimeout(context.Background(), tt.args.timeout) defer cancel() - got, err := s.Send(ctx, tt.args.builder.Build(t)) + err = s.Send(ctx, tt.args.builder.Build(t)) if (err != nil) != tt.wantErr { t.Errorf("Send() error = %v, wantErr %v", err, tt.wantErr) return } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Send() got = %v, want %v", got, tt.want) - } }) } } @@ -151,8 +152,8 @@ func TestSender_Send(t *testing.T) { name string fields fields args args - want sender.PublishResult - wantErr bool + want sender.PublishError + wantErr error }{ { name: "valid event, backend 400", @@ -163,11 +164,9 @@ func TestSender_Send(t *testing.T) { ctx: context.Background(), builder: testing2.NewCloudEventBuilder(), }, - want: HTTPPublishResult{ - Status: 400, - Body: []byte{}, + wantErr: common.BackendPublishError{ + HTTPCode: 400, }, - wantErr: false, }, { name: "valid event", @@ -178,11 +177,7 @@ func TestSender_Send(t *testing.T) { ctx: context.Background(), builder: testing2.NewCloudEventBuilder(), }, - want: HTTPPublishResult{ - Status: 204, - Body: []byte{}, - }, - wantErr: false, + wantErr: nil, }, } for _, tt := range tests { @@ -195,18 +190,11 @@ func TestSender_Send(t *testing.T) { server := httptest.NewServer(mux) target, err := url.JoinPath(server.URL, tt.fields.Target) assert.NoError(t, err) - s := &Sender{ - Client: server.Client(), - Target: target, - } - got, err := s.Send(tt.args.ctx, tt.args.builder.Build(t)) - if (err != nil) != tt.wantErr { - t.Errorf("Send() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Send() got = %v, want %v", got, tt.want) - } + mockedLogger, err := logger.New("json", "info") + require.NoError(t, err) + s := NewSender(target, server.Client(), mockedLogger) + err = s.Send(tt.args.ctx, tt.args.builder.Build(t)) + assert.ErrorIs(t, err, tt.wantErr) }) } } diff --git a/pkg/sender/jetstream/jetstream.go b/pkg/sender/jetstream/jetstream.go index 0e7c142..86cdbc7 100644 --- a/pkg/sender/jetstream/jetstream.go +++ b/pkg/sender/jetstream/jetstream.go @@ -21,13 +21,13 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/eventmesh" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/common" ) const ( JSStoreFailedCode = 10077 natsBackend = "nats" - jestreamHandlerName = "jetstream-handler" + handlerName = "jetstream-handler" noSpaceLeftErrMessage = "no space left on device" ) @@ -35,9 +35,11 @@ const ( var _ sender.GenericSender = &Sender{} var _ health.Checker = &Sender{} +//nolint:lll // reads better this way var ( - ErrNotConnected = errors.New("no connection to NATS JetStream server") - ErrCannotSendToStream = errors.New("cannot send to stream") + ErrNotConnected = common.BackendPublishError{HTTPCode: http.StatusBadGateway, Info: "no connection to NATS JetStream server"} + ErrCannotSendToStream = common.BackendPublishError{HTTPCode: http.StatusGatewayTimeout, Info: "cannot send to stream"} + ErrNoSpaceLeftOnDevice = common.BackendPublishError{HTTPCode: http.StatusInsufficientStorage, Info: "insufficient resources on target stream"} ) // Sender is responsible for sending messages over HTTP. @@ -58,48 +60,62 @@ func NewSender(ctx context.Context, connection *nats.Conn, envCfg *env.NATSConfi return &Sender{ctx: ctx, connection: connection, envCfg: envCfg, opts: opts, logger: logger} } -// ConnectionStatus returns nats.Status for the NATS connection used by the Sender. +// ConnectionStatus returns nats.code for the NATS connection used by the Sender. func (s *Sender) ConnectionStatus() nats.Status { return s.connection.Status() } // Send dispatches the event to the NATS backend in JetStream mode. // If the NATS connection is not open, it returns an error. -func (s *Sender) Send(_ context.Context, event *event.Event) (sender.PublishResult, error) { +func (s *Sender) Send(_ context.Context, event *event.Event) sender.PublishError { if s.ConnectionStatus() != nats.CONNECTED { - return nil, ErrNotConnected + return ErrNotConnected } - jsCtx, jsError := s.connection.JetStream() - if jsError != nil { - return nil, jsError + jsCtx, err := s.connection.JetStream() + if err != nil { + s.namedLogger().Error("error", err) + return common.ErrClientNoConnection } msg, err := s.eventToNATSMsg(event) if err != nil { - return nil, err + s.namedLogger().Error("error", err) + e := common.ErrClientConversionFailed + e.Wrap(err) + return e } // send the event _, err = jsCtx.PublishMsg(msg) if err != nil { s.namedLogger().Errorw("Cannot send event to backend", "error", err) - if errors.Is(err, nats.ErrNoStreamResponse) { - return nil, fmt.Errorf("%w : %v", sender.ErrBackendTargetNotFound, fmt.Errorf("%w, %v", ErrCannotSendToStream, err)) - } + return natsErrorToPublishError(err) + } + return nil +} - var apiErr nats.JetStreamError - if ok := errors.As(err, &apiErr); ok { - if apiErr.APIError().ErrorCode == JSStoreFailedCode { - return nil, fmt.Errorf("%w: %v", sender.ErrInsufficientStorage, err) - } - } - if strings.Contains(err.Error(), noSpaceLeftErrMessage) { - return nil, fmt.Errorf("%w: %v", sender.ErrInsufficientStorage, err) +func natsErrorToPublishError(err error) sender.PublishError { + if errors.Is(err, nats.ErrNoStreamResponse) { + return ErrCannotSendToStream + } + + if strings.Contains(err.Error(), noSpaceLeftErrMessage) { + return ErrNoSpaceLeftOnDevice + } + + var apiErr nats.JetStreamError + e := common.BackendPublishError{HTTPCode: http.StatusInternalServerError} + if errors.As(err, &apiErr) { + if apiErr.APIError().ErrorCode == JSStoreFailedCode { + return ErrNoSpaceLeftOnDevice } - return nil, fmt.Errorf("%w : %v", sender.ErrInternalBackendError, fmt.Errorf("%w, %v", ErrCannotSendToStream, err)) + e.HTTPCode = apiErr.APIError().Code + e.Info = apiErr.APIError().Description + e.Wrap(err) + return e } - return eventmesh.HTTPPublishResult{Status: http.StatusNoContent}, nil + return common.ErrInternalBackendError } // eventToNATSMsg translates cloud event into the NATS Msg. @@ -135,5 +151,5 @@ func (s *Sender) getJsSubjectToPublish(subject string) string { } func (s *Sender) namedLogger() *zap.SugaredLogger { - return s.logger.WithContext().Named(jestreamHandlerName).With("backend", natsBackend, "jetstream enabled", true) + return s.logger.WithContext().Named(handlerName).With("backend", natsBackend, "jetstream enabled", true) } diff --git a/pkg/sender/jetstream/jetstream_test.go b/pkg/sender/jetstream/jetstream_test.go index 3cc530b..9d629f2 100644 --- a/pkg/sender/jetstream/jetstream_test.go +++ b/pkg/sender/jetstream/jetstream_test.go @@ -4,14 +4,13 @@ import ( "context" "encoding/json" "fmt" - "net/http" "testing" "time" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" - "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" + "github.com/stretchr/testify/require" "github.com/cloudevents/sdk-go/v2/event" @@ -22,7 +21,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" testingutils "github.com/kyma-project/kyma/components/event-publisher-proxy/testing" ) @@ -39,14 +37,14 @@ func TestJetStreamMessageSender(t *testing.T) { name: "send in jetstream mode should not succeed if stream doesn't exist", givenStream: false, givenNATSConnectionClosed: false, - wantErr: sender.ErrBackendTargetNotFound, + wantErr: ErrCannotSendToStream, }, { name: "send in jetstream mode should not succeed if stream is full", givenStream: true, givenStreamMaxBytes: 1, givenNATSConnectionClosed: false, - wantErr: sender.ErrInsufficientStorage, + wantErr: ErrNoSpaceLeftOnDevice, }, { name: "send in jetstream mode should succeed if NATS connection is open and the stream exists", @@ -54,7 +52,6 @@ func TestJetStreamMessageSender(t *testing.T) { givenStreamMaxBytes: 5000, givenNATSConnectionClosed: false, wantErr: nil, - wantStatusCode: http.StatusNoContent, }, { name: "send in jetstream mode should fail if NATS connection is not open", @@ -92,15 +89,12 @@ func TestJetStreamMessageSender(t *testing.T) { } // act - status, err := sender.Send(ctx, ce) + err := sender.Send(ctx, ce) testEnv.Logger.WithContext().Errorf("err: %v", err) // assert assert.ErrorIs(t, err, tc.wantErr) - if tc.wantErr == nil { - assert.Equal(t, tc.wantStatusCode, status.HTTPStatus()) - } }) } } diff --git a/pkg/sender/sender.go b/pkg/sender/sender.go index 3a86d8a..b1e9c60 100644 --- a/pkg/sender/sender.go +++ b/pkg/sender/sender.go @@ -2,24 +2,17 @@ package sender import ( "context" - "errors" "github.com/cloudevents/sdk-go/v2/event" ) -var ( - ErrInsufficientStorage = errors.New("insufficient storage on backend") - ErrBackendTargetNotFound = errors.New("publishing target on backend not found") - ErrNoConnection = errors.New("no connection to backend") - ErrInternalBackendError = errors.New("internal error on backend") -) - type GenericSender interface { - Send(context.Context, *event.Event) (PublishResult, error) + Send(context.Context, *event.Event) PublishError URL() string } -type PublishResult interface { - HTTPStatus() int - ResponseBody() []byte +type PublishError interface { + error + Code() int + Message() string } From 1d16237d74c04f6728d32c90b7cac945eb7fa1a0 Mon Sep 17 00:00:00 2001 From: Carina Kothe <69976260+grischperl@users.noreply.github.com> Date: Mon, 17 Jul 2023 13:57:51 +0200 Subject: [PATCH 185/194] Bump DependaBot PRs (#17835) * Bump DependaBot PRs * Image bump --- go.mod | 3 ++- go.sum | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 7f76323..1c97668 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230605123955-9a13db476af1 - github.com/nats-io/nats-server/v2 v2.9.19 + github.com/nats-io/nats-server/v2 v2.9.20 github.com/nats-io/nats.go v1.27.1 github.com/onsi/gomega v1.27.8 github.com/pkg/errors v0.9.1 @@ -69,6 +69,7 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect go.uber.org/atomic v1.10.0 // indirect + go.uber.org/automaxprocs v1.5.1 // indirect go.uber.org/multierr v1.8.0 // indirect golang.org/x/crypto v0.11.0 // indirect golang.org/x/net v0.12.0 // indirect diff --git a/go.sum b/go.sum index d040167..84eb76d 100644 --- a/go.sum +++ b/go.sum @@ -262,6 +262,8 @@ github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4= github.com/nats-io/jwt/v2 v2.4.1/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI= github.com/nats-io/nats-server/v2 v2.9.19 h1:OF9jSKZGo425C/FcVVIvNgpd36CUe7aVTTXEZRJk6kA= github.com/nats-io/nats-server/v2 v2.9.19/go.mod h1:aTb/xtLCGKhfTFLxP591CMWfkdgBmcUUSkiSOe5A3gw= +github.com/nats-io/nats-server/v2 v2.9.20 h1:bt1dW6xsL1hWWwv7Hovm+EJt5L6iplyqlgEFkoEUk0k= +github.com/nats-io/nats-server/v2 v2.9.20/go.mod h1:aTb/xtLCGKhfTFLxP591CMWfkdgBmcUUSkiSOe5A3gw= github.com/nats-io/nats.go v1.27.1 h1:OuYnal9aKVSnOzLQIzf7554OXMCG7KbaTkCSBHRcSoo= github.com/nats-io/nats.go v1.27.1/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= @@ -330,6 +332,8 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk= +go.uber.org/automaxprocs v1.5.1/go.mod h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= From f9f7f81307ad2f4bf7dced3779814ef22b77c529 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Fri, 21 Jul 2023 09:52:28 +0200 Subject: [PATCH 186/194] expose health status as metric (#17839) * add health status as metric * bump images * update metrics documentation * fix comments * fix comments --- cmd/event-publisher-proxy/main.go | 1 + pkg/metrics/collector.go | 32 ++++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/cmd/event-publisher-proxy/main.go b/cmd/event-publisher-proxy/main.go index 372d8f4..d4174ac 100644 --- a/cmd/event-publisher-proxy/main.go +++ b/cmd/event-publisher-proxy/main.go @@ -58,6 +58,7 @@ func main() { // metrics collector metricsCollector := metrics.NewCollector(latency.NewBucketsProvider()) prometheus.MustRegister(metricsCollector) + metricsCollector.SetHealthStatus(true) // Instantiate configured commander. var c commander.Commander diff --git a/pkg/metrics/collector.go b/pkg/metrics/collector.go index de9c0d1..e89713c 100644 --- a/pkg/metrics/collector.go +++ b/pkg/metrics/collector.go @@ -13,9 +13,14 @@ import ( ) const ( - // BackendLatencyKey name of the backendLatencyHelp metric. + // HealthKey name of the health metric. + HealthKey = "eventing_epp_health" + // HealthHelp help text for the Health metric. + healthHelp = "The current health of the system. `1` indicates a healthy system" + + // BackendLatencyKey name of the backendLatency metric. BackendLatencyKey = "eventing_epp_backend_duration_milliseconds" - // backendLatencyHelp help text for the backendLatencyHelp metric. + // backendLatencyHelp help text for the backendLatency metric. backendLatencyHelp = "The duration of sending events to the messaging server in milliseconds" // durationKey name of the duration metric. @@ -66,6 +71,8 @@ type Collector struct { requests *prometheus.CounterVec eventType *prometheus.CounterVec + + health *prometheus.GaugeVec } // NewCollector creates a new instance of Collector. @@ -102,7 +109,15 @@ func NewCollector(latency histogram.BucketsProvider) *Collector { Name: RequestsKey, Help: requestsHelp, }, - []string{responseCodeLabel, methodLabel, pathLabel}), + []string{responseCodeLabel, methodLabel, pathLabel}, + ), + health: prometheus.NewGaugeVec( + prometheus.GaugeOpts{ + Name: HealthKey, + Help: healthHelp, + }, + nil, + ), } } @@ -112,6 +127,7 @@ func (c *Collector) Describe(ch chan<- *prometheus.Desc) { c.eventType.Describe(ch) c.requests.Describe(ch) c.duration.Describe(ch) + c.health.Describe(ch) } // Collect implements the prometheus.Collector interface Collect method. @@ -120,6 +136,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) { c.eventType.Collect(ch) c.requests.Collect(ch) c.duration.Collect(ch) + c.health.Collect(ch) } // RecordLatency records a backendLatencyHelp metric. @@ -127,6 +144,15 @@ func (c *Collector) RecordBackendLatency(duration time.Duration, statusCode int, c.backendLatency.WithLabelValues(fmt.Sprint(statusCode), destSvc).Observe(float64(duration.Milliseconds())) } +// SetHealthStatus updates the health metric. +func (c *Collector) SetHealthStatus(healthy bool) { + var v float64 + if healthy { + v = 1 + } + c.health.WithLabelValues().Set(v) +} + // RecordEventType records an eventType metric. func (c *Collector) RecordEventType(eventType, eventSource string, statusCode int) { c.eventType.WithLabelValues(eventType, eventSource, fmt.Sprint(statusCode)).Inc() From 93d56e7283d7519ab6ff933bd73a1ce636ff6f18 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 10:47:12 +0200 Subject: [PATCH 187/194] docker(deps): bump kyma-project/prod/external/golang from 1.20.5-alpine3.18 to 1.20.6-alpine3.18 in /components/event-publisher-proxy (#17904) * docker(deps): bump kyma-project/prod/external/golang Bumps kyma-project/prod/external/golang from 1.20.5-alpine3.18 to 1.20.6-alpine3.18. --- updated-dependencies: - dependency-name: kyma-project/prod/external/golang dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Update values.yaml * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Friedrich --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 18f8f66..9e729c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM europe-docker.pkg.dev/kyma-project/prod/external/golang:1.20.5-alpine3.18 as builder +FROM europe-docker.pkg.dev/kyma-project/prod/external/golang:1.20.6-alpine3.18 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy From 11c26263f57f1c1e75a0650e972dc31ba063eaf6 Mon Sep 17 00:00:00 2001 From: Carina Kothe <69976260+grischperl@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:47:02 +0200 Subject: [PATCH 188/194] Bump dependabot prs (#18100) * Bump dependabot prs * vendor packages * Undo unwanted change * Image bump --- go.mod | 14 ++++++-------- go.sum | 35 +++++++++++++++-------------------- 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index 1c97668..563ee31 100644 --- a/go.mod +++ b/go.mod @@ -9,14 +9,14 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230605123955-9a13db476af1 - github.com/nats-io/nats-server/v2 v2.9.20 - github.com/nats-io/nats.go v1.27.1 - github.com/onsi/gomega v1.27.8 + github.com/nats-io/nats-server/v2 v2.9.21 + github.com/nats-io/nats.go v1.28.0 + github.com/onsi/gomega v1.27.10 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.16.0 github.com/stretchr/testify v1.8.4 go.opencensus.io v0.24.0 - go.uber.org/zap v1.24.0 + go.uber.org/zap v1.25.0 golang.org/x/oauth2 v0.10.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 k8s.io/api v0.27.3 @@ -50,7 +50,7 @@ require ( github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.16.7 // indirect github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect @@ -68,9 +68,7 @@ require ( github.com/prometheus/procfs v0.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/automaxprocs v1.5.1 // indirect - go.uber.org/multierr v1.8.0 // indirect + go.uber.org/multierr v1.10.0 // indirect golang.org/x/crypto v0.11.0 // indirect golang.org/x/net v0.12.0 // indirect golang.org/x/sys v0.10.0 // indirect diff --git a/go.sum b/go.sum index 84eb76d..dc6411b 100644 --- a/go.sum +++ b/go.sum @@ -53,8 +53,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/avast/retry-go/v3 v3.1.1 h1:49Scxf4v8PmiQ/nY0aY3p0hDueqSmc7++cBbtiDGu2g= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= @@ -223,8 +223,8 @@ github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dv github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -260,12 +260,10 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4= github.com/nats-io/jwt/v2 v2.4.1/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI= -github.com/nats-io/nats-server/v2 v2.9.19 h1:OF9jSKZGo425C/FcVVIvNgpd36CUe7aVTTXEZRJk6kA= -github.com/nats-io/nats-server/v2 v2.9.19/go.mod h1:aTb/xtLCGKhfTFLxP591CMWfkdgBmcUUSkiSOe5A3gw= -github.com/nats-io/nats-server/v2 v2.9.20 h1:bt1dW6xsL1hWWwv7Hovm+EJt5L6iplyqlgEFkoEUk0k= -github.com/nats-io/nats-server/v2 v2.9.20/go.mod h1:aTb/xtLCGKhfTFLxP591CMWfkdgBmcUUSkiSOe5A3gw= -github.com/nats-io/nats.go v1.27.1 h1:OuYnal9aKVSnOzLQIzf7554OXMCG7KbaTkCSBHRcSoo= -github.com/nats-io/nats.go v1.27.1/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= +github.com/nats-io/nats-server/v2 v2.9.21 h1:2TBTh0UDE74eNXQmV4HofsmRSCiVN0TH2Wgrp6BD6fk= +github.com/nats-io/nats-server/v2 v2.9.21/go.mod h1:ozqMZc2vTHcNcblOiXMWIXkf8+0lDGAi5wQcG+O1mHU= +github.com/nats-io/nats.go v1.28.0 h1:Th4G6zdsz2d0OqXdfzKLClo6bOfoI/b1kInhRtFIy5c= +github.com/nats-io/nats.go v1.28.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -274,9 +272,9 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.9.7 h1:06xGQy5www2oN160RtEZoTvnP2sPhEfePYmCDc2szss= -github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= -github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= +github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -331,17 +329,14 @@ go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk= -go.uber.org/automaxprocs v1.5.1/go.mod h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= +go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= +go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= +go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -580,7 +575,7 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= +golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From eb7dd1823bb7b737ba8605e15351820e199fcb27 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 14:21:03 +0200 Subject: [PATCH 189/194] gomod(deps): bump github.com/nats-io/nats-server/v2 from 2.9.21 to 2.10.1 in /components/event-publisher-proxy (#18210) * gomod(deps): bump github.com/nats-io/nats-server/v2 Bumps [github.com/nats-io/nats-server/v2](https://github.com/nats-io/nats-server) from 2.9.21 to 2.10.1. - [Release notes](https://github.com/nats-io/nats-server/releases) - [Changelog](https://github.com/nats-io/nats-server/blob/main/.goreleaser.yml) - [Commits](https://github.com/nats-io/nats-server/compare/v2.9.21...v2.10.1) --- updated-dependencies: - dependency-name: github.com/nats-io/nats-server/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mansur Uralov --- go.mod | 18 +++++++++--------- go.sum | 37 +++++++++++++++++++------------------ 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index 563ee31..c72024b 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/kelseyhightower/envconfig v1.4.0 github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230605123955-9a13db476af1 - github.com/nats-io/nats-server/v2 v2.9.21 - github.com/nats-io/nats.go v1.28.0 + github.com/nats-io/nats-server/v2 v2.10.1 + github.com/nats-io/nats.go v1.29.0 github.com/onsi/gomega v1.27.10 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.16.0 @@ -50,7 +50,7 @@ require ( github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.16.7 // indirect + github.com/klauspost/compress v1.17.0 // indirect github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 // indirect github.com/mailru/easyjson v0.7.6 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect @@ -59,8 +59,8 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/nats-io/jwt/v2 v2.4.1 // indirect - github.com/nats-io/nkeys v0.4.4 // indirect + github.com/nats-io/jwt/v2 v2.5.2 // indirect + github.com/nats-io/nkeys v0.4.5 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect @@ -69,11 +69,11 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.11.0 // indirect + golang.org/x/crypto v0.13.0 // indirect golang.org/x/net v0.12.0 // indirect - golang.org/x/sys v0.10.0 // indirect - golang.org/x/term v0.10.0 // indirect - golang.org/x/text v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/term v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index dc6411b..c1b3768 100644 --- a/go.sum +++ b/go.sum @@ -223,8 +223,8 @@ github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dv github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= -github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= +github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -258,14 +258,14 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt/v2 v2.4.1 h1:Y35W1dgbbz2SQUYDPCaclXcuqleVmpbRa7646Jf2EX4= -github.com/nats-io/jwt/v2 v2.4.1/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI= -github.com/nats-io/nats-server/v2 v2.9.21 h1:2TBTh0UDE74eNXQmV4HofsmRSCiVN0TH2Wgrp6BD6fk= -github.com/nats-io/nats-server/v2 v2.9.21/go.mod h1:ozqMZc2vTHcNcblOiXMWIXkf8+0lDGAi5wQcG+O1mHU= -github.com/nats-io/nats.go v1.28.0 h1:Th4G6zdsz2d0OqXdfzKLClo6bOfoI/b1kInhRtFIy5c= -github.com/nats-io/nats.go v1.28.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= -github.com/nats-io/nkeys v0.4.4 h1:xvBJ8d69TznjcQl9t6//Q5xXuVhyYiSos6RPtvQNTwA= -github.com/nats-io/nkeys v0.4.4/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= +github.com/nats-io/jwt/v2 v2.5.2 h1:DhGH+nKt+wIkDxM6qnVSKjokq5t59AZV5HRcFW0zJwU= +github.com/nats-io/jwt/v2 v2.5.2/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI= +github.com/nats-io/nats-server/v2 v2.10.1 h1:MIJ614dhOIdo71iSzY8ln78miXwrYvlvXHUyS+XdKZQ= +github.com/nats-io/nats-server/v2 v2.10.1/go.mod h1:3PMvMSu2cuK0J9YInRLWdFpFsswKKGUS77zVSAudRto= +github.com/nats-io/nats.go v1.29.0 h1:dSXZ+SZeGyTdHVYeXimeq12FsIpb9dM8CJ2IZFiHcyE= +github.com/nats-io/nats.go v1.29.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= +github.com/nats-io/nkeys v0.4.5 h1:Zdz2BUlFm4fJlierwvGK+yl20IAKUm7eV6AAZXEhkPk= +github.com/nats-io/nkeys v0.4.5/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= @@ -342,8 +342,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -354,6 +354,7 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -499,12 +500,12 @@ golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= -golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= +golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -514,8 +515,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= From 21b126a6e7d3f5ab255ef5cebb4bbc4f58720757 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 18:54:59 +0200 Subject: [PATCH 190/194] gomod(deps): bump go.uber.org/zap from 1.25.0 to 1.26.0 in /components/event-publisher-proxy (#18179) * gomod(deps): bump go.uber.org/zap in /components/event-publisher-proxy Bumps [go.uber.org/zap](https://github.com/uber-go/zap) from 1.25.0 to 1.26.0. - [Release notes](https://github.com/uber-go/zap/releases) - [Changelog](https://github.com/uber-go/zap/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/zap/compare/v1.25.0...v1.26.0) --- updated-dependencies: - dependency-name: go.uber.org/zap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update values.yaml --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mansur Uralov --- go.mod | 2 +- go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index c72024b..f321c26 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/prometheus/client_golang v1.16.0 github.com/stretchr/testify v1.8.4 go.opencensus.io v0.24.0 - go.uber.org/zap v1.25.0 + go.uber.org/zap v1.26.0 golang.org/x/oauth2 v0.10.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 k8s.io/api v0.27.3 diff --git a/go.sum b/go.sum index c1b3768..7dbe071 100644 --- a/go.sum +++ b/go.sum @@ -54,7 +54,6 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdko github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/avast/retry-go/v3 v3.1.1 h1:49Scxf4v8PmiQ/nY0aY3p0hDueqSmc7++cBbtiDGu2g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= @@ -335,8 +334,8 @@ go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9i go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= -go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= +go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= +go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= From b0bd82fc2e68a51c2b071924e87904ea0e57d90d Mon Sep 17 00:00:00 2001 From: Muhammad Faizan Date: Thu, 5 Oct 2023 12:29:14 +0200 Subject: [PATCH 191/194] Added ENV flag to disable Application CR lister (#18259) * Added ENV flag to disable Application CR lister * added tests * image bump --- pkg/cloudevents/builder/generic.go | 17 +- pkg/cloudevents/builder/generic_test.go | 67 +++--- pkg/cloudevents/builder/types.go | 2 +- pkg/cloudevents/eventtype/clean.go | 19 +- pkg/cloudevents/eventtype/clean_test.go | 286 +++++++++++++----------- pkg/commander/eventmesh/eventmesh.go | 10 +- pkg/commander/nats/nats.go | 10 +- pkg/env/eventmesh_config.go | 3 +- pkg/env/nats_config.go | 13 +- pkg/legacy/legacy.go | 23 +- pkg/legacy/legacy_test.go | 90 +++++--- 11 files changed, 321 insertions(+), 219 deletions(-) diff --git a/pkg/cloudevents/builder/generic.go b/pkg/cloudevents/builder/generic.go index 71ff161..ae09129 100644 --- a/pkg/cloudevents/builder/generic.go +++ b/pkg/cloudevents/builder/generic.go @@ -30,6 +30,10 @@ func NewGenericBuilder(typePrefix string, cleaner cleaner.Cleaner, applicationLi } } +func (gb *GenericBuilder) isApplicationListerEnabled() bool { + return gb.applicationLister != nil +} + func (gb *GenericBuilder) Build(event cev2event.Event) (*cev2event.Event, error) { // format logger namedLogger := gb.namedLogger(event.Source(), event.Type()) @@ -77,12 +81,15 @@ func (gb *GenericBuilder) getFinalSubject(source, eventType string) string { // GetAppNameOrSource returns the application name if exists, otherwise returns source name. func (gb *GenericBuilder) GetAppNameOrSource(source string, namedLogger *zap.SugaredLogger) string { var appName = source - if appObj, err := gb.applicationLister.Get(source); err == nil && appObj != nil { - appName = application.GetTypeOrName(appObj) - namedLogger.With("application", source).Debug("Using application name: %s as source.", appName) - } else { - namedLogger.With("application", source).Debug("Cannot find application.") + if gb.isApplicationListerEnabled() { + if appObj, err := gb.applicationLister.Get(source); err == nil && appObj != nil { + appName = application.GetTypeOrName(appObj) + namedLogger.With("application", source).Debug("Using application name: %s as source.", appName) + } else { + namedLogger.With("application", source).Debug("Cannot find application.") + } } + return appName } diff --git a/pkg/cloudevents/builder/generic_test.go b/pkg/cloudevents/builder/generic_test.go index 6bf8388..31d63f7 100644 --- a/pkg/cloudevents/builder/generic_test.go +++ b/pkg/cloudevents/builder/generic_test.go @@ -149,38 +149,51 @@ func Test_GetAppNameOrSource(t *testing.T) { } testCases := []struct { - name string - givenApplicationName string - givenApplicationLabels map[string]string - givenSource string - wantSource string + name string + givenApplicationName string + givenApplicationLabels map[string]string + givenSource string + givenApplicationListerEnabled bool + wantSource string }{ { - name: "should return application name instead of source name", - givenSource: "appName1", - givenApplicationName: "appName1", - wantSource: "appName1", + name: "should return application name instead of source name", + givenSource: "appName1", + givenApplicationName: "appName1", + givenApplicationListerEnabled: true, + wantSource: "appName1", }, { - name: "should return application label instead of source name or app name", - givenSource: "appName1", - givenApplicationName: "appName1", - givenApplicationLabels: map[string]string{application.TypeLabel: "testapptype"}, - wantSource: "testapptype", + name: "should return application label instead of source name or app name", + givenSource: "appName1", + givenApplicationName: "appName1", + givenApplicationListerEnabled: true, + givenApplicationLabels: map[string]string{application.TypeLabel: "testapptype"}, + wantSource: "testapptype", }, { - name: "should return non-clean application label", - givenSource: "appName1", - givenApplicationName: "appName1", - givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, - wantSource: "t..e--s__t!!a@@p##p%%t^^y&&p**e", + name: "should return non-clean application label", + givenSource: "appName1", + givenApplicationName: "appName1", + givenApplicationListerEnabled: true, + givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, + wantSource: "t..e--s__t!!a@@p##p%%t^^y&&p**e", }, { - name: "should return source name as application does not exists", - givenSource: "noapp1", - givenApplicationName: "appName1", - givenApplicationLabels: map[string]string{application.TypeLabel: "testapptype"}, - wantSource: "noapp1", + name: "should return source name as application does not exists", + givenSource: "noapp1", + givenApplicationName: "appName1", + givenApplicationListerEnabled: true, + givenApplicationLabels: map[string]string{application.TypeLabel: "testapptype"}, + wantSource: "noapp1", + }, + { + name: "should return source name when application lister is disabled", + givenSource: "appName1", + givenApplicationName: "appName1", + givenApplicationListerEnabled: false, + givenApplicationLabels: map[string]string{application.TypeLabel: "testapptype"}, + wantSource: "appName1", }, } for _, testCase := range testCases { @@ -189,7 +202,11 @@ func Test_GetAppNameOrSource(t *testing.T) { t.Parallel() app := applicationtest.NewApplication(tc.givenApplicationName, tc.givenApplicationLabels) - appLister := fake.NewApplicationListerOrDie(context.Background(), app) + + var appLister *application.Lister + if tc.givenApplicationListerEnabled { + appLister = fake.NewApplicationListerOrDie(context.Background(), app) + } genericBuilder := &GenericBuilder{ applicationLister: appLister, diff --git a/pkg/cloudevents/builder/types.go b/pkg/cloudevents/builder/types.go index 06e8ff4..f2764df 100644 --- a/pkg/cloudevents/builder/types.go +++ b/pkg/cloudevents/builder/types.go @@ -17,7 +17,7 @@ type CloudEventBuilder interface { type GenericBuilder struct { typePrefix string - applicationLister *application.Lister + applicationLister *application.Lister // applicationLister will be nil when disabled. cleaner cleaner.Cleaner logger *logger.Logger } diff --git a/pkg/cloudevents/eventtype/clean.go b/pkg/cloudevents/eventtype/clean.go index bc40fa5..43c4959 100644 --- a/pkg/cloudevents/eventtype/clean.go +++ b/pkg/cloudevents/eventtype/clean.go @@ -28,7 +28,7 @@ type Cleaner interface { type cleaner struct { eventTypePrefix string - applicationLister *application.Lister + applicationLister *application.Lister // applicationLister will be nil when disabled. logger *logger.Logger } @@ -39,6 +39,10 @@ func NewCleaner(eventTypePrefix string, applicationLister *application.Lister, l return &cleaner{eventTypePrefix: eventTypePrefix, applicationLister: applicationLister, logger: logger} } +func (c *cleaner) isApplicationListerEnabled() bool { + return c.applicationLister != nil +} + // Clean cleans the event-type from none-alphanumeric characters and returns it // or returns an error if the event-type parsing failed. func (c *cleaner) Clean(eventType string) (string, error) { @@ -51,12 +55,13 @@ func (c *cleaner) Clean(eventType string) (string, error) { } // clean the application name - var eventTypeClean string - if appObj, err := c.applicationLister.Get(appName); err != nil { - namedLogger.With("application", appName).Debug("Cannot find application") - eventTypeClean = build(c.eventTypePrefix, application.GetCleanName(appName), event, version) - } else { - eventTypeClean = build(c.eventTypePrefix, application.GetCleanTypeOrName(appObj), event, version) + eventTypeClean := build(c.eventTypePrefix, application.GetCleanName(appName), event, version) + if c.isApplicationListerEnabled() { + if appObj, err := c.applicationLister.Get(appName); err == nil { + eventTypeClean = build(c.eventTypePrefix, application.GetCleanTypeOrName(appObj), event, version) + } else { + namedLogger.With("application", appName).Debug("Cannot find application") + } } // clean the event-type segments diff --git a/pkg/cloudevents/eventtype/clean_test.go b/pkg/cloudevents/eventtype/clean_test.go index 7ce6bde..90b6edb 100644 --- a/pkg/cloudevents/eventtype/clean_test.go +++ b/pkg/cloudevents/eventtype/clean_test.go @@ -17,145 +17,172 @@ import ( func TestCleaner(t *testing.T) { t.Parallel() testCases := []struct { - name string - givenEventTypePrefix string - givenApplicationName string - givenApplicationLabels map[string]string - givenEventType string - wantEventType string - wantError bool + name string + givenEventTypePrefix string + givenApplicationName string + givenApplicationLabels map[string]string + givenApplicationListerEnabled bool + givenEventType string + wantEventType string + wantError bool }{ // valid even-types for existing applications { - name: "success if prefix is empty", - givenEventTypePrefix: "", - givenApplicationName: "testapp", - givenEventType: "testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", - wantEventType: "testapp.Segment1Part1Part2.Segment2Part1Part2.v1", - wantError: false, - }, - { - name: "success if the given application name is clean", - givenEventTypePrefix: "prefix", - givenApplicationName: "testapp", - givenEventType: "prefix.testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", - wantEventType: "prefix.testapp.Segment1Part1Part2.Segment2Part1Part2.v1", - wantError: false, - }, - { - name: "success if the given application name is clean and event has more than two segments", - givenEventTypePrefix: "prefix", - givenApplicationName: "testapp", - givenEventType: "prefix.testapp.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", - wantEventType: "prefix.testapp.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", - wantError: false, - }, - { - name: "success if the given application type label is clean", - givenEventTypePrefix: "prefix", - givenApplicationName: "testapp", - givenApplicationLabels: map[string]string{application.TypeLabel: "testapptype"}, - givenEventType: "prefix.testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", - wantEventType: "prefix.testapptype.Segment1Part1Part2.Segment2Part1Part2.v1", - wantError: false, - }, - { - name: "success if the given application type label is clean and event has more than two segments", - givenEventTypePrefix: "prefix", - givenApplicationName: "testapp", - givenApplicationLabels: map[string]string{application.TypeLabel: "testapptype"}, - givenEventType: "prefix.testapp.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", - wantEventType: "prefix.testapptype.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", - wantError: false, - }, - { - name: "success if the given application name needs to be cleaned", - givenEventTypePrefix: "prefix", - givenApplicationName: "te--s__t!!a@@p##p%%", - givenEventType: "prefix.te--s__t!!a@@p##p%%.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", - wantEventType: "prefix.testapp.Segment1Part1Part2.Segment2Part1Part2.v1", - wantError: false, - }, - { - name: "success if the given application name needs to be cleaned and event has more than two segments", - givenEventTypePrefix: "prefix", - givenApplicationName: "te--s__t!!a@@p##p%%", - givenEventType: "prefix.te--s__t!!a@@p##p%%.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", - wantEventType: "prefix.testapp.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", - wantError: false, - }, - { - name: "success if the given application type label needs to be cleaned", - givenEventTypePrefix: "prefix", - givenApplicationName: "te--s__t!!a@@p##p%%", - givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, - givenEventType: "prefix.te--s__t!!a@@p##p%%.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", - wantEventType: "prefix.testapptype.Segment1Part1Part2.Segment2Part1Part2.v1", - wantError: false, - }, - { - name: "success if the given application type label needs to be cleaned and event has more than two segments", - givenEventTypePrefix: "prefix", - givenApplicationName: "te--s__t!!a@@p##p%%", - givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, - givenEventType: "prefix.te--s__t!!a@@p##p%%.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", - wantEventType: "prefix.testapptype.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", - wantError: false, + name: "success if prefix is empty", + givenEventTypePrefix: "", + givenApplicationName: "testapp", + givenApplicationListerEnabled: true, + givenEventType: "testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "testapp.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name is clean", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenApplicationListerEnabled: true, + givenEventType: "prefix.testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name is clean and event has more than two segments", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenApplicationListerEnabled: true, + givenEventType: "prefix.testapp.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application type label is clean", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenApplicationListerEnabled: true, + givenApplicationLabels: map[string]string{application.TypeLabel: "testapptype"}, + givenEventType: "prefix.testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapptype.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application type label is clean and event has more than two segments", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenApplicationListerEnabled: true, + givenApplicationLabels: map[string]string{application.TypeLabel: "testapptype"}, + givenEventType: "prefix.testapp.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapptype.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name needs to be cleaned", + givenEventTypePrefix: "prefix", + givenApplicationName: "te--s__t!!a@@p##p%%", + givenApplicationListerEnabled: true, + givenEventType: "prefix.te--s__t!!a@@p##p%%.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name needs to be cleaned and event has more than two segments", + givenEventTypePrefix: "prefix", + givenApplicationName: "te--s__t!!a@@p##p%%", + givenApplicationListerEnabled: true, + givenEventType: "prefix.te--s__t!!a@@p##p%%.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application type label needs to be cleaned", + givenEventTypePrefix: "prefix", + givenApplicationName: "te--s__t!!a@@p##p%%", + givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, + givenApplicationListerEnabled: true, + givenEventType: "prefix.te--s__t!!a@@p##p%%.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapptype.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application type label needs to be cleaned and event has more than two segments", + givenEventTypePrefix: "prefix", + givenApplicationName: "te--s__t!!a@@p##p%%", + givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, + givenApplicationListerEnabled: true, + givenEventType: "prefix.te--s__t!!a@@p##p%%.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapptype.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", + wantError: false, + }, + { + name: "success if the application lister is disabled", + givenEventTypePrefix: "prefix", + givenApplicationName: "te--s__t!!a@@p##p%%", + givenApplicationLabels: map[string]string{application.TypeLabel: "t..e--s__t!!a@@p##p%%t^^y&&p**e"}, + givenApplicationListerEnabled: false, + givenEventType: "prefix.te--s__t!!a@@p##p%%.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, }, // valid even-types for non-existing applications to simulate in-cluster eventing { - name: "success if the given application name is clean for non-existing application", - givenEventTypePrefix: "prefix", - givenApplicationName: "", - givenEventType: "prefix.test-app.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", - wantEventType: "prefix.testapp.Segment1Part1Part2.Segment2Part1Part2.v1", - wantError: false, - }, - { - name: "success if the given application name is clean for non-existing application and event has more than two segments", - givenEventTypePrefix: "prefix", - givenApplicationName: "", - givenEventType: "prefix.test-app.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", - wantEventType: "prefix.testapp.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", - wantError: false, - }, - { - name: "success if the given application name is not clean for non-existing application", - givenEventTypePrefix: "prefix", - givenApplicationName: "", - givenEventType: "prefix.testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", - wantEventType: "prefix.testapp.Segment1Part1Part2.Segment2Part1Part2.v1", - wantError: false, - }, - { - name: "success if the given application name is not clean for non-existing application and event has more than two segments", - givenEventTypePrefix: "prefix", - givenApplicationName: "", - givenEventType: "prefix.testapp.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", - wantEventType: "prefix.testapp.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", - wantError: false, + name: "success if the given application name is clean for non-existing application", + givenEventTypePrefix: "prefix", + givenApplicationName: "", + givenApplicationListerEnabled: true, + givenEventType: "prefix.test-app.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name is clean for non-existing application and event has more than two segments", + givenEventTypePrefix: "prefix", + givenApplicationName: "", + givenApplicationListerEnabled: true, + givenEventType: "prefix.test-app.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name is not clean for non-existing application", + givenEventTypePrefix: "prefix", + givenApplicationName: "", + givenApplicationListerEnabled: true, + givenEventType: "prefix.testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Part1Part2.Segment2Part1Part2.v1", + wantError: false, + }, + { + name: "success if the given application name is not clean for non-existing application and event has more than two segments", + givenEventTypePrefix: "prefix", + givenApplicationName: "", + givenApplicationListerEnabled: true, + givenEventType: "prefix.testapp.Segment1.Segment2.Segment3.Segment4-Part1-Part2-Ä.Segment5-Part1-Part2-Ä.v1", + wantEventType: "prefix.testapp.Segment1Segment2Segment3Segment4Part1Part2.Segment5Part1Part2.v1", + wantError: false, }, // invalid even-types { - name: "fail if the prefix is invalid", - givenEventTypePrefix: "prefix", - givenApplicationName: "testapp", - givenEventType: "invalid.prefix.testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", - wantError: true, + name: "fail if the prefix is invalid", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenApplicationListerEnabled: true, + givenEventType: "invalid.prefix.testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantError: true, }, { - name: "fail if the prefix is missing", - givenEventTypePrefix: "prefix", - givenApplicationName: "testapp", - givenEventType: "testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", - wantError: true, + name: "fail if the prefix is missing", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenApplicationListerEnabled: true, + givenEventType: "testapp.Segment1-Part1-Part2-Ä.Segment2-Part1-Part2-Ä.v1", + wantError: true, }, { - name: "fail if the event-type is incomplete", - givenEventTypePrefix: "prefix", - givenApplicationName: "testapp", - givenEventType: "prefix.testapp.Segment1-Part1-Part2-Ä.v1", - wantError: true, + name: "fail if the event-type is incomplete", + givenEventTypePrefix: "prefix", + givenApplicationName: "testapp", + givenApplicationListerEnabled: true, + givenEventType: "prefix.testapp.Segment1-Part1-Part2-Ä.v1", + wantError: true, }, } @@ -167,7 +194,12 @@ func TestCleaner(t *testing.T) { t.Run(tc.name, func(t *testing.T) { t.Parallel() app := applicationtest.NewApplication(tc.givenApplicationName, tc.givenApplicationLabels) - appLister := fake.NewApplicationListerOrDie(context.Background(), app) + + var appLister *application.Lister + if tc.givenApplicationListerEnabled { + appLister = fake.NewApplicationListerOrDie(context.Background(), app) + } + cleaner := NewCleaner(tc.givenEventTypePrefix, appLister, mockedLogger) eventType, err := cleaner.Clean(tc.givenEventType) require.Equal(t, tc.wantError, err != nil) diff --git a/pkg/commander/eventmesh/eventmesh.go b/pkg/commander/eventmesh/eventmesh.go index fc2132d..d16ef3e 100644 --- a/pkg/commander/eventmesh/eventmesh.go +++ b/pkg/commander/eventmesh/eventmesh.go @@ -87,8 +87,14 @@ func (c *Commander) Start() error { k8sConfig := config.GetConfigOrDie() // setup application lister - dynamicClient := dynamic.NewForConfigOrDie(k8sConfig) - applicationLister := application.NewLister(ctx, dynamicClient) + var applicationLister *application.Lister + if c.envCfg.ApplicationCRDEnabled { + dynamicClient := dynamic.NewForConfigOrDie(k8sConfig) + applicationLister = application.NewLister(ctx, dynamicClient) + c.namedLogger().Info("Application CR lister is enabled!") + } else { + c.namedLogger().Info("Application CR lister is disabled!") + } // configure legacyTransformer legacyTransformer := legacy.NewTransformer( diff --git a/pkg/commander/nats/nats.go b/pkg/commander/nats/nats.go index e49e173..965ac13 100644 --- a/pkg/commander/nats/nats.go +++ b/pkg/commander/nats/nats.go @@ -95,8 +95,14 @@ func (c *Commander) Start() error { k8sConfig := config.GetConfigOrDie() // setup application lister - dynamicClient := dynamic.NewForConfigOrDie(k8sConfig) - applicationLister := application.NewLister(ctx, dynamicClient) + var applicationLister *application.Lister + if c.envCfg.ApplicationCRDEnabled { + dynamicClient := dynamic.NewForConfigOrDie(k8sConfig) + applicationLister = application.NewLister(ctx, dynamicClient) + c.namedLogger().Info("Application CR lister is enabled!") + } else { + c.namedLogger().Info("Application CR lister is disabled!") + } // configure legacyTransformer legacyTransformer := legacy.NewTransformer( diff --git a/pkg/env/eventmesh_config.go b/pkg/env/eventmesh_config.go index b03c03c..4c058f9 100644 --- a/pkg/env/eventmesh_config.go +++ b/pkg/env/eventmesh_config.go @@ -23,7 +23,8 @@ type EventMeshConfig struct { EventMeshNamespace string `envconfig:"BEB_NAMESPACE" required:"true"` // EventTypePrefix is the prefix of each event as per the eventing specification. // It follows the eventType format: ... - EventTypePrefix string `envconfig:"EVENT_TYPE_PREFIX" default:""` + EventTypePrefix string `envconfig:"EVENT_TYPE_PREFIX" default:""` + ApplicationCRDEnabled bool `envconfig:"APPLICATION_CRD_ENABLED" default:"true"` } // ConfigureTransport receives an HTTP transport and configure its max idle connection properties. diff --git a/pkg/env/nats_config.go b/pkg/env/nats_config.go index 89a7660..671b0b6 100644 --- a/pkg/env/nats_config.go +++ b/pkg/env/nats_config.go @@ -12,12 +12,13 @@ const JetStreamSubjectPrefix = "kyma" // NATSConfig represents the environment config for the Event Publisher to NATS. type NATSConfig struct { - Port int `envconfig:"INGRESS_PORT" default:"8080"` - URL string `envconfig:"NATS_URL" required:"true"` - RetryOnFailedConnect bool `envconfig:"RETRY_ON_FAILED_CONNECT" default:"true"` - MaxReconnects int `envconfig:"MAX_RECONNECTS" default:"-1"` // Negative means keep try reconnecting. - ReconnectWait time.Duration `envconfig:"RECONNECT_WAIT" default:"5s"` - RequestTimeout time.Duration `envconfig:"REQUEST_TIMEOUT" default:"5s"` + Port int `envconfig:"INGRESS_PORT" default:"8080"` + URL string `envconfig:"NATS_URL" required:"true"` + RetryOnFailedConnect bool `envconfig:"RETRY_ON_FAILED_CONNECT" default:"true"` + MaxReconnects int `envconfig:"MAX_RECONNECTS" default:"-1"` // Negative means keep try reconnecting. + ReconnectWait time.Duration `envconfig:"RECONNECT_WAIT" default:"5s"` + RequestTimeout time.Duration `envconfig:"REQUEST_TIMEOUT" default:"5s"` + ApplicationCRDEnabled bool `envconfig:"APPLICATION_CRD_ENABLED" default:"true"` // Legacy Namespace is used as the event source for legacy events LegacyNamespace string `envconfig:"LEGACY_NAMESPACE" default:"kyma"` diff --git a/pkg/legacy/legacy.go b/pkg/legacy/legacy.go index 73d6f4c..793e6cf 100644 --- a/pkg/legacy/legacy.go +++ b/pkg/legacy/legacy.go @@ -37,7 +37,7 @@ type RequestToCETransformer interface { type Transformer struct { eventMeshNamespace string eventTypePrefix string - applicationLister *application.Lister + applicationLister *application.Lister // applicationLister will be nil when disabled. } func NewTransformer(bebNamespace string, eventTypePrefix string, applicationLister *application.Lister) *Transformer { @@ -48,6 +48,10 @@ func NewTransformer(bebNamespace string, eventTypePrefix string, applicationList } } +func (t *Transformer) isApplicationListerEnabled() bool { + return t.applicationLister != nil +} + // CheckParameters validates the parameters in the request and sends error responses if found invalid. func (t *Transformer) checkParameters(parameters *apiv1.PublishEventParametersV1) (response *apiv1.PublishEventResponses) { if parameters == nil { @@ -121,14 +125,17 @@ func (t *Transformer) ExtractPublishRequestData(request *http.Request) (*apiv1.P // WriteLegacyRequestsToCE transforms the legacy event to cloudevent from the given request. // It also returns the original event-type without cleanup as the second return type. func (t *Transformer) WriteLegacyRequestsToCE(writer http.ResponseWriter, publishData *apiv1.PublishRequestData) (*cev2.Event, string) { + uncleanedAppName := publishData.ApplicationName + // clean the application name form non-alphanumeric characters - appName := publishData.ApplicationName - if appObj, err := t.applicationLister.Get(appName); err == nil { - // handle existing applications - appName = application.GetCleanTypeOrName(appObj) - } else { - // handle non-existing applications - appName = application.GetCleanName(appName) + // handle non-existing applications + appName := application.GetCleanName(uncleanedAppName) + // check if we need to use name from application CR. + if t.isApplicationListerEnabled() { + if appObj, err := t.applicationLister.Get(uncleanedAppName); err == nil { + // handle existing applications + appName = application.GetCleanTypeOrName(appObj) + } } event, err := t.convertPublishRequestToCloudEvent(appName, publishData.PublishEventParameters) diff --git a/pkg/legacy/legacy_test.go b/pkg/legacy/legacy_test.go index dd3d495..d428edd 100644 --- a/pkg/legacy/legacy_test.go +++ b/pkg/legacy/legacy_test.go @@ -46,48 +46,63 @@ func TestTransformLegacyRequestsToCE(t *testing.T) { // derived from that a legacy event path (a.k.a. endpoint) has the structure // http://:///events // e.g. http://localhost:8081/varkestest/v1/events - givenPrefix string - givenApplication string - givenTypeLabel string - givenEventName string - wantVersion string - wantType string + givenPrefix string + givenApplication string + givenTypeLabel string + givenApplicationListerEnabled bool + givenEventName string + wantVersion string + wantType string }{ { - name: "clean", - givenPrefix: "pre1.pre2.pre3", - givenApplication: "app", - givenTypeLabel: "", - givenEventName: "object.do", - wantVersion: "v1", - wantType: "pre1.pre2.pre3.app.object.do.v1", + name: "clean", + givenPrefix: "pre1.pre2.pre3", + givenApplication: "app", + givenTypeLabel: "", + givenApplicationListerEnabled: true, + givenEventName: "object.do", + wantVersion: "v1", + wantType: "pre1.pre2.pre3.app.object.do.v1", }, { - name: "not clean app name", - givenPrefix: "pre1.pre2.pre3", - givenApplication: "no-app", - givenTypeLabel: "", - givenEventName: "object.do", - wantVersion: "v1", - wantType: "pre1.pre2.pre3.noapp.object.do.v1", + name: "not clean app name", + givenPrefix: "pre1.pre2.pre3", + givenApplication: "no-app", + givenTypeLabel: "", + givenApplicationListerEnabled: true, + givenEventName: "object.do", + wantVersion: "v1", + wantType: "pre1.pre2.pre3.noapp.object.do.v1", }, { - name: "event name too many segments", - givenPrefix: "pre1.pre2.pre3", - givenApplication: "app", - givenTypeLabel: "", - givenEventName: "too.many.dots.object.do", - wantVersion: "v1", - wantType: "pre1.pre2.pre3.app.toomanydotsobject.do.v1", + name: "event name too many segments", + givenPrefix: "pre1.pre2.pre3", + givenApplication: "app", + givenTypeLabel: "", + givenApplicationListerEnabled: true, + givenEventName: "too.many.dots.object.do", + wantVersion: "v1", + wantType: "pre1.pre2.pre3.app.toomanydotsobject.do.v1", }, { - name: "with event type label", - givenPrefix: "pre1.pre2.pre3", - givenApplication: "app", - givenTypeLabel: "different", - givenEventName: "object.do", - wantVersion: "v1", - wantType: "pre1.pre2.pre3.different.object.do.v1", + name: "with event type label", + givenPrefix: "pre1.pre2.pre3", + givenApplication: "app", + givenTypeLabel: "different", + givenApplicationListerEnabled: true, + givenEventName: "object.do", + wantVersion: "v1", + wantType: "pre1.pre2.pre3.different.object.do.v1", + }, + { + name: "with application lister disabled", + givenPrefix: "pre1.pre2.pre3", + givenApplication: "app", + givenTypeLabel: "different", + givenApplicationListerEnabled: false, + givenEventName: "object.do", + wantVersion: "v1", + wantType: "pre1.pre2.pre3.app.object.do.v1", }, } @@ -104,7 +119,12 @@ func TestTransformLegacyRequestsToCE(t *testing.T) { writer := httptest.NewRecorder() app := applicationtest.NewApplication(tc.givenApplication, applicationTypeLabel(tc.givenTypeLabel)) - appLister := fake.NewApplicationListerOrDie(ctx, app) + + var appLister *application.Lister + if tc.givenApplicationListerEnabled { + appLister = fake.NewApplicationListerOrDie(ctx, app) + } + transformer := NewTransformer("test", tc.givenPrefix, appLister) publishData, errResp, _ := transformer.ExtractPublishRequestData(request) assert.Nil(t, errResp) From 6c4c0089cae2a58108e0aa71fce258dfd0e02dd0 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Tue, 17 Oct 2023 13:54:59 +0200 Subject: [PATCH 192/194] simplify readiness check for event-publisher-proxy (#18307) * dont-deploy-epp-without-nats * bump image * undo bump image of ec * change to disconnected * simplify * reenable nats --- pkg/sender/jetstream/health.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pkg/sender/jetstream/health.go b/pkg/sender/jetstream/health.go index 15c481b..9f337b5 100644 --- a/pkg/sender/jetstream/health.go +++ b/pkg/sender/jetstream/health.go @@ -3,8 +3,6 @@ package jetstream import ( "net/http" - "github.com/nats-io/nats.go" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" ) @@ -12,11 +10,6 @@ import ( // It checks the NATS server connection status and reports 2XX if connected, otherwise reports 5XX. // It panics if the given NATS Handler is nil. func (s *Sender) ReadinessCheck(w http.ResponseWriter, _ *http.Request) { - if status := s.ConnectionStatus(); status != nats.CONNECTED { - s.namedLogger().Error("Readiness check failed: not connected to nats server") - w.WriteHeader(health.StatusCodeNotHealthy) - return - } w.WriteHeader(health.StatusCodeHealthy) } From 6a3c6f74a3d5bfa46548d6c5d66efd3d3955c992 Mon Sep 17 00:00:00 2001 From: Korbinian Stoemmer Date: Wed, 18 Oct 2023 21:42:57 +0200 Subject: [PATCH 193/194] rename metric to eventing_epp_requests_duration_seconds and adjust buckets (#18301) * rename metric to eventing_epp_requests_duration_milliseconds and adjust buckets * fix lint * fix buckets and test * fix lint job * bump images --- pkg/handler/handler.go | 2 +- pkg/metrics/collector.go | 11 ++--- pkg/metrics/collector_test.go | 78 +++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 6 deletions(-) diff --git a/pkg/handler/handler.go b/pkg/handler/handler.go index 20e1da5..673c94c 100644 --- a/pkg/handler/handler.go +++ b/pkg/handler/handler.go @@ -8,6 +8,7 @@ import ( "time" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy/api" @@ -24,7 +25,6 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler/health" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/legacy" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/options" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/receiver" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender" diff --git a/pkg/metrics/collector.go b/pkg/metrics/collector.go index e89713c..29f42fd 100644 --- a/pkg/metrics/collector.go +++ b/pkg/metrics/collector.go @@ -24,7 +24,7 @@ const ( backendLatencyHelp = "The duration of sending events to the messaging server in milliseconds" // durationKey name of the duration metric. - durationKey = "eventing_epp_requests_duration_milliseconds" + durationKey = "eventing_epp_requests_duration_seconds" // durationHelp help text for the duration metric. durationHelp = "The duration of processing an incoming request (includes sending to the backend)" @@ -95,12 +95,13 @@ func NewCollector(latency histogram.BucketsProvider) *Collector { []string{eventTypeLabel, eventSourceLabel, responseCodeLabel}, ), - //nolint:promlinter // we follow the same pattern as istio. so a millisecond unit if fine here duration: prometheus.NewHistogramVec( prometheus.HistogramOpts{ - Name: durationKey, - Help: durationHelp, - Buckets: latency.Buckets(), + Name: durationKey, + Help: durationHelp, + Buckets: []float64{0.001, 0.002, 0.004, 0.008, 0.016, 0.032, 0.050, 0.075, + 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, + 1, 1.5, 2, 3, 5}, }, []string{responseCodeLabel, methodLabel, pathLabel}, ), diff --git a/pkg/metrics/collector_test.go b/pkg/metrics/collector_test.go index 9ad4d67..ab90fb2 100644 --- a/pkg/metrics/collector_test.go +++ b/pkg/metrics/collector_test.go @@ -1,11 +1,18 @@ package metrics import ( + "net/http" + "net/http/httptest" + "strings" "testing" + "time" + "github.com/gorilla/mux" + "github.com/prometheus/client_golang/prometheus/testutil" "github.com/stretchr/testify/assert" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/histogram/mocks" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/metrics/latency" ) func TestNewCollector(t *testing.T) { @@ -24,3 +31,74 @@ func TestNewCollector(t *testing.T) { assert.NotNil(t, collector.eventType.MetricVec) latency.AssertExpectations(t) } + +func TestCollector_MetricsMiddleware(t *testing.T) { + router := mux.NewRouter() + c := NewCollector(latency.BucketsProvider{}) + router.Use(c.MetricsMiddleware()) + router.HandleFunc("/test", func(writer http.ResponseWriter, request *http.Request) { + time.Sleep(6 * time.Millisecond) + writer.WriteHeader(http.StatusOK) + }) + srv := httptest.NewServer(router) + defer srv.Close() + http.Get(srv.URL + "/test") //nolint: errcheck // this call never fails as it is a testserver + //nolint: lll // prometheus tef follows + tef := ` + # HELP eventing_epp_requests_duration_seconds The duration of processing an incoming request (includes sending to the backend) + # TYPE eventing_epp_requests_duration_seconds histogram + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.001"} 0 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.002"} 0 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.004"} 0 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.008"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.016"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.032"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.05"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.075"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.1"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.15"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.2"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.25"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.3"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.35"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.4"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.45"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.5"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.6"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.7"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.8"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="0.9"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="1"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="1.5"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="2"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="3"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="5"} 1 + eventing_epp_requests_duration_seconds_bucket{code="200",method="get",path="/test",le="+Inf"} 1 + eventing_epp_requests_duration_seconds_sum{code="200",method="get",path="/test"} 0.006837792 + eventing_epp_requests_duration_seconds_count{code="200",method="get",path="/test"} 1 + # HELP eventing_epp_requests_total The total number of requests + # TYPE eventing_epp_requests_total counter + eventing_epp_requests_total{code="200",method="get",path="/test"} 1 +` + if err := ignoreErr(testutil.CollectAndCompare(c, strings.NewReader(tef)), + "eventing_epp_requests_duration_seconds_sum"); err != nil { + t.Fatalf("%v", err) + } +} + +// Hack to filter out validation of the sum calculated by the metric. +func ignoreErr(err error, metric string) error { + for _, line := range strings.Split(err.Error(), "\n") { + if line == "--- metric output does not match expectation; want" || line == "+++ got:" { + continue + } + if strings.HasPrefix(strings.TrimSpace(line), "+") || + strings.HasPrefix(strings.TrimSpace(line), "-") { + if !(strings.HasPrefix(strings.TrimSpace(line), "+"+metric) || + strings.HasPrefix(strings.TrimSpace(line), "-"+metric)) { + return err + } + } + } + return nil +} From da5c8d3ce05599c4966beee2d991e5d2f0463334 Mon Sep 17 00:00:00 2001 From: Friedrich Date: Wed, 25 Oct 2023 11:55:31 +0200 Subject: [PATCH 194/194] Dependency bump epp (#18344) * Bump golang in Dockerfile. * Bump golang version in module. * Bump eventing-controller * Remove replace for k8s modules. * Code quality. * Bump remaining dependencies. * Replace interface{} with any. --- Dockerfile | 2 +- go.mod | 105 ++--- go.sum | 668 +++++---------------------- pkg/commander/eventmesh/eventmesh.go | 25 +- pkg/commander/nats/nats.go | 26 +- pkg/handler/handler_v1alpha1_test.go | 4 +- pkg/legacy/api/types.go | 3 +- pkg/legacy/error_responses.go | 4 +- pkg/signals/signals.go | 2 +- pkg/tracing/helpers_test.go | 6 +- 10 files changed, 198 insertions(+), 647 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9e729c5..61a5c87 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM europe-docker.pkg.dev/kyma-project/prod/external/golang:1.20.6-alpine3.18 as builder +FROM europe-docker.pkg.dev/kyma-project/prod/external/golang:1.21.3-alpine3.18 as builder ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/event-publisher-proxy diff --git a/go.mod b/go.mod index f321c26..d9b1e14 100644 --- a/go.mod +++ b/go.mod @@ -1,59 +1,56 @@ module github.com/kyma-project/kyma/components/event-publisher-proxy -go 1.20 +go 1.21 require ( github.com/cloudevents/sdk-go/v2 v2.14.0 - github.com/google/uuid v1.3.0 + github.com/google/uuid v1.3.1 github.com/gorilla/mux v1.8.0 github.com/kelseyhightower/envconfig v1.4.0 - github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 - github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230605123955-9a13db476af1 - github.com/nats-io/nats-server/v2 v2.10.1 - github.com/nats-io/nats.go v1.29.0 - github.com/onsi/gomega v1.27.10 + github.com/kyma-project/kyma/components/application-operator v0.0.0-20230127165033-ec8e43477eca + github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20231023131930-0990d091c639 + github.com/nats-io/nats-server/v2 v2.10.3 + github.com/nats-io/nats.go v1.31.0 + github.com/onsi/gomega v1.28.1 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.16.0 + github.com/prometheus/client_golang v1.17.0 github.com/stretchr/testify v1.8.4 go.opencensus.io v0.24.0 go.uber.org/zap v1.26.0 - golang.org/x/oauth2 v0.10.0 - golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 - k8s.io/api v0.27.3 - k8s.io/apimachinery v0.27.3 - k8s.io/client-go v0.27.3 - sigs.k8s.io/controller-runtime v0.13.1 + golang.org/x/oauth2 v0.13.0 + golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 + k8s.io/api v0.28.3 + k8s.io/apimachinery v0.28.3 + k8s.io/client-go v0.28.3 + sigs.k8s.io/controller-runtime v0.16.3 ) require ( - cloud.google.com/go v0.97.0 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful/v3 v3.8.0 // indirect - github.com/evanphx/json-patch v4.12.0+incompatible // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.6.0 // indirect - github.com/fsnotify/fsnotify v1.5.4 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-logr/logr v1.2.4 // indirect - github.com/go-logr/zapr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.5 // indirect - github.com/go-openapi/swag v0.19.14 // indirect + github.com/go-logr/zapr v1.2.4 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/google/gofuzz v1.1.0 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/gofuzz v1.2.0 // indirect github.com/imdario/mergo v0.3.12 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.0 // indirect - github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 // indirect - github.com/mailru/easyjson v0.7.6 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/kyma-project/kyma/common/logging v0.0.0-20231020092259-d58329d50da1 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -63,43 +60,33 @@ require ( github.com/nats-io/nkeys v0.4.5 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_model v0.3.0 // indirect - github.com/prometheus/common v0.37.0 // indirect - github.com/prometheus/procfs v0.8.0 // indirect + github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.0 // indirect - go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.13.0 // indirect - golang.org/x/net v0.12.0 // indirect - golang.org/x/sys v0.12.0 // indirect - golang.org/x/term v0.12.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.14.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect + golang.org/x/net v0.17.0 // indirect + golang.org/x/sys v0.13.0 // indirect + golang.org/x/term v0.13.0 // indirect golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect - gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect - google.golang.org/appengine v1.6.7 // indirect + gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect + google.golang.org/appengine v1.6.8 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiextensions-apiserver v0.25.0 // indirect - k8s.io/component-base v0.25.11 // indirect - k8s.io/klog/v2 v2.80.1 // indirect - k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 // indirect - k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect - sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect + k8s.io/apiextensions-apiserver v0.28.3 // indirect + k8s.io/component-base v0.28.3 // indirect + k8s.io/klog/v2 v2.100.1 // indirect + k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) -replace ( - // keep all following packages at the same version - k8s.io/api => k8s.io/api v0.25.11 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.25.11 - k8s.io/apimachinery => k8s.io/apimachinery v0.25.11 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.25.11 - k8s.io/client-go => k8s.io/client-go v0.25.11 - k8s.io/component-base => k8s.io/component-base v0.25.11 - k8s.io/kubectl => k8s.io/kubectl v0.25.11 -) - replace github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.14.0 diff --git a/go.sum b/go.sum index 7dbe071..691e680 100644 --- a/go.sum +++ b/go.sum @@ -1,223 +1,97 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0 h1:3DXvAyifywvq64LfkKaMOmkWPS1CikIQdMe2lY9vxU8= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/avast/retry-go/v3 v3.1.1 h1:49Scxf4v8PmiQ/nY0aY3p0hDueqSmc7++cBbtiDGu2g= +github.com/avast/retry-go/v3 v3.1.1/go.mod h1:6cXRK369RpzFL3UQGqIUp9Q7GDrams+KsYWrfNA1/nQ= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudevents/sdk-go/v2 v2.14.0 h1:Nrob4FwVgi5L4tV9lhjzZcjYqFVyJzsA56CwPaPfv6s= github.com/cloudevents/sdk-go/v2 v2.14.0/go.mod h1:xDmKfzNjM8gBvjaF8ijFjM1VYOVUEeUfapHMUX1T5To= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/emicklei/go-restful/v3 v3.8.0 h1:eCZ8ulSerjdAiaNpF7GxXIE7ZCMo1moN1qX+S609eVw= -github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= -github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= +github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= -github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= -github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= +github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/gnostic v0.5.7-v3refs h1:FhTMOKj2VhjpouxvWJAV1TL304uMlb9zcDqkl6cEI54= -github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= +github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -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/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -225,26 +99,25 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kyma-incubator/api-gateway v0.0.0-20220819093753-296e6704d413 h1:Np4jOrlYMJcgklgrvVwXWfFMCtlg06SDAaxk9SIX7xE= -github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455 h1:7CVA4isawiebZGBPeaRwFyxNLb36ZWgmfiSpJSUgI+c= -github.com/kyma-project/kyma/common/logging v0.0.0-20221118103320-ffe096ff3455/go.mod h1:oXoP77o6Am2IWp8wDS3jaA1gGWLrcaO6gLWyDZbAkJs= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455 h1:XxhNPU8Z1eknyepGqg21ajEisuTeknKydHiZ6m5Qp3k= -github.com/kyma-project/kyma/components/application-operator v0.0.0-20221118103320-ffe096ff3455/go.mod h1:18VKkunC8gEMKAIX3/64rXDq3XNk82CfHQ2G1kZPSQM= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230605123955-9a13db476af1 h1:n1hh/o2ku8VLGG50rnjwCYkJPcQzs2xCDg9awLf4NB8= -github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20230605123955-9a13db476af1/go.mod h1:DmZjh7+uHPR7uI72TESY9mpwuIgLNmBm4YdiDIALt3k= -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.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= -github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/kyma-project/api-gateway v0.0.0-20231020123059-319383e7e6e5 h1:9ycfI/VSV9kj7jbheCzRs8+bfCZ8KENjZrJuz+citjA= +github.com/kyma-project/api-gateway v0.0.0-20231020123059-319383e7e6e5/go.mod h1:ZMaRPv9fLs1rUlKMOjsdNh6B4R6aALVqypeQam6mqBg= +github.com/kyma-project/kyma/common/logging v0.0.0-20231020092259-d58329d50da1 h1:Lur/R654ghUmsZiNrSrQBDjxCAvkb/7CueB0X/VQbKg= +github.com/kyma-project/kyma/common/logging v0.0.0-20231020092259-d58329d50da1/go.mod h1:JGb5RBi8Uz+RZ/jf54+qA+RqY6uPQBJ8pO1w3KSwm1Q= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20230127165033-ec8e43477eca h1:7UpCIk6+sMCOhPfolAlppRugSln5M4T8/dHJm8x0erc= +github.com/kyma-project/kyma/components/application-operator v0.0.0-20230127165033-ec8e43477eca/go.mod h1:Tog02gZ1VT7yvFmhSqmiuGZpDYt18zTF4kr6E0N9ttk= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20231023131930-0990d091c639 h1:50OACQOQhG1KheBrBI3fT7iXKnc13bHX32CWiH4P60A= +github.com/kyma-project/kyma/components/eventing-controller v0.0.0-20231023131930-0990d091c639/go.mod h1:sE1dyneTNw8RyyDsl1KSS+9rhMRcaZ2nE8JfwuOOGAw= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= @@ -256,24 +129,24 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nats-io/jwt/v2 v2.5.2 h1:DhGH+nKt+wIkDxM6qnVSKjokq5t59AZV5HRcFW0zJwU= github.com/nats-io/jwt/v2 v2.5.2/go.mod h1:24BeQtRwxRV8ruvC4CojXlx/WQ/VjuwlYiH+vu/+ibI= -github.com/nats-io/nats-server/v2 v2.10.1 h1:MIJ614dhOIdo71iSzY8ln78miXwrYvlvXHUyS+XdKZQ= -github.com/nats-io/nats-server/v2 v2.10.1/go.mod h1:3PMvMSu2cuK0J9YInRLWdFpFsswKKGUS77zVSAudRto= -github.com/nats-io/nats.go v1.29.0 h1:dSXZ+SZeGyTdHVYeXimeq12FsIpb9dM8CJ2IZFiHcyE= -github.com/nats-io/nats.go v1.29.0/go.mod h1:XpbWUlOElGwTYbMR7imivs7jJj9GtK7ypv321Wp6pjc= +github.com/nats-io/nats-server/v2 v2.10.3 h1:nk2QVLpJUh3/AhZCJlQdTfj2oeLDvWnn1Z6XzGlNFm0= +github.com/nats-io/nats-server/v2 v2.10.3/go.mod h1:lzrskZ/4gyMAh+/66cCd+q74c6v7muBypzfWhP/MAaM= +github.com/nats-io/nats.go v1.31.0 h1:/WFBHEc/dOKBF6qf1TZhrdEfTmOZ5JzdJ+Y3m6Y/p7E= +github.com/nats-io/nats.go v1.31.0/go.mod h1:di3Bm5MLsoB4Bx61CBTsxuarI36WbhAwOm8QrW39+i8= github.com/nats-io/nkeys v0.4.5 h1:Zdz2BUlFm4fJlierwvGK+yl20IAKUm7eV6AAZXEhkPk= github.com/nats-io/nkeys v0.4.5/go.mod h1:XUkxdLPTufzlihbamfzQ7mw/VGx6ObUs+0bN5sNvt64= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/gomega v1.28.1 h1:MijcGUbfYuznzK/5R4CPNoUP/9Xvuo20sXfEm6XxoTA= +github.com/onsi/gomega v1.28.1/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -282,28 +155,21 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= -github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= -github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -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/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= +github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -311,397 +177,125 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ= -go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= -golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= +golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 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= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/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= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= +gomodules.xyz/jsonpatch/v2 v2.4.0 h1:Ci3iUJyx9UeRx7CeFN8ARgGbkESwJK+KB9lLcWxY/Zw= +gomodules.xyz/jsonpatch/v2 v2.4.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -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/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= +google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -710,67 +304,49 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 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-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.25.11 h1:4mjYDfE3yp22jrytjH0knwgzjXKkxHX4D01ZCAazvZM= -k8s.io/api v0.25.11/go.mod h1:bK4UvD4bthtutNlvensrfBX21PRQ/vs2cIYggHkOOAo= -k8s.io/apiextensions-apiserver v0.25.11 h1:qZY0kCt0tW3QHPKcogp3k4zrlZhe9f8H6EJOr7sNRbA= -k8s.io/apiextensions-apiserver v0.25.11/go.mod h1:wsXndE5H00YrPUF/H6KuuNwW2VyYKnKsh8/R9eq4KMs= -k8s.io/apimachinery v0.25.11 h1:2EhfdrSAMvBxsswvOGCEymKk4ZnHZkranuZqdR0rsO4= -k8s.io/apimachinery v0.25.11/go.mod h1:IFwbcNi3gKkfDhuy0VYu3+BwbxbiIov3p6FR8ge1Epc= -k8s.io/client-go v0.25.11 h1:DJQ141UsbNRI6wYSlcYLP5J5BW5Wq7Bgm42Ztq2SW70= -k8s.io/client-go v0.25.11/go.mod h1:41Xs7p1SfhoReUnmjjYCfCNWFiq4xSkexwJfbxF2F7A= -k8s.io/component-base v0.25.11 h1:3QmISCE9n9CJkVpTA4spQO1IZCrLlOwbKdzSN9dqZZA= -k8s.io/component-base v0.25.11/go.mod h1:wFR4pfB+xTc6FBak+RoWRNeTmelGE4XWJP/xVOvn3vM= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1 h1:MQ8BAZPZlWk3S9K4a9NCkIFQtZShWqoha7snGixVgEA= -k8s.io/kube-openapi v0.0.0-20220803162953-67bda5d908f1/go.mod h1:C/N6wCaBHeBHkHUesQOQy2/MZqGgMAFPqGsGQLdbZBU= -k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4= -k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/controller-runtime v0.13.1 h1:tUsRCSJVM1QQOOeViGeX3GMT3dQF1eePPw6sEE3xSlg= -sigs.k8s.io/controller-runtime v0.13.1/go.mod h1:Zbz+el8Yg31jubvAEyglRZGdLAjplZl+PgtYNI6WNTI= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= -sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +k8s.io/api v0.28.3 h1:Gj1HtbSdB4P08C8rs9AR94MfSGpRhJgsS+GF9V26xMM= +k8s.io/api v0.28.3/go.mod h1:MRCV/jr1dW87/qJnZ57U5Pak65LGmQVkKTzf3AtKFHc= +k8s.io/apiextensions-apiserver v0.28.3 h1:Od7DEnhXHnHPZG+W9I97/fSQkVpVPQx2diy+2EtmY08= +k8s.io/apiextensions-apiserver v0.28.3/go.mod h1:NE1XJZ4On0hS11aWWJUTNkmVB03j9LM7gJSisbRt8Lc= +k8s.io/apimachinery v0.28.3 h1:B1wYx8txOaCQG0HmYF6nbpU8dg6HvA06x5tEffvOe7A= +k8s.io/apimachinery v0.28.3/go.mod h1:uQTKmIqs+rAYaq+DFaoD2X7pcjLOqbQX2AOiO0nIpb8= +k8s.io/client-go v0.28.3 h1:2OqNb72ZuTZPKCl+4gTKvqao0AMOl9f3o2ijbAj3LI4= +k8s.io/client-go v0.28.3/go.mod h1:LTykbBp9gsA7SwqirlCXBWtK0guzfhpoW4qSm7i9dxo= +k8s.io/component-base v0.28.3 h1:rDy68eHKxq/80RiMb2Ld/tbH8uAE75JdCqJyi6lXMzI= +k8s.io/component-base v0.28.3/go.mod h1:fDJ6vpVNSk6cRo5wmDa6eKIG7UlIQkaFmZN2fYgIUD8= +k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= +k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= +k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4= +sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/structured-merge-diff/v4 v4.3.0 h1:UZbZAZfX0wV2zr7YZorDz6GXROfDFj6LvqCRm4VUVKk= +sigs.k8s.io/structured-merge-diff/v4 v4.3.0/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/pkg/commander/eventmesh/eventmesh.go b/pkg/commander/eventmesh/eventmesh.go index d16ef3e..7664b13 100644 --- a/pkg/commander/eventmesh/eventmesh.go +++ b/pkg/commander/eventmesh/eventmesh.go @@ -3,21 +3,9 @@ package eventmesh import ( "context" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" - - "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" - "k8s.io/client-go/tools/cache" - "github.com/kelseyhightower/envconfig" - "golang.org/x/xerrors" - - "github.com/kyma-project/kyma/components/eventing-controller/logger" - "go.uber.org/zap" - "k8s.io/client-go/dynamic" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only used in a development setup - "sigs.k8s.io/controller-runtime/pkg/client/config" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" @@ -31,6 +19,14 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/eventmesh" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" + + "go.uber.org/zap" + "golang.org/x/xerrors" + "k8s.io/client-go/dynamic" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only used in a development setup + "sigs.k8s.io/controller-runtime/pkg/client/config" ) const ( @@ -105,8 +101,7 @@ func (c *Commander) Start() error { // Configure Subscription Lister subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig) - var subLister cache.GenericLister - subLister = subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() + subLister := subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() subscribedProcessor := &subscribed.Processor{ SubscriptionLister: &subLister, Prefix: c.envCfg.EventTypePrefix, diff --git a/pkg/commander/nats/nats.go b/pkg/commander/nats/nats.go index 965ac13..4343e49 100644 --- a/pkg/commander/nats/nats.go +++ b/pkg/commander/nats/nats.go @@ -3,22 +3,9 @@ package nats import ( "context" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" - - "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" - "k8s.io/client-go/tools/cache" - "github.com/kelseyhightower/envconfig" - "golang.org/x/xerrors" - - "github.com/kyma-project/kyma/components/eventing-controller/logger" - "go.uber.org/zap" - - "k8s.io/client-go/dynamic" - _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only required in a dev setup - "sigs.k8s.io/controller-runtime/pkg/client/config" - "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/application" + "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/builder" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/cloudevents/eventtype" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/env" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/handler" @@ -31,6 +18,14 @@ import ( "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/sender/jetstream" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/signals" "github.com/kyma-project/kyma/components/event-publisher-proxy/pkg/subscribed" + "github.com/kyma-project/kyma/components/eventing-controller/logger" + "github.com/kyma-project/kyma/components/eventing-controller/pkg/backend/cleaner" + + "go.uber.org/zap" + "golang.org/x/xerrors" + "k8s.io/client-go/dynamic" + _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" // TODO: remove as this is only required in a dev setup + "sigs.k8s.io/controller-runtime/pkg/client/config" ) const ( @@ -113,8 +108,7 @@ func (c *Commander) Start() error { // configure Subscription Lister subDynamicSharedInfFactory := subscribed.GenerateSubscriptionInfFactory(k8sConfig) - var subLister cache.GenericLister - subLister = subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() + subLister := subDynamicSharedInfFactory.ForResource(subscribed.GVR).Lister() subscribedProcessor := &subscribed.Processor{ SubscriptionLister: &subLister, Prefix: c.envCfg.ToConfig().EventTypePrefix, diff --git a/pkg/handler/handler_v1alpha1_test.go b/pkg/handler/handler_v1alpha1_test.go index 5031bbc..ea640e0 100644 --- a/pkg/handler/handler_v1alpha1_test.go +++ b/pkg/handler/handler_v1alpha1_test.go @@ -570,7 +570,7 @@ func TestHandler_sendEventAndRecordMetrics_TracingAndDefaults(t *testing.T) { for _, v := range headers { header.Add(v, v) } - expectedExtensions := map[string]interface{}{ + expectedExtensions := map[string]any{ "traceparent": "traceparent", "b3traceid": "X-B3-TraceId", "b3parentspanid": "X-B3-ParentSpanId", @@ -595,7 +595,7 @@ func CreateCloudEvent(t *testing.T) *cev2event.Event { err := json.Unmarshal([]byte(payload), &newEvent) assert.NoError(t, err) newEvent.SetType(testingutils.CloudEventTypeWithPrefix) - err = newEvent.SetData("", map[string]interface{}{"foo": "bar"}) + err = newEvent.SetData("", map[string]any{"foo": "bar"}) assert.NoError(t, err) return &newEvent diff --git a/pkg/legacy/api/types.go b/pkg/legacy/api/types.go index de05395..dad8dfe 100644 --- a/pkg/legacy/api/types.go +++ b/pkg/legacy/api/types.go @@ -3,8 +3,7 @@ package api import "net/http" // AnyValue implements the service definition of AnyValue. -type AnyValue interface { -} +type AnyValue any // PublishRequestData holds request data. type PublishRequestData struct { diff --git a/pkg/legacy/error_responses.go b/pkg/legacy/error_responses.go index 7e618b3..ce5e9b4 100644 --- a/pkg/legacy/error_responses.go +++ b/pkg/legacy/error_responses.go @@ -80,7 +80,7 @@ func ErrorResponse(status int, err error) *api.PublishEventResponses { } // CreateMissingFieldError creates an error for a missing field. -func CreateMissingFieldError(field interface{}) *api.PublishEventResponses { +func CreateMissingFieldError(field any) *api.PublishEventResponses { apiErrorDetail := api.ErrorDetail{ Field: field.(string), Type: ErrorTypeMissingField, @@ -99,7 +99,7 @@ func CreateMissingFieldError(field interface{}) *api.PublishEventResponses { } // CreateInvalidFieldError creates an error for an invalid field. -func CreateInvalidFieldError(field interface{}) *api.PublishEventResponses { +func CreateInvalidFieldError(field any) *api.PublishEventResponses { apiErrorDetail := api.ErrorDetail{ Field: field.(string), Type: ErrorTypeInvalidField, diff --git a/pkg/signals/signals.go b/pkg/signals/signals.go index f6e8c0e..6877765 100644 --- a/pkg/signals/signals.go +++ b/pkg/signals/signals.go @@ -77,6 +77,6 @@ func (scc *signalContext) Err() error { } // Value implements context.Context. -func (scc *signalContext) Value(interface{}) interface{} { +func (scc *signalContext) Value(any) any { return nil } diff --git a/pkg/tracing/helpers_test.go b/pkg/tracing/helpers_test.go index 6e350ac..952a799 100644 --- a/pkg/tracing/helpers_test.go +++ b/pkg/tracing/helpers_test.go @@ -15,7 +15,7 @@ func TestAddTracingContextToCEExtensions(t *testing.T) { testCases := []struct { name string headers http.Header - expectedExtensions map[string]interface{} + expectedExtensions map[string]any }{ { name: "headers with w3c tracing headers", @@ -24,7 +24,7 @@ func TestAddTracingContextToCEExtensions(t *testing.T) { headers.Add(traceParentKey, "traceparent") return headers }(), - expectedExtensions: map[string]interface{}{ + expectedExtensions: map[string]any{ traceParentKey: "traceparent", }, }, { @@ -39,7 +39,7 @@ func TestAddTracingContextToCEExtensions(t *testing.T) { return headers }(), - expectedExtensions: map[string]interface{}{ + expectedExtensions: map[string]any{ b3TraceIDCEExtensionsKey: "traceID", b3ParentSpanIDCEExtensionsKey: "parentspanID", b3SpanIDCEExtensionsKey: "spanID",