From 53640738878e86880635a77dc9cc81646bbc17c2 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Mon, 18 Nov 2024 17:25:04 +0530 Subject: [PATCH 01/23] resolve conflict --- NOTICE.txt | 120 ++++++++++++------ filebeat/input/kafka/config.go | 2 +- filebeat/input/kafka/input.go | 2 +- .../input/kafka/kafka_integration_test.go | 2 +- go.mod | 17 +-- go.sum | 49 ++++--- libbeat/common/kafka/sasl.go | 2 +- libbeat/common/kafka/scram.go | 2 +- libbeat/common/kafka/version.go | 2 +- libbeat/common/kafka/version_test.go | 2 +- libbeat/outputs/kafka/client.go | 2 +- libbeat/outputs/kafka/config.go | 4 +- libbeat/outputs/kafka/kafka.go | 2 +- .../outputs/kafka/kafka_integration_test.go | 2 +- libbeat/outputs/kafka/log.go | 2 +- libbeat/outputs/kafka/message.go | 2 +- libbeat/outputs/kafka/partition.go | 2 +- libbeat/outputs/kafka/partition_test.go | 2 +- metricbeat/module/kafka/broker.go | 2 +- .../consumergroup_integration_test.go | 2 +- .../module/kafka/consumergroup/mock_test.go | 2 +- .../module/kafka/consumergroup/query.go | 2 +- .../module/kafka/partition/partition.go | 2 +- .../partition/partition_integration_test.go | 2 +- 24 files changed, 139 insertions(+), 91 deletions(-) diff --git a/NOTICE.txt b/NOTICE.txt index 415b57dfe68..90fa23a9604 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -2646,6 +2646,40 @@ Contents of probable licence file $GOMODCACHE/github.com/!azure/go-autorest/auto limitations under the License. +-------------------------------------------------------------------------------- +Dependency : github.com/elastic/sarama +Version: v1.19.1-0.20241118045140-603e70e982ce +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/elastic/sarama@v1.19.1-0.20241118045140-603e70e982ce/LICENSE.md: + +# MIT License + +Copyright (c) 2013 Shopify + +Copyright (c) 2023 IBM Corporation + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + -------------------------------------------------------------------------------- Dependency : github.com/Microsoft/go-winio Version: v0.6.2 @@ -2745,36 +2779,6 @@ OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --------------------------------------------------------------------------------- -Dependency : github.com/elastic/sarama -Version: v1.19.1-0.20220310193331-ebc2b0d8eef3 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/elastic/sarama@v1.19.1-0.20220310193331-ebc2b0d8eef3/LICENSE: - -Copyright (c) 2013 Shopify - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -------------------------------------------------------------------------------- Dependency : github.com/StackExchange/wmi Version: v1.2.1 @@ -12880,11 +12884,11 @@ SOFTWARE. -------------------------------------------------------------------------------- Dependency : github.com/eapache/go-resiliency -Version: v1.2.0 +Version: v1.7.0 Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/eapache/go-resiliency@v1.2.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/eapache/go-resiliency@v1.7.0/LICENSE: The MIT License (MIT) @@ -21905,11 +21909,11 @@ THE SOFTWARE. -------------------------------------------------------------------------------- Dependency : github.com/pierrec/lz4/v4 -Version: v4.1.18 +Version: v4.1.21 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/pierrec/lz4/v4@v4.1.18/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/pierrec/lz4/v4@v4.1.21/LICENSE: Copyright (c) 2015, Pierre Curto All rights reserved. @@ -32858,6 +32862,36 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +-------------------------------------------------------------------------------- +Dependency : github.com/Shopify/sarama +Version: v1.27.0 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/!shopify/sarama@v1.27.0/LICENSE: + +Copyright (c) 2013 Shopify + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + -------------------------------------------------------------------------------- Dependency : github.com/Shopify/toxiproxy Version: v2.1.4+incompatible @@ -39130,11 +39164,11 @@ Contents of probable licence file $GOMODCACHE/github.com/docker/go-metrics@v0.0. -------------------------------------------------------------------------------- Dependency : github.com/eapache/go-xerial-snappy -Version: v0.0.0-20180814174437-776d5712da21 +Version: v0.0.0-20230731223053-c322873962e3 Licence type (autodetected): MIT -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/eapache/go-xerial-snappy@v0.0.0-20180814174437-776d5712da21/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/eapache/go-xerial-snappy@v0.0.0-20230731223053-c322873962e3/LICENSE: The MIT License (MIT) @@ -45873,11 +45907,13 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice -------------------------------------------------------------------------------- Dependency : github.com/hashicorp/go-uuid -Version: v1.0.2 +Version: v1.0.3 Licence type (autodetected): MPL-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/hashicorp/go-uuid@v1.0.2/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/hashicorp/go-uuid@v1.0.3/LICENSE: + +Copyright © 2015-2022 HashiCorp, Inc. Mozilla Public License, version 2.0 @@ -47312,11 +47348,11 @@ Contents of probable licence file $GOMODCACHE/github.com/jcmturner/dnsutils/v2@v -------------------------------------------------------------------------------- Dependency : github.com/jcmturner/gofork -Version: v1.0.0 +Version: v1.7.6 Licence type (autodetected): BSD-3-Clause -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/jcmturner/gofork@v1.0.0/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/jcmturner/gofork@v1.7.6/LICENSE: Copyright (c) 2009 The Go Authors. All rights reserved. @@ -47560,11 +47596,11 @@ Contents of probable licence file $GOMODCACHE/github.com/jcmturner/goidentity/v6 -------------------------------------------------------------------------------- Dependency : github.com/jcmturner/gokrb5/v8 -Version: v8.4.2 +Version: v8.4.4 Licence type (autodetected): Apache-2.0 -------------------------------------------------------------------------------- -Contents of probable licence file $GOMODCACHE/github.com/jcmturner/gokrb5/v8@v8.4.2/LICENSE: +Contents of probable licence file $GOMODCACHE/github.com/jcmturner/gokrb5/v8@v8.4.4/LICENSE: Apache License Version 2.0, January 2004 diff --git a/filebeat/input/kafka/config.go b/filebeat/input/kafka/config.go index 107d765344b..833fefbb7d1 100644 --- a/filebeat/input/kafka/config.go +++ b/filebeat/input/kafka/config.go @@ -22,7 +22,7 @@ import ( "fmt" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/elastic/beats/v7/libbeat/common/cfgwarn" "github.com/elastic/beats/v7/libbeat/common/kafka" diff --git a/filebeat/input/kafka/input.go b/filebeat/input/kafka/input.go index e2a04b5fa49..0c750e519e9 100644 --- a/filebeat/input/kafka/input.go +++ b/filebeat/input/kafka/input.go @@ -30,7 +30,7 @@ import ( "github.com/elastic/beats/v7/libbeat/common/atomic" "github.com/elastic/elastic-agent-libs/mapstr" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" input "github.com/elastic/beats/v7/filebeat/input/v2" "github.com/elastic/beats/v7/libbeat/beat" diff --git a/filebeat/input/kafka/kafka_integration_test.go b/filebeat/input/kafka/kafka_integration_test.go index 0728004c16d..60a3077ae7f 100644 --- a/filebeat/input/kafka/kafka_integration_test.go +++ b/filebeat/input/kafka/kafka_integration_test.go @@ -35,7 +35,7 @@ import ( "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/mapstr" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/stretchr/testify/assert" "github.com/elastic/beats/v7/libbeat/beat" diff --git a/go.mod b/go.mod index ebafd4e4ec0..40a19b14854 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/Microsoft/go-winio v0.6.2 github.com/PaesslerAG/gval v1.2.2 github.com/PaesslerAG/jsonpath v0.1.1 - github.com/Shopify/sarama v1.27.0 + github.com/Shopify/sarama v1.27.0 // indirect github.com/StackExchange/wmi v1.2.1 github.com/akavel/rsrc v0.8.0 // indirect github.com/apoydence/eachers v0.0.0-20181020210610-23942921fe77 // indirect @@ -60,7 +60,7 @@ require ( github.com/dop251/goja v0.0.0-20200831102558-9af81ddcf0e1 github.com/dop251/goja_nodejs v0.0.0-20171011081505-adff31b136e6 github.com/dustin/go-humanize v1.0.1 - github.com/eapache/go-resiliency v1.2.0 + github.com/eapache/go-resiliency v1.7.0 github.com/eclipse/paho.mqtt.golang v1.3.5 github.com/elastic/elastic-agent-client/v7 v7.15.0 github.com/elastic/go-concert v0.3.0 @@ -175,6 +175,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0 github.com/Azure/azure-storage-blob-go v0.15.0 github.com/Azure/go-autorest/autorest/adal v0.9.24 + github.com/IBM/sarama v1.43.3 github.com/aerospike/aerospike-client-go/v7 v7.7.1 github.com/apache/arrow/go/v14 v14.0.2 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 @@ -212,7 +213,7 @@ require ( github.com/icholy/digest v0.1.22 github.com/meraki/dashboard-api-go/v3 v3.0.9 github.com/otiai10/copy v1.12.0 - github.com/pierrec/lz4/v4 v4.1.18 + github.com/pierrec/lz4/v4 v4.1.21 github.com/pkg/xattr v0.4.9 github.com/prometheus/prometheus v0.54.1 github.com/shirou/gopsutil/v3 v3.22.10 @@ -281,7 +282,7 @@ require ( github.com/distribution/reference v0.6.0 // indirect github.com/dnephin/pflag v1.0.7 // indirect github.com/docker/go-metrics v0.0.1 // indirect - github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect + github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect github.com/eapache/queue v1.1.0 // indirect github.com/elastic/elastic-transport-go/v8 v8.6.0 // indirect github.com/elastic/go-windows v1.0.2 // indirect @@ -320,14 +321,14 @@ require ( github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect - github.com/hashicorp/go-uuid v1.0.2 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.2.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect - github.com/jcmturner/gofork v1.0.0 // indirect - github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect + github.com/jcmturner/gofork v1.7.6 // indirect + github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect github.com/jcmturner/rpc/v2 v2.0.3 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -415,7 +416,7 @@ require ( replace ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption => github.com/elastic/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption v1.1.0-elastic - github.com/Shopify/sarama => github.com/elastic/sarama v1.19.1-0.20220310193331-ebc2b0d8eef3 + github.com/IBM/sarama => github.com/elastic/sarama v1.19.1-0.20241118045140-603e70e982ce github.com/apoydence/eachers => github.com/poy/eachers v0.0.0-20181020210610-23942921fe77 //indirect, see https://github.com/elastic/beats/pull/29780 for details. github.com/dop251/goja => github.com/elastic/goja v0.0.0-20190128172624-dd2ac4456e20 github.com/fsnotify/fsevents => github.com/elastic/fsevents v0.0.0-20181029231046-e1d381a4d270 diff --git a/go.sum b/go.sum index 56c592bb507..48d5016d5ce 100644 --- a/go.sum +++ b/go.sum @@ -128,6 +128,8 @@ github.com/PaesslerAG/jsonpath v0.1.1 h1:c1/AToHQMVsduPAa4Vh6xp2U0evy4t8SWp8imEs github.com/PaesslerAG/jsonpath v0.1.1/go.mod h1:lVboNxFGal/VwW6d9JzIy56bUsYAP6tH/x80vjnCseY= github.com/PaloAltoNetworks/pango v0.10.2 h1:Tjn6vIzzAq6Dd7N0mDuiP8w8pz8k5W9zz/TTSUQCsQY= github.com/PaloAltoNetworks/pango v0.10.2/go.mod h1:GztcRnVLur7G+VFG7Z5ZKNFgScLtsycwPMp1qVebE5g= +github.com/Shopify/sarama v1.27.0 h1:tqo2zmyzPf1+gwTTwhI6W+EXDw4PVSczynpHKFtVAmo= +github.com/Shopify/sarama v1.27.0/go.mod h1:aCdj6ymI8uyPEux1JJ9gcaDT6cinjGhNCAhs54taSUo= github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= @@ -320,10 +322,12 @@ github.com/dop251/goja_nodejs v0.0.0-20171011081505-adff31b136e6 h1:RrkoB0pT3gnj github.com/dop251/goja_nodejs v0.0.0-20171011081505-adff31b136e6/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/eapache/go-resiliency v1.2.0 h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q= github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw= +github.com/eapache/go-resiliency v1.7.0 h1:n3NRTnBn5N0Cbi/IeOHuQn9s2UwVUH7Ga0ZWcP+9JTA= +github.com/eapache/go-resiliency v1.7.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= +github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/eclipse/paho.mqtt.golang v1.3.5 h1:sWtmgNxYM9P2sP+xEItMozsR3w0cqZFlqnNN1bdl41Y= @@ -391,8 +395,8 @@ github.com/elastic/mock-es v0.0.0-20240712014503-e5b47ece0015 h1:z8cC8GASpPo8yKl github.com/elastic/mock-es v0.0.0-20240712014503-e5b47ece0015/go.mod h1:qH9DX/Dmflz6EAtaks/+2SsdQzecVAKE174Zl66hk7E= github.com/elastic/pkcs8 v1.0.0 h1:HhitlUKxhN288kcNcYkjW6/ouvuwJWd9ioxpjnD9jVA= github.com/elastic/pkcs8 v1.0.0/go.mod h1:ipsZToJfq1MxclVTwpG7U/bgeDtf+0HkUiOxebk95+0= -github.com/elastic/sarama v1.19.1-0.20220310193331-ebc2b0d8eef3 h1:FzA0/n4iMt8ojGDGRoiFPSHFvvdVIvxOxyLtiFnrLBM= -github.com/elastic/sarama v1.19.1-0.20220310193331-ebc2b0d8eef3/go.mod h1:mdtqvCSg8JOxk8PmpTNGyo6wzd4BMm4QXSfDnTXmgkE= +github.com/elastic/sarama v1.19.1-0.20241118045140-603e70e982ce h1:yLX+Tg3d6g1Q/idz8iOpq7pqBZGcIHxACJKBOIHr9NA= +github.com/elastic/sarama v1.19.1-0.20241118045140-603e70e982ce/go.mod h1:FVIRaLrhK3Cla/9FfRF5X9Zua2KpS3SYIXxhac1H+FQ= github.com/elastic/tk-btf v0.1.0 h1:T4rbsnfaRH/MZKSLwZFd3sndt/NexsQb0IXWtMQ9PAA= github.com/elastic/tk-btf v0.1.0/go.mod h1:caLQPEcMbyKmPUQb2AsbX3ZAj1yCz06lOxfhn0esLR8= github.com/elastic/toutoumomoma v0.0.0-20240626215117-76e39db18dfb h1:8SvKmGOYyxKi6jB0nvV1lpxEHfIS6tQ40x1BXBhKMsE= @@ -424,7 +428,7 @@ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8 github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/foxcpp/go-mockdns v0.0.0-20201212160233-ede2f9158d15 h1:nLPjjvpUAODOR6vY/7o0hBIk8iTr19Fvmf8aFx/kC7A= github.com/foxcpp/go-mockdns v0.0.0-20201212160233-ede2f9158d15/go.mod h1:tPg4cp4nseejPd+UKxtCVQ2hUxNTZ7qQZJa7CLriIeo= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/go-asn1-ber/asn1-ber v1.5.5 h1:MNHlNMBDgEKD4TcKr36vQN68BA00aDfjIt3/bD50WnA= @@ -517,7 +521,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.8.3 h1:HR0kYDX2RJZvAup8CsiJwxB4dTCSC0AaUq6S4SiLwUc= @@ -532,6 +536,7 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a 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.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -604,8 +609,9 @@ github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISH github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -627,12 +633,13 @@ github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFK github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= -github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg= +github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= -github.com/jcmturner/gokrb5/v8 v8.4.2 h1:6ZIM6b/JJN0X8UM43ZOM6Z4SJzla+a/u7scXFJzodkA= -github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= +github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8= +github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -665,7 +672,7 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK4= github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= -github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= @@ -675,6 +682,7 @@ github.com/kortschak/utter v1.5.0 h1:1vHGHPZmJ6zU5XbfllIAG3eQBoHT97ePrZJ+pT3RoiQ github.com/kortschak/utter v1.5.0/go.mod h1:vSmSjbyrlKjjsL71193LmzBOKgwePk9DH6uFaWHIInc= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/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= @@ -778,10 +786,11 @@ github.com/otiai10/mint v1.5.1/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAq github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2 h1:CXwSGu/LYmbjEab5aMCs5usQRVBGThelUKBNnoSOuso= github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2/go.mod h1:L3UMQOThbttwfYRNFOWLLVXMhk5Lkio4GGOtw5UrxS0= github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= +github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A= github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= -github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= +github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pierrre/gotestcover v0.0.0-20160517101806-924dca7d15f0 h1:i5VIxp6QB8oWZ8IkK8zrDgeT6ORGIUeiN+61iETwJbI= github.com/pierrre/gotestcover v0.0.0-20160517101806-924dca7d15f0/go.mod h1:4xpMLz7RBWyB+ElzHu8Llua96TRCB3YwX+l5EP1wmHk= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= @@ -821,6 +830,7 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/prometheus v0.54.1 h1:vKuwQNjnYN2/mDoWfHXDhAsz/68q/dQDb+YbcEqU7MQ= github.com/prometheus/prometheus v0.54.1/go.mod h1:xlLByHhk2g3ycakQGrMaU8K7OySZx98BzeCR99991NY= +github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= @@ -868,7 +878,7 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf 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.6.0/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= @@ -904,8 +914,8 @@ github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= -github.com/xdg/scram v1.0.3/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v1.0.3/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= +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/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1002,11 +1012,10 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/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-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -1051,6 +1060,7 @@ golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/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-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200528225125-3c3fba18258b/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-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1058,11 +1068,11 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY 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-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/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/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.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= @@ -1263,6 +1273,7 @@ gopkg.in/yaml.v2 v2.2.8/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-20200601152816-913338de1bd2/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= diff --git a/libbeat/common/kafka/sasl.go b/libbeat/common/kafka/sasl.go index 9a6b3314b8b..dc329e75cb7 100644 --- a/libbeat/common/kafka/sasl.go +++ b/libbeat/common/kafka/sasl.go @@ -21,7 +21,7 @@ import ( "fmt" "strings" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) type SaslConfig struct { diff --git a/libbeat/common/kafka/scram.go b/libbeat/common/kafka/scram.go index e87ed11f756..997fb2e84d3 100644 --- a/libbeat/common/kafka/scram.go +++ b/libbeat/common/kafka/scram.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -// https://github.com/Shopify/sarama/blob/master/examples/sasl_scram_client/scram_client.go +// https://github.com/IBM/sarama/blob/master/examples/sasl_scram_client/scram_client.go package kafka import ( diff --git a/libbeat/common/kafka/version.go b/libbeat/common/kafka/version.go index 3df44b86216..6edcf3b5ef5 100644 --- a/libbeat/common/kafka/version.go +++ b/libbeat/common/kafka/version.go @@ -20,7 +20,7 @@ package kafka import ( "fmt" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) // Version is a kafka version diff --git a/libbeat/common/kafka/version_test.go b/libbeat/common/kafka/version_test.go index 19d5b04ad23..da95477e7c9 100644 --- a/libbeat/common/kafka/version_test.go +++ b/libbeat/common/kafka/version_test.go @@ -20,7 +20,7 @@ package kafka import ( "testing" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" ) func TestVersionGet(t *testing.T) { diff --git a/libbeat/outputs/kafka/client.go b/libbeat/outputs/kafka/client.go index 1780f1392b3..2cc21c0ce2b 100644 --- a/libbeat/outputs/kafka/client.go +++ b/libbeat/outputs/kafka/client.go @@ -26,7 +26,7 @@ import ( "sync/atomic" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/eapache/go-resiliency/breaker" "github.com/elastic/beats/v7/libbeat/common/fmtstr" diff --git a/libbeat/outputs/kafka/config.go b/libbeat/outputs/kafka/config.go index c7dc74ee993..12f5a54826c 100644 --- a/libbeat/outputs/kafka/config.go +++ b/libbeat/outputs/kafka/config.go @@ -25,7 +25,7 @@ import ( "strings" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/elastic/beats/v7/libbeat/common/cfgwarn" "github.com/elastic/beats/v7/libbeat/common/fmtstr" @@ -98,7 +98,7 @@ type metaRetryConfig struct { var compressionModes = map[string]sarama.CompressionCodec{ // As of sarama 1.24.1, zstd support is broken - // (https://github.com/Shopify/sarama/issues/1252), which needs to be + // (https://github.com/IBM/sarama/issues/1252), which needs to be // addressed before we add support here. // (https://github.com/IBM/sarama/pull/1574) sarama version 1.26.0 has diff --git a/libbeat/outputs/kafka/kafka.go b/libbeat/outputs/kafka/kafka.go index e8c0d75aa4d..9523e4d030c 100644 --- a/libbeat/outputs/kafka/kafka.go +++ b/libbeat/outputs/kafka/kafka.go @@ -20,7 +20,7 @@ package kafka import ( "fmt" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/elastic/beats/v7/libbeat/beat" "github.com/elastic/beats/v7/libbeat/outputs" diff --git a/libbeat/outputs/kafka/kafka_integration_test.go b/libbeat/outputs/kafka/kafka_integration_test.go index e9abc559774..b1984427201 100644 --- a/libbeat/outputs/kafka/kafka_integration_test.go +++ b/libbeat/outputs/kafka/kafka_integration_test.go @@ -30,7 +30,7 @@ import ( "testing" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/stretchr/testify/assert" "github.com/elastic/beats/v7/libbeat/beat" diff --git a/libbeat/outputs/kafka/log.go b/libbeat/outputs/kafka/log.go index 2f7bfa94848..91717b53b98 100644 --- a/libbeat/outputs/kafka/log.go +++ b/libbeat/outputs/kafka/log.go @@ -18,7 +18,7 @@ package kafka import ( - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/elastic/elastic-agent-libs/logp" ) diff --git a/libbeat/outputs/kafka/message.go b/libbeat/outputs/kafka/message.go index bf77f32ac25..b3685f032b0 100644 --- a/libbeat/outputs/kafka/message.go +++ b/libbeat/outputs/kafka/message.go @@ -20,7 +20,7 @@ package kafka import ( "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/elastic/beats/v7/libbeat/publisher" ) diff --git a/libbeat/outputs/kafka/partition.go b/libbeat/outputs/kafka/partition.go index 8f56fde53e4..993a085fa3f 100644 --- a/libbeat/outputs/kafka/partition.go +++ b/libbeat/outputs/kafka/partition.go @@ -26,7 +26,7 @@ import ( "math/rand" "strconv" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/logp" diff --git a/libbeat/outputs/kafka/partition_test.go b/libbeat/outputs/kafka/partition_test.go index bebc03f4a44..716a58b1b64 100644 --- a/libbeat/outputs/kafka/partition_test.go +++ b/libbeat/outputs/kafka/partition_test.go @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/stretchr/testify/assert" "github.com/elastic/beats/v7/libbeat/beat" diff --git a/metricbeat/module/kafka/broker.go b/metricbeat/module/kafka/broker.go index 9d504644730..dcc223c5381 100644 --- a/metricbeat/module/kafka/broker.go +++ b/metricbeat/module/kafka/broker.go @@ -26,7 +26,7 @@ import ( "strings" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/elastic/beats/v7/libbeat/common" "github.com/elastic/beats/v7/libbeat/common/kafka" diff --git a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go index aafb5250499..cc09b2f90a8 100644 --- a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go +++ b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go @@ -101,7 +101,7 @@ func startConsumer(t *testing.T, host string, topic string) (io.Closer, error) { config.Net.SASL.User = kafkaSASLConsumerUsername config.Net.SASL.Password = kafkaSASLConsumerPassword // The test panics unless CommitInterval is set due to the following bug in sarama: - // https://github.com/Shopify/sarama/issues/1638 + // https://github.com/IBM/sarama/issues/1638 // To work around the issue we need to set CommitInterval, but now sarama emits // a deprecation warning. config.Consumer.Offsets.CommitInterval = 1 * time.Second diff --git a/metricbeat/module/kafka/consumergroup/mock_test.go b/metricbeat/module/kafka/consumergroup/mock_test.go index e25abf46a07..a1bd975da72 100644 --- a/metricbeat/module/kafka/consumergroup/mock_test.go +++ b/metricbeat/module/kafka/consumergroup/mock_test.go @@ -21,7 +21,7 @@ import ( "fmt" "math/rand" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/elastic/beats/v7/metricbeat/module/kafka" ) diff --git a/metricbeat/module/kafka/consumergroup/query.go b/metricbeat/module/kafka/consumergroup/query.go index 1dc6bdb3c43..a3ac395fe05 100644 --- a/metricbeat/module/kafka/consumergroup/query.go +++ b/metricbeat/module/kafka/consumergroup/query.go @@ -18,7 +18,7 @@ package consumergroup import ( - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/elastic/beats/v7/metricbeat/module/kafka" "github.com/elastic/elastic-agent-libs/logp" diff --git a/metricbeat/module/kafka/partition/partition.go b/metricbeat/module/kafka/partition/partition.go index 486c9a79e24..fe8ea13730e 100644 --- a/metricbeat/module/kafka/partition/partition.go +++ b/metricbeat/module/kafka/partition/partition.go @@ -21,7 +21,7 @@ import ( "errors" "fmt" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/elastic/beats/v7/metricbeat/mb" "github.com/elastic/beats/v7/metricbeat/mb/parse" diff --git a/metricbeat/module/kafka/partition/partition_integration_test.go b/metricbeat/module/kafka/partition/partition_integration_test.go index b9e91b943b9..9034a64d6dc 100644 --- a/metricbeat/module/kafka/partition/partition_integration_test.go +++ b/metricbeat/module/kafka/partition/partition_integration_test.go @@ -26,7 +26,7 @@ import ( "testing" "time" - "github.com/Shopify/sarama" + "github.com/IBM/sarama" "github.com/stretchr/testify/assert" "github.com/elastic/beats/v7/libbeat/tests/compose" From 291d008c0a701ad2d2c00e80b72cb781ba609666 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Wed, 20 Nov 2024 19:54:24 +0530 Subject: [PATCH 02/23] point to elastic sarama fork directly --- filebeat/input/kafka/config.go | 3 +-- filebeat/input/kafka/input.go | 3 +-- filebeat/input/kafka/kafka_integration_test.go | 2 +- go.mod | 1 + go.sum | 2 ++ libbeat/common/kafka/sasl.go | 2 +- libbeat/common/kafka/version.go | 2 +- libbeat/common/kafka/version_test.go | 2 +- libbeat/outputs/kafka/client.go | 2 +- libbeat/outputs/kafka/config.go | 3 +-- libbeat/outputs/kafka/kafka.go | 3 +-- libbeat/outputs/kafka/kafka_integration_test.go | 2 +- libbeat/outputs/kafka/log.go | 3 +-- libbeat/outputs/kafka/message.go | 3 +-- libbeat/outputs/kafka/partition.go | 3 +-- libbeat/outputs/kafka/partition_test.go | 2 +- metricbeat/include/list_init.go | 3 +-- metricbeat/module/kafka/broker.go | 3 +-- metricbeat/module/kafka/consumergroup/mock_test.go | 3 +-- metricbeat/module/kafka/consumergroup/query.go | 3 +-- metricbeat/module/kafka/partition/partition.go | 3 +-- .../module/kafka/partition/partition_integration_test.go | 2 +- 22 files changed, 23 insertions(+), 32 deletions(-) diff --git a/filebeat/input/kafka/config.go b/filebeat/input/kafka/config.go index 833fefbb7d1..0282cf758f6 100644 --- a/filebeat/input/kafka/config.go +++ b/filebeat/input/kafka/config.go @@ -22,8 +22,6 @@ import ( "fmt" "time" - "github.com/IBM/sarama" - "github.com/elastic/beats/v7/libbeat/common/cfgwarn" "github.com/elastic/beats/v7/libbeat/common/kafka" "github.com/elastic/beats/v7/libbeat/common/transport/kerberos" @@ -31,6 +29,7 @@ import ( "github.com/elastic/elastic-agent-libs/monitoring" "github.com/elastic/elastic-agent-libs/monitoring/adapter" "github.com/elastic/elastic-agent-libs/transport/tlscommon" + "github.com/elastic/sarama" ) type kafkaInputConfig struct { diff --git a/filebeat/input/kafka/input.go b/filebeat/input/kafka/input.go index 0c750e519e9..6cc74514bef 100644 --- a/filebeat/input/kafka/input.go +++ b/filebeat/input/kafka/input.go @@ -30,8 +30,6 @@ import ( "github.com/elastic/beats/v7/libbeat/common/atomic" "github.com/elastic/elastic-agent-libs/mapstr" - "github.com/IBM/sarama" - input "github.com/elastic/beats/v7/filebeat/input/v2" "github.com/elastic/beats/v7/libbeat/beat" "github.com/elastic/beats/v7/libbeat/common/acker" @@ -42,6 +40,7 @@ import ( "github.com/elastic/beats/v7/libbeat/reader/parser" conf "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/logp" + "github.com/elastic/sarama" ) const pluginName = "kafka" diff --git a/filebeat/input/kafka/kafka_integration_test.go b/filebeat/input/kafka/kafka_integration_test.go index 60a3077ae7f..da9138497e2 100644 --- a/filebeat/input/kafka/kafka_integration_test.go +++ b/filebeat/input/kafka/kafka_integration_test.go @@ -35,7 +35,7 @@ import ( "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/mapstr" - "github.com/IBM/sarama" + "github.com/elastic/sarama" "github.com/stretchr/testify/assert" "github.com/elastic/beats/v7/libbeat/beat" diff --git a/go.mod b/go.mod index 8854e55451f..5822fc40745 100644 --- a/go.mod +++ b/go.mod @@ -288,6 +288,7 @@ require ( github.com/elastic/elastic-transport-go/v8 v8.6.0 // indirect github.com/elastic/go-windows v1.0.2 // indirect github.com/elastic/pkcs8 v1.0.0 // indirect + github.com/elastic/sarama v1.19.1-0.20241120141909-c7eabfcee7e5 // indirect github.com/elazarl/goproxy v0.0.0-20240909085733-6741dbfc16a1 // indirect github.com/elazarl/goproxy/ext v0.0.0-20240909085733-6741dbfc16a1 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect diff --git a/go.sum b/go.sum index 48d5016d5ce..7c03b2f3676 100644 --- a/go.sum +++ b/go.sum @@ -397,6 +397,8 @@ github.com/elastic/pkcs8 v1.0.0 h1:HhitlUKxhN288kcNcYkjW6/ouvuwJWd9ioxpjnD9jVA= github.com/elastic/pkcs8 v1.0.0/go.mod h1:ipsZToJfq1MxclVTwpG7U/bgeDtf+0HkUiOxebk95+0= github.com/elastic/sarama v1.19.1-0.20241118045140-603e70e982ce h1:yLX+Tg3d6g1Q/idz8iOpq7pqBZGcIHxACJKBOIHr9NA= github.com/elastic/sarama v1.19.1-0.20241118045140-603e70e982ce/go.mod h1:FVIRaLrhK3Cla/9FfRF5X9Zua2KpS3SYIXxhac1H+FQ= +github.com/elastic/sarama v1.19.1-0.20241120141909-c7eabfcee7e5 h1:U7rts7RrrzQSDKkMuECpw9QCafSn2nRp36eRnWyR14E= +github.com/elastic/sarama v1.19.1-0.20241120141909-c7eabfcee7e5/go.mod h1:EEdpKWvuZ46X7OEOENvSH5jEJXosi4fn7xjIeTajf+M= github.com/elastic/tk-btf v0.1.0 h1:T4rbsnfaRH/MZKSLwZFd3sndt/NexsQb0IXWtMQ9PAA= github.com/elastic/tk-btf v0.1.0/go.mod h1:caLQPEcMbyKmPUQb2AsbX3ZAj1yCz06lOxfhn0esLR8= github.com/elastic/toutoumomoma v0.0.0-20240626215117-76e39db18dfb h1:8SvKmGOYyxKi6jB0nvV1lpxEHfIS6tQ40x1BXBhKMsE= diff --git a/libbeat/common/kafka/sasl.go b/libbeat/common/kafka/sasl.go index dc329e75cb7..ca9df078ebc 100644 --- a/libbeat/common/kafka/sasl.go +++ b/libbeat/common/kafka/sasl.go @@ -21,7 +21,7 @@ import ( "fmt" "strings" - "github.com/IBM/sarama" + "github.com/elastic/sarama" ) type SaslConfig struct { diff --git a/libbeat/common/kafka/version.go b/libbeat/common/kafka/version.go index 6edcf3b5ef5..04243590ec2 100644 --- a/libbeat/common/kafka/version.go +++ b/libbeat/common/kafka/version.go @@ -20,7 +20,7 @@ package kafka import ( "fmt" - "github.com/IBM/sarama" + "github.com/elastic/sarama" ) // Version is a kafka version diff --git a/libbeat/common/kafka/version_test.go b/libbeat/common/kafka/version_test.go index da95477e7c9..8696a2ef2bb 100644 --- a/libbeat/common/kafka/version_test.go +++ b/libbeat/common/kafka/version_test.go @@ -20,7 +20,7 @@ package kafka import ( "testing" - "github.com/IBM/sarama" + "github.com/elastic/sarama" ) func TestVersionGet(t *testing.T) { diff --git a/libbeat/outputs/kafka/client.go b/libbeat/outputs/kafka/client.go index 2cc21c0ce2b..0278e84bcec 100644 --- a/libbeat/outputs/kafka/client.go +++ b/libbeat/outputs/kafka/client.go @@ -26,8 +26,8 @@ import ( "sync/atomic" "time" - "github.com/IBM/sarama" "github.com/eapache/go-resiliency/breaker" + "github.com/elastic/sarama" "github.com/elastic/beats/v7/libbeat/common/fmtstr" "github.com/elastic/beats/v7/libbeat/outputs" diff --git a/libbeat/outputs/kafka/config.go b/libbeat/outputs/kafka/config.go index 12f5a54826c..297f5aab3c4 100644 --- a/libbeat/outputs/kafka/config.go +++ b/libbeat/outputs/kafka/config.go @@ -25,8 +25,6 @@ import ( "strings" "time" - "github.com/IBM/sarama" - "github.com/elastic/beats/v7/libbeat/common/cfgwarn" "github.com/elastic/beats/v7/libbeat/common/fmtstr" "github.com/elastic/beats/v7/libbeat/common/kafka" @@ -38,6 +36,7 @@ import ( "github.com/elastic/elastic-agent-libs/monitoring" "github.com/elastic/elastic-agent-libs/monitoring/adapter" "github.com/elastic/elastic-agent-libs/transport/tlscommon" + "github.com/elastic/sarama" ) type backoffConfig struct { diff --git a/libbeat/outputs/kafka/kafka.go b/libbeat/outputs/kafka/kafka.go index 9523e4d030c..02dadafd972 100644 --- a/libbeat/outputs/kafka/kafka.go +++ b/libbeat/outputs/kafka/kafka.go @@ -20,14 +20,13 @@ package kafka import ( "fmt" - "github.com/IBM/sarama" - "github.com/elastic/beats/v7/libbeat/beat" "github.com/elastic/beats/v7/libbeat/outputs" "github.com/elastic/beats/v7/libbeat/outputs/codec" "github.com/elastic/beats/v7/libbeat/outputs/outil" "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/logp" + "github.com/elastic/sarama" ) const ( diff --git a/libbeat/outputs/kafka/kafka_integration_test.go b/libbeat/outputs/kafka/kafka_integration_test.go index b1984427201..855e8637b23 100644 --- a/libbeat/outputs/kafka/kafka_integration_test.go +++ b/libbeat/outputs/kafka/kafka_integration_test.go @@ -30,7 +30,7 @@ import ( "testing" "time" - "github.com/IBM/sarama" + "github.com/elastic/sarama" "github.com/stretchr/testify/assert" "github.com/elastic/beats/v7/libbeat/beat" diff --git a/libbeat/outputs/kafka/log.go b/libbeat/outputs/kafka/log.go index 91717b53b98..1745bf2000f 100644 --- a/libbeat/outputs/kafka/log.go +++ b/libbeat/outputs/kafka/log.go @@ -18,9 +18,8 @@ package kafka import ( - "github.com/IBM/sarama" - "github.com/elastic/elastic-agent-libs/logp" + "github.com/elastic/sarama" ) type kafkaLogger struct { diff --git a/libbeat/outputs/kafka/message.go b/libbeat/outputs/kafka/message.go index b3685f032b0..2010cdcfb48 100644 --- a/libbeat/outputs/kafka/message.go +++ b/libbeat/outputs/kafka/message.go @@ -20,9 +20,8 @@ package kafka import ( "time" - "github.com/IBM/sarama" - "github.com/elastic/beats/v7/libbeat/publisher" + "github.com/elastic/sarama" ) type message struct { diff --git a/libbeat/outputs/kafka/partition.go b/libbeat/outputs/kafka/partition.go index 993a085fa3f..fa68c55a8c8 100644 --- a/libbeat/outputs/kafka/partition.go +++ b/libbeat/outputs/kafka/partition.go @@ -26,11 +26,10 @@ import ( "math/rand" "strconv" - "github.com/IBM/sarama" - "github.com/elastic/elastic-agent-libs/config" "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/mapstr" + "github.com/elastic/sarama" ) type partitionBuilder func(*logp.Logger, *config.C) (func() partitioner, error) diff --git a/libbeat/outputs/kafka/partition_test.go b/libbeat/outputs/kafka/partition_test.go index 716a58b1b64..f5dbed84545 100644 --- a/libbeat/outputs/kafka/partition_test.go +++ b/libbeat/outputs/kafka/partition_test.go @@ -25,7 +25,7 @@ import ( "testing" "time" - "github.com/IBM/sarama" + "github.com/elastic/sarama" "github.com/stretchr/testify/assert" "github.com/elastic/beats/v7/libbeat/beat" diff --git a/metricbeat/include/list_init.go b/metricbeat/include/list_init.go index 037e00b2891..fbfa58a65c5 100644 --- a/metricbeat/include/list_init.go +++ b/metricbeat/include/list_init.go @@ -21,10 +21,9 @@ package include import ( // Import packages to perform 'func InitializeModule()' when in-use. - m0 "github.com/elastic/beats/v7/metricbeat/autodiscover/builder/hints" m1 "github.com/elastic/beats/v7/metricbeat/autodiscover/appender/kubernetes/token" + m0 "github.com/elastic/beats/v7/metricbeat/autodiscover/builder/hints" m2 "github.com/elastic/beats/v7/metricbeat/processor/add_kubernetes_metadata" - // Import packages that perform 'func init()'. ) diff --git a/metricbeat/module/kafka/broker.go b/metricbeat/module/kafka/broker.go index dcc223c5381..0740509e7b4 100644 --- a/metricbeat/module/kafka/broker.go +++ b/metricbeat/module/kafka/broker.go @@ -26,10 +26,9 @@ import ( "strings" "time" - "github.com/IBM/sarama" - "github.com/elastic/beats/v7/libbeat/common" "github.com/elastic/beats/v7/libbeat/common/kafka" + "github.com/elastic/sarama" ) // Version returns a kafka version from its string representation diff --git a/metricbeat/module/kafka/consumergroup/mock_test.go b/metricbeat/module/kafka/consumergroup/mock_test.go index a1bd975da72..ad26d47cb3b 100644 --- a/metricbeat/module/kafka/consumergroup/mock_test.go +++ b/metricbeat/module/kafka/consumergroup/mock_test.go @@ -21,9 +21,8 @@ import ( "fmt" "math/rand" - "github.com/IBM/sarama" - "github.com/elastic/beats/v7/metricbeat/module/kafka" + "github.com/elastic/sarama" ) type mockClient struct { diff --git a/metricbeat/module/kafka/consumergroup/query.go b/metricbeat/module/kafka/consumergroup/query.go index a3ac395fe05..b0659ef433a 100644 --- a/metricbeat/module/kafka/consumergroup/query.go +++ b/metricbeat/module/kafka/consumergroup/query.go @@ -18,11 +18,10 @@ package consumergroup import ( - "github.com/IBM/sarama" - "github.com/elastic/beats/v7/metricbeat/module/kafka" "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/mapstr" + "github.com/elastic/sarama" ) type client interface { diff --git a/metricbeat/module/kafka/partition/partition.go b/metricbeat/module/kafka/partition/partition.go index fe8ea13730e..1a4f90690f6 100644 --- a/metricbeat/module/kafka/partition/partition.go +++ b/metricbeat/module/kafka/partition/partition.go @@ -21,13 +21,12 @@ import ( "errors" "fmt" - "github.com/IBM/sarama" - "github.com/elastic/beats/v7/metricbeat/mb" "github.com/elastic/beats/v7/metricbeat/mb/parse" "github.com/elastic/beats/v7/metricbeat/module/kafka" "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/mapstr" + "github.com/elastic/sarama" ) // init registers the partition MetricSet with the central registry. diff --git a/metricbeat/module/kafka/partition/partition_integration_test.go b/metricbeat/module/kafka/partition/partition_integration_test.go index 9034a64d6dc..def60499706 100644 --- a/metricbeat/module/kafka/partition/partition_integration_test.go +++ b/metricbeat/module/kafka/partition/partition_integration_test.go @@ -26,7 +26,7 @@ import ( "testing" "time" - "github.com/IBM/sarama" + "github.com/elastic/sarama" "github.com/stretchr/testify/assert" "github.com/elastic/beats/v7/libbeat/tests/compose" From bcfbf514c8b45a0f3ee44e867ffec326149f9b5c Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Wed, 20 Nov 2024 20:06:45 +0530 Subject: [PATCH 03/23] remove dependency on shopify --- NOTICE.txt | 102 +++++++++++++++++++++----------- go.mod | 5 +- go.sum | 4 +- metricbeat/include/list_init.go | 3 +- 4 files changed, 73 insertions(+), 41 deletions(-) diff --git a/NOTICE.txt b/NOTICE.txt index b178b98083d..5b15037f9f4 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -2646,40 +2646,6 @@ Contents of probable licence file $GOMODCACHE/github.com/!azure/go-autorest/auto limitations under the License. --------------------------------------------------------------------------------- -Dependency : github.com/elastic/sarama -Version: v1.19.1-0.20241118045140-603e70e982ce -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/elastic/sarama@v1.19.1-0.20241118045140-603e70e982ce/LICENSE.md: - -# MIT License - -Copyright (c) 2013 Shopify - -Copyright (c) 2023 IBM Corporation - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -------------------------------------------------------------------------------- Dependency : github.com/Microsoft/go-winio Version: v0.6.2 @@ -16708,6 +16674,40 @@ See the License for the specific language governing permissions and limitations under the License. +-------------------------------------------------------------------------------- +Dependency : github.com/elastic/sarama +Version: v1.19.1-0.20241120141909-c7eabfcee7e5 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/elastic/sarama@v1.19.1-0.20241120141909-c7eabfcee7e5/LICENSE.md: + +# MIT License + +Copyright (c) 2013 Shopify + +Copyright (c) 2023 IBM Corporation + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + -------------------------------------------------------------------------------- Dependency : github.com/elastic/tk-btf Version: v0.1.0 @@ -33139,6 +33139,40 @@ Contents of probable licence file $GOMODCACHE/github.com/!azure!a!d/microsoft-au SOFTWARE +-------------------------------------------------------------------------------- +Dependency : github.com/IBM/sarama +Version: v1.43.3 +Licence type (autodetected): MIT +-------------------------------------------------------------------------------- + +Contents of probable licence file $GOMODCACHE/github.com/!i!b!m/sarama@v1.43.3/LICENSE.md: + +# MIT License + +Copyright (c) 2013 Shopify + +Copyright (c) 2023 IBM Corporation + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + -------------------------------------------------------------------------------- Dependency : github.com/JohnCGriffin/overflow Version: v0.0.0-20211019200055-46fa312c352c diff --git a/go.mod b/go.mod index 5822fc40745..271d44d60f9 100644 --- a/go.mod +++ b/go.mod @@ -175,7 +175,6 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0 github.com/Azure/azure-storage-blob-go v0.15.0 github.com/Azure/go-autorest/autorest/adal v0.9.24 - github.com/IBM/sarama v1.43.3 github.com/aerospike/aerospike-client-go/v7 v7.7.1 github.com/apache/arrow/go/v14 v14.0.2 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.12 @@ -199,6 +198,7 @@ require ( github.com/elastic/go-sfdc v0.0.0-20241010131323-8e176480d727 github.com/elastic/mito v1.15.0 github.com/elastic/mock-es v0.0.0-20240712014503-e5b47ece0015 + github.com/elastic/sarama v1.19.1-0.20241120141909-c7eabfcee7e5 github.com/elastic/tk-btf v0.1.0 github.com/elastic/toutoumomoma v0.0.0-20240626215117-76e39db18dfb github.com/foxcpp/go-mockdns v0.0.0-20201212160233-ede2f9158d15 @@ -288,7 +288,6 @@ require ( github.com/elastic/elastic-transport-go/v8 v8.6.0 // indirect github.com/elastic/go-windows v1.0.2 // indirect github.com/elastic/pkcs8 v1.0.0 // indirect - github.com/elastic/sarama v1.19.1-0.20241120141909-c7eabfcee7e5 // indirect github.com/elazarl/goproxy v0.0.0-20240909085733-6741dbfc16a1 // indirect github.com/elazarl/goproxy/ext v0.0.0-20240909085733-6741dbfc16a1 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect @@ -416,8 +415,6 @@ require ( replace ( github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption => github.com/elastic/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption v1.1.0-elastic - - github.com/IBM/sarama => github.com/elastic/sarama v1.19.1-0.20241118045140-603e70e982ce github.com/apoydence/eachers => github.com/poy/eachers v0.0.0-20181020210610-23942921fe77 //indirect, see https://github.com/elastic/beats/pull/29780 for details. github.com/dop251/goja => github.com/elastic/goja v0.0.0-20190128172624-dd2ac4456e20 github.com/fsnotify/fsevents => github.com/elastic/fsevents v0.0.0-20181029231046-e1d381a4d270 diff --git a/go.sum b/go.sum index 7c03b2f3676..0a120eb96a2 100644 --- a/go.sum +++ b/go.sum @@ -113,6 +113,8 @@ github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358/go.mod h1:chxPXzS github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/IBM/sarama v1.43.3 h1:Yj6L2IaNvb2mRBop39N7mmJAHBVY3dTPncr3qGVkxPA= +github.com/IBM/sarama v1.43.3/go.mod h1:FVIRaLrhK3Cla/9FfRF5X9Zua2KpS3SYIXxhac1H+FQ= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c h1:RGWPOewvKIROun94nF7v2cua9qP+thov/7M50KEoeSU= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= @@ -395,8 +397,6 @@ github.com/elastic/mock-es v0.0.0-20240712014503-e5b47ece0015 h1:z8cC8GASpPo8yKl github.com/elastic/mock-es v0.0.0-20240712014503-e5b47ece0015/go.mod h1:qH9DX/Dmflz6EAtaks/+2SsdQzecVAKE174Zl66hk7E= github.com/elastic/pkcs8 v1.0.0 h1:HhitlUKxhN288kcNcYkjW6/ouvuwJWd9ioxpjnD9jVA= github.com/elastic/pkcs8 v1.0.0/go.mod h1:ipsZToJfq1MxclVTwpG7U/bgeDtf+0HkUiOxebk95+0= -github.com/elastic/sarama v1.19.1-0.20241118045140-603e70e982ce h1:yLX+Tg3d6g1Q/idz8iOpq7pqBZGcIHxACJKBOIHr9NA= -github.com/elastic/sarama v1.19.1-0.20241118045140-603e70e982ce/go.mod h1:FVIRaLrhK3Cla/9FfRF5X9Zua2KpS3SYIXxhac1H+FQ= github.com/elastic/sarama v1.19.1-0.20241120141909-c7eabfcee7e5 h1:U7rts7RrrzQSDKkMuECpw9QCafSn2nRp36eRnWyR14E= github.com/elastic/sarama v1.19.1-0.20241120141909-c7eabfcee7e5/go.mod h1:EEdpKWvuZ46X7OEOENvSH5jEJXosi4fn7xjIeTajf+M= github.com/elastic/tk-btf v0.1.0 h1:T4rbsnfaRH/MZKSLwZFd3sndt/NexsQb0IXWtMQ9PAA= diff --git a/metricbeat/include/list_init.go b/metricbeat/include/list_init.go index fbfa58a65c5..037e00b2891 100644 --- a/metricbeat/include/list_init.go +++ b/metricbeat/include/list_init.go @@ -21,9 +21,10 @@ package include import ( // Import packages to perform 'func InitializeModule()' when in-use. - m1 "github.com/elastic/beats/v7/metricbeat/autodiscover/appender/kubernetes/token" m0 "github.com/elastic/beats/v7/metricbeat/autodiscover/builder/hints" + m1 "github.com/elastic/beats/v7/metricbeat/autodiscover/appender/kubernetes/token" m2 "github.com/elastic/beats/v7/metricbeat/processor/add_kubernetes_metadata" + // Import packages that perform 'func init()'. ) From 37e83bbb4e9e82cba2b33105228c16f9891116ae Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Wed, 20 Nov 2024 20:53:32 +0530 Subject: [PATCH 04/23] linting issues --- filebeat/input/kafka/config.go | 4 ++-- libbeat/outputs/kafka/client.go | 1 + .../module/kafka/partition/partition_integration_test.go | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/filebeat/input/kafka/config.go b/filebeat/input/kafka/config.go index 0282cf758f6..c96de01cb9b 100644 --- a/filebeat/input/kafka/config.go +++ b/filebeat/input/kafka/config.go @@ -240,8 +240,8 @@ func (off *initialOffset) Unpack(value string) error { func (st rebalanceStrategy) asSaramaStrategy() sarama.BalanceStrategy { return map[rebalanceStrategy]sarama.BalanceStrategy{ - rebalanceStrategyRange: sarama.BalanceStrategyRange, - rebalanceStrategyRoundRobin: sarama.BalanceStrategyRoundRobin, + rebalanceStrategyRange: sarama.NewBalanceStrategyRange(), + rebalanceStrategyRoundRobin: sarama.NewBalanceStrategyRoundRobin(), }[st] } diff --git a/libbeat/outputs/kafka/client.go b/libbeat/outputs/kafka/client.go index 0278e84bcec..98f511a4016 100644 --- a/libbeat/outputs/kafka/client.go +++ b/libbeat/outputs/kafka/client.go @@ -27,6 +27,7 @@ import ( "time" "github.com/eapache/go-resiliency/breaker" + "github.com/elastic/sarama" "github.com/elastic/beats/v7/libbeat/common/fmtstr" diff --git a/metricbeat/module/kafka/partition/partition_integration_test.go b/metricbeat/module/kafka/partition/partition_integration_test.go index def60499706..f7f72e597ca 100644 --- a/metricbeat/module/kafka/partition/partition_integration_test.go +++ b/metricbeat/module/kafka/partition/partition_integration_test.go @@ -26,9 +26,10 @@ import ( "testing" "time" - "github.com/elastic/sarama" "github.com/stretchr/testify/assert" + "github.com/elastic/sarama" + "github.com/elastic/beats/v7/libbeat/tests/compose" mbtest "github.com/elastic/beats/v7/metricbeat/mb/testing" "github.com/elastic/elastic-agent-libs/logp" From e1579e68df86624105d90db035264db038f693c9 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Wed, 20 Nov 2024 20:56:58 +0530 Subject: [PATCH 05/23] linint issues 2 --- libbeat/common/kafka/scram.go | 2 +- libbeat/outputs/kafka/config.go | 2 +- .../kafka/consumergroup/consumergroup_integration_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libbeat/common/kafka/scram.go b/libbeat/common/kafka/scram.go index 997fb2e84d3..e87ed11f756 100644 --- a/libbeat/common/kafka/scram.go +++ b/libbeat/common/kafka/scram.go @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -// https://github.com/IBM/sarama/blob/master/examples/sasl_scram_client/scram_client.go +// https://github.com/Shopify/sarama/blob/master/examples/sasl_scram_client/scram_client.go package kafka import ( diff --git a/libbeat/outputs/kafka/config.go b/libbeat/outputs/kafka/config.go index 297f5aab3c4..7da85ee44f9 100644 --- a/libbeat/outputs/kafka/config.go +++ b/libbeat/outputs/kafka/config.go @@ -97,7 +97,7 @@ type metaRetryConfig struct { var compressionModes = map[string]sarama.CompressionCodec{ // As of sarama 1.24.1, zstd support is broken - // (https://github.com/IBM/sarama/issues/1252), which needs to be + // (https://github.com/Shopify/sarama/issues/1252), which needs to be // addressed before we add support here. // (https://github.com/IBM/sarama/pull/1574) sarama version 1.26.0 has diff --git a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go index cc09b2f90a8..aafb5250499 100644 --- a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go +++ b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go @@ -101,7 +101,7 @@ func startConsumer(t *testing.T, host string, topic string) (io.Closer, error) { config.Net.SASL.User = kafkaSASLConsumerUsername config.Net.SASL.Password = kafkaSASLConsumerPassword // The test panics unless CommitInterval is set due to the following bug in sarama: - // https://github.com/IBM/sarama/issues/1638 + // https://github.com/Shopify/sarama/issues/1638 // To work around the issue we need to set CommitInterval, but now sarama emits // a deprecation warning. config.Consumer.Offsets.CommitInterval = 1 * time.Second From 05989d1078b6a4d41bab329e024eb23d218e5be5 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Thu, 21 Nov 2024 10:55:14 +0530 Subject: [PATCH 06/23] fixed wrapped errors lining --- .../input/kafka/kafka_integration_test.go | 7 +++- libbeat/outputs/kafka/client.go | 6 ++- libbeat/outputs/kafka/message.go | 2 - libbeat/outputs/kafka/partition.go | 4 +- metricbeat/module/kafka/broker.go | 42 +++++++++++-------- 5 files changed, 36 insertions(+), 25 deletions(-) diff --git a/filebeat/input/kafka/kafka_integration_test.go b/filebeat/input/kafka/kafka_integration_test.go index da9138497e2..d4e1930c6a6 100644 --- a/filebeat/input/kafka/kafka_integration_test.go +++ b/filebeat/input/kafka/kafka_integration_test.go @@ -460,7 +460,8 @@ func findMessage(t *testing.T, text string, msgs []testMessage) *testMessage { var msg *testMessage for _, m := range msgs { if text == m.message { - msg = &m + mCopy := m + msg = &mCopy break } } @@ -606,7 +607,9 @@ func run(t *testing.T, cfg *conf.C, client *beattest.ChanClient) (*kafkaInput, f pipeline := beattest.ConstClient(client) input := inp.(*kafkaInput) - go input.Run(ctx, pipeline) + go func() { + _ = input.Run(ctx, pipeline) + }() return input, cancel } diff --git a/libbeat/outputs/kafka/client.go b/libbeat/outputs/kafka/client.go index 98f511a4016..89450658d21 100644 --- a/libbeat/outputs/kafka/client.go +++ b/libbeat/outputs/kafka/client.go @@ -258,7 +258,11 @@ func (c *client) successWorker(ch <-chan *sarama.ProducerMessage) { defer c.log.Debug("Stop kafka ack worker") for libMsg := range ch { - msg := libMsg.Metadata.(*message) + msg, ok := libMsg.Metadata.(*message) + if !ok { + c.log.Debug("Failed to assert libMsg.Metadata to *message") + return + } msg.ref.done() } } diff --git a/libbeat/outputs/kafka/message.go b/libbeat/outputs/kafka/message.go index 2010cdcfb48..af034736b66 100644 --- a/libbeat/outputs/kafka/message.go +++ b/libbeat/outputs/kafka/message.go @@ -39,8 +39,6 @@ type message struct { data publisher.Event } -var kafkaMessageKey interface{} = int(0) - func (m *message) initProducerMessage() { m.msg = sarama.ProducerMessage{ Metadata: m, diff --git a/libbeat/outputs/kafka/partition.go b/libbeat/outputs/kafka/partition.go index fa68c55a8c8..bdc38791a48 100644 --- a/libbeat/outputs/kafka/partition.go +++ b/libbeat/outputs/kafka/partition.go @@ -125,13 +125,13 @@ func (p *messagePartitioner) Partition( partition, err := p.p(msg, numPartitions) if err != nil { - return 0, nil + return 0, err } msg.partition = partition if _, err := msg.data.Cache.Put("partition", partition); err != nil { - return 0, fmt.Errorf("setting kafka partition in publisher event failed: %v", err) + return 0, fmt.Errorf("setting kafka partition in publisher event failed: %w", err) } p.partitions = numPartitions diff --git a/metricbeat/module/kafka/broker.go b/metricbeat/module/kafka/broker.go index 0740509e7b4..be02b18ffc9 100644 --- a/metricbeat/module/kafka/broker.go +++ b/metricbeat/module/kafka/broker.go @@ -19,6 +19,7 @@ package kafka import ( "crypto/tls" + "errors" "fmt" "io" "net" @@ -301,13 +302,20 @@ func queryMetadataWithRetry( b *sarama.Broker, cfg *sarama.Config, topics []string, -) (r *sarama.MetadataResponse, err error) { - err = withRetry(b, cfg, func() (e error) { +) (*sarama.MetadataResponse, error) { + var r *sarama.MetadataResponse + var err error + + err = withRetry(b, cfg, func() error { requ := &sarama.MetadataRequest{Topics: topics} - r, e = b.GetMetadata(requ) - return + r, err = b.GetMetadata(requ) + return err }) - return + + if err != nil { + return nil, err + } + return r, nil } func closeBroker(b *sarama.Broker) { @@ -353,22 +361,20 @@ func checkRetryQuery(err error) (retry, reconnect bool) { return false, false } - if err == io.EOF { + if errors.Is(err, io.EOF) { return true, true } - k, ok := err.(sarama.KError) - if !ok { - return false, false - } - - switch k { - case sarama.ErrLeaderNotAvailable, sarama.ErrReplicaNotAvailable, - sarama.ErrOffsetsLoadInProgress, sarama.ErrRebalanceInProgress: - return true, false - case sarama.ErrRequestTimedOut, sarama.ErrBrokerNotAvailable, - sarama.ErrNetworkException: - return true, true + var k *sarama.KError + if errors.As(err, &k) { + switch *k { + case sarama.ErrLeaderNotAvailable, sarama.ErrReplicaNotAvailable, + sarama.ErrOffsetsLoadInProgress, sarama.ErrRebalanceInProgress: + return true, false + case sarama.ErrRequestTimedOut, sarama.ErrBrokerNotAvailable, + sarama.ErrNetworkException: + return true, true + } } return false, false From 7b68d68e0c63b2fe298cbadb884ffbf3cdd29a08 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Thu, 21 Nov 2024 11:27:34 +0530 Subject: [PATCH 07/23] CI failures --- libbeat/outputs/kafka/partition.go | 2 +- metricbeat/module/kafka/consumergroup/mock_test.go | 2 +- metricbeat/module/kafka/partition/partition.go | 2 +- .../module/kafka/partition/partition_integration_test.go | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libbeat/outputs/kafka/partition.go b/libbeat/outputs/kafka/partition.go index bdc38791a48..b9ca8660fc6 100644 --- a/libbeat/outputs/kafka/partition.go +++ b/libbeat/outputs/kafka/partition.go @@ -116,7 +116,7 @@ func (p *messagePartitioner) Partition( libMsg *sarama.ProducerMessage, numPartitions int32, ) (int32, error) { - msg := libMsg.Metadata.(*message) + msg, _ := libMsg.Metadata.(*message) if numPartitions == p.partitions { // if reachable is false, this is always true if 0 <= msg.partition && msg.partition < numPartitions { return msg.partition, nil diff --git a/metricbeat/module/kafka/consumergroup/mock_test.go b/metricbeat/module/kafka/consumergroup/mock_test.go index ad26d47cb3b..bf8a133ccb1 100644 --- a/metricbeat/module/kafka/consumergroup/mock_test.go +++ b/metricbeat/module/kafka/consumergroup/mock_test.go @@ -124,7 +124,7 @@ func makeFetchGroupOffsets( for i, offset := range partition { T[int32(i)] = &sarama.OffsetFetchResponseBlock{ - Offset: int64(offset), + Offset: offset, } } } diff --git a/metricbeat/module/kafka/partition/partition.go b/metricbeat/module/kafka/partition/partition.go index 1a4f90690f6..1134299fdb0 100644 --- a/metricbeat/module/kafka/partition/partition.go +++ b/metricbeat/module/kafka/partition/partition.go @@ -124,7 +124,7 @@ func (m *MetricSet) Fetch(r mb.ReporterV2) error { err = errFailQueryOffset } - msg := fmt.Errorf("Failed to query kafka partition (%v:%v) offsets: %v", + msg := fmt.Errorf("failed to query kafka partition (%v:%v) offsets: %w", topic.Name, partition.ID, err) m.Logger().Warn(msg) r.Error(msg) diff --git a/metricbeat/module/kafka/partition/partition_integration_test.go b/metricbeat/module/kafka/partition/partition_integration_test.go index f7f72e597ca..b7d992ba683 100644 --- a/metricbeat/module/kafka/partition/partition_integration_test.go +++ b/metricbeat/module/kafka/partition/partition_integration_test.go @@ -108,13 +108,13 @@ func TestTopic(t *testing.T) { // Its possible that other topics exists -> select the right data for _, data := range dataBefore { if data.ModuleFields["topic"].(mapstr.M)["name"] == testTopic { - offsetBefore = data.MetricSetFields["offset"].(mapstr.M)["newest"].(int64) + offsetBefore, _ = data.MetricSetFields["offset"].(mapstr.M)["newest"].(int64) } } for _, data := range dataAfter { if data.ModuleFields["topic"].(mapstr.M)["name"] == testTopic { - offsetAfter = data.MetricSetFields["offset"].(mapstr.M)["newest"].(int64) + offsetAfter, _ = data.MetricSetFields["offset"].(mapstr.M)["newest"].(int64) } } From 550613a6e65054cea6ac093300d62856b8ccece6 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Thu, 21 Nov 2024 11:42:35 +0530 Subject: [PATCH 08/23] ignore error messages in integration tests --- filebeat/input/kafka/kafka_integration_test.go | 2 +- libbeat/outputs/kafka/client.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/filebeat/input/kafka/kafka_integration_test.go b/filebeat/input/kafka/kafka_integration_test.go index d4e1930c6a6..2af01157808 100644 --- a/filebeat/input/kafka/kafka_integration_test.go +++ b/filebeat/input/kafka/kafka_integration_test.go @@ -606,7 +606,7 @@ func run(t *testing.T, cfg *conf.C, client *beattest.ChanClient) (*kafkaInput, f t.Cleanup(cancel) pipeline := beattest.ConstClient(client) - input := inp.(*kafkaInput) + input, _ := inp.(*kafkaInput) go func() { _ = input.Run(ctx, pipeline) }() diff --git a/libbeat/outputs/kafka/client.go b/libbeat/outputs/kafka/client.go index 89450658d21..90e1156bf23 100644 --- a/libbeat/outputs/kafka/client.go +++ b/libbeat/outputs/kafka/client.go @@ -273,7 +273,7 @@ func (c *client) errorWorker(ch <-chan *sarama.ProducerError) { defer c.log.Debug("Stop kafka error handler") for errMsg := range ch { - msg := errMsg.Msg.Metadata.(*message) + msg, _ := errMsg.Msg.Metadata.(*message) msg.ref.fail(msg, errMsg.Err) if errors.Is(errMsg.Err, breaker.ErrBreakerOpen) { From 85c0cd775705e0e5bdd3dbe0c87bb1c2a902c3ea Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Thu, 21 Nov 2024 12:51:03 +0530 Subject: [PATCH 09/23] import paths --- libbeat/outputs/kafka/kafka_integration_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libbeat/outputs/kafka/kafka_integration_test.go b/libbeat/outputs/kafka/kafka_integration_test.go index 855e8637b23..12db7433a82 100644 --- a/libbeat/outputs/kafka/kafka_integration_test.go +++ b/libbeat/outputs/kafka/kafka_integration_test.go @@ -30,9 +30,10 @@ import ( "testing" "time" - "github.com/elastic/sarama" "github.com/stretchr/testify/assert" + "github.com/elastic/sarama" + "github.com/elastic/beats/v7/libbeat/beat" "github.com/elastic/beats/v7/libbeat/common/fmtstr" "github.com/elastic/beats/v7/libbeat/outputs" From 12d7be53332c8afff6b873ba669f3e1e49d663fd Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Thu, 21 Nov 2024 13:16:40 +0530 Subject: [PATCH 10/23] correct elastic import path --- filebeat/input/kafka/kafka_integration_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filebeat/input/kafka/kafka_integration_test.go b/filebeat/input/kafka/kafka_integration_test.go index 2af01157808..cc8b29361da 100644 --- a/filebeat/input/kafka/kafka_integration_test.go +++ b/filebeat/input/kafka/kafka_integration_test.go @@ -35,9 +35,10 @@ import ( "github.com/elastic/elastic-agent-libs/logp" "github.com/elastic/elastic-agent-libs/mapstr" - "github.com/elastic/sarama" "github.com/stretchr/testify/assert" + "github.com/elastic/sarama" + "github.com/elastic/beats/v7/libbeat/beat" _ "github.com/elastic/beats/v7/libbeat/outputs/codec/format" _ "github.com/elastic/beats/v7/libbeat/outputs/codec/json" From 8b3a6b55987dc101f17e4fbf7709ef665ef434a0 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Thu, 21 Nov 2024 13:18:52 +0530 Subject: [PATCH 11/23] import path --- libbeat/outputs/kafka/partition_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libbeat/outputs/kafka/partition_test.go b/libbeat/outputs/kafka/partition_test.go index f5dbed84545..0a35c2bfdf0 100644 --- a/libbeat/outputs/kafka/partition_test.go +++ b/libbeat/outputs/kafka/partition_test.go @@ -25,9 +25,10 @@ import ( "testing" "time" - "github.com/elastic/sarama" "github.com/stretchr/testify/assert" + "github.com/elastic/sarama" + "github.com/elastic/beats/v7/libbeat/beat" "github.com/elastic/beats/v7/libbeat/common" "github.com/elastic/beats/v7/libbeat/publisher" From 76b93ad24a177ab390aed3d15ff320ab130d38a8 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Thu, 21 Nov 2024 16:25:16 +0530 Subject: [PATCH 12/23] add next valid versions --- libbeat/common/kafka/version_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libbeat/common/kafka/version_test.go b/libbeat/common/kafka/version_test.go index 8696a2ef2bb..ae0f0a385e0 100644 --- a/libbeat/common/kafka/version_test.go +++ b/libbeat/common/kafka/version_test.go @@ -62,7 +62,7 @@ func TestSaramaUpdate(t *testing.T) { // If any of these versions are considered valid by our parsing code, // it means someone updated sarama without updating the parsing code // for the new version. Gently remind them. - flagVersions := []Version{"2.8.1", "2.9.0"} + flagVersions := []Version{"3.7.0", "3.8.0"} for _, v := range flagVersions { if _, ok := v.Get(); ok { t.Fatalf( @@ -71,7 +71,7 @@ func TestSaramaUpdate(t *testing.T) { "- Update truncatedKafkaVersions in libbeat/common/kafka/version.go\n"+ "- Update the documentation to list the latest version:\n"+ " * libbeat/outputs/kafka/docs/kafka.asciidoc\n"+ - " * filebeat/docs/inputs/inputs-kafka.asciidoc\n"+ + " * filebeat/docs/inputs/input-kafka.asciidoc\n"+ "- Update TestSaramaUpdate in libbeat/common/kafka/version_test.go\n", v) From 610d4d1ca3b482fbfea67da9e72292e217061558 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Thu, 21 Nov 2024 18:39:38 +0530 Subject: [PATCH 13/23] revert --- testing/environments/docker/kafka/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/environments/docker/kafka/Dockerfile b/testing/environments/docker/kafka/Dockerfile index afb2df2d9d7..f6dcea5cd65 100644 --- a/testing/environments/docker/kafka/Dockerfile +++ b/testing/environments/docker/kafka/Dockerfile @@ -6,7 +6,7 @@ ENV KAFKA_HOME /kafka ENV KAFKA_ADVERTISED_HOST kafka ENV KAFKA_LOGS_DIR="/kafka-logs" -ENV KAFKA_VERSION 2.2.2 +ENV KAFKA_VERSION 3.2.1 ENV _JAVA_OPTIONS "-Djava.net.preferIPv4Stack=true" ENV TERM=linux From 7b9436859736381b011eba5093f18999fb3f0b12 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Thu, 21 Nov 2024 18:48:56 +0530 Subject: [PATCH 14/23] revert --- testing/environments/docker/kafka/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/environments/docker/kafka/Dockerfile b/testing/environments/docker/kafka/Dockerfile index f6dcea5cd65..c8a039553e2 100644 --- a/testing/environments/docker/kafka/Dockerfile +++ b/testing/environments/docker/kafka/Dockerfile @@ -6,7 +6,7 @@ ENV KAFKA_HOME /kafka ENV KAFKA_ADVERTISED_HOST kafka ENV KAFKA_LOGS_DIR="/kafka-logs" -ENV KAFKA_VERSION 3.2.1 +ENV KAFKA_VERSION 2.2.2 ENV _JAVA_OPTIONS "-Djava.net.preferIPv4Stack=true" ENV TERM=linux @@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y curl openjdk-11-jre-headless netcat-ope RUN mkdir -p ${KAFKA_LOGS_DIR} && mkdir -p ${KAFKA_HOME} && \ curl -J -L -s -f -o - https://github.com/kadwanev/retry/releases/download/1.0.1/retry-1.0.1.tar.gz | tar xfz - -C /usr/local/bin && \ retry --min 1 --max 180 -- curl -J -L -s -f --show-error -o $INSTALL_DIR/kafka.tgz \ - "https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_2.11-${KAFKA_VERSION}.tgz" && \ + "https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_2.12-${KAFKA_VERSION}.tgz" && \ tar xzf ${INSTALL_DIR}/kafka.tgz -C ${KAFKA_HOME} --strip-components 1 ADD run.sh /run.sh From 9a446c86501651bcaa6a5e8e43046853e0c16bb2 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Thu, 21 Nov 2024 18:50:41 +0530 Subject: [PATCH 15/23] revert --- testing/environments/docker/kafka/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/environments/docker/kafka/Dockerfile b/testing/environments/docker/kafka/Dockerfile index c8a039553e2..afb2df2d9d7 100644 --- a/testing/environments/docker/kafka/Dockerfile +++ b/testing/environments/docker/kafka/Dockerfile @@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y curl openjdk-11-jre-headless netcat-ope RUN mkdir -p ${KAFKA_LOGS_DIR} && mkdir -p ${KAFKA_HOME} && \ curl -J -L -s -f -o - https://github.com/kadwanev/retry/releases/download/1.0.1/retry-1.0.1.tar.gz | tar xfz - -C /usr/local/bin && \ retry --min 1 --max 180 -- curl -J -L -s -f --show-error -o $INSTALL_DIR/kafka.tgz \ - "https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_2.12-${KAFKA_VERSION}.tgz" && \ + "https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_2.11-${KAFKA_VERSION}.tgz" && \ tar xzf ${INSTALL_DIR}/kafka.tgz -C ${KAFKA_HOME} --strip-components 1 ADD run.sh /run.sh From 55552b885a36046a5436f72be6f68fe630a4837c Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Fri, 22 Nov 2024 12:19:52 +0530 Subject: [PATCH 16/23] fix failing intergation tests --- NOTICE.txt | 132 -------------------------------- go.mod | 3 - go.sum | 25 ------ libbeat/common/kafka/version.go | 9 +++ 4 files changed, 9 insertions(+), 160 deletions(-) diff --git a/NOTICE.txt b/NOTICE.txt index 5b15037f9f4..f206e75cb42 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -10129,38 +10129,6 @@ THE SOFTWARE. --------------------------------------------------------------------------------- -Dependency : github.com/bsm/sarama-cluster -Version: v2.1.14-0.20180625083203-7e67d87a6b3f+incompatible -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/bsm/sarama-cluster@v2.1.14-0.20180625083203-7e67d87a6b3f+incompatible/LICENSE: - -(The MIT License) - -Copyright (c) 2017 Black Square Media Ltd - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -------------------------------------------------------------------------------- Dependency : github.com/cavaliergopher/rpm Version: v1.2.0 @@ -33210,68 +33178,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------- -Dependency : github.com/Shopify/sarama -Version: v1.27.0 -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/!shopify/sarama@v1.27.0/LICENSE: - -Copyright (c) 2013 Shopify - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - --------------------------------------------------------------------------------- -Dependency : github.com/Shopify/toxiproxy -Version: v2.1.4+incompatible -Licence type (autodetected): MIT --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/!shopify/toxiproxy@v2.1.4+incompatible/LICENSE: - -The MIT License (MIT) - -Copyright (c) 2014 Shopify - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - -------------------------------------------------------------------------------- Dependency : github.com/akavel/rsrc Version: v0.8.0 @@ -52219,44 +52125,6 @@ Contents of probable licence file $GOMODCACHE/github.com/oxtoacart/bpool@v0.0.0- limitations under the License. --------------------------------------------------------------------------------- -Dependency : github.com/pierrec/lz4 -Version: v2.6.0+incompatible -Licence type (autodetected): BSD-3-Clause --------------------------------------------------------------------------------- - -Contents of probable licence file $GOMODCACHE/github.com/pierrec/lz4@v2.6.0+incompatible/LICENSE: - -Copyright (c) 2015, Pierre Curto -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of xxHash nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - -------------------------------------------------------------------------------- Dependency : github.com/pkg/browser Version: v0.0.0-20240102092130-5ac0b6a4141c diff --git a/go.mod b/go.mod index 271d44d60f9..8012adc5a63 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,6 @@ require ( github.com/Microsoft/go-winio v0.6.2 github.com/PaesslerAG/gval v1.2.2 github.com/PaesslerAG/jsonpath v0.1.1 - github.com/Shopify/sarama v1.27.0 // indirect github.com/StackExchange/wmi v1.2.1 github.com/akavel/rsrc v0.8.0 // indirect github.com/apoydence/eachers v0.0.0-20181020210610-23942921fe77 // indirect @@ -40,7 +39,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/sqs v1.34.5 github.com/aws/aws-sdk-go-v2/service/sts v1.30.5 github.com/blakesmith/ar v0.0.0-20150311145944-8bd4349a67f2 - github.com/bsm/sarama-cluster v2.1.14-0.20180625083203-7e67d87a6b3f+incompatible github.com/cavaliergopher/rpm v1.2.0 github.com/cespare/xxhash/v2 v2.3.0 github.com/cloudfoundry-community/go-cfclient v0.0.0-20190808214049-35bcce23fc5f @@ -360,7 +358,6 @@ require ( github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0 // indirect - github.com/pierrec/lz4 v2.6.0+incompatible // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/prometheus/client_golang v1.20.2 // indirect diff --git a/go.sum b/go.sum index 0a120eb96a2..75a9a860c06 100644 --- a/go.sum +++ b/go.sum @@ -130,10 +130,6 @@ github.com/PaesslerAG/jsonpath v0.1.1 h1:c1/AToHQMVsduPAa4Vh6xp2U0evy4t8SWp8imEs github.com/PaesslerAG/jsonpath v0.1.1/go.mod h1:lVboNxFGal/VwW6d9JzIy56bUsYAP6tH/x80vjnCseY= github.com/PaloAltoNetworks/pango v0.10.2 h1:Tjn6vIzzAq6Dd7N0mDuiP8w8pz8k5W9zz/TTSUQCsQY= github.com/PaloAltoNetworks/pango v0.10.2/go.mod h1:GztcRnVLur7G+VFG7Z5ZKNFgScLtsycwPMp1qVebE5g= -github.com/Shopify/sarama v1.27.0 h1:tqo2zmyzPf1+gwTTwhI6W+EXDw4PVSczynpHKFtVAmo= -github.com/Shopify/sarama v1.27.0/go.mod h1:aCdj6ymI8uyPEux1JJ9gcaDT6cinjGhNCAhs54taSUo= -github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= -github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/aerospike/aerospike-client-go/v7 v7.7.1 h1:lcskBtPZYe6ESObhIEQEp4XO1axYZpaFD3ie4iwr6tg= @@ -246,8 +242,6 @@ github.com/blakesmith/ar v0.0.0-20150311145944-8bd4349a67f2 h1:oMCHnXa6CCCafdPDb github.com/blakesmith/ar v0.0.0-20150311145944-8bd4349a67f2/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI= github.com/bluekeyes/go-gitdiff v0.7.1 h1:graP4ElLRshr8ecu0UtqfNTCHrtSyZd3DABQm/DWesQ= github.com/bluekeyes/go-gitdiff v0.7.1/go.mod h1:QpfYYO1E0fTVHVZAZKiRjtSGY9823iCdvGXBcEzHGbM= -github.com/bsm/sarama-cluster v2.1.14-0.20180625083203-7e67d87a6b3f+incompatible h1:4g18+HnTDwEtO0n7K8B1Kjq+04MEKJRkhJNQ/hb9d5A= -github.com/bsm/sarama-cluster v2.1.14-0.20180625083203-7e67d87a6b3f+incompatible/go.mod h1:r7ao+4tTNXvWm+VRpRJchr2kQhqxgmAp2iEX5W96gMM= github.com/cavaliergopher/rpm v1.2.0 h1:s0h+QeVK252QFTolkhGiMeQ1f+tMeIMhGl8B1HUmGUc= github.com/cavaliergopher/rpm v1.2.0/go.mod h1:R0q3vTqa7RUvPofAZYrnjJ63hh2vngjFfphuXiExVos= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= @@ -278,7 +272,6 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cyphar/filepath-securejoin v0.2.5 h1:6iR5tXJ/e6tJZzzdMc1km3Sa7RRIVBKAK32O2s7AYfo= @@ -324,10 +317,8 @@ github.com/dop251/goja_nodejs v0.0.0-20171011081505-adff31b136e6 h1:RrkoB0pT3gnj github.com/dop251/goja_nodejs v0.0.0-20171011081505-adff31b136e6/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-resiliency v1.7.0 h1:n3NRTnBn5N0Cbi/IeOHuQn9s2UwVUH7Ga0ZWcP+9JTA= github.com/eapache/go-resiliency v1.7.0/go.mod h1:5yPzW0MIvSe0JDsv0v+DvcjEv2FyD6iZYSs1ZI+iQho= -github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4ALJ04o5Qqpdz8XLIpNA3WM/iSIXqxtqo7UGVws= github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= @@ -430,7 +421,6 @@ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8 github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/foxcpp/go-mockdns v0.0.0-20201212160233-ede2f9158d15 h1:nLPjjvpUAODOR6vY/7o0hBIk8iTr19Fvmf8aFx/kC7A= github.com/foxcpp/go-mockdns v0.0.0-20201212160233-ede2f9158d15/go.mod h1:tPg4cp4nseejPd+UKxtCVQ2hUxNTZ7qQZJa7CLriIeo= -github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/go-asn1-ber/asn1-ber v1.5.5 h1:MNHlNMBDgEKD4TcKr36vQN68BA00aDfjIt3/bD50WnA= @@ -523,7 +513,6 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v1.8.3 h1:HR0kYDX2RJZvAup8CsiJwxB4dTCSC0AaUq6S4SiLwUc= @@ -538,7 +527,6 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a 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.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -635,7 +623,6 @@ github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFK github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= -github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg= github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= @@ -674,7 +661,6 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK4= github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= -github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= @@ -684,7 +670,6 @@ github.com/kortschak/utter v1.5.0 h1:1vHGHPZmJ6zU5XbfllIAG3eQBoHT97ePrZJ+pT3RoiQ github.com/kortschak/utter v1.5.0/go.mod h1:vSmSjbyrlKjjsL71193LmzBOKgwePk9DH6uFaWHIInc= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/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= @@ -788,9 +773,6 @@ github.com/otiai10/mint v1.5.1/go.mod h1:MJm72SBthJjz8qhefc4z1PYEieWmy8Bku7CjcAq github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2 h1:CXwSGu/LYmbjEab5aMCs5usQRVBGThelUKBNnoSOuso= github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2/go.mod h1:L3UMQOThbttwfYRNFOWLLVXMhk5Lkio4GGOtw5UrxS0= github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= -github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.6.0+incompatible h1:Ix9yFKn1nSPBLFl/yZknTp8TU5G4Ps0JDmguYK6iH1A= -github.com/pierrec/lz4 v2.6.0+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ= github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pierrre/gotestcover v0.0.0-20160517101806-924dca7d15f0 h1:i5VIxp6QB8oWZ8IkK8zrDgeT6ORGIUeiN+61iETwJbI= @@ -832,7 +814,6 @@ github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0leargg github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/prometheus/prometheus v0.54.1 h1:vKuwQNjnYN2/mDoWfHXDhAsz/68q/dQDb+YbcEqU7MQ= github.com/prometheus/prometheus v0.54.1/go.mod h1:xlLByHhk2g3ycakQGrMaU8K7OySZx98BzeCR99991NY= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/go-charset v0.0.0-20180617210344-2471d30d28b4/go.mod h1:qgYeAmZ5ZIpBWTGllZSQnw97Dj+woV0toclVaRGI8pc= @@ -880,7 +861,6 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf 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.0/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= @@ -916,8 +896,6 @@ github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= -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/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -1014,7 +992,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/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= @@ -1062,7 +1039,6 @@ golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/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-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200528225125-3c3fba18258b/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-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1275,7 +1251,6 @@ gopkg.in/yaml.v2 v2.2.8/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-20200601152816-913338de1bd2/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= diff --git a/libbeat/common/kafka/version.go b/libbeat/common/kafka/version.go index 04243590ec2..bf60c28d77c 100644 --- a/libbeat/common/kafka/version.go +++ b/libbeat/common/kafka/version.go @@ -57,7 +57,16 @@ var ( "2.4": sarama.V2_4_0_0, "2.5": sarama.V2_5_0_0, "2.6": sarama.V2_6_0_0, + "2.7": sarama.V2_7_0_0, + "2.8": sarama.V2_8_0_0, "2": sarama.V2_6_0_0, + + "3": sarama.V3_1_1_0, + "3.2": sarama.V3_2_0_0, + "3.3": sarama.V3_3_1_0, + "3.4": sarama.V3_4_0_0, + "3.5": sarama.V3_5_1_0, + "3.6": sarama.V3_6_0_0, } ) From 93b7c07ab3465f229b337359245d2b3d59914e0e Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Fri, 22 Nov 2024 12:20:29 +0530 Subject: [PATCH 17/23] fix failing test --- .../kafka/consumergroup/consumergroup_integration_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go index aafb5250499..7b03ce3e71d 100644 --- a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go +++ b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go @@ -25,7 +25,7 @@ import ( "testing" "time" - saramacluster "github.com/bsm/sarama-cluster" + "github.com/elastic/sarama" "github.com/elastic/beats/v7/libbeat/tests/compose" "github.com/elastic/beats/v7/metricbeat/mb" @@ -96,7 +96,7 @@ func TestFetch(t *testing.T) { func startConsumer(t *testing.T, host string, topic string) (io.Closer, error) { brokers := []string{host} topics := []string{topic} - config := saramacluster.NewConfig() + config := sarama.NewConfig() config.Net.SASL.Enable = true config.Net.SASL.User = kafkaSASLConsumerUsername config.Net.SASL.Password = kafkaSASLConsumerPassword @@ -105,7 +105,9 @@ func startConsumer(t *testing.T, host string, topic string) (io.Closer, error) { // To work around the issue we need to set CommitInterval, but now sarama emits // a deprecation warning. config.Consumer.Offsets.CommitInterval = 1 * time.Second - return saramacluster.NewConsumer(brokers, "test-group", topics, config) + + return sarama.NewConsumer(brokers, "test-group", topics, config) + } func getConfig(host string) map[string]interface{} { From 3c6ea31d90e5b338bd2950bc354a9cfb7358746e Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Fri, 22 Nov 2024 12:42:08 +0530 Subject: [PATCH 18/23] upgrade kafka version for testing --- testing/environments/docker/kafka/Dockerfile | 10 +++++----- testing/environments/docker/kafka/README.md | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/testing/environments/docker/kafka/Dockerfile b/testing/environments/docker/kafka/Dockerfile index afb2df2d9d7..826d09c4823 100644 --- a/testing/environments/docker/kafka/Dockerfile +++ b/testing/environments/docker/kafka/Dockerfile @@ -1,13 +1,13 @@ FROM debian:buster -ENV KAFKA_HOME /kafka +ENV KAFKA_HOME=/kafka # Controls the hostname advertised within the Docker network, should generally match the container # name in a docker-compose file. -ENV KAFKA_ADVERTISED_HOST kafka +ENV KAFKA_ADVERTISED_HOST=kafka ENV KAFKA_LOGS_DIR="/kafka-logs" -ENV KAFKA_VERSION 2.2.2 -ENV _JAVA_OPTIONS "-Djava.net.preferIPv4Stack=true" +ENV KAFKA_VERSION=3.5.1 +ENV _JAVA_OPTIONS="-Djava.net.preferIPv4Stack=true" ENV TERM=linux RUN apt-get update && apt-get install -y curl openjdk-11-jre-headless netcat-openbsd @@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y curl openjdk-11-jre-headless netcat-ope RUN mkdir -p ${KAFKA_LOGS_DIR} && mkdir -p ${KAFKA_HOME} && \ curl -J -L -s -f -o - https://github.com/kadwanev/retry/releases/download/1.0.1/retry-1.0.1.tar.gz | tar xfz - -C /usr/local/bin && \ retry --min 1 --max 180 -- curl -J -L -s -f --show-error -o $INSTALL_DIR/kafka.tgz \ - "https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_2.11-${KAFKA_VERSION}.tgz" && \ + "https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_2.12-${KAFKA_VERSION}.tgz" && \ tar xzf ${INSTALL_DIR}/kafka.tgz -C ${KAFKA_HOME} --strip-components 1 ADD run.sh /run.sh diff --git a/testing/environments/docker/kafka/README.md b/testing/environments/docker/kafka/README.md index 16b6223f988..cafc12fe95a 100644 --- a/testing/environments/docker/kafka/README.md +++ b/testing/environments/docker/kafka/README.md @@ -1,6 +1,10 @@ # Kafka test container -This Docker container provides an environment for testing with Kafka. It exposes two ports to the host system, `9092` for `PLAINTEXT` and `9093` for `SASL/SSL` with username `beats` and password `KafkaTest`. +This Docker container provides an environment for testing with Kafka. It exposes two ports to the host system, `9092` for `PLAINTEXT` and `9093` for `SASL/SSL` with username `beats` and password `KafkaTest`. To run this container locally, make sure to add below entry to /etc/hosts + +``` +127.0.0.1 kafka +``` ## Certificates From fc94087b717a1500e46d40274224e50c78d2a9f7 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Fri, 22 Nov 2024 13:22:59 +0530 Subject: [PATCH 19/23] using 2.2.2 kafka version --- testing/environments/docker/kafka/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/environments/docker/kafka/Dockerfile b/testing/environments/docker/kafka/Dockerfile index 826d09c4823..58fbdb0dded 100644 --- a/testing/environments/docker/kafka/Dockerfile +++ b/testing/environments/docker/kafka/Dockerfile @@ -6,7 +6,7 @@ ENV KAFKA_HOME=/kafka ENV KAFKA_ADVERTISED_HOST=kafka ENV KAFKA_LOGS_DIR="/kafka-logs" -ENV KAFKA_VERSION=3.5.1 +ENV KAFKA_VERSION=2.2.2 ENV _JAVA_OPTIONS="-Djava.net.preferIPv4Stack=true" ENV TERM=linux @@ -15,7 +15,7 @@ RUN apt-get update && apt-get install -y curl openjdk-11-jre-headless netcat-ope RUN mkdir -p ${KAFKA_LOGS_DIR} && mkdir -p ${KAFKA_HOME} && \ curl -J -L -s -f -o - https://github.com/kadwanev/retry/releases/download/1.0.1/retry-1.0.1.tar.gz | tar xfz - -C /usr/local/bin && \ retry --min 1 --max 180 -- curl -J -L -s -f --show-error -o $INSTALL_DIR/kafka.tgz \ - "https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_2.12-${KAFKA_VERSION}.tgz" && \ + "https://archive.apache.org/dist/kafka/${KAFKA_VERSION}/kafka_2.11-${KAFKA_VERSION}.tgz" && \ tar xzf ${INSTALL_DIR}/kafka.tgz -C ${KAFKA_HOME} --strip-components 1 ADD run.sh /run.sh From 7db64c9bc1596fe5b002820709372d4882d9f64d Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Fri, 22 Nov 2024 16:59:59 +0530 Subject: [PATCH 20/23] startConsumergroup --- .../consumergroup_integration_test.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go index 7b03ce3e71d..b7ddffb891e 100644 --- a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go +++ b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go @@ -15,8 +15,6 @@ // specific language governing permissions and limitations // under the License. -//go:build integration - package consumergroup import ( @@ -45,7 +43,7 @@ func TestData(t *testing.T) { compose.UpWithAdvertisedHostEnvFileForPort(9092), ) - c, err := startConsumer(t, service.HostForPort(9092), "metricbeat-test") + c, err := startConsumer(service.HostForPort(9092)) if err != nil { t.Fatal(fmt.Errorf("starting kafka consumer: %w", err)) } @@ -68,7 +66,7 @@ func TestFetch(t *testing.T) { compose.UpWithAdvertisedHostEnvFileForPort(9092), ) - c, err := startConsumer(t, service.HostForPort(9092), "metricbeat-test") + c, err := startConsumer(service.HostForPort(9092)) if err != nil { t.Fatal(fmt.Errorf("starting kafka consumer: %w", err)) } @@ -93,9 +91,8 @@ func TestFetch(t *testing.T) { } } -func startConsumer(t *testing.T, host string, topic string) (io.Closer, error) { +func startConsumer(host string) (io.Closer, error) { brokers := []string{host} - topics := []string{topic} config := sarama.NewConfig() config.Net.SASL.Enable = true config.Net.SASL.User = kafkaSASLConsumerUsername @@ -104,9 +101,10 @@ func startConsumer(t *testing.T, host string, topic string) (io.Closer, error) { // https://github.com/Shopify/sarama/issues/1638 // To work around the issue we need to set CommitInterval, but now sarama emits // a deprecation warning. - config.Consumer.Offsets.CommitInterval = 1 * time.Second + config.Consumer.Offsets.AutoCommit.Enable = true + config.Consumer.Offsets.AutoCommit.Interval = 1 * time.Second - return sarama.NewConsumer(brokers, "test-group", topics, config) + return sarama.NewConsumer(brokers, config) } From e7deb67901ec7d20e57f1fbab5f30432cff3c7a6 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Fri, 22 Nov 2024 18:10:03 +0530 Subject: [PATCH 21/23] consumergroup --- .../kafka/consumergroup/consumergroup_integration_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go index b7ddffb891e..d90431b3141 100644 --- a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go +++ b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go @@ -15,6 +15,8 @@ // specific language governing permissions and limitations // under the License. +//go:build integration + package consumergroup import ( @@ -104,7 +106,8 @@ func startConsumer(host string) (io.Closer, error) { config.Consumer.Offsets.AutoCommit.Enable = true config.Consumer.Offsets.AutoCommit.Interval = 1 * time.Second - return sarama.NewConsumer(brokers, config) + consumer, _ := sarama.NewConsumer(brokers, config) + return consumer.ConsumePartition("metricbeat-test", 0, sarama.OffsetNewest) } From ba7e70c834974f7433da49cf69c954ed6de8d606 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Sat, 23 Nov 2024 00:18:44 +0530 Subject: [PATCH 22/23] add IBM/sarama methods for consumerinteg --- libbeat/outputs/kafka/client.go | 6 +- libbeat/outputs/kafka/partition.go | 6 +- .../consumergroup_integration_test.go | 69 ++++++++++++++++--- metricbeat/module/kafka/docker-compose.yml | 2 - 4 files changed, 68 insertions(+), 15 deletions(-) diff --git a/libbeat/outputs/kafka/client.go b/libbeat/outputs/kafka/client.go index 90e1156bf23..919fafde839 100644 --- a/libbeat/outputs/kafka/client.go +++ b/libbeat/outputs/kafka/client.go @@ -273,7 +273,11 @@ func (c *client) errorWorker(ch <-chan *sarama.ProducerError) { defer c.log.Debug("Stop kafka error handler") for errMsg := range ch { - msg, _ := errMsg.Msg.Metadata.(*message) + msg, ok := errMsg.Msg.Metadata.(*message) + if !ok { + c.log.Debug("Failed to assert libMsg.Metadata to *message") + return + } msg.ref.fail(msg, errMsg.Err) if errors.Is(errMsg.Err, breaker.ErrBreakerOpen) { diff --git a/libbeat/outputs/kafka/partition.go b/libbeat/outputs/kafka/partition.go index b9ca8660fc6..1a925f31fa8 100644 --- a/libbeat/outputs/kafka/partition.go +++ b/libbeat/outputs/kafka/partition.go @@ -116,7 +116,11 @@ func (p *messagePartitioner) Partition( libMsg *sarama.ProducerMessage, numPartitions int32, ) (int32, error) { - msg, _ := libMsg.Metadata.(*message) + msg, ok := libMsg.Metadata.(*message) + if !ok { + return 0, fmt.Errorf("failed to assert libMsg.Metadata to *message") + } + if numPartitions == p.partitions { // if reachable is false, this is always true if 0 <= msg.partition && msg.partition < numPartitions { return msg.partition, nil diff --git a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go index d90431b3141..3bfbf75e903 100644 --- a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go +++ b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go @@ -20,6 +20,7 @@ package consumergroup import ( + "context" "fmt" "io" "testing" @@ -45,7 +46,7 @@ func TestData(t *testing.T) { compose.UpWithAdvertisedHostEnvFileForPort(9092), ) - c, err := startConsumer(service.HostForPort(9092)) + c, err := startConsumer(t, service.HostForPort(9092), "metricbeat-test", "test-group") if err != nil { t.Fatal(fmt.Errorf("starting kafka consumer: %w", err)) } @@ -68,7 +69,7 @@ func TestFetch(t *testing.T) { compose.UpWithAdvertisedHostEnvFileForPort(9092), ) - c, err := startConsumer(service.HostForPort(9092)) + c, err := startConsumer(t, service.HostForPort(9092), "metricbeat-test", "test-group") if err != nil { t.Fatal(fmt.Errorf("starting kafka consumer: %w", err)) } @@ -93,22 +94,68 @@ func TestFetch(t *testing.T) { } } -func startConsumer(host string) (io.Closer, error) { +func startConsumer(t *testing.T, host string, topic string, groupID string) (io.Closer, error) { brokers := []string{host} + topics := []string{topic} + config := sarama.NewConfig() + config.Version = sarama.V2_5_0_0 // Use the correct Kafka version + config.Consumer.Group.Rebalance.Strategy = sarama.BalanceStrategyRange + config.Consumer.Offsets.Initial = sarama.OffsetOldest config.Net.SASL.Enable = true config.Net.SASL.User = kafkaSASLConsumerUsername config.Net.SASL.Password = kafkaSASLConsumerPassword - // The test panics unless CommitInterval is set due to the following bug in sarama: - // https://github.com/Shopify/sarama/issues/1638 - // To work around the issue we need to set CommitInterval, but now sarama emits - // a deprecation warning. - config.Consumer.Offsets.AutoCommit.Enable = true - config.Consumer.Offsets.AutoCommit.Interval = 1 * time.Second - consumer, _ := sarama.NewConsumer(brokers, config) - return consumer.ConsumePartition("metricbeat-test", 0, sarama.OffsetNewest) + // Create a new consumer group + consumerGroup, err := sarama.NewConsumerGroup(brokers, groupID, config) + if err != nil { + t.Fatalf("Error creating consumer group: %v", err) + return nil, err + } + + // Run the consumer in a separate goroutine + ctx := context.Background() + go func() { + for { + err := consumerGroup.Consume(ctx, topics, &Consumer{}) + if err != nil { + t.Logf("Error consuming: %v", err) + } + // Check if the context was canceled + if ctx.Err() != nil { + return + } + } + }() + + return consumerGroup, nil +} + +// Consumer struct implementing sarama.ConsumerGroupHandler +type Consumer struct{} + +// Setup is run before the consumer starts consuming +func (c *Consumer) Setup(session sarama.ConsumerGroupSession) error { + fmt.Println("Consumer setup completed") + return nil +} +// Cleanup is run after the consumer stops consuming +func (c *Consumer) Cleanup(session sarama.ConsumerGroupSession) error { + fmt.Println("Consumer cleanup completed") + return nil +} + +// ConsumeClaim processes messages from Kafka topics +func (c *Consumer) ConsumeClaim(session sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error { + for message := range claim.Messages() { + fmt.Printf("Message topic:%s partition:%d offset:%d key:%s value:%s\n", + message.Topic, message.Partition, message.Offset, string(message.Key), string(message.Value)) + + // Mark message as processed + session.MarkMessage(message, "") + } + return nil } func getConfig(host string) map[string]interface{} { diff --git a/metricbeat/module/kafka/docker-compose.yml b/metricbeat/module/kafka/docker-compose.yml index 9865faf5116..76bea13fcf8 100644 --- a/metricbeat/module/kafka/docker-compose.yml +++ b/metricbeat/module/kafka/docker-compose.yml @@ -1,5 +1,3 @@ -version: '2.3' - services: kafka: image: docker.elastic.co/integrations-ci/beats-kafka:${KAFKA_VERSION:-2.2.2}-2 From 675a960684ce2651e88637049ea3b731438e47b4 Mon Sep 17 00:00:00 2001 From: Khushi Jain Date: Sat, 23 Nov 2024 00:39:25 +0530 Subject: [PATCH 23/23] linter errors --- .../kafka/consumergroup/consumergroup_integration_test.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go index 3bfbf75e903..623fd7df585 100644 --- a/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go +++ b/metricbeat/module/kafka/consumergroup/consumergroup_integration_test.go @@ -99,9 +99,6 @@ func startConsumer(t *testing.T, host string, topic string, groupID string) (io. topics := []string{topic} config := sarama.NewConfig() - config.Version = sarama.V2_5_0_0 // Use the correct Kafka version - config.Consumer.Group.Rebalance.Strategy = sarama.BalanceStrategyRange - config.Consumer.Offsets.Initial = sarama.OffsetOldest config.Net.SASL.Enable = true config.Net.SASL.User = kafkaSASLConsumerUsername config.Net.SASL.Password = kafkaSASLConsumerPassword @@ -136,13 +133,11 @@ type Consumer struct{} // Setup is run before the consumer starts consuming func (c *Consumer) Setup(session sarama.ConsumerGroupSession) error { - fmt.Println("Consumer setup completed") return nil } // Cleanup is run after the consumer stops consuming func (c *Consumer) Cleanup(session sarama.ConsumerGroupSession) error { - fmt.Println("Consumer cleanup completed") return nil }