From 27e15173dab8f08f41bc5a5d32fed63ecfddab59 Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Mon, 2 Jan 2023 19:34:18 +0100 Subject: [PATCH] fix: apply semgrep suggestions (#3998) --- .semgrepignore | 4 + config/manager/manager.yaml | 1 + config/metrics-server/api_service.yaml | 1 + config/metrics-server/deployment.yaml | 8 +- go.mod | 9 +- go.sum | 69 +- pkg/metricsservice/client.go | 3 +- pkg/metricsservice/server.go | 9 +- pkg/provider/provider.go | 2 +- pkg/scalers/activemq_scaler.go | 14 +- pkg/scalers/artemis_scaler.go | 12 +- .../authentication/authentication_helpers.go | 4 +- pkg/scalers/aws_cloudwatch_scaler.go | 8 +- pkg/scalers/aws_dynamodb_scaler.go | 8 +- pkg/scalers/aws_dynamodb_scaler_test.go | 2 +- pkg/scalers/aws_dynamodb_streams_scaler.go | 6 +- pkg/scalers/aws_kinesis_stream_scaler.go | 4 +- pkg/scalers/aws_sqs_queue_scaler.go | 4 +- pkg/scalers/azure/azure_app_insights.go | 2 +- pkg/scalers/azure/azure_data_explorer.go | 12 +- pkg/scalers/azure/azure_eventhub.go | 2 +- .../azure/azure_eventhub_checkpoint.go | 10 +- pkg/scalers/azure/azure_eventhub_test.go | 4 +- pkg/scalers/azure/azure_monitor.go | 2 +- pkg/scalers/azure_app_insights_scaler.go | 8 +- pkg/scalers/azure_blob_scaler.go | 10 +- pkg/scalers/azure_data_explorer_scaler.go | 12 +- pkg/scalers/azure_eventhub_scaler.go | 24 +- pkg/scalers/azure_eventhub_scaler_test.go | 28 +- pkg/scalers/azure_log_analytics_scaler.go | 34 +- pkg/scalers/azure_monitor_scaler.go | 8 +- pkg/scalers/azure_pipelines_scaler.go | 8 +- pkg/scalers/azure_queue_scaler.go | 8 +- pkg/scalers/azure_servicebus_scaler.go | 4 +- pkg/scalers/cassandra_scaler.go | 16 +- pkg/scalers/couchdb_scaler.go | 18 +- pkg/scalers/cpu_memory_scaler.go | 2 +- pkg/scalers/cron_scaler.go | 14 +- pkg/scalers/datadog_scaler.go | 26 +- pkg/scalers/elasticsearch_scaler.go | 13 +- pkg/scalers/etcd_scaler.go | 14 +- pkg/scalers/external_scaler.go | 9 +- pkg/scalers/gcp_pubsub_scaler.go | 10 +- pkg/scalers/gcp_stackdriver_scaler.go | 10 +- pkg/scalers/gcp_storage_scaler.go | 12 +- pkg/scalers/graphite_scaler.go | 8 +- pkg/scalers/huawei_cloudeye_scaler.go | 4 +- pkg/scalers/ibmmq_scaler.go | 20 +- pkg/scalers/influxdb_scaler.go | 10 +- pkg/scalers/kafka_scaler.go | 44 +- pkg/scalers/kubernetes_workload_scaler.go | 6 +- pkg/scalers/liiklus/LiiklusService.pb.go | 2 - pkg/scalers/liiklus_scaler.go | 10 +- pkg/scalers/loki_scaler.go | 10 +- pkg/scalers/metrics_api_scaler.go | 12 +- pkg/scalers/mongo_scaler.go | 14 +- pkg/scalers/mssql_scaler.go | 14 +- pkg/scalers/mysql_scaler.go | 12 +- pkg/scalers/nats_jetstream_scaler.go | 10 +- pkg/scalers/newrelic_scaler.go | 8 +- .../openstack/keystone_authentication.go | 14 +- pkg/scalers/openstack_metrics_scaler.go | 18 +- pkg/scalers/openstack_swift_scaler.go | 20 +- pkg/scalers/postgresql_scaler.go | 14 +- pkg/scalers/predictkube_scaler.go | 12 +- pkg/scalers/prometheus_scaler.go | 10 +- pkg/scalers/pulsar_scaler.go | 22 +- pkg/scalers/rabbitmq_scaler.go | 24 +- pkg/scalers/redis_scaler.go | 22 +- pkg/scalers/redis_streams_scaler.go | 20 +- pkg/scalers/selenium_grid_scaler.go | 10 +- pkg/scalers/solace_scaler.go | 16 +- pkg/scalers/stan_scaler.go | 10 +- pkg/scaling/executor/scale_jobs.go | 6 +- pkg/scaling/resolver/scale_resolvers.go | 6 +- pkg/scaling/scale_handler.go | 4 +- pkg/util/parse_string.go | 8 +- pkg/util/tls_config.go | 4 +- vendor/golang.org/x/net/http2/hpack/encode.go | 5 + vendor/golang.org/x/net/http2/server.go | 52 +- vendor/golang.org/x/net/http2/transport.go | 78 +- .../x/net/publicsuffix/data/children | Bin 0 -> 2876 bytes .../golang.org/x/net/publicsuffix/data/nodes | Bin 0 -> 48280 bytes .../golang.org/x/net/publicsuffix/data/text | 1 + vendor/golang.org/x/net/publicsuffix/list.go | 36 +- vendor/golang.org/x/net/publicsuffix/table.go | 10552 +--------------- .../golang.org/x/sys/execabs/execabs_go119.go | 8 +- .../x/sys/windows/syscall_windows.go | 1 + .../x/sys/windows/zsyscall_windows.go | 7 + vendor/modules.txt | 9 +- 90 files changed, 612 insertions(+), 11049 deletions(-) create mode 100644 vendor/golang.org/x/net/publicsuffix/data/children create mode 100644 vendor/golang.org/x/net/publicsuffix/data/nodes create mode 100644 vendor/golang.org/x/net/publicsuffix/data/text diff --git a/.semgrepignore b/.semgrepignore index 0b104db10c2..665f762db1c 100644 --- a/.semgrepignore +++ b/.semgrepignore @@ -4,3 +4,7 @@ vendor/ # Autogenerated code pkg/generated/ **/zz_generated.* +config/crd/bases/ + +# Add .gitignore +:include .gitignore diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 12e57b1d47a..255cd14624f 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -68,6 +68,7 @@ spec: - ALL allowPrivilegeEscalation: false readOnlyRootFilesystem: true + runAsNonRoot: true seccompProfile: type: RuntimeDefault terminationGracePeriodSeconds: 10 diff --git a/config/metrics-server/api_service.yaml b/config/metrics-server/api_service.yaml index c86015e8ab5..cef8b603b73 100644 --- a/config/metrics-server/api_service.yaml +++ b/config/metrics-server/api_service.yaml @@ -6,6 +6,7 @@ metadata: app.kubernetes.io/version: latest app.kubernetes.io/part-of: keda-operator name: v1beta1.external.metrics.k8s.io +# nosemgrep: yaml.kubernetes.security.skip-tls-verify-service.skip-tls-verify-service spec: service: name: keda-metrics-apiserver diff --git a/config/metrics-server/deployment.yaml b/config/metrics-server/deployment.yaml index 42016989d61..43d4c7cec8d 100644 --- a/config/metrics-server/deployment.yaml +++ b/config/metrics-server/deployment.yaml @@ -69,13 +69,15 @@ spec: volumeMounts: - mountPath: /tmp name: temp-vol + - mountPath: /apiserver.local.config/certificates + name: certs securityContext: capabilities: drop: - ALL allowPrivilegeEscalation: false - ## Metrics server needs to write the self-signed cert. See FAQ for discussion of options. - # readOnlyRootFilesystem: true + runAsNonRoot: true + readOnlyRootFilesystem: true seccompProfile: type: RuntimeDefault nodeSelector: @@ -83,3 +85,5 @@ spec: volumes: - name: temp-vol emptyDir: {} + - name: certs + emptyDir: {} diff --git a/go.mod b/go.mod index c701b3f3335..54ee167110f 100644 --- a/go.mod +++ b/go.mod @@ -99,6 +99,9 @@ replace ( // https://avd.aquasec.com/nvd/2022/cve-2022-27191/ golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 + // Needed for CVE-2022-41717 https://avd.aquasec.com/nvd/2022/cve-2022-41717/ + golang.org/x/net => golang.org/x/net v0.4.0 + // https://nvd.nist.gov/vuln/detail/CVE-2022-32149 golang.org/x/text => golang.org/x/text v0.4.0 @@ -275,9 +278,9 @@ require ( golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect golang.org/x/net v0.2.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.2.0 // indirect - golang.org/x/term v0.2.0 // indirect - golang.org/x/text v0.4.0 // indirect + golang.org/x/sys v0.3.0 // indirect + golang.org/x/term v0.3.0 // indirect + golang.org/x/text v0.5.0 // indirect golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect golang.org/x/tools v0.1.12 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect diff --git a/go.sum b/go.sum index 5b4a5ed8461..7ced9b1bddb 100644 --- a/go.sum +++ b/go.sum @@ -1009,57 +1009,8 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220513224357-95641704303c/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220725212005-46097bf591d3/go.mod h1:AaygXjzTFtRAg2ttMY5RMuhpJ3cNnI0XpyFJD1iQRSM= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= +golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1123,13 +1074,10 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1141,25 +1089,20 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= +golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= diff --git a/pkg/metricsservice/client.go b/pkg/metricsservice/client.go index cb96275830d..d5d52b7bd10 100644 --- a/pkg/metricsservice/client.go +++ b/pkg/metricsservice/client.go @@ -58,6 +58,7 @@ func NewGrpcClient(url string) (*GrpcClient, error) { return &GrpcClient{client: api.NewMetricsServiceClient(conn), connection: conn}, nil } +// nosemgrep: trailofbits.go.invalid-usage-of-modified-variable.invalid-usage-of-modified-variable func (c *GrpcClient) GetMetrics(ctx context.Context, scaledObjectName, scaledObjectNamespace, metricName string) (*external_metrics.ExternalMetricValueList, *api.PromMetricsMsg, error) { response, err := c.client.GetMetrics(ctx, &api.ScaledObjectRef{Name: scaledObjectName, Namespace: scaledObjectNamespace, MetricName: metricName}) if err != nil { @@ -71,7 +72,7 @@ func (c *GrpcClient) GetMetrics(ctx context.Context, scaledObjectName, scaledObj if err != nil { // in certain cases we would like to get Prometheus metrics even if there's an error // so we can expose information about the error in the client - return nil, response.GetPromMetrics(), fmt.Errorf("error when converting metric values %s", err) + return nil, response.GetPromMetrics(), fmt.Errorf("error when converting metric values %w", err) } return extMetrics, response.GetPromMetrics(), nil diff --git a/pkg/metricsservice/server.go b/pkg/metricsservice/server.go index 5ef78fcb262..06703f5b3ec 100644 --- a/pkg/metricsservice/server.go +++ b/pkg/metricsservice/server.go @@ -45,12 +45,12 @@ func (s *GrpcServer) GetMetrics(ctx context.Context, in *api.ScaledObjectRef) (* extMetrics, exportedMetrics, err := (*s.scalerHandler).GetScaledObjectMetrics(ctx, in.Name, in.Namespace, in.MetricName) response.PromMetrics = exportedMetrics if err != nil { - return &response, fmt.Errorf("error when getting metric values %s", err) + return &response, fmt.Errorf("error when getting metric values %w", err) } err = v1beta1.Convert_external_metrics_ExternalMetricValueList_To_v1beta1_ExternalMetricValueList(extMetrics, v1beta1ExtMetrics, nil) if err != nil { - return &response, fmt.Errorf("error when converting metric values %s", err) + return &response, fmt.Errorf("error when converting metric values %w", err) } log.V(1).WithValues("scaledObjectName", in.Name, "scaledObjectNamespace", in.Namespace, "metrics", v1beta1ExtMetrics).Info("Providing metrics") @@ -61,6 +61,7 @@ func (s *GrpcServer) GetMetrics(ctx context.Context, in *api.ScaledObjectRef) (* // NewGrpcServer creates a new instance of GrpcServer func NewGrpcServer(scaleHandler *scaling.ScaleHandler, address string) GrpcServer { + // nosemgrep: go.grpc.security.grpc-server-insecure-connection.grpc-server-insecure-connection gsrv := grpc.NewServer() srv := GrpcServer{ server: gsrv, @@ -75,11 +76,11 @@ func NewGrpcServer(scaleHandler *scaling.ScaleHandler, address string) GrpcServe func (s *GrpcServer) startServer() error { lis, err := net.Listen("tcp", s.address) if err != nil { - return fmt.Errorf("failed to listen: %v", err) + return fmt.Errorf("failed to listen: %w", err) } if err := s.server.Serve(lis); err != nil { - return fmt.Errorf("failed to serve: %v", err) + return fmt.Errorf("failed to serve: %w", err) } return nil diff --git a/pkg/provider/provider.go b/pkg/provider/provider.go index c4d283284fe..7241bb6a14e 100644 --- a/pkg/provider/provider.go +++ b/pkg/provider/provider.go @@ -146,7 +146,7 @@ func (p *KedaProvider) GetExternalMetric(ctx context.Context, namespace string, cache, err := p.scaleHandler.GetScalersCache(ctx, scaledObject) promMetricsServer.RecordScaledObjectError(scaledObject.Namespace, scaledObject.Name, err) if err != nil { - return nil, fmt.Errorf("error when getting scalers %s", err) + return nil, fmt.Errorf("error when getting scalers %w", err) } // let's check metrics for all scalers in a ScaledObject diff --git a/pkg/scalers/activemq_scaler.go b/pkg/scalers/activemq_scaler.go index 2e07e1984ff..12e5834a98e 100644 --- a/pkg/scalers/activemq_scaler.go +++ b/pkg/scalers/activemq_scaler.go @@ -56,12 +56,12 @@ const ( func NewActiveMQScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } meta, err := parseActiveMQMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing ActiveMQ metadata: %s", err) + return nil, fmt.Errorf("error parsing ActiveMQ metadata: %w", err) } httpClient := kedautil.CreateHTTPClient(config.GlobalHTTPTimeout, false) @@ -170,7 +170,7 @@ func parseActiveMQMetadata(config *ScalerConfig) (*activeMQMetadata, error) { func getRestAPIParameters(meta activeMQMetadata) (activeMQMetadata, error) { u, err := url.ParseRequestURI(meta.restAPITemplate) if err != nil { - return meta, fmt.Errorf("unable to parse ActiveMQ restAPITemplate: %s", err) + return meta, fmt.Errorf("unable to parse ActiveMQ restAPITemplate: %w", err) } meta.managementEndpoint = u.Host @@ -178,7 +178,7 @@ func getRestAPIParameters(meta activeMQMetadata) (activeMQMetadata, error) { replacer := strings.NewReplacer(",", "&") v, err := url.ParseQuery(replacer.Replace(splitURL)) // This returns a map with key: string types and element type [] string. : map[brokerName:[<>] destinationName:[<>] destinationType:[Queue] type:[Broker]] if err != nil { - return meta, fmt.Errorf("unable to parse ActiveMQ restAPITemplate: %s", err) + return meta, fmt.Errorf("unable to parse ActiveMQ restAPITemplate: %w", err) } if len(v["destinationName"][0]) == 0 { @@ -203,11 +203,11 @@ func (s *activeMQScaler) getMonitoringEndpoint() (string, error) { } template, err := template.New("monitoring_endpoint").Parse(s.metadata.restAPITemplate) if err != nil { - return "", fmt.Errorf("error parsing template: %s", err) + return "", fmt.Errorf("error parsing template: %w", err) } err = template.Execute(&buf, endpoint) if err != nil { - return "", fmt.Errorf("error executing template: %s", err) + return "", fmt.Errorf("error executing template: %w", err) } monitoringEndpoint := buf.String() return monitoringEndpoint, nil @@ -271,7 +271,7 @@ func (s *activeMQScaler) GetMetricSpecForScaling(context.Context) []v2.MetricSpe func (s *activeMQScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { queueSize, err := s.getQueueMessageCount(ctx) if err != nil { - return nil, false, fmt.Errorf("error inspecting ActiveMQ queue size: %s", err) + return nil, false, fmt.Errorf("error inspecting ActiveMQ queue size: %w", err) } metric := GenerateMetricInMili(metricName, float64(queueSize)) diff --git a/pkg/scalers/artemis_scaler.go b/pkg/scalers/artemis_scaler.go index a90239b2d0c..0e1ee2c425c 100644 --- a/pkg/scalers/artemis_scaler.go +++ b/pkg/scalers/artemis_scaler.go @@ -64,12 +64,12 @@ func NewArtemisQueueScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } artemisMetadata, err := parseArtemisMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing artemis metadata: %s", err) + return nil, fmt.Errorf("error parsing artemis metadata: %w", err) } return &artemisScaler{ @@ -124,7 +124,7 @@ func parseArtemisMetadata(config *ScalerConfig) (*artemisMetadata, error) { if val, ok := config.TriggerMetadata["queueLength"]; ok { queueLength, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, fmt.Errorf("can't parse queueLength: %s", err) + return nil, fmt.Errorf("can't parse queueLength: %w", err) } meta.queueLength = queueLength @@ -133,7 +133,7 @@ func parseArtemisMetadata(config *ScalerConfig) (*artemisMetadata, error) { if val, ok := config.TriggerMetadata["activationQueueLength"]; ok { activationQueueLength, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, fmt.Errorf("can't parse activationQueueLength: %s", err) + return nil, fmt.Errorf("can't parse activationQueueLength: %w", err) } meta.activationQueueLength = activationQueueLength @@ -180,14 +180,14 @@ func parseArtemisMetadata(config *ScalerConfig) (*artemisMetadata, error) { func getAPIParameters(meta artemisMetadata) (artemisMetadata, error) { u, err := url.ParseRequestURI(meta.restAPITemplate) if err != nil { - return meta, fmt.Errorf("unable to parse the artemis restAPITemplate: %s", err) + return meta, fmt.Errorf("unable to parse the artemis restAPITemplate: %w", err) } meta.managementEndpoint = u.Host splitURL := strings.Split(strings.Split(u.RawPath, ":")[1], "/")[0] // This returns : broker="<>",component=addresses,address="<>",subcomponent=queues,routing-type="anycast",queue="<>" replacer := strings.NewReplacer(",", "&", "\"\"", "") v, err := url.ParseQuery(replacer.Replace(splitURL)) // This returns a map with key: string types and element type [] string. : map[address:["<>"] broker:["<>"] component:[addresses] queue:["<>"] routing-type:["anycast"] subcomponent:[queues]] if err != nil { - return meta, fmt.Errorf("unable to parse the artemis restAPITemplate: %s", err) + return meta, fmt.Errorf("unable to parse the artemis restAPITemplate: %w", err) } if len(v["address"][0]) == 0 { diff --git a/pkg/scalers/authentication/authentication_helpers.go b/pkg/scalers/authentication/authentication_helpers.go index 537fe6175e2..6ecf5c315a5 100644 --- a/pkg/scalers/authentication/authentication_helpers.go +++ b/pkg/scalers/authentication/authentication_helpers.go @@ -98,7 +98,7 @@ func CreateHTTPRoundTripper(roundTripperType TransportType, auth *AuthMeta, conf if auth != nil && (auth.CA != "" || auth.EnableTLS) { tlsConfig, err = NewTLSConfig(auth) if err != nil || tlsConfig == nil { - return nil, fmt.Errorf("error creating the TLS config: %s", err) + return nil, fmt.Errorf("error creating the TLS config: %w", err) } } @@ -135,7 +135,7 @@ func CreateHTTPRoundTripper(roundTripperType TransportType, auth *AuthMeta, conf libs.SetTransportConfigs(httpConf), libs.SetTLS(tlsConfig), ); err != nil { - return nil, fmt.Errorf("error creating fast http round tripper: %s", err) + return nil, fmt.Errorf("error creating fast http round tripper: %w", err) } if auth != nil { diff --git a/pkg/scalers/aws_cloudwatch_scaler.go b/pkg/scalers/aws_cloudwatch_scaler.go index cfb21476a02..45fa83b601c 100644 --- a/pkg/scalers/aws_cloudwatch_scaler.go +++ b/pkg/scalers/aws_cloudwatch_scaler.go @@ -60,12 +60,12 @@ type awsCloudwatchMetadata struct { func NewAwsCloudwatchScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } meta, err := parseAwsCloudwatchMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing cloudwatch metadata: %s", err) + return nil, fmt.Errorf("error parsing cloudwatch metadata: %w", err) } return &awsCloudwatchScaler{ @@ -80,7 +80,7 @@ func getIntMetadataValue(metadata map[string]string, key string, required bool, if val, ok := metadata[key]; ok && val != "" { value, err := strconv.Atoi(val) if err != nil { - return 0, fmt.Errorf("error parsing %s metadata: %v", key, err) + return 0, fmt.Errorf("error parsing %s metadata: %w", key, err) } return int64(value), nil } @@ -96,7 +96,7 @@ func getFloatMetadataValue(metadata map[string]string, key string, required bool if val, ok := metadata[key]; ok && val != "" { value, err := strconv.ParseFloat(val, 64) if err != nil { - return 0, fmt.Errorf("error parsing %s metadata: %v", key, err) + return 0, fmt.Errorf("error parsing %s metadata: %w", key, err) } return value, nil } diff --git a/pkg/scalers/aws_dynamodb_scaler.go b/pkg/scalers/aws_dynamodb_scaler.go index 0081975d9da..c6913efb1a5 100644 --- a/pkg/scalers/aws_dynamodb_scaler.go +++ b/pkg/scalers/aws_dynamodb_scaler.go @@ -42,12 +42,12 @@ type awsDynamoDBMetadata struct { func NewAwsDynamoDBScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } meta, err := parseAwsDynamoDBMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing DynamoDb metadata: %s", err) + return nil, fmt.Errorf("error parsing DynamoDb metadata: %w", err) } return &awsDynamoDBScaler{ @@ -231,7 +231,7 @@ func (s *awsDynamoDBScaler) GetQueryMetrics() (float64, error) { func json2Map(js string) (m map[string]*string, err error) { err = bson.UnmarshalExtJSON([]byte(js), true, &m) if err != nil { - return nil, fmt.Errorf("%w: %v", ErrAwsDynamoInvalidExpressionAttributeNames, err) + return nil, fmt.Errorf("%v: %w", ErrAwsDynamoInvalidExpressionAttributeNames, err) } if len(m) == 0 { @@ -245,7 +245,7 @@ func json2DynamoMap(js string) (m map[string]*dynamodb.AttributeValue, err error err = json.Unmarshal([]byte(js), &m) if err != nil { - return nil, fmt.Errorf("%w: %v", ErrAwsDynamoInvalidExpressionAttributeValues, err) + return nil, fmt.Errorf("%v: %w", ErrAwsDynamoInvalidExpressionAttributeValues, err) } return m, err } diff --git a/pkg/scalers/aws_dynamodb_scaler_test.go b/pkg/scalers/aws_dynamodb_scaler_test.go index 204833693fb..d2335f16cd8 100644 --- a/pkg/scalers/aws_dynamodb_scaler_test.go +++ b/pkg/scalers/aws_dynamodb_scaler_test.go @@ -238,7 +238,7 @@ func TestParseDynamoMetadata(t *testing.T) { ScalerIndex: 1, }) if tc.expectedError != nil { - assert.ErrorIs(t, err, tc.expectedError) + assert.ErrorContains(t, err, tc.expectedError.Error()) } else { assert.NoError(t, err) fmt.Println(tc.name) diff --git a/pkg/scalers/aws_dynamodb_streams_scaler.go b/pkg/scalers/aws_dynamodb_streams_scaler.go index 8f2ae7dc525..d8ed4f6f665 100644 --- a/pkg/scalers/aws_dynamodb_streams_scaler.go +++ b/pkg/scalers/aws_dynamodb_streams_scaler.go @@ -43,21 +43,21 @@ type awsDynamoDBStreamsMetadata struct { func NewAwsDynamoDBStreamsScaler(ctx context.Context, config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "aws_dynamodb_streams_scaler") meta, err := parseAwsDynamoDBStreamsMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing dynamodb stream metadata: %s", err) + return nil, fmt.Errorf("error parsing dynamodb stream metadata: %w", err) } dbClient, dbStreamClient := createClientsForDynamoDBStreamsScaler(meta) streamArn, err := getDynamoDBStreamsArn(ctx, dbClient, &meta.tableName) if err != nil { - return nil, fmt.Errorf("error dynamodb stream arn: %s", err) + return nil, fmt.Errorf("error dynamodb stream arn: %w", err) } return &awsDynamoDBStreamsScaler{ diff --git a/pkg/scalers/aws_kinesis_stream_scaler.go b/pkg/scalers/aws_kinesis_stream_scaler.go index fdab9daee36..513b4c09645 100644 --- a/pkg/scalers/aws_kinesis_stream_scaler.go +++ b/pkg/scalers/aws_kinesis_stream_scaler.go @@ -40,14 +40,14 @@ type awsKinesisStreamMetadata struct { func NewAwsKinesisStreamScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "aws_kinesis_stream_scaler") meta, err := parseAwsKinesisStreamMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing Kinesis stream metadata: %s", err) + return nil, fmt.Errorf("error parsing Kinesis stream metadata: %w", err) } return &awsKinesisStreamScaler{ diff --git a/pkg/scalers/aws_sqs_queue_scaler.go b/pkg/scalers/aws_sqs_queue_scaler.go index aa15f458148..ae5f153ef87 100644 --- a/pkg/scalers/aws_sqs_queue_scaler.go +++ b/pkg/scalers/aws_sqs_queue_scaler.go @@ -51,14 +51,14 @@ type awsSqsQueueMetadata struct { func NewAwsSqsQueueScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "aws_sqs_queue_scaler") meta, err := parseAwsSqsQueueMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing SQS queue metadata: %s", err) + return nil, fmt.Errorf("error parsing SQS queue metadata: %w", err) } return &awsSqsQueueScaler{ diff --git a/pkg/scalers/azure/azure_app_insights.go b/pkg/scalers/azure/azure_app_insights.go index f6fe7baf469..2582dabe7e2 100644 --- a/pkg/scalers/azure/azure_app_insights.go +++ b/pkg/scalers/azure/azure_app_insights.go @@ -53,7 +53,7 @@ func toISO8601(time string) (string, error) { minutes, merr := strconv.Atoi(timeSegments[1]) if herr != nil || merr != nil { - return "", fmt.Errorf("errors parsing time: %v, %v", herr, merr) + return "", fmt.Errorf("errors parsing time: %v, %w", herr, merr) } return fmt.Sprintf("PT%02dH%02dM", hours, minutes), nil diff --git a/pkg/scalers/azure/azure_data_explorer.go b/pkg/scalers/azure/azure_data_explorer.go index 929c218aedb..9aa195c0243 100644 --- a/pkg/scalers/azure/azure_data_explorer.go +++ b/pkg/scalers/azure/azure_data_explorer.go @@ -50,17 +50,17 @@ var azureDataExplorerLogger = logf.Log.WithName("azure_data_explorer_scaler") func CreateAzureDataExplorerClient(ctx context.Context, metadata *DataExplorerMetadata) (*kusto.Client, error) { authConfig, err := getDataExplorerAuthConfig(ctx, metadata) if err != nil { - return nil, fmt.Errorf("failed to get data explorer auth config: %v", err) + return nil, fmt.Errorf("failed to get data explorer auth config: %w", err) } authorizer, err := authConfig.Authorizer() if err != nil { - return nil, fmt.Errorf("failed to get authorizer: %v", err) + return nil, fmt.Errorf("failed to get authorizer: %w", err) } client, err := kusto.New(metadata.Endpoint, kusto.Authorization{Authorizer: authorizer}) if err != nil { - return nil, fmt.Errorf("failed to create kusto client: %v", err) + return nil, fmt.Errorf("failed to create kusto client: %w", err) } return client, nil @@ -102,7 +102,7 @@ func GetAzureDataExplorerMetricValue(ctx context.Context, client *kusto.Client, iter, err := client.Query(ctx, db, kusto.NewStmt("", kusto.UnsafeStmt(unsafe.Stmt{Add: true, SuppressWarning: false})).UnsafeAdd(query)) if err != nil { - return -1, fmt.Errorf("failed to get azure data explorer metric result from query %s: %v", query, err) + return -1, fmt.Errorf("failed to get azure data explorer metric result from query %s: %w", query, err) } defer iter.Stop() @@ -111,7 +111,7 @@ func GetAzureDataExplorerMetricValue(ctx context.Context, client *kusto.Client, return -1, fmt.Errorf("failed to get query %s result: %v", query, inlineError) } if err != nil { - return -1, fmt.Errorf("failed to get query %s result: %v", query, err) + return -1, fmt.Errorf("failed to get query %s result: %w", query, err) } if !row.ColumnTypes[0].Type.Valid() { @@ -126,7 +126,7 @@ func GetAzureDataExplorerMetricValue(ctx context.Context, client *kusto.Client, metricValue, err := extractDataExplorerMetricValue(row) if err != nil { - return -1, fmt.Errorf("failed to extract value from query %s: %v", query, err) + return -1, fmt.Errorf("failed to extract value from query %s: %w", query, err) } return metricValue, nil diff --git a/pkg/scalers/azure/azure_eventhub.go b/pkg/scalers/azure/azure_eventhub.go index 1b77159398c..55b4dc4f3c2 100644 --- a/pkg/scalers/azure/azure_eventhub.go +++ b/pkg/scalers/azure/azure_eventhub.go @@ -41,7 +41,7 @@ func GetEventHubClient(ctx context.Context, info EventHubInfo) (*eventhub.Hub, e // The user wants to use a connectionstring, not a pod identity hub, err := eventhub.NewHubFromConnectionString(info.EventHubConnection) if err != nil { - return nil, fmt.Errorf("failed to create hub client: %s", err) + return nil, fmt.Errorf("failed to create hub client: %w", err) } return hub, nil case kedav1alpha1.PodIdentityProviderAzure: diff --git a/pkg/scalers/azure/azure_eventhub_checkpoint.go b/pkg/scalers/azure/azure_eventhub_checkpoint.go index 8edec54b117..64b40ad4007 100644 --- a/pkg/scalers/azure/azure_eventhub_checkpoint.go +++ b/pkg/scalers/azure/azure_eventhub_checkpoint.go @@ -240,16 +240,16 @@ func (checkpointer *defaultCheckpointer) extractCheckpoint(get *azblob.DownloadR reader := get.Body(azblob.RetryReaderOptions{}) if _, err := blobData.ReadFrom(reader); err != nil { - return Checkpoint{}, fmt.Errorf("failed to read blob data: %s", err) + return Checkpoint{}, fmt.Errorf("failed to read blob data: %w", err) } defer reader.Close() // The client must close the response body when finished with it if err := json.Unmarshal(blobData.Bytes(), &checkpoint); err != nil { - return Checkpoint{}, fmt.Errorf("failed to decode blob data: %s", err) + return Checkpoint{}, fmt.Errorf("failed to decode blob data: %w", err) } if err := json.Unmarshal(blobData.Bytes(), &pyCheckpoint); err != nil { - return Checkpoint{}, fmt.Errorf("failed to decode blob data: %s", err) + return Checkpoint{}, fmt.Errorf("failed to decode blob data: %w", err) } err := mergo.Merge(&checkpoint, Checkpoint(pyCheckpoint)) @@ -331,12 +331,12 @@ func readToCheckpointFromBody(get *azblob.DownloadResponse, checkpoint interface reader := get.Body(azblob.RetryReaderOptions{}) if _, err := blobData.ReadFrom(reader); err != nil { - return fmt.Errorf("failed to read blob data: %s", err) + return fmt.Errorf("failed to read blob data: %w", err) } defer reader.Close() // The client must close the response body when finished with it if err := json.Unmarshal(blobData.Bytes(), &checkpoint); err != nil { - return fmt.Errorf("failed to decode blob data: %s", err) + return fmt.Errorf("failed to decode blob data: %w", err) } return nil diff --git a/pkg/scalers/azure/azure_eventhub_test.go b/pkg/scalers/azure/azure_eventhub_test.go index f7121b5d25c..ca95c77e660 100644 --- a/pkg/scalers/azure/azure_eventhub_test.go +++ b/pkg/scalers/azure/azure_eventhub_test.go @@ -457,7 +457,7 @@ func createNewCheckpointInStorage(urlPath string, containerName string, partitio if err != nil { if stErr, ok := err.(azblob.StorageError); ok { if stErr.ServiceCode() == azblob.ServiceCodeContainerAlreadyExists { - return ctx, fmt.Errorf("failed to create container: %s", err) + return ctx, fmt.Errorf("failed to create container: %w", err) } } } @@ -473,7 +473,7 @@ func createNewCheckpointInStorage(urlPath string, containerName string, partitio Metadata: metadata, Parallelism: 16}) if err != nil { - return ctx, fmt.Errorf("Err uploading file to blob: %s", err) + return ctx, fmt.Errorf("Err uploading file to blob: %w", err) } return ctx, nil } diff --git a/pkg/scalers/azure/azure_monitor.go b/pkg/scalers/azure/azure_monitor.go index 5a67dfcc39f..08ef4fa21a1 100644 --- a/pkg/scalers/azure/azure_monitor.go +++ b/pkg/scalers/azure/azure_monitor.go @@ -222,7 +222,7 @@ func formatTimeSpan(timeSpan string) (string, error) { seconds, serr := strconv.Atoi(aggregationInterval[2]) if herr != nil || merr != nil || serr != nil { - return "", fmt.Errorf("errors parsing metricAggregationInterval: %v, %v, %v", herr, merr, serr) + return "", fmt.Errorf("errors parsing metricAggregationInterval: %v, %v, %w", herr, merr, serr) } starttime = time.Now().Add(-(time.Duration(hours)*time.Hour + time.Duration(minutes)*time.Minute + time.Duration(seconds)*time.Second)).UTC().Format(time.RFC3339) diff --git a/pkg/scalers/azure_app_insights_scaler.go b/pkg/scalers/azure_app_insights_scaler.go index d804342a8fd..a0663d8f500 100644 --- a/pkg/scalers/azure_app_insights_scaler.go +++ b/pkg/scalers/azure_app_insights_scaler.go @@ -44,14 +44,14 @@ type azureAppInsightsScaler struct { func NewAzureAppInsightsScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "azure_app_insights_scaler") meta, err := parseAzureAppInsightsMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing azure app insights metadata: %s", err) + return nil, fmt.Errorf("error parsing azure app insights metadata: %w", err) } return &azureAppInsightsScaler{ @@ -74,7 +74,7 @@ func parseAzureAppInsightsMetadata(config *ScalerConfig, logger logr.Logger) (*a targetValue, err := strconv.ParseFloat(val, 64) if err != nil { logger.Error(err, "Error parsing azure app insights metadata", azureAppInsightsTargetValueName, azureAppInsightsTargetValueName) - return nil, fmt.Errorf("error parsing azure app insights metadata %s: %s", azureAppInsightsTargetValueName, err.Error()) + return nil, fmt.Errorf("error parsing azure app insights metadata %s: %w", azureAppInsightsTargetValueName, err) } meta.targetValue = targetValue @@ -84,7 +84,7 @@ func parseAzureAppInsightsMetadata(config *ScalerConfig, logger logr.Logger) (*a activationTargetValue, err := strconv.ParseFloat(val, 64) if err != nil { logger.Error(err, "Error parsing azure app insights metadata", azureAppInsightsActivationTargetValueName, azureAppInsightsActivationTargetValueName) - return nil, fmt.Errorf("error parsing azure app insights metadata %s: %s", azureAppInsightsActivationTargetValueName, err.Error()) + return nil, fmt.Errorf("error parsing azure app insights metadata %s: %w", azureAppInsightsActivationTargetValueName, err) } meta.activationTargetValue = activationTargetValue } diff --git a/pkg/scalers/azure_blob_scaler.go b/pkg/scalers/azure_blob_scaler.go index f67e589994c..36f69e307c6 100644 --- a/pkg/scalers/azure_blob_scaler.go +++ b/pkg/scalers/azure_blob_scaler.go @@ -52,14 +52,14 @@ type azureBlobScaler struct { func NewAzureBlobScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "azure_blob_scaler") meta, podIdentity, err := parseAzureBlobMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing azure blob metadata: %s", err) + return nil, fmt.Errorf("error parsing azure blob metadata: %w", err) } return &azureBlobScaler{ @@ -81,7 +81,7 @@ func parseAzureBlobMetadata(config *ScalerConfig, logger logr.Logger) (*azure.Bl blobCount, err := strconv.ParseInt(val, 10, 64) if err != nil { logger.Error(err, "Error parsing azure blob metadata", "blobCountMetricName", blobCountMetricName) - return nil, kedav1alpha1.AuthPodIdentity{}, fmt.Errorf("error parsing azure blob metadata %s: %s", blobCountMetricName, err.Error()) + return nil, kedav1alpha1.AuthPodIdentity{}, fmt.Errorf("error parsing azure blob metadata %s: %w", blobCountMetricName, err) } meta.TargetBlobCount = blobCount @@ -92,7 +92,7 @@ func parseAzureBlobMetadata(config *ScalerConfig, logger logr.Logger) (*azure.Bl activationBlobCount, err := strconv.ParseInt(val, 10, 64) if err != nil { logger.Error(err, "Error parsing azure blob metadata", activationBlobCountMetricName, activationBlobCountMetricName) - return nil, kedav1alpha1.AuthPodIdentity{}, fmt.Errorf("error parsing azure blob metadata %s: %s", activationBlobCountMetricName, err.Error()) + return nil, kedav1alpha1.AuthPodIdentity{}, fmt.Errorf("error parsing azure blob metadata %s: %w", activationBlobCountMetricName, err) } meta.ActivationTargetBlobCount = activationBlobCount @@ -122,7 +122,7 @@ func parseAzureBlobMetadata(config *ScalerConfig, logger logr.Logger) (*azure.Bl if val, ok := config.TriggerMetadata["globPattern"]; ok && val != "" { glob, err := glob.Compile(val) if err != nil { - return nil, kedav1alpha1.AuthPodIdentity{}, fmt.Errorf("invalid glob pattern - %s", err.Error()) + return nil, kedav1alpha1.AuthPodIdentity{}, fmt.Errorf("invalid glob pattern - %w", err) } meta.GlobPattern = &glob } diff --git a/pkg/scalers/azure_data_explorer_scaler.go b/pkg/scalers/azure_data_explorer_scaler.go index b75bd005b2b..eae954eb31f 100644 --- a/pkg/scalers/azure_data_explorer_scaler.go +++ b/pkg/scalers/azure_data_explorer_scaler.go @@ -45,19 +45,19 @@ const adxName = "azure-data-explorer" func NewAzureDataExplorerScaler(ctx context.Context, config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "azure_data_explorer_scaler") metadata, err := parseAzureDataExplorerMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("failed to parse azure data explorer metadata: %s", err) + return nil, fmt.Errorf("failed to parse azure data explorer metadata: %w", err) } client, err := azure.CreateAzureDataExplorerClient(ctx, metadata) if err != nil { - return nil, fmt.Errorf("failed to create azure data explorer client: %s", err) + return nil, fmt.Errorf("failed to create azure data explorer client: %w", err) } return &azureDataExplorerScaler{ @@ -101,7 +101,7 @@ func parseAzureDataExplorerMetadata(config *ScalerConfig, logger logr.Logger) (* if val, ok := config.TriggerMetadata["threshold"]; ok { threshold, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("error parsing metadata. Details: can't parse threshold. Inner Error: %v", err) + return nil, fmt.Errorf("error parsing metadata. Details: can't parse threshold. Inner Error: %w", err) } metadata.Threshold = threshold } @@ -111,7 +111,7 @@ func parseAzureDataExplorerMetadata(config *ScalerConfig, logger logr.Logger) (* if val, ok := config.TriggerMetadata["activationThreshold"]; ok { activationThreshold, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("error parsing metadata. Details: can't parse activationThreshold. Inner Error: %v", err) + return nil, fmt.Errorf("error parsing metadata. Details: can't parse activationThreshold. Inner Error: %w", err) } metadata.ActivationThreshold = activationThreshold } @@ -172,7 +172,7 @@ func parseAzureDataExplorerAuthParams(config *ScalerConfig, logger logr.Logger) func (s azureDataExplorerScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { metricValue, err := azure.GetAzureDataExplorerMetricValue(ctx, s.client, s.metadata.DatabaseName, s.metadata.Query) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("failed to get metrics for scaled object %s in namespace %s: %v", s.name, s.namespace, err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("failed to get metrics for scaled object %s in namespace %s: %w", s.name, s.namespace, err) } metric := GenerateMetricInMili(metricName, metricValue) diff --git a/pkg/scalers/azure_eventhub_scaler.go b/pkg/scalers/azure_eventhub_scaler.go index e8bc509008e..514149fa543 100644 --- a/pkg/scalers/azure_eventhub_scaler.go +++ b/pkg/scalers/azure_eventhub_scaler.go @@ -66,19 +66,19 @@ type eventHubMetadata struct { func NewAzureEventHubScaler(ctx context.Context, config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "azure_eventhub_scaler") parsedMetadata, err := parseAzureEventHubMetadata(logger, config) if err != nil { - return nil, fmt.Errorf("unable to get eventhub metadata: %s", err) + return nil, fmt.Errorf("unable to get eventhub metadata: %w", err) } hub, err := azure.GetEventHubClient(ctx, parsedMetadata.eventHubInfo) if err != nil { - return nil, fmt.Errorf("unable to get eventhub client: %s", err) + return nil, fmt.Errorf("unable to get eventhub client: %w", err) } return &azureEventHubScaler{ @@ -115,7 +115,7 @@ func parseCommonAzureEventHubMetadata(config *ScalerConfig, meta *eventHubMetada if val, ok := config.TriggerMetadata[thresholdMetricName]; ok { threshold, err := strconv.ParseInt(val, 10, 64) if err != nil { - return fmt.Errorf("error parsing azure eventhub metadata %s: %s", thresholdMetricName, err) + return fmt.Errorf("error parsing azure eventhub metadata %s: %w", thresholdMetricName, err) } meta.threshold = threshold @@ -125,7 +125,7 @@ func parseCommonAzureEventHubMetadata(config *ScalerConfig, meta *eventHubMetada if val, ok := config.TriggerMetadata[activationThresholdMetricName]; ok { activationThreshold, err := strconv.ParseInt(val, 10, 64) if err != nil { - return fmt.Errorf("error parsing azure eventhub metadata %s: %s", activationThresholdMetricName, err) + return fmt.Errorf("error parsing azure eventhub metadata %s: %w", activationThresholdMetricName, err) } meta.activationThreshold = activationThreshold @@ -283,7 +283,7 @@ func (s *azureEventHubScaler) GetUnprocessedEventCountInPartition(ctx context.Co return GetUnprocessedEventCountWithoutCheckpoint(partitionInfo), azure.Checkpoint{}, nil } } - return -1, azure.Checkpoint{}, fmt.Errorf("unable to get checkpoint from storage: %s", err) + return -1, azure.Checkpoint{}, fmt.Errorf("unable to get checkpoint from storage: %w", err) } unprocessedEventCountInPartition := int64(0) @@ -332,7 +332,7 @@ func (s *azureEventHubScaler) IsActive(ctx context.Context) (bool, error) { runtimeInfo, err := s.client.GetRuntimeInformation(ctx) if err != nil { s.logger.Error(err, "unable to get runtimeInfo for isActive") - return false, fmt.Errorf("unable to get runtimeInfo for isActive: %s", err) + return false, fmt.Errorf("unable to get runtimeInfo for isActive: %w", err) } partitionIDs := runtimeInfo.PartitionIDs @@ -342,13 +342,13 @@ func (s *azureEventHubScaler) IsActive(ctx context.Context) (bool, error) { partitionRuntimeInfo, err := s.client.GetPartitionInformation(ctx, partitionID) if err != nil { - return false, fmt.Errorf("unable to get partitionRuntimeInfo for metrics: %s", err) + return false, fmt.Errorf("unable to get partitionRuntimeInfo for metrics: %w", err) } unprocessedEventCount, _, err := s.GetUnprocessedEventCountInPartition(ctx, partitionRuntimeInfo) if err != nil { - return false, fmt.Errorf("unable to get unprocessedEventCount for isActive: %s", err) + return false, fmt.Errorf("unable to get unprocessedEventCount for isActive: %w", err) } if unprocessedEventCount > s.metadata.activationThreshold { @@ -376,7 +376,7 @@ func (s *azureEventHubScaler) GetMetrics(ctx context.Context, metricName string) totalUnprocessedEventCount := int64(0) runtimeInfo, err := s.client.GetRuntimeInformation(ctx) if err != nil { - return []external_metrics.ExternalMetricValue{}, fmt.Errorf("unable to get runtimeInfo for metrics: %s", err) + return []external_metrics.ExternalMetricValue{}, fmt.Errorf("unable to get runtimeInfo for metrics: %w", err) } partitionIDs := runtimeInfo.PartitionIDs @@ -385,14 +385,14 @@ func (s *azureEventHubScaler) GetMetrics(ctx context.Context, metricName string) partitionID := partitionIDs[i] partitionRuntimeInfo, err := s.client.GetPartitionInformation(ctx, partitionID) if err != nil { - return []external_metrics.ExternalMetricValue{}, fmt.Errorf("unable to get partitionRuntimeInfo for metrics: %s", err) + return []external_metrics.ExternalMetricValue{}, fmt.Errorf("unable to get partitionRuntimeInfo for metrics: %w", err) } unprocessedEventCount := int64(0) unprocessedEventCount, checkpoint, err := s.GetUnprocessedEventCountInPartition(ctx, partitionRuntimeInfo) if err != nil { - return []external_metrics.ExternalMetricValue{}, fmt.Errorf("unable to get unprocessedEventCount for metrics: %s", err) + return []external_metrics.ExternalMetricValue{}, fmt.Errorf("unable to get unprocessedEventCount for metrics: %w", err) } totalUnprocessedEventCount += unprocessedEventCount diff --git a/pkg/scalers/azure_eventhub_scaler_test.go b/pkg/scalers/azure_eventhub_scaler_test.go index d00e1edf6d3..1d044e44083 100644 --- a/pkg/scalers/azure_eventhub_scaler_test.go +++ b/pkg/scalers/azure_eventhub_scaler_test.go @@ -481,19 +481,19 @@ func CreateNewCheckpointInStorage(endpoint *url.URL, credential azblob.Credentia containerURL := azblob.NewContainerURL(*url, azblob.NewPipeline(credential, azblob.PipelineOptions{})) _, err := containerURL.Create(ctx, azblob.Metadata{}, azblob.PublicAccessNone) if err != nil { - return ctx, fmt.Errorf("failed to create container: %s", err) + return ctx, fmt.Errorf("failed to create container: %w", err) } // Create directory checkpoints will be in err = os.MkdirAll(urlPath, 0777) if err != nil { - return ctx, fmt.Errorf("Unable to create directory: %s", err) + return ctx, fmt.Errorf("Unable to create directory: %w", err) } defer os.RemoveAll(urlPath) file, err := os.Create(fmt.Sprintf("%s/file", urlPath)) if err != nil { - return ctx, fmt.Errorf("Unable to create folder: %s", err) + return ctx, fmt.Errorf("Unable to create folder: %w", err) } defer file.Close() @@ -504,15 +504,15 @@ func CreateNewCheckpointInStorage(endpoint *url.URL, credential azblob.Credentia BlockSize: 4 * 1024 * 1024, Parallelism: 16}) if err != nil { - return ctx, fmt.Errorf("Err uploading file to blob: %s", err) + return ctx, fmt.Errorf("Err uploading file to blob: %w", err) } // Make checkpoint blob files if err := CreatePartitionFile(ctx, urlPath, "0", containerURL, client); err != nil { - return ctx, fmt.Errorf("failed to create partitionID 0 file: %s", err) + return ctx, fmt.Errorf("failed to create partitionID 0 file: %w", err) } if err := CreatePartitionFile(ctx, urlPath, "1", containerURL, client); err != nil { - return ctx, fmt.Errorf("failed to create partitionID 1 file: %s", err) + return ctx, fmt.Errorf("failed to create partitionID 1 file: %w", err) } return ctx, nil @@ -524,30 +524,30 @@ func CreatePartitionFile(ctx context.Context, urlPathToPartition string, partiti partitionInfo, err := client.GetPartitionInformation(ctx, partitionID) if err != nil { - return fmt.Errorf("unable to get partition info: %s", err) + return fmt.Errorf("unable to get partition info: %w", err) } f, err := os.Create(partitionID) if err != nil { - return fmt.Errorf("unable to create file: %s", err) + return fmt.Errorf("unable to create file: %w", err) } if partitionID == "0" { _, err = f.WriteString(fmt.Sprintf(checkpointFormat, partitionInfo.LastSequenceNumber-1, partitionID)) if err != nil { - return fmt.Errorf("unable to write to file: %s", err) + return fmt.Errorf("unable to write to file: %w", err) } } else { _, err = f.WriteString(fmt.Sprintf(checkpointFormat, partitionInfo.LastSequenceNumber, partitionID)) if err != nil { - return fmt.Errorf("unable to write to file: %s", err) + return fmt.Errorf("unable to write to file: %w", err) } } // Write checkpoints to file file, err := os.Open(partitionID) if err != nil { - return fmt.Errorf("Unable to create file: %s", err) + return fmt.Errorf("Unable to create file: %w", err) } defer file.Close() @@ -558,7 +558,7 @@ func CreatePartitionFile(ctx context.Context, urlPathToPartition string, partiti BlockSize: 4 * 1024 * 1024, Parallelism: 16}) if err != nil { - return fmt.Errorf("Err uploading file to blob: %s", err) + return fmt.Errorf("Err uploading file to blob: %w", err) } return nil } @@ -568,7 +568,7 @@ func SendMessageToEventHub(client *eventhub.Hub) error { err := client.Send(ctx, eventhub.NewEventFromString("1")) if err != nil { - return fmt.Errorf("Error sending msg: %s", err) + return fmt.Errorf("Error sending msg: %w", err) } return nil } @@ -582,7 +582,7 @@ func DeleteContainerInStorage(ctx context.Context, endpoint *url.URL, credential ModifiedAccessConditions: azblob.ModifiedAccessConditions{}, }) if err != nil { - return fmt.Errorf("failed to delete container in blob storage: %s", err) + return fmt.Errorf("failed to delete container in blob storage: %w", err) } return nil } diff --git a/pkg/scalers/azure_log_analytics_scaler.go b/pkg/scalers/azure_log_analytics_scaler.go index ed6f6dc8ede..e2fdaa2eaf5 100644 --- a/pkg/scalers/azure_log_analytics_scaler.go +++ b/pkg/scalers/azure_log_analytics_scaler.go @@ -19,7 +19,7 @@ package scalers import ( "bytes" "context" - "crypto/sha1" + "crypto/sha256" "encoding/base64" "encoding/json" "fmt" @@ -113,12 +113,12 @@ var logAnalyticsResourceURLInCloud = map[string]string{ func NewAzureLogAnalyticsScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } azureLogAnalyticsMetadata, err := parseAzureLogAnalyticsMetadata(config) if err != nil { - return nil, fmt.Errorf("failed to initialize Log Analytics scaler. Scaled object: %s. Namespace: %s. Inner Error: %v", config.ScalableObjectName, config.ScalableObjectNamespace, err) + return nil, fmt.Errorf("failed to initialize Log Analytics scaler. Scaled object: %s. Namespace: %s. Inner Error: %w", config.ScalableObjectName, config.ScalableObjectNamespace, err) } return &azureLogAnalyticsScaler{ @@ -184,7 +184,7 @@ func parseAzureLogAnalyticsMetadata(config *ScalerConfig) (*azureLogAnalyticsMet } threshold, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("error parsing metadata. Details: can't parse threshold. Inner Error: %v", err) + return nil, fmt.Errorf("error parsing metadata. Details: can't parse threshold. Inner Error: %w", err) } meta.threshold = threshold @@ -194,7 +194,7 @@ func parseAzureLogAnalyticsMetadata(config *ScalerConfig) (*azureLogAnalyticsMet if err == nil { activationThreshold, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("error parsing metadata. Details: can't parse threshold. Inner Error: %v", err) + return nil, fmt.Errorf("error parsing metadata. Details: can't parse threshold. Inner Error: %w", err) } meta.activationThreshold = activationThreshold } @@ -261,7 +261,7 @@ func (s *azureLogAnalyticsScaler) GetMetricsAndActivity(ctx context.Context, met receivedMetric, err := s.getMetricData(ctx) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("failed to get metrics. Scaled object: %s. Namespace: %s. Inner Error: %v", s.name, s.namespace, err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("failed to get metrics. Scaled object: %s. Namespace: %s. Inner Error: %w", s.name, s.namespace, err) } metric := GenerateMetricInMili(metricName, receivedMetric.value) @@ -512,12 +512,12 @@ func (s *azureLogAnalyticsScaler) executeLogAnalyticsREST(ctx context.Context, q jsonBytes, err := json.Marshal(m) if err != nil { - return nil, 0, fmt.Errorf("can't construct JSON for request to Log Analytics API. Inner Error: %v", err) + return nil, 0, fmt.Errorf("can't construct JSON for request to Log Analytics API. Inner Error: %w", err) } request, err := http.NewRequestWithContext(ctx, http.MethodPost, fmt.Sprintf(laQueryEndpoint, s.metadata.logAnalyticsResourceURL, s.metadata.workspaceID), bytes.NewBuffer(jsonBytes)) // URL-encoded payload if err != nil { - return nil, 0, fmt.Errorf("can't construct HTTP request to Log Analytics API. Inner Error: %v", err) + return nil, 0, fmt.Errorf("can't construct HTTP request to Log Analytics API. Inner Error: %w", err) } request.Header.Add("Content-Type", "application/json") @@ -538,7 +538,7 @@ func (s *azureLogAnalyticsScaler) executeAADApicall(ctx context.Context) ([]byte request, err := http.NewRequestWithContext(ctx, http.MethodPost, fmt.Sprintf(aadTokenEndpoint, s.metadata.activeDirectoryEndpoint, s.metadata.tenantID), strings.NewReader(data.Encode())) // URL-encoded payload if err != nil { - return nil, 0, fmt.Errorf("can't construct HTTP request to Azure Active Directory. Inner Error: %v", err) + return nil, 0, fmt.Errorf("can't construct HTTP request to Azure Active Directory. Inner Error: %w", err) } request.Header.Add("Content-Type", "application/x-www-form-urlencoded") @@ -557,7 +557,7 @@ func (s *azureLogAnalyticsScaler) executeIMDSApicall(ctx context.Context) ([]byt request, err := http.NewRequestWithContext(ctx, http.MethodGet, urlStr, nil) if err != nil { - return nil, 0, fmt.Errorf("can't construct HTTP request to Azure Instance Metadata service. Inner Error: %v", err) + return nil, 0, fmt.Errorf("can't construct HTTP request to Azure Instance Metadata service. Inner Error: %w", err) } request.Header.Add("Metadata", "true") @@ -571,9 +571,9 @@ func (s *azureLogAnalyticsScaler) runHTTP(request *http.Request, caller string) resp, err := s.httpClient.Do(request) if err != nil && resp != nil { - return nil, resp.StatusCode, fmt.Errorf("error calling %s. Inner Error: %v", caller, err) + return nil, resp.StatusCode, fmt.Errorf("error calling %s. Inner Error: %w", caller, err) } else if err != nil { - return nil, 0, fmt.Errorf("error calling %s. Inner Error: %v", caller, err) + return nil, 0, fmt.Errorf("error calling %s. Inner Error: %w", caller, err) } defer resp.Body.Close() @@ -581,7 +581,7 @@ func (s *azureLogAnalyticsScaler) runHTTP(request *http.Request, caller string) body, err := io.ReadAll(resp.Body) if err != nil { - return nil, resp.StatusCode, fmt.Errorf("error reading %s response body: Inner Error: %v", caller, err) + return nil, resp.StatusCode, fmt.Errorf("error reading %s response body: Inner Error: %w", caller, err) } return body, resp.StatusCode, nil @@ -590,7 +590,7 @@ func (s *azureLogAnalyticsScaler) runHTTP(request *http.Request, caller string) func getTokenFromCache(clientID string, clientSecret string) (tokenData, error) { key, err := getHash(clientID, clientSecret) if err != nil { - return tokenData{}, fmt.Errorf("error calculating sha1 hash. Inner Error: %v", err) + return tokenData{}, fmt.Errorf("error calculating sha1 hash. Inner Error: %w", err) } tokenCache.RLock() @@ -618,12 +618,12 @@ func setTokenInCache(clientID string, clientSecret string, tokenInfo tokenData) } func getHash(clientID string, clientSecret string) (string, error) { - sha1Hash := sha1.New() - _, err := sha1Hash.Write([]byte(fmt.Sprintf("%s|%s", clientID, clientSecret))) + sha256Hash := sha256.New() + _, err := fmt.Fprintf(sha256Hash, "%s|%s", clientID, clientSecret) if err != nil { return "", err } - return base64.StdEncoding.EncodeToString(sha1Hash.Sum(nil)), nil + return base64.StdEncoding.EncodeToString(sha256Hash.Sum(nil)), nil } diff --git a/pkg/scalers/azure_monitor_scaler.go b/pkg/scalers/azure_monitor_scaler.go index 1de83010d6a..f4ef32ca953 100644 --- a/pkg/scalers/azure_monitor_scaler.go +++ b/pkg/scalers/azure_monitor_scaler.go @@ -56,14 +56,14 @@ type azureMonitorMetadata struct { func NewAzureMonitorScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "azure_monitor_scaler") meta, err := parseAzureMonitorMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing azure monitor metadata: %s", err) + return nil, fmt.Errorf("error parsing azure monitor metadata: %w", err) } return &azureMonitorScaler{ @@ -83,7 +83,7 @@ func parseAzureMonitorMetadata(config *ScalerConfig, logger logr.Logger) (*azure targetValue, err := strconv.ParseFloat(val, 64) if err != nil { logger.Error(err, "Error parsing azure monitor metadata", "targetValue", targetValueName) - return nil, fmt.Errorf("error parsing azure monitor metadata %s: %s", targetValueName, err.Error()) + return nil, fmt.Errorf("error parsing azure monitor metadata %s: %w", targetValueName, err) } meta.targetValue = targetValue } else { @@ -94,7 +94,7 @@ func parseAzureMonitorMetadata(config *ScalerConfig, logger logr.Logger) (*azure activationTargetValue, err := strconv.ParseFloat(val, 64) if err != nil { logger.Error(err, "Error parsing azure monitor metadata", "targetValue", activationTargetValueName) - return nil, fmt.Errorf("error parsing azure monitor metadata %s: %s", activationTargetValueName, err.Error()) + return nil, fmt.Errorf("error parsing azure monitor metadata %s: %w", activationTargetValueName, err) } meta.activationTargetValue = activationTargetValue } else { diff --git a/pkg/scalers/azure_pipelines_scaler.go b/pkg/scalers/azure_pipelines_scaler.go index ce99c301e31..28c414b232d 100644 --- a/pkg/scalers/azure_pipelines_scaler.go +++ b/pkg/scalers/azure_pipelines_scaler.go @@ -142,12 +142,12 @@ func NewAzurePipelinesScaler(ctx context.Context, config *ScalerConfig) (Scaler, metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } meta, err := parseAzurePipelinesMetadata(ctx, config, httpClient) if err != nil { - return nil, fmt.Errorf("error parsing azure Pipelines metadata: %s", err) + return nil, fmt.Errorf("error parsing azure Pipelines metadata: %w", err) } return &azurePipelinesScaler{ @@ -165,7 +165,7 @@ func parseAzurePipelinesMetadata(ctx context.Context, config *ScalerConfig, http if val, ok := config.TriggerMetadata["targetPipelinesQueueLength"]; ok { queueLength, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, fmt.Errorf("error parsing azure pipelines metadata targetPipelinesQueueLength: %s", err.Error()) + return nil, fmt.Errorf("error parsing azure pipelines metadata targetPipelinesQueueLength: %w", err) } meta.targetPipelinesQueueLength = queueLength @@ -175,7 +175,7 @@ func parseAzurePipelinesMetadata(ctx context.Context, config *ScalerConfig, http if val, ok := config.TriggerMetadata["activationTargetPipelinesQueueLength"]; ok { activationQueueLength, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, fmt.Errorf("error parsing azure pipelines metadata activationTargetPipelinesQueueLength: %s", err.Error()) + return nil, fmt.Errorf("error parsing azure pipelines metadata activationTargetPipelinesQueueLength: %w", err) } meta.activationTargetPipelinesQueueLength = activationQueueLength diff --git a/pkg/scalers/azure_queue_scaler.go b/pkg/scalers/azure_queue_scaler.go index 6b208750761..e2a939274f2 100644 --- a/pkg/scalers/azure_queue_scaler.go +++ b/pkg/scalers/azure_queue_scaler.go @@ -60,14 +60,14 @@ type azureQueueMetadata struct { func NewAzureQueueScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "azure_queue_scaler") meta, podIdentity, err := parseAzureQueueMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing azure queue metadata: %s", err) + return nil, fmt.Errorf("error parsing azure queue metadata: %w", err) } return &azureQueueScaler{ @@ -88,7 +88,7 @@ func parseAzureQueueMetadata(config *ScalerConfig, logger logr.Logger) (*azureQu if err != nil { logger.Error(err, "Error parsing azure queue metadata", "queueLengthMetricName", queueLengthMetricName) return nil, kedav1alpha1.AuthPodIdentity{}, - fmt.Errorf("error parsing azure queue metadata %s: %s", queueLengthMetricName, err.Error()) + fmt.Errorf("error parsing azure queue metadata %s: %w", queueLengthMetricName, err) } meta.targetQueueLength = queueLength @@ -100,7 +100,7 @@ func parseAzureQueueMetadata(config *ScalerConfig, logger logr.Logger) (*azureQu if err != nil { logger.Error(err, "Error parsing azure queue metadata", activationQueueLengthMetricName, activationQueueLengthMetricName) return nil, kedav1alpha1.AuthPodIdentity{}, - fmt.Errorf("error parsing azure queue metadata %s: %s", activationQueueLengthMetricName, err.Error()) + fmt.Errorf("error parsing azure queue metadata %s: %w", activationQueueLengthMetricName, err) } meta.activationTargetQueueLength = activationQueueLength diff --git a/pkg/scalers/azure_servicebus_scaler.go b/pkg/scalers/azure_servicebus_scaler.go index b8da096a39c..b9aba816549 100755 --- a/pkg/scalers/azure_servicebus_scaler.go +++ b/pkg/scalers/azure_servicebus_scaler.go @@ -76,14 +76,14 @@ type azureServiceBusMetadata struct { func NewAzureServiceBusScaler(ctx context.Context, config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "azure_servicebus_scaler") meta, err := parseAzureServiceBusMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing azure service bus metadata: %s", err) + return nil, fmt.Errorf("error parsing azure service bus metadata: %w", err) } return &azureServiceBusScaler{ diff --git a/pkg/scalers/cassandra_scaler.go b/pkg/scalers/cassandra_scaler.go index f0a48e080e1..949fa3ee3f8 100644 --- a/pkg/scalers/cassandra_scaler.go +++ b/pkg/scalers/cassandra_scaler.go @@ -43,19 +43,19 @@ type CassandraMetadata struct { func NewCassandraScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "cassandra_scaler") meta, err := parseCassandraMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing cassandra metadata: %s", err) + return nil, fmt.Errorf("error parsing cassandra metadata: %w", err) } session, err := newCassandraSession(meta, logger) if err != nil { - return nil, fmt.Errorf("error establishing cassandra session: %s", err) + return nil, fmt.Errorf("error establishing cassandra session: %w", err) } return &cassandraScaler{ @@ -79,7 +79,7 @@ func parseCassandraMetadata(config *ScalerConfig) (*CassandraMetadata, error) { if val, ok := config.TriggerMetadata["targetQueryValue"]; ok { targetQueryValue, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, fmt.Errorf("targetQueryValue parsing error %s", err.Error()) + return nil, fmt.Errorf("targetQueryValue parsing error %w", err) } meta.targetQueryValue = targetQueryValue } else { @@ -90,7 +90,7 @@ func parseCassandraMetadata(config *ScalerConfig) (*CassandraMetadata, error) { if val, ok := config.TriggerMetadata["activationTargetQueryValue"]; ok { activationTargetQueryValue, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, fmt.Errorf("activationTargetQueryValue parsing error %s", err.Error()) + return nil, fmt.Errorf("activationTargetQueryValue parsing error %w", err) } meta.activationTargetQueryValue = activationTargetQueryValue } @@ -104,7 +104,7 @@ func parseCassandraMetadata(config *ScalerConfig) (*CassandraMetadata, error) { if val, ok := config.TriggerMetadata["port"]; ok { port, err := strconv.Atoi(val) if err != nil { - return nil, fmt.Errorf("port parsing error %s", err.Error()) + return nil, fmt.Errorf("port parsing error %w", err) } meta.port = port } @@ -125,7 +125,7 @@ func parseCassandraMetadata(config *ScalerConfig) (*CassandraMetadata, error) { if val, ok := config.TriggerMetadata["protocolVersion"]; ok { protocolVersion, err := strconv.Atoi(val) if err != nil { - return nil, fmt.Errorf("protocolVersion parsing error %s", err.Error()) + return nil, fmt.Errorf("protocolVersion parsing error %w", err) } meta.protocolVersion = protocolVersion } else { @@ -199,7 +199,7 @@ func (s *cassandraScaler) GetMetricSpecForScaling(context.Context) []v2.MetricSp func (s *cassandraScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { num, err := s.GetQueryResult(ctx) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting cassandra: %s", err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting cassandra: %w", err) } metric := GenerateMetricInMili(metricName, float64(num)) diff --git a/pkg/scalers/couchdb_scaler.go b/pkg/scalers/couchdb_scaler.go index 481114490a3..ec82d40e070 100644 --- a/pkg/scalers/couchdb_scaler.go +++ b/pkg/scalers/couchdb_scaler.go @@ -111,7 +111,7 @@ func parseCouchDBMetadata(config *ScalerConfig) (*couchDBMetadata, string, error if val, ok := config.TriggerMetadata["queryValue"]; ok { queryValue, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, "", fmt.Errorf("failed to convert %v to int, because of %v", val, err.Error()) + return nil, "", fmt.Errorf("failed to convert %v to int, because of %w", val, err) } meta.queryValue = queryValue } else { @@ -122,7 +122,7 @@ func parseCouchDBMetadata(config *ScalerConfig) (*couchDBMetadata, string, error if val, ok := config.TriggerMetadata["activationQueryValue"]; ok { activationQueryValue, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, "", fmt.Errorf("failed to convert %v to int, because of %v", val, err.Error()) + return nil, "", fmt.Errorf("failed to convert %v to int, because of %w", val, err) } meta.activationQueryValue = activationQueryValue } @@ -187,30 +187,30 @@ func parseCouchDBMetadata(config *ScalerConfig) (*couchDBMetadata, string, error func NewCouchDBScaler(ctx context.Context, config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } meta, connStr, err := parseCouchDBMetadata(config) if err != nil { - return nil, fmt.Errorf("failed to parsing couchDB metadata, because of %v", err) + return nil, fmt.Errorf("failed to parsing couchDB metadata, because of %w", err) } client, err := kivik.New("couch", connStr) if err != nil { - return nil, fmt.Errorf("%v", err) + return nil, fmt.Errorf("%w", err) } - err = client.Authenticate(context.TODO(), couchdb.BasicAuth("admin", meta.password)) + err = client.Authenticate(ctx, couchdb.BasicAuth("admin", meta.password)) if err != nil { return nil, err } isconnected, err := client.Ping(ctx) if !isconnected { - return nil, fmt.Errorf("%v", err) + return nil, fmt.Errorf("%w", err) } if err != nil { - return nil, fmt.Errorf("failed to ping couchDB, because of %v", err) + return nil, fmt.Errorf("failed to ping couchDB, because of %w", err) } return &couchDBScaler{ @@ -225,7 +225,7 @@ func NewCouchDBScaler(ctx context.Context, config *ScalerConfig) (Scaler, error) func (s *couchDBScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { result, err := s.getQueryResult(ctx) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("failed to inspect couchdb, because of %v", err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("failed to inspect couchdb, because of %w", err) } metric := GenerateMetricInMili(metricName, float64(result)) diff --git a/pkg/scalers/cpu_memory_scaler.go b/pkg/scalers/cpu_memory_scaler.go index 92a08918df5..8f7a355ae41 100644 --- a/pkg/scalers/cpu_memory_scaler.go +++ b/pkg/scalers/cpu_memory_scaler.go @@ -31,7 +31,7 @@ func NewCPUMemoryScaler(resourceName v1.ResourceName, config *ScalerConfig) (Sca meta, parseErr := parseResourceMetadata(config, logger) if parseErr != nil { - return nil, fmt.Errorf("error parsing %s metadata: %s", resourceName, parseErr) + return nil, fmt.Errorf("error parsing %s metadata: %w", resourceName, parseErr) } return &cpuMemoryScaler{ diff --git a/pkg/scalers/cron_scaler.go b/pkg/scalers/cron_scaler.go index e1de9c05159..b8f3542fa60 100644 --- a/pkg/scalers/cron_scaler.go +++ b/pkg/scalers/cron_scaler.go @@ -38,12 +38,12 @@ type cronMetadata struct { func NewCronScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } meta, parseErr := parseCronMetadata(config) if parseErr != nil { - return nil, fmt.Errorf("error parsing cron metadata: %s", parseErr) + return nil, fmt.Errorf("error parsing cron metadata: %w", parseErr) } return &cronScaler{ @@ -82,7 +82,7 @@ func parseCronMetadata(config *ScalerConfig) (*cronMetadata, error) { if val, ok := config.TriggerMetadata["start"]; ok && val != "" { _, err := parser.Parse(val) if err != nil { - return nil, fmt.Errorf("error parsing start schedule: %s", err) + return nil, fmt.Errorf("error parsing start schedule: %w", err) } meta.start = val } else { @@ -91,7 +91,7 @@ func parseCronMetadata(config *ScalerConfig) (*cronMetadata, error) { if val, ok := config.TriggerMetadata["end"]; ok && val != "" { _, err := parser.Parse(val) if err != nil { - return nil, fmt.Errorf("error parsing end schedule: %s", err) + return nil, fmt.Errorf("error parsing end schedule: %w", err) } meta.end = val } else { @@ -118,7 +118,7 @@ func parseCronMetadata(config *ScalerConfig) (*cronMetadata, error) { func (s *cronScaler) IsActive(ctx context.Context) (bool, error) { location, err := time.LoadLocation(s.metadata.timezone) if err != nil { - return false, fmt.Errorf("unable to load timezone. Error: %s", err) + return false, fmt.Errorf("unable to load timezone. Error: %w", err) } // Since we are considering the timestamp here and not the exact time, timezone does matter. @@ -126,12 +126,12 @@ func (s *cronScaler) IsActive(ctx context.Context) (bool, error) { nextStartTime, startTimecronErr := getCronTime(location, s.metadata.start) if startTimecronErr != nil { - return false, fmt.Errorf("error initializing start cron: %s", startTimecronErr) + return false, fmt.Errorf("error initializing start cron: %w", startTimecronErr) } nextEndTime, endTimecronErr := getCronTime(location, s.metadata.end) if endTimecronErr != nil { - return false, fmt.Errorf("error intializing end cron: %s", endTimecronErr) + return false, fmt.Errorf("error intializing end cron: %w", endTimecronErr) } switch { diff --git a/pkg/scalers/datadog_scaler.go b/pkg/scalers/datadog_scaler.go index ea3c9e59389..364eb516ac0 100644 --- a/pkg/scalers/datadog_scaler.go +++ b/pkg/scalers/datadog_scaler.go @@ -54,12 +54,12 @@ func NewDatadogScaler(ctx context.Context, config *ScalerConfig) (Scaler, error) meta, err := parseDatadogMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing Datadog metadata: %s", err) + return nil, fmt.Errorf("error parsing Datadog metadata: %w", err) } apiClient, err := newDatadogConnection(ctx, meta, config) if err != nil { - return nil, fmt.Errorf("error establishing Datadog connection: %s", err) + return nil, fmt.Errorf("error establishing Datadog connection: %w", err) } return &datadogScaler{ metadata: meta, @@ -84,7 +84,7 @@ func parseDatadogMetadata(config *ScalerConfig, logger logr.Logger) (*datadogMet if val, ok := config.TriggerMetadata["age"]; ok { age, err := strconv.Atoi(val) if err != nil { - return nil, fmt.Errorf("age parsing error %s", err.Error()) + return nil, fmt.Errorf("age parsing error %w", err) } meta.age = age @@ -101,7 +101,7 @@ func parseDatadogMetadata(config *ScalerConfig, logger logr.Logger) (*datadogMet if val, ok := config.TriggerMetadata["timeWindowOffset"]; ok { timeWindowOffset, err := strconv.Atoi(val) if err != nil { - return nil, fmt.Errorf("timeWindowOffset parsing error %s", err.Error()) + return nil, fmt.Errorf("timeWindowOffset parsing error %w", err) } if timeWindowOffset < 0 { return nil, fmt.Errorf("timeWindowOffset should not be smaller than 0 seconds") @@ -114,7 +114,7 @@ func parseDatadogMetadata(config *ScalerConfig, logger logr.Logger) (*datadogMet if val, ok := config.TriggerMetadata["lastAvailablePointOffset"]; ok { lastAvailablePointOffset, err := strconv.Atoi(val) if err != nil { - return nil, fmt.Errorf("lastAvailablePointOffset parsing error %s", err.Error()) + return nil, fmt.Errorf("lastAvailablePointOffset parsing error %w", err) } if lastAvailablePointOffset < 0 { @@ -129,7 +129,7 @@ func parseDatadogMetadata(config *ScalerConfig, logger logr.Logger) (*datadogMet _, err := parseDatadogQuery(val) if err != nil { - return nil, fmt.Errorf("error in query: %s", err.Error()) + return nil, fmt.Errorf("error in query: %w", err) } meta.query = val } else { @@ -139,7 +139,7 @@ func parseDatadogMetadata(config *ScalerConfig, logger logr.Logger) (*datadogMet if val, ok := config.TriggerMetadata["queryValue"]; ok { queryValue, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("queryValue parsing error %s", err.Error()) + return nil, fmt.Errorf("queryValue parsing error %w", err) } meta.queryValue = queryValue } else { @@ -162,7 +162,7 @@ func parseDatadogMetadata(config *ScalerConfig, logger logr.Logger) (*datadogMet if val, ok := config.TriggerMetadata["activationQueryValue"]; ok { activationQueryValue, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("queryValue parsing error %s", err.Error()) + return nil, fmt.Errorf("queryValue parsing error %w", err) } meta.activationQueryValue = activationQueryValue } @@ -170,7 +170,7 @@ func parseDatadogMetadata(config *ScalerConfig, logger logr.Logger) (*datadogMet if val, ok := config.TriggerMetadata["metricUnavailableValue"]; ok { fillValue, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("metricUnavailableValue parsing error %s", err.Error()) + return nil, fmt.Errorf("metricUnavailableValue parsing error %w", err) } meta.fillValue = fillValue meta.useFiller = true @@ -193,7 +193,7 @@ func parseDatadogMetadata(config *ScalerConfig, logger logr.Logger) (*datadogMet } else { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } meta.vType = metricType } @@ -251,7 +251,7 @@ func newDatadogConnection(ctx context.Context, meta *datadogMetadata, config *Sc _, _, err := apiClient.AuthenticationApi.Validate(ctx) //nolint:bodyclose if err != nil { - return nil, fmt.Errorf("error connecting to Datadog API endpoint: %v", err) + return nil, fmt.Errorf("error connecting to Datadog API endpoint: %w", err) } return apiClient, nil @@ -287,7 +287,7 @@ func (s *datadogScaler) getQueryResult(ctx context.Context) (float64, error) { timeWindowFrom := timeWindowTo - int64(s.metadata.age) resp, r, err := s.apiClient.MetricsApi.QueryMetrics(ctx, timeWindowFrom, timeWindowTo, s.metadata.query) //nolint:bodyclose if err != nil { - return -1, fmt.Errorf("error when retrieving Datadog metrics: %s", err) + return -1, fmt.Errorf("error when retrieving Datadog metrics: %w", err) } if r.StatusCode == 429 { @@ -377,7 +377,7 @@ func (s *datadogScaler) GetMetricsAndActivity(ctx context.Context, metricName st num, err := s.getQueryResult(ctx) if err != nil { s.logger.Error(err, "error getting metrics from Datadog") - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error getting metrics from Datadog: %s", err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error getting metrics from Datadog: %w", err) } metric := GenerateMetricInMili(metricName, num) diff --git a/pkg/scalers/elasticsearch_scaler.go b/pkg/scalers/elasticsearch_scaler.go index 5614717582d..25a64dee38a 100644 --- a/pkg/scalers/elasticsearch_scaler.go +++ b/pkg/scalers/elasticsearch_scaler.go @@ -48,19 +48,19 @@ type elasticsearchMetadata struct { func NewElasticsearchScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "elasticsearch_scaler") meta, err := parseElasticsearchMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing elasticsearch metadata: %s", err) + return nil, fmt.Errorf("error parsing elasticsearch metadata: %w", err) } esClient, err := newElasticsearchClient(meta, logger) if err != nil { - return nil, fmt.Errorf("error getting elasticsearch client: %s", err) + return nil, fmt.Errorf("error getting elasticsearch client: %w", err) } return &elasticsearchScaler{ metricType: metricType, @@ -170,7 +170,7 @@ func parseElasticsearchMetadata(config *ScalerConfig) (*elasticsearchMetadata, e if val, ok := config.TriggerMetadata["unsafeSsl"]; ok { unsafeSsl, err := strconv.ParseBool(val) if err != nil { - return nil, fmt.Errorf("error parsing unsafeSsl: %s", err) + return nil, fmt.Errorf("error parsing unsafeSsl: %w", err) } meta.unsafeSsl = unsafeSsl } else { @@ -211,10 +211,11 @@ func parseElasticsearchMetadata(config *ScalerConfig) (*elasticsearchMetadata, e meta.activationTargetValue = 0 if val, ok := config.TriggerMetadata["activationTargetValue"]; ok { - meta.activationTargetValue, err = strconv.ParseFloat(val, 64) + activationTargetValue, err := strconv.ParseFloat(val, 64) if err != nil { return nil, fmt.Errorf("activationTargetValue parsing error: %w", err) } + meta.activationTargetValue = activationTargetValue } meta.metricName = GenerateMetricNameWithIndex(config.ScalerIndex, kedautil.NormalizeString(fmt.Sprintf("elasticsearch-%s", meta.searchTemplateName))) @@ -346,7 +347,7 @@ func (s *elasticsearchScaler) GetMetricSpecForScaling(context.Context) []v2.Metr func (s *elasticsearchScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { num, err := s.getQueryResult(ctx) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting elasticsearch: %s", err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting elasticsearch: %w", err) } metric := GenerateMetricInMili(metricName, num) diff --git a/pkg/scalers/etcd_scaler.go b/pkg/scalers/etcd_scaler.go index 09a51819111..e72e2cde761 100644 --- a/pkg/scalers/etcd_scaler.go +++ b/pkg/scalers/etcd_scaler.go @@ -55,12 +55,12 @@ type etcdMetadata struct { func NewEtcdScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } meta, parseErr := parseEtcdMetadata(config) if parseErr != nil { - return nil, fmt.Errorf("error parsing kubernetes workload metadata: %s", parseErr) + return nil, fmt.Errorf("error parsing kubernetes workload metadata: %w", parseErr) } cli, err := getEtcdClients(meta) @@ -166,7 +166,7 @@ func getEtcdClients(metadata *etcdMetadata) (*clientv3.Client, error) { TLS: tlsConfig, }) if err != nil { - return nil, fmt.Errorf("error connecting to etcd server: %s", err) + return nil, fmt.Errorf("error connecting to etcd server: %w", err) } return cli, nil @@ -184,7 +184,7 @@ func (s *etcdScaler) Close(context.Context) error { func (s *etcdScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { v, err := s.getMetricValue(ctx) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error getting metric value: %s", err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error getting metric value: %w", err) } metric := GenerateMetricInMili(metricName, v) @@ -217,12 +217,16 @@ func (s *etcdScaler) Run(ctx context.Context, active chan<- bool) { progress := make(chan bool) defer close(progress) go func() { + delayDuration := time.Duration(s.metadata.watchProgressNotifyInterval) * 2 * time.Second + delay := time.NewTimer(delayDuration) + defer delay.Stop() for { + delay.Reset(delayDuration) select { case <-progress: case <-subCtx.Done(): return - case <-time.After(time.Duration(s.metadata.watchProgressNotifyInterval) * 2 * time.Second): + case <-delay.C: s.logger.Info("no watch progress notification in the interval", "watchKey", s.metadata.watchKey, "endpoints", s.metadata.endpoints) cancel() return diff --git a/pkg/scalers/external_scaler.go b/pkg/scalers/external_scaler.go index b9fb43988c2..d6a0a452cd9 100644 --- a/pkg/scalers/external_scaler.go +++ b/pkg/scalers/external_scaler.go @@ -49,12 +49,12 @@ var connectionPool sync.Map func NewExternalScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting external scaler metric type: %s", err) + return nil, fmt.Errorf("error getting external scaler metric type: %w", err) } meta, err := parseExternalScalerMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing external scaler metadata: %s", err) + return nil, fmt.Errorf("error parsing external scaler metadata: %w", err) } return &externalScaler{ @@ -73,12 +73,12 @@ func NewExternalScaler(config *ScalerConfig) (Scaler, error) { func NewExternalPushScaler(config *ScalerConfig) (PushScaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting external scaler metric type: %s", err) + return nil, fmt.Errorf("error getting external scaler metric type: %w", err) } meta, err := parseExternalScalerMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing external scaler metadata: %s", err) + return nil, fmt.Errorf("error parsing external scaler metadata: %w", err) } return &externalPushScaler{ @@ -343,6 +343,7 @@ func getClientForConnectionPool(metadata externalScalerMetadata) (pb.ExternalSca go func() { // clean up goroutine. // once gRPC client is shutdown, remove the connection from the pool and Close() grpc.ClientConn + // nosemgrep: dgryski.semgrep-go.contexttodo.context-todo <-waitForState(context.TODO(), connGroup.grpcConnection, connectivity.Shutdown) connectionPoolMutex.Lock() defer connectionPoolMutex.Unlock() diff --git a/pkg/scalers/gcp_pubsub_scaler.go b/pkg/scalers/gcp_pubsub_scaler.go index 7a09b6a40bd..a5f76ab22ac 100644 --- a/pkg/scalers/gcp_pubsub_scaler.go +++ b/pkg/scalers/gcp_pubsub_scaler.go @@ -49,14 +49,14 @@ type pubsubMetadata struct { func NewPubSubScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "gcp_pub_sub_scaler") meta, err := parsePubSubMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing PubSub metadata: %s", err) + return nil, fmt.Errorf("error parsing PubSub metadata: %w", err) } return &pubsubScaler{ @@ -81,7 +81,7 @@ func parsePubSubMetadata(config *ScalerConfig, logger logr.Logger) (*pubsubMetad meta.mode = pubsubModeSubscriptionSize subSizeValue, err := strconv.ParseFloat(subSize, 64) if err != nil { - return nil, fmt.Errorf("value parsing error %s", err.Error()) + return nil, fmt.Errorf("value parsing error %w", err) } meta.value = subSizeValue } else { @@ -101,7 +101,7 @@ func parsePubSubMetadata(config *ScalerConfig, logger logr.Logger) (*pubsubMetad if valuePresent { triggerValue, err := strconv.ParseFloat(value, 64) if err != nil { - return nil, fmt.Errorf("value parsing error %s", err.Error()) + return nil, fmt.Errorf("value parsing error %w", err) } meta.value = triggerValue } @@ -121,7 +121,7 @@ func parsePubSubMetadata(config *ScalerConfig, logger logr.Logger) (*pubsubMetad if val, ok := config.TriggerMetadata["activationValue"]; ok { activationValue, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("activationValue parsing error %s", err.Error()) + return nil, fmt.Errorf("activationValue parsing error %w", err) } meta.activationValue = activationValue } diff --git a/pkg/scalers/gcp_stackdriver_scaler.go b/pkg/scalers/gcp_stackdriver_scaler.go index 63921fe2979..ae3c4a87528 100644 --- a/pkg/scalers/gcp_stackdriver_scaler.go +++ b/pkg/scalers/gcp_stackdriver_scaler.go @@ -39,14 +39,14 @@ type stackdriverMetadata struct { func NewStackdriverScaler(ctx context.Context, config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "gcp_stackdriver_scaler") meta, err := parseStackdriverMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing Stackdriver metadata: %s", err) + return nil, fmt.Errorf("error parsing Stackdriver metadata: %w", err) } client, err := initializeStackdriverClient(ctx, meta.gcpAuthorization, logger) @@ -94,7 +94,7 @@ func parseStackdriverMetadata(config *ScalerConfig, logger logr.Logger) (*stackd targetValue, err := strconv.ParseFloat(val, 64) if err != nil { logger.Error(err, "Error parsing targetValue") - return nil, fmt.Errorf("error parsing targetValue: %s", err.Error()) + return nil, fmt.Errorf("error parsing targetValue: %w", err) } meta.targetValue = targetValue @@ -104,7 +104,7 @@ func parseStackdriverMetadata(config *ScalerConfig, logger logr.Logger) (*stackd if val, ok := config.TriggerMetadata["activationTargetValue"]; ok { activationTargetValue, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("activationTargetValue parsing error %s", err.Error()) + return nil, fmt.Errorf("activationTargetValue parsing error %w", err) } meta.activationTargetValue = activationTargetValue } @@ -137,7 +137,7 @@ func parseAggregation(config *ScalerConfig, logger logr.Logger) (*monitoringpb.A } if err != nil { logger.Error(err, "Error parsing alignmentPeriodSeconds") - return nil, fmt.Errorf("error parsing alignmentPeriodSeconds: %s", err.Error()) + return nil, fmt.Errorf("error parsing alignmentPeriodSeconds: %w", err) } return NewStackdriverAggregator(val, config.TriggerMetadata["alignmentAligner"], config.TriggerMetadata["alignmentReducer"]) diff --git a/pkg/scalers/gcp_storage_scaler.go b/pkg/scalers/gcp_storage_scaler.go index a359096519f..bee2f45cfeb 100644 --- a/pkg/scalers/gcp_storage_scaler.go +++ b/pkg/scalers/gcp_storage_scaler.go @@ -46,14 +46,14 @@ type gcsMetadata struct { func NewGcsScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "gcp_storage_scaler") meta, err := parseGcsMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing GCP storage metadata: %s", err) + return nil, fmt.Errorf("error parsing GCP storage metadata: %w", err) } ctx := context.Background() @@ -72,7 +72,7 @@ func NewGcsScaler(config *ScalerConfig) (Scaler, error) { } if err != nil { - return nil, fmt.Errorf("storage.NewClient: %v", err) + return nil, fmt.Errorf("storage.NewClient: %w", err) } bucket := client.Bucket(meta.bucketName) @@ -112,7 +112,7 @@ func parseGcsMetadata(config *ScalerConfig, logger logr.Logger) (*gcsMetadata, e targetObjectCount, err := strconv.ParseInt(val, 10, 64) if err != nil { logger.Error(err, "Error parsing targetObjectCount") - return nil, fmt.Errorf("error parsing targetObjectCount: %s", err.Error()) + return nil, fmt.Errorf("error parsing targetObjectCount: %w", err) } meta.targetObjectCount = targetObjectCount @@ -122,7 +122,7 @@ func parseGcsMetadata(config *ScalerConfig, logger logr.Logger) (*gcsMetadata, e if val, ok := config.TriggerMetadata["activationTargetObjectCount"]; ok { activationTargetObjectCount, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, fmt.Errorf("activationTargetObjectCount parsing error %s", err.Error()) + return nil, fmt.Errorf("activationTargetObjectCount parsing error %w", err) } meta.activationTargetObjectCount = activationTargetObjectCount } @@ -131,7 +131,7 @@ func parseGcsMetadata(config *ScalerConfig, logger logr.Logger) (*gcsMetadata, e maxBucketItemsToScan, err := strconv.ParseInt(val, 10, 64) if err != nil { logger.Error(err, "Error parsing maxBucketItemsToScan") - return nil, fmt.Errorf("error parsing maxBucketItemsToScan: %s", err.Error()) + return nil, fmt.Errorf("error parsing maxBucketItemsToScan: %w", err) } meta.maxBucketItemsToScan = maxBucketItemsToScan diff --git a/pkg/scalers/graphite_scaler.go b/pkg/scalers/graphite_scaler.go index f9e88620c7e..24ac62eb76b 100644 --- a/pkg/scalers/graphite_scaler.go +++ b/pkg/scalers/graphite_scaler.go @@ -59,12 +59,12 @@ type grapQueryResult []struct { func NewGraphiteScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } meta, err := parseGraphiteMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing graphite metadata: %s", err) + return nil, fmt.Errorf("error parsing graphite metadata: %w", err) } httpClient := kedautil.CreateHTTPClient(config.GlobalHTTPTimeout, false) @@ -108,7 +108,7 @@ func parseGraphiteMetadata(config *ScalerConfig) (*graphiteMetadata, error) { if val, ok := config.TriggerMetadata[graphiteThreshold]; ok && val != "" { t, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("error parsing %s: %s", graphiteThreshold, err) + return nil, fmt.Errorf("error parsing %s: %w", graphiteThreshold, err) } meta.threshold = t @@ -118,7 +118,7 @@ func parseGraphiteMetadata(config *ScalerConfig) (*graphiteMetadata, error) { if val, ok := config.TriggerMetadata[graphiteActivationThreshold]; ok { t, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("activationTargetValue parsing error %s", err.Error()) + return nil, fmt.Errorf("activationTargetValue parsing error %w", err) } meta.activationThreshold = t diff --git a/pkg/scalers/huawei_cloudeye_scaler.go b/pkg/scalers/huawei_cloudeye_scaler.go index be9c4810b78..081ee2509ed 100644 --- a/pkg/scalers/huawei_cloudeye_scaler.go +++ b/pkg/scalers/huawei_cloudeye_scaler.go @@ -74,14 +74,14 @@ type huaweiAuthorizationMetadata struct { func NewHuaweiCloudeyeScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "huawei_cloudeye_scaler") meta, err := parseHuaweiCloudeyeMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing Cloudeye metadata: %s", err) + return nil, fmt.Errorf("error parsing Cloudeye metadata: %w", err) } return &huaweiCloudeyeScaler{ diff --git a/pkg/scalers/ibmmq_scaler.go b/pkg/scalers/ibmmq_scaler.go index f9cfc88abaa..8ac90c9e70f 100644 --- a/pkg/scalers/ibmmq_scaler.go +++ b/pkg/scalers/ibmmq_scaler.go @@ -65,12 +65,12 @@ type Parameters struct { func NewIBMMQScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } meta, err := parseIBMMQMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing IBM MQ metadata: %s", err) + return nil, fmt.Errorf("error parsing IBM MQ metadata: %w", err) } return &IBMMQScaler{ @@ -93,7 +93,7 @@ func parseIBMMQMetadata(config *ScalerConfig) (*IBMMQMetadata, error) { if val, ok := config.TriggerMetadata["host"]; ok { _, err := url.ParseRequestURI(val) if err != nil { - return nil, fmt.Errorf("invalid URL: %s", err) + return nil, fmt.Errorf("invalid URL: %w", err) } meta.host = val } else { @@ -135,7 +135,7 @@ func parseIBMMQMetadata(config *ScalerConfig) (*IBMMQMetadata, error) { if val, ok := config.TriggerMetadata["tls"]; ok { tlsDisabled, err := strconv.ParseBool(val) if err != nil { - return nil, fmt.Errorf("invalid tls setting: %s", err) + return nil, fmt.Errorf("invalid tls setting: %w", err) } meta.tlsDisabled = tlsDisabled } else { @@ -172,7 +172,7 @@ func (s *IBMMQScaler) getQueueDepthViaHTTP(ctx context.Context) (int64, error) { var requestJSON = []byte(`{"type": "runCommandJSON", "command": "display", "qualifier": "qlocal", "name": "` + queue + `", "responseParameters" : ["CURDEPTH"]}`) req, err := http.NewRequestWithContext(ctx, "POST", url, bytes.NewBuffer(requestJSON)) if err != nil { - return 0, fmt.Errorf("failed to request queue depth: %s", err) + return 0, fmt.Errorf("failed to request queue depth: %w", err) } req.Header.Set("ibm-mq-rest-csrf-token", "value") req.Header.Set("Content-Type", "application/json") @@ -186,23 +186,23 @@ func (s *IBMMQScaler) getQueueDepthViaHTTP(ctx context.Context) (int64, error) { resp, err := client.Do(req) if err != nil { - return 0, fmt.Errorf("failed to contact MQ via REST: %s", err) + return 0, fmt.Errorf("failed to contact MQ via REST: %w", err) } defer resp.Body.Close() body, err := io.ReadAll(resp.Body) if err != nil { - return 0, fmt.Errorf("failed to ready body of request: %s", err) + return 0, fmt.Errorf("failed to ready body of request: %w", err) } var response CommandResponse err = json.Unmarshal(body, &response) if err != nil { - return 0, fmt.Errorf("failed to parse JSON: %s", err) + return 0, fmt.Errorf("failed to parse JSON: %w", err) } if response.CommandResponse == nil || len(response.CommandResponse) == 0 { - return 0, fmt.Errorf("failed to parse response from REST call: %s", err) + return 0, fmt.Errorf("failed to parse response from REST call: %w", err) } return int64(response.CommandResponse[0].Parameters.Curdepth), nil } @@ -223,7 +223,7 @@ func (s *IBMMQScaler) GetMetricSpecForScaling(context.Context) []v2.MetricSpec { func (s *IBMMQScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { queueDepth, err := s.getQueueDepthViaHTTP(ctx) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting IBM MQ queue depth: %s", err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting IBM MQ queue depth: %w", err) } metric := GenerateMetricInMili(metricName, float64(queueDepth)) diff --git a/pkg/scalers/influxdb_scaler.go b/pkg/scalers/influxdb_scaler.go index 1da56243e90..a9b5aff8837 100644 --- a/pkg/scalers/influxdb_scaler.go +++ b/pkg/scalers/influxdb_scaler.go @@ -38,14 +38,14 @@ type influxDBMetadata struct { func NewInfluxDBScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "influxdb_scaler") meta, err := parseInfluxDBMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing influxdb metadata: %s", err) + return nil, fmt.Errorf("error parsing influxdb metadata: %w", err) } logger.Info("starting up influxdb client") @@ -128,7 +128,7 @@ func parseInfluxDBMetadata(config *ScalerConfig) (*influxDBMetadata, error) { if val, ok := config.TriggerMetadata["activationThresholdValue"]; ok { value, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("activationThresholdValue: failed to parse activationThresholdValue %s", err.Error()) + return nil, fmt.Errorf("activationThresholdValue: failed to parse activationThresholdValue %w", err) } activationThresholdValue = value } @@ -136,7 +136,7 @@ func parseInfluxDBMetadata(config *ScalerConfig) (*influxDBMetadata, error) { if val, ok := config.TriggerMetadata["thresholdValue"]; ok { value, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("thresholdValue: failed to parse thresholdValue length %s", err.Error()) + return nil, fmt.Errorf("thresholdValue: failed to parse thresholdValue length %w", err) } thresholdValue = value } else { @@ -146,7 +146,7 @@ func parseInfluxDBMetadata(config *ScalerConfig) (*influxDBMetadata, error) { if val, ok := config.TriggerMetadata["unsafeSsl"]; ok { parsedVal, err := strconv.ParseBool(val) if err != nil { - return nil, fmt.Errorf("error parsing unsafeSsl: %s", err) + return nil, fmt.Errorf("error parsing unsafeSsl: %w", err) } unsafeSsl = parsedVal } diff --git a/pkg/scalers/kafka_scaler.go b/pkg/scalers/kafka_scaler.go index c76c953b662..38ba241dc12 100644 --- a/pkg/scalers/kafka_scaler.go +++ b/pkg/scalers/kafka_scaler.go @@ -92,14 +92,14 @@ const ( func NewKafkaScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "kafka_scaler") kafkaMetadata, err := parseKafkaMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing kafka metadata: %s", err) + return nil, fmt.Errorf("error parsing kafka metadata: %w", err) } client, admin, err := getKafkaClients(kafkaMetadata) @@ -219,7 +219,7 @@ func parseKafkaMetadata(config *ScalerConfig, logger logr.Logger) (kafkaMetadata pattern := config.TriggerMetadata["partitionLimitation"] parsed, err := kedautil.ParseInt32List(pattern) if err != nil { - return meta, fmt.Errorf("error parsing in partitionLimitation '%s': %s", pattern, err) + return meta, fmt.Errorf("error parsing in partitionLimitation '%s': %w", pattern, err) } meta.partitionLimitation = parsed logger.V(0).Info(fmt.Sprintf("partition limit active '%s'", pattern)) @@ -241,7 +241,7 @@ func parseKafkaMetadata(config *ScalerConfig, logger logr.Logger) (kafkaMetadata if val, ok := config.TriggerMetadata[lagThresholdMetricName]; ok { t, err := strconv.ParseInt(val, 10, 64) if err != nil { - return meta, fmt.Errorf("error parsing %q: %s", lagThresholdMetricName, err) + return meta, fmt.Errorf("error parsing %q: %w", lagThresholdMetricName, err) } if t <= 0 { return meta, fmt.Errorf("%q must be positive number", lagThresholdMetricName) @@ -254,7 +254,7 @@ func parseKafkaMetadata(config *ScalerConfig, logger logr.Logger) (kafkaMetadata if val, ok := config.TriggerMetadata[activationLagThresholdMetricName]; ok { t, err := strconv.ParseInt(val, 10, 64) if err != nil { - return meta, fmt.Errorf("error parsing %q: %s", activationLagThresholdMetricName, err) + return meta, fmt.Errorf("error parsing %q: %w", activationLagThresholdMetricName, err) } if t <= 0 { return meta, fmt.Errorf("%q must be positive number", activationLagThresholdMetricName) @@ -270,7 +270,7 @@ func parseKafkaMetadata(config *ScalerConfig, logger logr.Logger) (kafkaMetadata if val, ok := config.TriggerMetadata["allowIdleConsumers"]; ok { t, err := strconv.ParseBool(val) if err != nil { - return meta, fmt.Errorf("error parsing allowIdleConsumers: %s", err) + return meta, fmt.Errorf("error parsing allowIdleConsumers: %w", err) } meta.allowIdleConsumers = t } @@ -279,7 +279,7 @@ func parseKafkaMetadata(config *ScalerConfig, logger logr.Logger) (kafkaMetadata if val, ok := config.TriggerMetadata["excludePersistentLag"]; ok { t, err := strconv.ParseBool(val) if err != nil { - return meta, fmt.Errorf("error parsing excludePersistentLag: %s", err) + return meta, fmt.Errorf("error parsing excludePersistentLag: %w", err) } meta.excludePersistentLag = t } @@ -288,7 +288,7 @@ func parseKafkaMetadata(config *ScalerConfig, logger logr.Logger) (kafkaMetadata if val, ok := config.TriggerMetadata["scaleToZeroOnInvalidOffset"]; ok { t, err := strconv.ParseBool(val) if err != nil { - return meta, fmt.Errorf("error parsing scaleToZeroOnInvalidOffset: %s", err) + return meta, fmt.Errorf("error parsing scaleToZeroOnInvalidOffset: %w", err) } meta.scaleToZeroOnInvalidOffset = t } @@ -298,7 +298,7 @@ func parseKafkaMetadata(config *ScalerConfig, logger logr.Logger) (kafkaMetadata val = strings.TrimSpace(val) version, err := sarama.ParseKafkaVersion(val) if err != nil { - return meta, fmt.Errorf("error parsing kafka version: %s", err) + return meta, fmt.Errorf("error parsing kafka version: %w", err) } meta.version = version } @@ -346,7 +346,7 @@ func getKafkaClients(metadata kafkaMetadata) (sarama.Client, sarama.ClusterAdmin client, err := sarama.NewClient(metadata.bootstrapServers, config) if err != nil { - return nil, nil, fmt.Errorf("error creating kafka client: %s", err) + return nil, nil, fmt.Errorf("error creating kafka client: %w", err) } admin, err := sarama.NewClusterAdminFromClient(client) @@ -354,7 +354,7 @@ func getKafkaClients(metadata kafkaMetadata) (sarama.Client, sarama.ClusterAdmin if !client.Closed() { client.Close() } - return nil, nil, fmt.Errorf("error creating kafka admin: %s", err) + return nil, nil, fmt.Errorf("error creating kafka admin: %w", err) } return client, admin, nil @@ -367,11 +367,11 @@ func (s *kafkaScaler) getTopicPartitions() (map[string][]int32, error) { if s.metadata.topic == "" { listCGOffsetResponse, err := s.admin.ListConsumerGroupOffsets(s.metadata.group, nil) if err != nil { - return nil, fmt.Errorf("error listing cg offset: %s", err) + return nil, fmt.Errorf("error listing cg offset: %w", err) } if listCGOffsetResponse.Err > 0 { - errMsg := fmt.Errorf("error listing cg offset: %s", listCGOffsetResponse.Err.Error()) + errMsg := fmt.Errorf("error listing cg offset: %w", listCGOffsetResponse.Err) s.logger.Error(errMsg, "") } @@ -384,7 +384,7 @@ func (s *kafkaScaler) getTopicPartitions() (map[string][]int32, error) { topicsMetadata, err := s.admin.DescribeTopics(topicsToDescribe) if err != nil { - return nil, fmt.Errorf("error describing topics: %s", err) + return nil, fmt.Errorf("error describing topics: %w", err) } if s.metadata.topic != "" && len(topicsMetadata) != 1 { @@ -394,7 +394,7 @@ func (s *kafkaScaler) getTopicPartitions() (map[string][]int32, error) { topicPartitions := make(map[string][]int32, len(topicsMetadata)) for _, topicMetadata := range topicsMetadata { if topicMetadata.Err > 0 { - errMsg := fmt.Errorf("error describing topics: %s", topicMetadata.Err.Error()) + errMsg := fmt.Errorf("error describing topics: %w", topicMetadata.Err) s.logger.Error(errMsg, "") } partitionMetadata := topicMetadata.Partitions @@ -428,10 +428,10 @@ func (s *kafkaScaler) isActivePartition(pID int32) bool { func (s *kafkaScaler) getConsumerOffsets(topicPartitions map[string][]int32) (*sarama.OffsetFetchResponse, error) { offsets, err := s.admin.ListConsumerGroupOffsets(s.metadata.group, topicPartitions) if err != nil { - return nil, fmt.Errorf("error listing consumer group offsets: %s", err) + return nil, fmt.Errorf("error listing consumer group offsets: %w", err) } if offsets.Err > 0 { - errMsg := fmt.Errorf("error listing consumer group offsets: %s", offsets.Err.Error()) + errMsg := fmt.Errorf("error listing consumer group offsets: %w", offsets.Err) s.logger.Error(errMsg, "") } return offsets, nil @@ -449,7 +449,7 @@ func (s *kafkaScaler) getLagForPartition(topic string, partitionID int32, offset return 0, 0, errMsg } if block.Err > 0 { - errMsg := fmt.Errorf("error finding offset block for topic %s and partition %d: %s", topic, partitionID, offsets.Err.Error()) + errMsg := fmt.Errorf("error finding offset block for topic %s and partition %d: %w", topic, partitionID, offsets.Err) s.logger.Error(errMsg, "") } @@ -501,12 +501,10 @@ func (s *kafkaScaler) getLagForPartition(topic string, partitionID int32, offset // Close closes the kafka admin and client func (s *kafkaScaler) Close(context.Context) error { // underlying client will also be closed on admin's Close() call - err := s.admin.Close() - if err != nil { - return err + if s.admin == nil { + return nil } - - return nil + return s.admin.Close() } func (s *kafkaScaler) GetMetricSpecForScaling(context.Context) []v2.MetricSpec { diff --git a/pkg/scalers/kubernetes_workload_scaler.go b/pkg/scalers/kubernetes_workload_scaler.go index 3d56cef69b5..342a8956cee 100644 --- a/pkg/scalers/kubernetes_workload_scaler.go +++ b/pkg/scalers/kubernetes_workload_scaler.go @@ -46,12 +46,12 @@ type kubernetesWorkloadMetadata struct { func NewKubernetesWorkloadScaler(kubeClient client.Client, config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } meta, parseErr := parseWorkloadMetadata(config) if parseErr != nil { - return nil, fmt.Errorf("error parsing kubernetes workload metadata: %s", parseErr) + return nil, fmt.Errorf("error parsing kubernetes workload metadata: %w", parseErr) } return &kubernetesWorkloadScaler{ @@ -111,7 +111,7 @@ func (s *kubernetesWorkloadScaler) GetMetricSpecForScaling(context.Context) []v2 func (s *kubernetesWorkloadScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { pods, err := s.getMetricValue(ctx) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting kubernetes workload: %s", err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting kubernetes workload: %w", err) } metric := GenerateMetricInMili(metricName, float64(pods)) diff --git a/pkg/scalers/liiklus/LiiklusService.pb.go b/pkg/scalers/liiklus/LiiklusService.pb.go index 00bb5fb9e33..de2d6ed148d 100644 --- a/pkg/scalers/liiklus/LiiklusService.pb.go +++ b/pkg/scalers/liiklus/LiiklusService.pb.go @@ -326,7 +326,6 @@ type SubscribeReply struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Reply: - // // *SubscribeReply_Assignment Reply isSubscribeReply_Reply `protobuf_oneof:"reply"` } @@ -537,7 +536,6 @@ type ReceiveReply struct { unknownFields protoimpl.UnknownFields // Types that are assignable to Reply: - // // *ReceiveReply_Record_ Reply isReceiveReply_Reply `protobuf_oneof:"reply"` } diff --git a/pkg/scalers/liiklus_scaler.go b/pkg/scalers/liiklus_scaler.go index 871c2b17963..bbc635b6ffd 100644 --- a/pkg/scalers/liiklus_scaler.go +++ b/pkg/scalers/liiklus_scaler.go @@ -61,7 +61,7 @@ var ( func NewLiiklusScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } lm, err := parseLiiklusMetadata(config) @@ -114,8 +114,10 @@ func (s *liiklusScaler) GetMetricSpecForScaling(context.Context) []v2.MetricSpec func (s *liiklusScaler) Close(context.Context) error { err := s.connection.Close() if err != nil { + s.logger.Error(err, "Error closing liiklus connection") return err } + return nil } @@ -160,7 +162,7 @@ func parseLiiklusMetadata(config *ScalerConfig) (*liiklusMetadata, error) { if val, ok := config.TriggerMetadata[liiklusLagThresholdMetricName]; ok { t, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, fmt.Errorf("error parsing %s: %s", liiklusLagThresholdMetricName, err) + return nil, fmt.Errorf("error parsing %s: %w", liiklusLagThresholdMetricName, err) } lagThreshold = t } @@ -175,9 +177,9 @@ func parseLiiklusMetadata(config *ScalerConfig) (*liiklusMetadata, error) { groupVersion := uint32(0) if val, ok := config.TriggerMetadata["groupVersion"]; ok { - t, err := strconv.ParseInt(val, 10, 32) + t, err := strconv.ParseUint(val, 10, 32) if err != nil { - return nil, fmt.Errorf("error parsing groupVersion: %s", err) + return nil, fmt.Errorf("error parsing groupVersion: %w", err) } groupVersion = uint32(t) } diff --git a/pkg/scalers/loki_scaler.go b/pkg/scalers/loki_scaler.go index 2e9f1470ea0..601bffa5f18 100644 --- a/pkg/scalers/loki_scaler.go +++ b/pkg/scalers/loki_scaler.go @@ -67,14 +67,14 @@ type lokiQueryResult struct { func NewLokiScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "loki_scaler") meta, err := parseLokiMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing loki metadata: %s", err) + return nil, fmt.Errorf("error parsing loki metadata: %w", err) } httpClient := kedautil.CreateHTTPClient(config.GlobalHTTPTimeout, meta.unsafeSsl) @@ -105,7 +105,7 @@ func parseLokiMetadata(config *ScalerConfig) (meta *lokiMetadata, err error) { if val, ok := config.TriggerMetadata[lokiThreshold]; ok && val != "" { t, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("error parsing %s: %s", lokiThreshold, err) + return nil, fmt.Errorf("error parsing %s: %w", lokiThreshold, err) } meta.threshold = t @@ -117,7 +117,7 @@ func parseLokiMetadata(config *ScalerConfig) (meta *lokiMetadata, err error) { if val, ok := config.TriggerMetadata[lokiActivationThreshold]; ok { t, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("activationThreshold parsing error %s", err.Error()) + return nil, fmt.Errorf("activationThreshold parsing error %w", err) } meta.activationThreshold = t @@ -141,7 +141,7 @@ func parseLokiMetadata(config *ScalerConfig) (meta *lokiMetadata, err error) { if val, ok := config.TriggerMetadata[unsafeSsl]; ok && val != "" { unsafeSslValue, err := strconv.ParseBool(val) if err != nil { - return nil, fmt.Errorf("error parsing %s: %s", unsafeSsl, err) + return nil, fmt.Errorf("error parsing %s: %w", unsafeSsl, err) } meta.unsafeSsl = unsafeSslValue diff --git a/pkg/scalers/metrics_api_scaler.go b/pkg/scalers/metrics_api_scaler.go index 4490802446b..c819d057b9e 100644 --- a/pkg/scalers/metrics_api_scaler.go +++ b/pkg/scalers/metrics_api_scaler.go @@ -68,12 +68,12 @@ const ( func NewMetricsAPIScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } meta, err := parseMetricsAPIMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing metric API metadata: %s", err) + return nil, fmt.Errorf("error parsing metric API metadata: %w", err) } httpClient := kedautil.CreateHTTPClient(config.GlobalHTTPTimeout, meta.unsafeSsl) @@ -102,7 +102,7 @@ func parseMetricsAPIMetadata(config *ScalerConfig) (*metricsAPIScalerMetadata, e if val, ok := config.TriggerMetadata["unsafeSsl"]; ok { unsafeSsl, err := strconv.ParseBool(val) if err != nil { - return nil, fmt.Errorf("error parsing unsafeSsl: %s", err) + return nil, fmt.Errorf("error parsing unsafeSsl: %w", err) } meta.unsafeSsl = unsafeSsl } @@ -110,7 +110,7 @@ func parseMetricsAPIMetadata(config *ScalerConfig) (*metricsAPIScalerMetadata, e if val, ok := config.TriggerMetadata["targetValue"]; ok { targetValue, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("targetValue parsing error %s", err.Error()) + return nil, fmt.Errorf("targetValue parsing error %w", err) } meta.targetValue = targetValue } else { @@ -121,7 +121,7 @@ func parseMetricsAPIMetadata(config *ScalerConfig) (*metricsAPIScalerMetadata, e if val, ok := config.TriggerMetadata["activationTargetValue"]; ok { activationTargetValue, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("targetValue parsing error %s", err.Error()) + return nil, fmt.Errorf("targetValue parsing error %w", err) } meta.activationTargetValue = activationTargetValue } @@ -274,7 +274,7 @@ func (s *metricsAPIScaler) GetMetricSpecForScaling(context.Context) []v2.MetricS func (s *metricsAPIScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { val, err := s.getMetricValue(ctx) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error requesting metrics endpoint: %s", err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error requesting metrics endpoint: %w", err) } metric := GenerateMetricInMili(metricName, val) diff --git a/pkg/scalers/mongo_scaler.go b/pkg/scalers/mongo_scaler.go index b15b19823d7..be9307262c9 100644 --- a/pkg/scalers/mongo_scaler.go +++ b/pkg/scalers/mongo_scaler.go @@ -80,7 +80,7 @@ const ( func NewMongoDBScaler(ctx context.Context, config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } ctx, cancel := context.WithTimeout(ctx, mongoDBDefaultTimeOut) @@ -88,17 +88,17 @@ func NewMongoDBScaler(ctx context.Context, config *ScalerConfig) (Scaler, error) meta, connStr, err := parseMongoDBMetadata(config) if err != nil { - return nil, fmt.Errorf("failed to parsing mongoDB metadata, because of %v", err) + return nil, fmt.Errorf("failed to parsing mongoDB metadata, because of %w", err) } opt := options.Client().ApplyURI(connStr) client, err := mongo.Connect(ctx, opt) if err != nil { - return nil, fmt.Errorf("failed to establish connection with mongoDB, because of %v", err) + return nil, fmt.Errorf("failed to establish connection with mongoDB, because of %w", err) } if err = client.Ping(ctx, readpref.Primary()); err != nil { - return nil, fmt.Errorf("failed to ping mongoDB, because of %v", err) + return nil, fmt.Errorf("failed to ping mongoDB, because of %w", err) } return &mongoDBScaler{ @@ -131,7 +131,7 @@ func parseMongoDBMetadata(config *ScalerConfig) (*mongoDBMetadata, string, error if val, ok := config.TriggerMetadata["queryValue"]; ok { queryValue, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, "", fmt.Errorf("failed to convert %v to int, because of %v", val, err.Error()) + return nil, "", fmt.Errorf("failed to convert %v to int, because of %w", val, err) } meta.queryValue = queryValue } else { @@ -142,7 +142,7 @@ func parseMongoDBMetadata(config *ScalerConfig) (*mongoDBMetadata, string, error if val, ok := config.TriggerMetadata["activationQueryValue"]; ok { activationQueryValue, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, "", fmt.Errorf("failed to convert %v to int, because of %v", val, err.Error()) + return nil, "", fmt.Errorf("failed to convert %v to int, because of %w", val, err) } meta.activationQueryValue = activationQueryValue } @@ -244,7 +244,7 @@ func (s *mongoDBScaler) getQueryResult(ctx context.Context) (int64, error) { func (s *mongoDBScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { num, err := s.getQueryResult(ctx) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("failed to inspect momgoDB, because of %v", err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("failed to inspect momgoDB, because of %w", err) } metric := GenerateMetricInMili(metricName, float64(num)) diff --git a/pkg/scalers/mssql_scaler.go b/pkg/scalers/mssql_scaler.go index e86740e83cb..90d0cccbd88 100644 --- a/pkg/scalers/mssql_scaler.go +++ b/pkg/scalers/mssql_scaler.go @@ -76,19 +76,19 @@ type mssqlMetadata struct { func NewMSSQLScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "mssql_scaler") meta, err := parseMSSQLMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing mssql metadata: %s", err) + return nil, fmt.Errorf("error parsing mssql metadata: %w", err) } conn, err := newMSSQLConnection(meta, logger) if err != nil { - return nil, fmt.Errorf("error establishing mssql connection: %s", err) + return nil, fmt.Errorf("error establishing mssql connection: %w", err) } return &mssqlScaler{ @@ -114,7 +114,7 @@ func parseMSSQLMetadata(config *ScalerConfig) (*mssqlMetadata, error) { if val, ok := config.TriggerMetadata["targetValue"]; ok { targetValue, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("targetValue parsing error %s", err.Error()) + return nil, fmt.Errorf("targetValue parsing error %w", err) } meta.targetValue = targetValue } else { @@ -126,7 +126,7 @@ func parseMSSQLMetadata(config *ScalerConfig) (*mssqlMetadata, error) { if val, ok := config.TriggerMetadata["activationTargetValue"]; ok { activationTargetValue, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("activationTargetValue parsing error %s", err.Error()) + return nil, fmt.Errorf("activationTargetValue parsing error %w", err) } meta.activationTargetValue = activationTargetValue } @@ -152,7 +152,7 @@ func parseMSSQLMetadata(config *ScalerConfig) (*mssqlMetadata, error) { if paramPort != "" { port, err := strconv.Atoi(paramPort) if err != nil { - return nil, fmt.Errorf("port parsing error %s", err.Error()) + return nil, fmt.Errorf("port parsing error %w", err) } meta.port = port } @@ -258,7 +258,7 @@ func (s *mssqlScaler) GetMetricSpecForScaling(context.Context) []v2.MetricSpec { func (s *mssqlScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { num, err := s.getQueryResult(ctx) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting mssql: %s", err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting mssql: %w", err) } metric := GenerateMetricInMili(metricName, num) diff --git a/pkg/scalers/mysql_scaler.go b/pkg/scalers/mysql_scaler.go index 584675fc5b1..5ba4b5eedc5 100644 --- a/pkg/scalers/mysql_scaler.go +++ b/pkg/scalers/mysql_scaler.go @@ -40,19 +40,19 @@ type mySQLMetadata struct { func NewMySQLScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "mysql_scaler") meta, err := parseMySQLMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing MySQL metadata: %s", err) + return nil, fmt.Errorf("error parsing MySQL metadata: %w", err) } conn, err := newMySQLConnection(meta, logger) if err != nil { - return nil, fmt.Errorf("error establishing MySQL connection: %s", err) + return nil, fmt.Errorf("error establishing MySQL connection: %w", err) } return &mySQLScaler{ metricType: metricType, @@ -74,7 +74,7 @@ func parseMySQLMetadata(config *ScalerConfig) (*mySQLMetadata, error) { if val, ok := config.TriggerMetadata["queryValue"]; ok { queryValue, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("queryValue parsing error %s", err.Error()) + return nil, fmt.Errorf("queryValue parsing error %w", err) } meta.queryValue = queryValue } else { @@ -85,7 +85,7 @@ func parseMySQLMetadata(config *ScalerConfig) (*mySQLMetadata, error) { if val, ok := config.TriggerMetadata["activationQueryValue"]; ok { activationQueryValue, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("activationQueryValue parsing error %s", err.Error()) + return nil, fmt.Errorf("activationQueryValue parsing error %w", err) } meta.activationQueryValue = activationQueryValue } @@ -226,7 +226,7 @@ func (s *mySQLScaler) GetMetricSpecForScaling(context.Context) []v2.MetricSpec { func (s *mySQLScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { num, err := s.getQueryResult(ctx) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting MySQL: %s", err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting MySQL: %w", err) } metric := GenerateMetricInMili(metricName, num) diff --git a/pkg/scalers/nats_jetstream_scaler.go b/pkg/scalers/nats_jetstream_scaler.go index f4694a79a7d..06e4dca95ca 100644 --- a/pkg/scalers/nats_jetstream_scaler.go +++ b/pkg/scalers/nats_jetstream_scaler.go @@ -113,12 +113,12 @@ type consumerDeliveryStatus struct { func NewNATSJetStreamScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } jsMetadata, err := parseNATSJetStreamMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing NATS JetStream metadata: %s", err) + return nil, fmt.Errorf("error parsing NATS JetStream metadata: %w", err) } return &natsJetStreamScaler{ @@ -153,7 +153,7 @@ func parseNATSJetStreamMetadata(config *ScalerConfig) (natsJetStreamMetadata, er if val, ok := config.TriggerMetadata[jetStreamLagThresholdMetricName]; ok { t, err := strconv.ParseInt(val, 10, 64) if err != nil { - return meta, fmt.Errorf("error parsing %s: %s", jetStreamLagThresholdMetricName, err) + return meta, fmt.Errorf("error parsing %s: %w", jetStreamLagThresholdMetricName, err) } meta.lagThreshold = t @@ -163,7 +163,7 @@ func parseNATSJetStreamMetadata(config *ScalerConfig) (natsJetStreamMetadata, er if val, ok := config.TriggerMetadata["activationLagThreshold"]; ok { activationTargetQueryValue, err := strconv.ParseInt(val, 10, 64) if err != nil { - return meta, fmt.Errorf("activationLagThreshold parsing error %s", err.Error()) + return meta, fmt.Errorf("activationLagThreshold parsing error %w", err) } meta.activationLagThreshold = activationTargetQueryValue } @@ -178,7 +178,7 @@ func parseNATSJetStreamMetadata(config *ScalerConfig) (natsJetStreamMetadata, er if val, ok := config.TriggerMetadata["useHttps"]; ok { useHTTPS, err = strconv.ParseBool(val) if err != nil { - return meta, fmt.Errorf("useHTTPS parsing error %s", err.Error()) + return meta, fmt.Errorf("useHTTPS parsing error %w", err) } } meta.monitoringURL = getNATSJetStreamMonitoringURL(useHTTPS, natsServerEndpoint, meta.account) diff --git a/pkg/scalers/newrelic_scaler.go b/pkg/scalers/newrelic_scaler.go index 901da8d0180..5b813a894da 100644 --- a/pkg/scalers/newrelic_scaler.go +++ b/pkg/scalers/newrelic_scaler.go @@ -46,14 +46,14 @@ type newrelicMetadata struct { func NewNewRelicScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, fmt.Sprintf("%s_scaler", scalerName)) meta, err := parseNewRelicMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing %s metadata: %s", scalerName, err) + return nil, fmt.Errorf("error parsing %s metadata: %w", scalerName, err) } nrClient, err := newrelic.New( @@ -86,7 +86,7 @@ func parseNewRelicMetadata(config *ScalerConfig, logger logr.Logger) (*newrelicM t, err := strconv.Atoi(val) if err != nil { - return nil, fmt.Errorf("error parsing %s: %s", account, err) + return nil, fmt.Errorf("error parsing %s: %w", account, err) } meta.account = t @@ -123,7 +123,7 @@ func parseNewRelicMetadata(config *ScalerConfig, logger logr.Logger) (*newrelicM if val, ok := config.TriggerMetadata["activationThreshold"]; ok { activationThreshold, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("queryValue parsing error %s", err.Error()) + return nil, fmt.Errorf("queryValue parsing error %w", err) } meta.activationThreshold = activationThreshold } diff --git a/pkg/scalers/openstack/keystone_authentication.go b/pkg/scalers/openstack/keystone_authentication.go index 4319d1a28e3..b1106bd2786 100644 --- a/pkg/scalers/openstack/keystone_authentication.go +++ b/pkg/scalers/openstack/keystone_authentication.go @@ -110,7 +110,7 @@ func (client *Client) IsTokenValid(ctx context.Context) (bool, error) { tokenURL, err := url.Parse(client.authMetadata.AuthURL) if err != nil { - return false, fmt.Errorf("the authURL is invalid: %s", err.Error()) + return false, fmt.Errorf("the authURL is invalid: %w", err) } tokenURL.Path = path.Join(tokenURL.Path, tokensEndpoint) @@ -166,7 +166,7 @@ func NewPasswordAuth(authURL string, userID string, userPassword string, project url, err := url.Parse(authURL) if err != nil { - return nil, fmt.Errorf("authURL is invalid: %s", err.Error()) + return nil, fmt.Errorf("authURL is invalid: %w", err) } url.Path = path.Join(url.Path, "") @@ -196,7 +196,7 @@ func NewAppCredentialsAuth(authURL string, id string, secret string, httpTimeout url, err := url.Parse(authURL) if err != nil { - return nil, fmt.Errorf("authURL is invalid: %s", err.Error()) + return nil, fmt.Errorf("authURL is invalid: %w", err) } url.Path = path.Join(url.Path, "") @@ -243,7 +243,7 @@ func (keystone *KeystoneAuthRequest) RequestClient(ctx context.Context, projectP } if err != nil { - return client, fmt.Errorf("scaler could not find the service URL dinamically. Either provide it in the scaler parameters or check your OpenStack configuration: %s", err.Error()) + return client, fmt.Errorf("scaler could not find the service URL dinamically. Either provide it in the scaler parameters or check your OpenStack configuration: %w", err) } client.URL = serviceURL @@ -265,7 +265,7 @@ func (keystone *KeystoneAuthRequest) getToken(ctx context.Context) (string, erro tokenURL, err := url.Parse(keystone.AuthURL) if err != nil { - return "", fmt.Errorf("the authURL is invalid: %s", err.Error()) + return "", fmt.Errorf("the authURL is invalid: %w", err) } tokenURL.Path = path.Join(tokenURL.Path, tokensEndpoint) @@ -304,7 +304,7 @@ func (keystone *KeystoneAuthRequest) getCatalog(ctx context.Context, token strin catalogURL, err := url.Parse(keystone.AuthURL) if err != nil { - return nil, fmt.Errorf("the authURL is invalid: %s", err.Error()) + return nil, fmt.Errorf("the authURL is invalid: %w", err) } catalogURL.Path = path.Join(catalogURL.Path, catalogEndpoint) @@ -331,7 +331,7 @@ func (keystone *KeystoneAuthRequest) getCatalog(ctx context.Context, token strin err := json.NewDecoder(resp.Body).Decode(&keystoneCatalog) if err != nil { - return nil, fmt.Errorf("error parsing the catalog resquest response body: %s", err.Error()) + return nil, fmt.Errorf("error parsing the catalog resquest response body: %w", err) } return keystoneCatalog.Catalog, nil diff --git a/pkg/scalers/openstack_metrics_scaler.go b/pkg/scalers/openstack_metrics_scaler.go index 039c9446d03..bec7cb5862c 100644 --- a/pkg/scalers/openstack_metrics_scaler.go +++ b/pkg/scalers/openstack_metrics_scaler.go @@ -65,7 +65,7 @@ func NewOpenstackMetricScaler(ctx context.Context, config *ScalerConfig) (Scaler metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "openstack_metric_scaler") @@ -73,13 +73,13 @@ func NewOpenstackMetricScaler(ctx context.Context, config *ScalerConfig) (Scaler openstackMetricMetadata, err := parseOpenstackMetricMetadata(config, logger) if err != nil { - return nil, fmt.Errorf("error parsing openstack Metric metadata: %s", err) + return nil, fmt.Errorf("error parsing openstack Metric metadata: %w", err) } authMetadata, err := parseOpenstackMetricAuthenticationMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing openstack metric authentication metadata: %s", err) + return nil, fmt.Errorf("error parsing openstack metric authentication metadata: %w", err) } // User choose the "application_credentials" authentication method @@ -87,7 +87,7 @@ func NewOpenstackMetricScaler(ctx context.Context, config *ScalerConfig) (Scaler keystoneAuth, err = openstack.NewAppCredentialsAuth(authMetadata.authURL, authMetadata.appCredentialSecretID, authMetadata.appCredentialSecret, openstackMetricMetadata.timeout) if err != nil { - return nil, fmt.Errorf("error getting openstack credentials for application credentials method: %s", err) + return nil, fmt.Errorf("error getting openstack credentials for application credentials method: %w", err) } } else { // User choose the "password" authentication method @@ -95,7 +95,7 @@ func NewOpenstackMetricScaler(ctx context.Context, config *ScalerConfig) (Scaler keystoneAuth, err = openstack.NewPasswordAuth(authMetadata.authURL, authMetadata.userID, authMetadata.password, "", openstackMetricMetadata.timeout) if err != nil { - return nil, fmt.Errorf("error getting openstack credentials for password method: %s", err) + return nil, fmt.Errorf("error getting openstack credentials for password method: %w", err) } } else { return nil, fmt.Errorf("no authentication method was provided for OpenStack") @@ -157,7 +157,7 @@ func parseOpenstackMetricMetadata(config *ScalerConfig, logger logr.Logger) (*op _threshold, err := strconv.ParseFloat(val, 32) if err != nil { logger.Error(err, "error parsing openstack metric metadata", "threshold", "threshold") - return nil, fmt.Errorf("error parsing openstack metric metadata : %s", err.Error()) + return nil, fmt.Errorf("error parsing openstack metric metadata : %w", err) } meta.threshold = _threshold @@ -168,7 +168,7 @@ func parseOpenstackMetricMetadata(config *ScalerConfig, logger logr.Logger) (*op activationThreshold, err := strconv.ParseFloat(val, 32) if err != nil { logger.Error(err, "error parsing openstack metric metadata", "activationThreshold", "activationThreshold") - return nil, fmt.Errorf("error parsing openstack metric metadata : %s", err.Error()) + return nil, fmt.Errorf("error parsing openstack metric metadata : %w", err) } meta.activationThreshold = activationThreshold @@ -177,7 +177,7 @@ func parseOpenstackMetricMetadata(config *ScalerConfig, logger logr.Logger) (*op if val, ok := triggerMetadata["timeout"]; ok && val != "" { httpClientTimeout, err := strconv.Atoi(val) if err != nil { - return nil, fmt.Errorf("httpClientTimeout parsing error: %s", err.Error()) + return nil, fmt.Errorf("httpClientTimeout parsing error: %w", err) } meta.timeout = httpClientTimeout } else { @@ -274,7 +274,7 @@ func (s *openstackMetricScaler) readOpenstackMetrics(ctx context.Context) (float if err != nil { s.logger.Error(err, "metric url provided is invalid") - return defaultValueWhenError, fmt.Errorf("metric url is invalid: %s", err.Error()) + return defaultValueWhenError, fmt.Errorf("metric url is invalid: %w", err) } openstackMetricsURL.Path = path.Join(openstackMetricsURL.Path, s.metadata.metricID+"/measures") diff --git a/pkg/scalers/openstack_swift_scaler.go b/pkg/scalers/openstack_swift_scaler.go index 3c1e3ba2905..dcd287ce491 100644 --- a/pkg/scalers/openstack_swift_scaler.go +++ b/pkg/scalers/openstack_swift_scaler.go @@ -84,7 +84,7 @@ func (s *openstackSwiftScaler) getOpenstackSwiftContainerObjectCount(ctx context if err != nil { s.logger.Error(err, fmt.Sprintf("the swiftURL is invalid: %s. You might have forgotten to provide the either 'http' or 'https' in the URL. Check our documentation to see if you missed something", swiftURL)) - return 0, fmt.Errorf("the swiftURL is invalid: %s", err.Error()) + return 0, fmt.Errorf("the swiftURL is invalid: %w", err) } swiftContainerURL.Path = path.Join(swiftContainerURL.Path, containerName) @@ -183,7 +183,7 @@ func NewOpenstackSwiftScaler(ctx context.Context, config *ScalerConfig) (Scaler, metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "openstack_swift_scaler") @@ -191,27 +191,27 @@ func NewOpenstackSwiftScaler(ctx context.Context, config *ScalerConfig) (Scaler, openstackSwiftMetadata, err := parseOpenstackSwiftMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing swift metadata: %s", err) + return nil, fmt.Errorf("error parsing swift metadata: %w", err) } authMetadata, err := parseOpenstackSwiftAuthenticationMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing swift authentication metadata: %s", err) + return nil, fmt.Errorf("error parsing swift authentication metadata: %w", err) } // User chose the "application_credentials" authentication method if authMetadata.appCredentialID != "" { authRequest, err = openstack.NewAppCredentialsAuth(authMetadata.authURL, authMetadata.appCredentialID, authMetadata.appCredentialSecret, openstackSwiftMetadata.httpClientTimeout) if err != nil { - return nil, fmt.Errorf("error getting openstack credentials for application credentials method: %s", err) + return nil, fmt.Errorf("error getting openstack credentials for application credentials method: %w", err) } } else { // User chose the "password" authentication method if authMetadata.userID != "" { authRequest, err = openstack.NewPasswordAuth(authMetadata.authURL, authMetadata.userID, authMetadata.password, authMetadata.projectID, openstackSwiftMetadata.httpClientTimeout) if err != nil { - return nil, fmt.Errorf("error getting openstack credentials for password method: %s", err) + return nil, fmt.Errorf("error getting openstack credentials for password method: %w", err) } } else { return nil, fmt.Errorf("no authentication method was provided for OpenStack") @@ -223,7 +223,7 @@ func NewOpenstackSwiftScaler(ctx context.Context, config *ScalerConfig) (Scaler, swiftClient, err = authRequest.RequestClient(ctx, "swift", authMetadata.regionName) if err != nil { - return nil, fmt.Errorf("swiftURL was not provided and the scaler could not retrieve it dinamically using the OpenStack catalog: %s", err.Error()) + return nil, fmt.Errorf("swiftURL was not provided and the scaler could not retrieve it dinamically using the OpenStack catalog: %w", err) } openstackSwiftMetadata.swiftURL = swiftClient.URL @@ -264,7 +264,7 @@ func parseOpenstackSwiftMetadata(config *ScalerConfig) (*openstackSwiftMetadata, if val, ok := config.TriggerMetadata["objectCount"]; ok { objectCount, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, fmt.Errorf("objectCount parsing error: %s", err.Error()) + return nil, fmt.Errorf("objectCount parsing error: %w", err) } meta.objectCount = objectCount } else { @@ -274,7 +274,7 @@ func parseOpenstackSwiftMetadata(config *ScalerConfig) (*openstackSwiftMetadata, if val, ok := config.TriggerMetadata["activationObjectCount"]; ok { activationObjectCount, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, fmt.Errorf("activationObjectCount parsing error: %s", err.Error()) + return nil, fmt.Errorf("activationObjectCount parsing error: %w", err) } meta.activationObjectCount = activationObjectCount } else { @@ -296,7 +296,7 @@ func parseOpenstackSwiftMetadata(config *ScalerConfig) (*openstackSwiftMetadata, if val, ok := config.TriggerMetadata["timeout"]; ok { httpClientTimeout, err := strconv.Atoi(val) if err != nil { - return nil, fmt.Errorf("httpClientTimeout parsing error: %s", err.Error()) + return nil, fmt.Errorf("httpClientTimeout parsing error: %w", err) } meta.httpClientTimeout = httpClientTimeout } else { diff --git a/pkg/scalers/postgresql_scaler.go b/pkg/scalers/postgresql_scaler.go index 127eaf5504b..122f3b4a4d1 100644 --- a/pkg/scalers/postgresql_scaler.go +++ b/pkg/scalers/postgresql_scaler.go @@ -36,19 +36,19 @@ type postgreSQLMetadata struct { func NewPostgreSQLScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "postgresql_scaler") meta, err := parsePostgreSQLMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing postgreSQL metadata: %s", err) + return nil, fmt.Errorf("error parsing postgreSQL metadata: %w", err) } conn, err := getConnection(meta, logger) if err != nil { - return nil, fmt.Errorf("error establishing postgreSQL connection: %s", err) + return nil, fmt.Errorf("error establishing postgreSQL connection: %w", err) } return &postgreSQLScaler{ metricType: metricType, @@ -70,7 +70,7 @@ func parsePostgreSQLMetadata(config *ScalerConfig) (*postgreSQLMetadata, error) if val, ok := config.TriggerMetadata["targetQueryValue"]; ok { targetQueryValue, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("queryValue parsing error %s", err.Error()) + return nil, fmt.Errorf("queryValue parsing error %w", err) } meta.targetQueryValue = targetQueryValue } else { @@ -81,7 +81,7 @@ func parsePostgreSQLMetadata(config *ScalerConfig) (*postgreSQLMetadata, error) if val, ok := config.TriggerMetadata["activationTargetQueryValue"]; ok { activationTargetQueryValue, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("activationTargetQueryValue parsing error %s", err.Error()) + return nil, fmt.Errorf("activationTargetQueryValue parsing error %w", err) } meta.activationTargetQueryValue = activationTargetQueryValue } @@ -173,7 +173,7 @@ func (s *postgreSQLScaler) getActiveNumber(ctx context.Context) (float64, error) err := s.connection.QueryRowContext(ctx, s.metadata.query).Scan(&id) if err != nil { s.logger.Error(err, fmt.Sprintf("could not query postgreSQL: %s", err)) - return 0, fmt.Errorf("could not query postgreSQL: %s", err) + return 0, fmt.Errorf("could not query postgreSQL: %w", err) } return id, nil } @@ -196,7 +196,7 @@ func (s *postgreSQLScaler) GetMetricSpecForScaling(context.Context) []v2.MetricS func (s *postgreSQLScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { num, err := s.getActiveNumber(ctx) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting postgreSQL: %s", err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error inspecting postgreSQL: %w", err) } metric := GenerateMetricInMili(metricName, num) diff --git a/pkg/scalers/predictkube_scaler.go b/pkg/scalers/predictkube_scaler.go index 7f70e00cd48..7d67ffe7551 100644 --- a/pkg/scalers/predictkube_scaler.go +++ b/pkg/scalers/predictkube_scaler.go @@ -144,7 +144,7 @@ func NewPredictKubeScaler(ctx context.Context, config *ScalerConfig) (*PredictKu metricType, err := GetMetricTargetType(config) if err != nil { logger.Error(err, "error getting scaler metric type") - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } s.metricType = metricType @@ -370,7 +370,7 @@ func parsePredictKubeMetadata(config *ScalerConfig) (result *predictKubeMetadata if val, ok := config.TriggerMetadata["predictHorizon"]; ok { predictHorizon, err := str2duration.ParseDuration(val) if err != nil { - return nil, fmt.Errorf("predictHorizon parsing error %s", err.Error()) + return nil, fmt.Errorf("predictHorizon parsing error %w", err) } meta.predictHorizon = predictHorizon } else { @@ -380,7 +380,7 @@ func parsePredictKubeMetadata(config *ScalerConfig) (result *predictKubeMetadata if val, ok := config.TriggerMetadata["queryStep"]; ok { stepDuration, err := str2duration.ParseDuration(val) if err != nil { - return nil, fmt.Errorf("queryStep parsing error %s", err.Error()) + return nil, fmt.Errorf("queryStep parsing error %w", err) } meta.stepDuration = stepDuration } else { @@ -390,7 +390,7 @@ func parsePredictKubeMetadata(config *ScalerConfig) (result *predictKubeMetadata if val, ok := config.TriggerMetadata["historyTimeWindow"]; ok { historyTimeWindow, err := str2duration.ParseDuration(val) if err != nil { - return nil, fmt.Errorf("historyTimeWindow parsing error %s", err.Error()) + return nil, fmt.Errorf("historyTimeWindow parsing error %w", err) } meta.historyTimeWindow = historyTimeWindow } else { @@ -400,7 +400,7 @@ func parsePredictKubeMetadata(config *ScalerConfig) (result *predictKubeMetadata if val, ok := config.TriggerMetadata["threshold"]; ok { threshold, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("threshold parsing error %s", err.Error()) + return nil, fmt.Errorf("threshold parsing error %w", err) } meta.threshold = threshold } else { @@ -411,7 +411,7 @@ func parsePredictKubeMetadata(config *ScalerConfig) (result *predictKubeMetadata if val, ok := config.TriggerMetadata["activationThreshold"]; ok { activationThreshold, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("activationThreshold parsing error %s", err.Error()) + return nil, fmt.Errorf("activationThreshold parsing error %w", err) } meta.activationThreshold = activationThreshold } diff --git a/pkg/scalers/prometheus_scaler.go b/pkg/scalers/prometheus_scaler.go index 83d6fb1cb88..b96e61e7a81 100644 --- a/pkg/scalers/prometheus_scaler.go +++ b/pkg/scalers/prometheus_scaler.go @@ -77,14 +77,14 @@ type promQueryResult struct { func NewPrometheusScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "prometheus_scaler") meta, err := parsePrometheusMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing prometheus metadata: %s", err) + return nil, fmt.Errorf("error parsing prometheus metadata: %w", err) } httpClient := kedautil.CreateHTTPClient(config.GlobalHTTPTimeout, meta.unsafeSsl) @@ -134,7 +134,7 @@ func parsePrometheusMetadata(config *ScalerConfig) (meta *prometheusMetadata, er if val, ok := config.TriggerMetadata[promThreshold]; ok && val != "" { t, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("error parsing %s: %s", promThreshold, err) + return nil, fmt.Errorf("error parsing %s: %w", promThreshold, err) } meta.threshold = t @@ -146,7 +146,7 @@ func parsePrometheusMetadata(config *ScalerConfig) (meta *prometheusMetadata, er if val, ok := config.TriggerMetadata[promActivationThreshold]; ok { t, err := strconv.ParseFloat(val, 64) if err != nil { - return nil, fmt.Errorf("activationThreshold parsing error %s", err.Error()) + return nil, fmt.Errorf("activationThreshold parsing error %w", err) } meta.activationThreshold = t @@ -174,7 +174,7 @@ func parsePrometheusMetadata(config *ScalerConfig) (meta *prometheusMetadata, er if val, ok := config.TriggerMetadata[unsafeSsl]; ok && val != "" { unsafeSslValue, err := strconv.ParseBool(val) if err != nil { - return nil, fmt.Errorf("error parsing %s: %s", unsafeSsl, err) + return nil, fmt.Errorf("error parsing %s: %w", unsafeSsl, err) } meta.unsafeSsl = unsafeSslValue diff --git a/pkg/scalers/pulsar_scaler.go b/pkg/scalers/pulsar_scaler.go index f814f6db991..63b36b88869 100644 --- a/pkg/scalers/pulsar_scaler.go +++ b/pkg/scalers/pulsar_scaler.go @@ -97,7 +97,7 @@ type pulsarStats struct { func NewPulsarScaler(config *ScalerConfig) (Scaler, error) { pulsarMetadata, err := parsePulsarMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing pulsar metadata: %s", err) + return nil, fmt.Errorf("error parsing pulsar metadata: %w", err) } client := kedautil.CreateHTTPClient(config.GlobalHTTPTimeout, false) @@ -171,7 +171,7 @@ func parsePulsarMetadata(config *ScalerConfig) (pulsarMetadata, error) { if val, ok := config.TriggerMetadata["activationMsgBacklogThreshold"]; ok { activationMsgBacklogThreshold, err := strconv.ParseInt(val, 10, 64) if err != nil { - return meta, fmt.Errorf("activationMsgBacklogThreshold parsing error %s", err.Error()) + return meta, fmt.Errorf("activationMsgBacklogThreshold parsing error %w", err) } meta.activationMsgBacklogThreshold = activationMsgBacklogThreshold } @@ -181,7 +181,7 @@ func parsePulsarMetadata(config *ScalerConfig) (pulsarMetadata, error) { if val, ok := config.TriggerMetadata[msgBacklogMetricName]; ok { t, err := strconv.ParseInt(val, 10, 64) if err != nil { - return meta, fmt.Errorf("error parsing %s: %s", msgBacklogMetricName, err) + return meta, fmt.Errorf("error parsing %s: %w", msgBacklogMetricName, err) } meta.msgBacklogThreshold = t } @@ -197,7 +197,7 @@ func parsePulsarMetadata(config *ScalerConfig) (pulsarMetadata, error) { } auth, err := authentication.GetAuthConfigs(config.TriggerMetadata, config.AuthParams) if err != nil { - return meta, fmt.Errorf("error parsing %s: %s", msgBacklogMetricName, err) + return meta, fmt.Errorf("error parsing %s: %w", msgBacklogMetricName, err) } meta.pulsarAuth = auth meta.scalerIndex = config.ScalerIndex @@ -209,14 +209,14 @@ func (s *pulsarScaler) GetStats(ctx context.Context) (*pulsarStats, error) { req, err := http.NewRequestWithContext(ctx, "GET", s.metadata.statsURL, nil) if err != nil { - return nil, fmt.Errorf("error requesting stats from url: %s", err) + return nil, fmt.Errorf("error requesting stats from url: %w", err) } addAuthHeaders(req, &s.metadata) res, err := s.client.Do(req) if res == nil || err != nil { - return nil, fmt.Errorf("error requesting stats from url: %s", err) + return nil, fmt.Errorf("error requesting stats from url: %w", err) } defer res.Body.Close() @@ -225,17 +225,17 @@ func (s *pulsarScaler) GetStats(ctx context.Context) (*pulsarStats, error) { case 200: body, err := io.ReadAll(res.Body) if err != nil { - return nil, fmt.Errorf("error requesting stats from url: %s", err) + return nil, fmt.Errorf("error requesting stats from url: %w", err) } err = json.Unmarshal(body, stats) if err != nil { - return nil, fmt.Errorf("error unmarshalling response: %s", err) + return nil, fmt.Errorf("error unmarshalling response: %w", err) } return stats, nil case 404: - return nil, fmt.Errorf("error requesting stats from url: %s", err) + return nil, fmt.Errorf("error requesting stats from url: %w", err) default: - return nil, fmt.Errorf("error requesting stats from url: %s", err) + return nil, fmt.Errorf("error requesting stats from url: %w", err) } } @@ -258,7 +258,7 @@ func (s *pulsarScaler) getMsgBackLog(ctx context.Context) (int64, bool, error) { func (s *pulsarScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { msgBacklog, found, err := s.getMsgBackLog(ctx) if err != nil { - return nil, false, fmt.Errorf("error requesting stats from url: %s", err) + return nil, false, fmt.Errorf("error requesting stats from url: %w", err) } if !found { diff --git a/pkg/scalers/rabbitmq_scaler.go b/pkg/scalers/rabbitmq_scaler.go index 0ae43bdb178..e0ea41d4160 100644 --- a/pkg/scalers/rabbitmq_scaler.go +++ b/pkg/scalers/rabbitmq_scaler.go @@ -104,7 +104,7 @@ func NewRabbitMQScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } s.metricType = metricType @@ -112,7 +112,7 @@ func NewRabbitMQScaler(config *ScalerConfig) (Scaler, error) { meta, err := parseRabbitMQMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing rabbitmq metadata: %s", err) + return nil, fmt.Errorf("error parsing rabbitmq metadata: %w", err) } s.metadata = meta s.httpClient = kedautil.CreateHTTPClient(meta.timeout, false) @@ -123,7 +123,7 @@ func NewRabbitMQScaler(config *ScalerConfig) (Scaler, error) { if meta.vhostName != "" { hostURI, err := amqp.ParseURI(host) if err != nil { - return nil, fmt.Errorf("error parsing rabbitmq connection string: %s", err) + return nil, fmt.Errorf("error parsing rabbitmq connection string: %w", err) } hostURI.Vhost = meta.vhostName host = hostURI.String() @@ -131,7 +131,7 @@ func NewRabbitMQScaler(config *ScalerConfig) (Scaler, error) { conn, ch, err := getConnectionAndChannel(host) if err != nil { - return nil, fmt.Errorf("error establishing rabbitmq connection: %s", err) + return nil, fmt.Errorf("error establishing rabbitmq connection: %w", err) } s.connection = conn s.channel = ch @@ -171,7 +171,7 @@ func parseRabbitMQMetadata(config *ScalerConfig) (*rabbitMQMetadata, error) { if meta.protocol == autoProtocol { parsedURL, err := url.Parse(meta.host) if err != nil { - return nil, fmt.Errorf("can't parse host to find protocol: %s", err) + return nil, fmt.Errorf("can't parse host to find protocol: %w", err) } switch parsedURL.Scheme { case "amqp", "amqps": @@ -210,7 +210,7 @@ func parseRabbitMQMetadata(config *ScalerConfig) (*rabbitMQMetadata, error) { _, err = parseTrigger(&meta, config) if err != nil { - return nil, fmt.Errorf("unable to parse trigger: %s", err) + return nil, fmt.Errorf("unable to parse trigger: %w", err) } // Resolve metricName @@ -224,13 +224,13 @@ func parseRabbitMQMetadata(config *ScalerConfig) (*rabbitMQMetadata, error) { if val, ok := config.TriggerMetadata["timeout"]; ok { timeoutMS, err := strconv.Atoi(val) if err != nil { - return nil, fmt.Errorf("unable to parse timeout: %s", err) + return nil, fmt.Errorf("unable to parse timeout: %w", err) } if meta.protocol == amqpProtocol { - return nil, fmt.Errorf("amqp protocol doesn't support custom timeouts: %s", err) + return nil, fmt.Errorf("amqp protocol doesn't support custom timeouts: %w", err) } if timeoutMS <= 0 { - return nil, fmt.Errorf("timeout must be greater than 0: %s", err) + return nil, fmt.Errorf("timeout must be greater than 0: %w", err) } meta.timeout = time.Duration(timeoutMS) * time.Millisecond } else { @@ -308,7 +308,7 @@ func parseTrigger(meta *rabbitMQMetadata, config *ScalerConfig) (*rabbitMQMetada if activationValuePresent { activation, err := strconv.ParseFloat(activationValue, 64) if err != nil { - return nil, fmt.Errorf("can't parse %s: %s", rabbitActivationValueTriggerConfigName, err) + return nil, fmt.Errorf("can't parse %s: %w", rabbitActivationValueTriggerConfigName, err) } meta.activationValue = activation } @@ -317,7 +317,7 @@ func parseTrigger(meta *rabbitMQMetadata, config *ScalerConfig) (*rabbitMQMetada if deprecatedQueueLengthPresent { queueLength, err := strconv.ParseFloat(deprecatedQueueLengthValue, 64) if err != nil { - return nil, fmt.Errorf("can't parse %s: %s", rabbitQueueLengthMetricName, err) + return nil, fmt.Errorf("can't parse %s: %w", rabbitQueueLengthMetricName, err) } meta.mode = rabbitModeQueueLength meta.value = queueLength @@ -343,7 +343,7 @@ func parseTrigger(meta *rabbitMQMetadata, config *ScalerConfig) (*rabbitMQMetada } triggerValue, err := strconv.ParseFloat(value, 64) if err != nil { - return nil, fmt.Errorf("can't parse %s: %s", rabbitValueTriggerConfigName, err) + return nil, fmt.Errorf("can't parse %s: %w", rabbitValueTriggerConfigName, err) } meta.value = triggerValue diff --git a/pkg/scalers/redis_scaler.go b/pkg/scalers/redis_scaler.go index b4fc991365c..858960dab67 100644 --- a/pkg/scalers/redis_scaler.go +++ b/pkg/scalers/redis_scaler.go @@ -85,7 +85,7 @@ func NewRedisScaler(ctx context.Context, isClustered, isSentinel bool, config *S metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "redis_scaler") @@ -93,20 +93,20 @@ func NewRedisScaler(ctx context.Context, isClustered, isSentinel bool, config *S if isClustered { meta, err := parseRedisMetadata(config, parseRedisClusterAddress) if err != nil { - return nil, fmt.Errorf("error parsing redis metadata: %s", err) + return nil, fmt.Errorf("error parsing redis metadata: %w", err) } return createClusteredRedisScaler(ctx, meta, luaScript, metricType, logger) } else if isSentinel { meta, err := parseRedisMetadata(config, parseRedisSentinelAddress) if err != nil { - return nil, fmt.Errorf("error parsing redis metadata: %s", err) + return nil, fmt.Errorf("error parsing redis metadata: %w", err) } return createSentinelRedisScaler(ctx, meta, luaScript, metricType, logger) } meta, err := parseRedisMetadata(config, parseRedisAddress) if err != nil { - return nil, fmt.Errorf("error parsing redis metadata: %s", err) + return nil, fmt.Errorf("error parsing redis metadata: %w", err) } return createRedisScaler(ctx, meta, luaScript, metricType, logger) @@ -115,7 +115,7 @@ func NewRedisScaler(ctx context.Context, isClustered, isSentinel bool, config *S func createClusteredRedisScaler(ctx context.Context, meta *redisMetadata, script string, metricType v2.MetricTargetType, logger logr.Logger) (Scaler, error) { client, err := getRedisClusterClient(ctx, meta.connectionInfo) if err != nil { - return nil, fmt.Errorf("connection to redis cluster failed: %s", err) + return nil, fmt.Errorf("connection to redis cluster failed: %w", err) } closeFn := func() error { @@ -147,7 +147,7 @@ func createClusteredRedisScaler(ctx context.Context, meta *redisMetadata, script func createSentinelRedisScaler(ctx context.Context, meta *redisMetadata, script string, metricType v2.MetricTargetType, logger logr.Logger) (Scaler, error) { client, err := getRedisSentinelClient(ctx, meta.connectionInfo, meta.databaseIndex) if err != nil { - return nil, fmt.Errorf("connection to redis sentinel failed: %s", err) + return nil, fmt.Errorf("connection to redis sentinel failed: %w", err) } return createRedisScalerWithClient(client, meta, script, metricType, logger), nil @@ -156,7 +156,7 @@ func createSentinelRedisScaler(ctx context.Context, meta *redisMetadata, script func createRedisScaler(ctx context.Context, meta *redisMetadata, script string, metricType v2.MetricTargetType, logger logr.Logger) (Scaler, error) { client, err := getRedisClient(ctx, meta.connectionInfo, meta.databaseIndex) if err != nil { - return nil, fmt.Errorf("connection to redis failed: %s", err) + return nil, fmt.Errorf("connection to redis failed: %w", err) } return createRedisScalerWithClient(client, meta, script, metricType, logger), nil @@ -201,7 +201,7 @@ func parseRedisMetadata(config *ScalerConfig, parserFn redisAddressParser) (*red if val, ok := config.TriggerMetadata["enableTLS"]; ok { tls, err := strconv.ParseBool(val) if err != nil { - return nil, fmt.Errorf("enableTLS parsing error %s", err.Error()) + return nil, fmt.Errorf("enableTLS parsing error %w", err) } meta.connectionInfo.enableTLS = tls } @@ -210,7 +210,7 @@ func parseRedisMetadata(config *ScalerConfig, parserFn redisAddressParser) (*red if val, ok := config.TriggerMetadata["unsafeSsl"]; ok { parsedVal, err := strconv.ParseBool(val) if err != nil { - return nil, fmt.Errorf("error parsing unsafeSsl: %s", err) + return nil, fmt.Errorf("error parsing unsafeSsl: %w", err) } meta.connectionInfo.unsafeSsl = parsedVal } @@ -228,7 +228,7 @@ func parseRedisMetadata(config *ScalerConfig, parserFn redisAddressParser) (*red if val, ok := config.TriggerMetadata["activationListLength"]; ok { activationListLength, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, fmt.Errorf("activationListLength parsing error %s", err.Error()) + return nil, fmt.Errorf("activationListLength parsing error %w", err) } meta.activationListLength = activationListLength } @@ -243,7 +243,7 @@ func parseRedisMetadata(config *ScalerConfig, parserFn redisAddressParser) (*red if val, ok := config.TriggerMetadata["databaseIndex"]; ok { dbIndex, err := strconv.ParseInt(val, 10, 32) if err != nil { - return nil, fmt.Errorf("databaseIndex: parsing error %s", err.Error()) + return nil, fmt.Errorf("databaseIndex: parsing error %w", err) } meta.databaseIndex = int(dbIndex) } diff --git a/pkg/scalers/redis_streams_scaler.go b/pkg/scalers/redis_streams_scaler.go index 07ebe3fdb5b..2de3a319891 100644 --- a/pkg/scalers/redis_streams_scaler.go +++ b/pkg/scalers/redis_streams_scaler.go @@ -50,7 +50,7 @@ type redisStreamsMetadata struct { func NewRedisStreamsScaler(ctx context.Context, isClustered, isSentinel bool, config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "redis_streams_scaler") @@ -58,19 +58,19 @@ func NewRedisStreamsScaler(ctx context.Context, isClustered, isSentinel bool, co if isClustered { meta, err := parseRedisStreamsMetadata(config, parseRedisClusterAddress) if err != nil { - return nil, fmt.Errorf("error parsing redis streams metadata: %s", err) + return nil, fmt.Errorf("error parsing redis streams metadata: %w", err) } return createClusteredRedisStreamsScaler(ctx, meta, metricType, logger) } else if isSentinel { meta, err := parseRedisStreamsMetadata(config, parseRedisSentinelAddress) if err != nil { - return nil, fmt.Errorf("error parsing redis streams metadata: %s", err) + return nil, fmt.Errorf("error parsing redis streams metadata: %w", err) } return createSentinelRedisStreamsScaler(ctx, meta, metricType, logger) } meta, err := parseRedisStreamsMetadata(config, parseRedisAddress) if err != nil { - return nil, fmt.Errorf("error parsing redis streams metadata: %s", err) + return nil, fmt.Errorf("error parsing redis streams metadata: %w", err) } return createRedisStreamsScaler(ctx, meta, metricType, logger) } @@ -78,7 +78,7 @@ func NewRedisStreamsScaler(ctx context.Context, isClustered, isSentinel bool, co func createClusteredRedisStreamsScaler(ctx context.Context, meta *redisStreamsMetadata, metricType v2.MetricTargetType, logger logr.Logger) (Scaler, error) { client, err := getRedisClusterClient(ctx, meta.connectionInfo) if err != nil { - return nil, fmt.Errorf("connection to redis cluster failed: %s", err) + return nil, fmt.Errorf("connection to redis cluster failed: %w", err) } closeFn := func() error { @@ -109,7 +109,7 @@ func createClusteredRedisStreamsScaler(ctx context.Context, meta *redisStreamsMe func createSentinelRedisStreamsScaler(ctx context.Context, meta *redisStreamsMetadata, metricType v2.MetricTargetType, logger logr.Logger) (Scaler, error) { client, err := getRedisSentinelClient(ctx, meta.connectionInfo, meta.databaseIndex) if err != nil { - return nil, fmt.Errorf("connection to redis sentinel failed: %s", err) + return nil, fmt.Errorf("connection to redis sentinel failed: %w", err) } return createScaler(client, meta, metricType, logger) @@ -118,7 +118,7 @@ func createSentinelRedisStreamsScaler(ctx context.Context, meta *redisStreamsMet func createRedisStreamsScaler(ctx context.Context, meta *redisStreamsMetadata, metricType v2.MetricTargetType, logger logr.Logger) (Scaler, error) { client, err := getRedisClient(ctx, meta.connectionInfo, meta.databaseIndex) if err != nil { - return nil, fmt.Errorf("connection to redis failed: %s", err) + return nil, fmt.Errorf("connection to redis failed: %w", err) } return createScaler(client, meta, metricType, logger) @@ -171,7 +171,7 @@ func parseRedisStreamsMetadata(config *ScalerConfig, parseFn redisAddressParser) if val, ok := config.TriggerMetadata["enableTLS"]; ok { tls, err := strconv.ParseBool(val) if err != nil { - return nil, fmt.Errorf("enableTLS parsing error %s", err.Error()) + return nil, fmt.Errorf("enableTLS parsing error %w", err) } meta.connectionInfo.enableTLS = tls } @@ -180,7 +180,7 @@ func parseRedisStreamsMetadata(config *ScalerConfig, parseFn redisAddressParser) if val, ok := config.TriggerMetadata["unsafeSsl"]; ok { parsedVal, err := strconv.ParseBool(val) if err != nil { - return nil, fmt.Errorf("error parsing unsafeSsl: %s", err) + return nil, fmt.Errorf("error parsing unsafeSsl: %w", err) } meta.connectionInfo.unsafeSsl = parsedVal } @@ -213,7 +213,7 @@ func parseRedisStreamsMetadata(config *ScalerConfig, parseFn redisAddressParser) if val, ok := config.TriggerMetadata[databaseIndexMetadata]; ok { dbIndex, err := strconv.ParseInt(val, 10, 32) if err != nil { - return nil, fmt.Errorf("error parsing redis database index %v", err) + return nil, fmt.Errorf("error parsing redis database index %w", err) } meta.databaseIndex = int(dbIndex) } diff --git a/pkg/scalers/selenium_grid_scaler.go b/pkg/scalers/selenium_grid_scaler.go index 32a71398e0d..6a59444ec68 100644 --- a/pkg/scalers/selenium_grid_scaler.go +++ b/pkg/scalers/selenium_grid_scaler.go @@ -74,7 +74,7 @@ const ( func NewSeleniumGridScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, "selenium_grid_scaler") @@ -82,7 +82,7 @@ func NewSeleniumGridScaler(config *ScalerConfig) (Scaler, error) { meta, err := parseSeleniumGridScalerMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing selenium grid metadata: %s", err) + return nil, fmt.Errorf("error parsing selenium grid metadata: %w", err) } httpClient := kedautil.CreateHTTPClient(config.GlobalHTTPTimeout, meta.unsafeSsl) @@ -124,7 +124,7 @@ func parseSeleniumGridScalerMetadata(config *ScalerConfig) (*seleniumGridScalerM if val, ok := config.TriggerMetadata["activationThreshold"]; ok { activationThreshold, err := strconv.ParseInt(val, 10, 64) if err != nil { - return nil, fmt.Errorf("error parsing unsafeSsl: %s", err) + return nil, fmt.Errorf("error parsing unsafeSsl: %w", err) } meta.activationThreshold = activationThreshold } @@ -138,7 +138,7 @@ func parseSeleniumGridScalerMetadata(config *ScalerConfig) (*seleniumGridScalerM if val, ok := config.TriggerMetadata["unsafeSsl"]; ok { parsedVal, err := strconv.ParseBool(val) if err != nil { - return nil, fmt.Errorf("error parsing unsafeSsl: %s", err) + return nil, fmt.Errorf("error parsing unsafeSsl: %w", err) } meta.unsafeSsl = parsedVal } @@ -155,7 +155,7 @@ func (s *seleniumGridScaler) Close(context.Context) error { func (s *seleniumGridScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) { sessions, err := s.getSessionsCount(ctx, s.logger) if err != nil { - return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error requesting selenium grid endpoint: %s", err) + return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error requesting selenium grid endpoint: %w", err) } metric := GenerateMetricInMili(metricName, float64(sessions)) diff --git a/pkg/scalers/solace_scaler.go b/pkg/scalers/solace_scaler.go index 36a7c0207e8..e150b75a7c0 100644 --- a/pkg/scalers/solace_scaler.go +++ b/pkg/scalers/solace_scaler.go @@ -118,7 +118,7 @@ func NewSolaceScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } logger := InitializeLogger(config, solaceScalerID+"_scaler") @@ -166,7 +166,7 @@ func parseSolaceMetadata(config *ScalerConfig) (*SolaceMetadata, error) { if msgCount, err := strconv.ParseInt(val, 10, 64); err == nil { meta.msgCountTarget = msgCount } else { - return nil, fmt.Errorf("can't parse [%s], not a valid integer: %s", solaceMetaMsgCountTarget, err) + return nil, fmt.Errorf("can't parse [%s], not a valid integer: %w", solaceMetaMsgCountTarget, err) } } // GET msgSpoolUsageTarget @@ -174,7 +174,7 @@ func parseSolaceMetadata(config *ScalerConfig) (*SolaceMetadata, error) { if msgSpoolUsage, err := strconv.ParseInt(val, 10, 64); err == nil { meta.msgSpoolUsageTarget = msgSpoolUsage * 1024 * 1024 } else { - return nil, fmt.Errorf("can't parse [%s], not a valid integer: %s", solaceMetaMsgSpoolUsageTarget, err) + return nil, fmt.Errorf("can't parse [%s], not a valid integer: %w", solaceMetaMsgSpoolUsageTarget, err) } } @@ -190,7 +190,7 @@ func parseSolaceMetadata(config *ScalerConfig) (*SolaceMetadata, error) { if activationMsgCountTarget, err := strconv.Atoi(val); err == nil { meta.activationMsgCountTarget = activationMsgCountTarget } else { - return nil, fmt.Errorf("can't parse [%s], not a valid integer: %s", solaceMetaActivationMsgCountTarget, err) + return nil, fmt.Errorf("can't parse [%s], not a valid integer: %w", solaceMetaActivationMsgCountTarget, err) } } // GET activationMsgSpoolUsageTarget @@ -199,7 +199,7 @@ func parseSolaceMetadata(config *ScalerConfig) (*SolaceMetadata, error) { if activationMsgSpoolUsageTarget, err := strconv.Atoi(val); err == nil { meta.activationMsgSpoolUsageTarget = activationMsgSpoolUsageTarget * 1024 * 1024 } else { - return nil, fmt.Errorf("can't parse [%s], not a valid integer: %s", solaceMetaActivationMsgSpoolUsageTarget, err) + return nil, fmt.Errorf("can't parse [%s], not a valid integer: %w", solaceMetaActivationMsgSpoolUsageTarget, err) } } @@ -310,7 +310,7 @@ func (s *SolaceScaler) getSolaceQueueMetricsFromSEMP(ctx context.Context) (Solac // Define HTTP Request request, err := http.NewRequestWithContext(ctx, "GET", scaledMetricEndpointURL, nil) if err != nil { - return SolaceMetricValues{}, fmt.Errorf("failed attempting request to solace semp api: %s", err) + return SolaceMetricValues{}, fmt.Errorf("failed attempting request to solace semp api: %w", err) } // Add HTTP Auth and Headers @@ -320,7 +320,7 @@ func (s *SolaceScaler) getSolaceQueueMetricsFromSEMP(ctx context.Context) (Solac // Call Solace SEMP API response, err := httpClient.Do(request) if err != nil { - return SolaceMetricValues{}, fmt.Errorf("call to solace semp api failed: %s", err) + return SolaceMetricValues{}, fmt.Errorf("call to solace semp api failed: %w", err) } defer response.Body.Close() @@ -332,7 +332,7 @@ func (s *SolaceScaler) getSolaceQueueMetricsFromSEMP(ctx context.Context) (Solac // Decode SEMP Response and Test if err := json.NewDecoder(response.Body).Decode(&sempResponse); err != nil { - return SolaceMetricValues{}, fmt.Errorf("failed to read semp response body: %s", err) + return SolaceMetricValues{}, fmt.Errorf("failed to read semp response body: %w", err) } if sempResponse.Meta.ResponseCode < 200 || sempResponse.Meta.ResponseCode > 299 { return SolaceMetricValues{}, fmt.Errorf("solace semp api returned error status: %d", sempResponse.Meta.ResponseCode) diff --git a/pkg/scalers/stan_scaler.go b/pkg/scalers/stan_scaler.go index a4f9b0c7787..b539fed23aa 100644 --- a/pkg/scalers/stan_scaler.go +++ b/pkg/scalers/stan_scaler.go @@ -65,12 +65,12 @@ const ( func NewStanScaler(config *ScalerConfig) (Scaler, error) { metricType, err := GetMetricTargetType(config) if err != nil { - return nil, fmt.Errorf("error getting scaler metric type: %s", err) + return nil, fmt.Errorf("error getting scaler metric type: %w", err) } stanMetadata, err := parseStanMetadata(config) if err != nil { - return nil, fmt.Errorf("error parsing stan metadata: %s", err) + return nil, fmt.Errorf("error parsing stan metadata: %w", err) } return &stanScaler{ @@ -105,7 +105,7 @@ func parseStanMetadata(config *ScalerConfig) (stanMetadata, error) { if val, ok := config.TriggerMetadata[lagThresholdMetricName]; ok { t, err := strconv.ParseInt(val, 10, 64) if err != nil { - return meta, fmt.Errorf("error parsing %s: %s", lagThresholdMetricName, err) + return meta, fmt.Errorf("error parsing %s: %w", lagThresholdMetricName, err) } meta.lagThreshold = t } @@ -114,7 +114,7 @@ func parseStanMetadata(config *ScalerConfig) (stanMetadata, error) { if val, ok := config.TriggerMetadata["activationLagThreshold"]; ok { activationTargetQueryValue, err := strconv.ParseInt(val, 10, 64) if err != nil { - return meta, fmt.Errorf("activationLagThreshold parsing error %s", err.Error()) + return meta, fmt.Errorf("activationLagThreshold parsing error %w", err) } meta.activationLagThreshold = activationTargetQueryValue } @@ -126,7 +126,7 @@ func parseStanMetadata(config *ScalerConfig) (stanMetadata, error) { if val, ok := config.TriggerMetadata["useHttps"]; ok { useHTTPS, err = strconv.ParseBool(val) if err != nil { - return meta, fmt.Errorf("useHTTPS parsing error %s", err.Error()) + return meta, fmt.Errorf("useHTTPS parsing error %w", err) } } natsServerEndpoint, err := GetFromAuthOrMeta(config, "natsServerMonitoringEndpoint") diff --git a/pkg/scaling/executor/scale_jobs.go b/pkg/scaling/executor/scale_jobs.go index d4b5b12c563..69629fa88a5 100644 --- a/pkg/scaling/executor/scale_jobs.go +++ b/pkg/scaling/executor/scale_jobs.go @@ -321,11 +321,7 @@ func (e *scaleExecutor) cleanUp(ctx context.Context, scaledJob *kedav1alpha1.Sca if err != nil { return err } - err = e.deleteJobsWithHistoryLimit(ctx, logger, failedJobs, failedJobsHistoryLimit) - if err != nil { - return err - } - return nil + return e.deleteJobsWithHistoryLimit(ctx, logger, failedJobs, failedJobsHistoryLimit) } func (e *scaleExecutor) deleteJobsWithHistoryLimit(ctx context.Context, logger logr.Logger, jobs []batchv1.Job, historyLimit int32) error { diff --git a/pkg/scaling/resolver/scale_resolvers.go b/pkg/scaling/resolver/scale_resolvers.go index 35fa6d1a078..afd58ea2fcf 100644 --- a/pkg/scaling/resolver/scale_resolvers.go +++ b/pkg/scaling/resolver/scale_resolvers.go @@ -160,7 +160,7 @@ func ResolveAuthRefAndPodIdentity(ctx context.Context, client client.Client, log err := client.Get(ctx, types.NamespacedName{Name: serviceAccountName, Namespace: namespace}, serviceAccount) if err != nil { return nil, kedav1alpha1.AuthPodIdentity{Provider: kedav1alpha1.PodIdentityProviderNone}, - fmt.Errorf("error getting service account: '%s', error: %s", serviceAccountName, err) + fmt.Errorf("error getting service account: '%s', error: %w", serviceAccountName, err) } authParams["awsRoleArn"] = serviceAccount.Annotations[kedav1alpha1.PodIdentityAnnotationEKS] } else if podIdentity.Provider == kedav1alpha1.PodIdentityProviderAwsKiam { @@ -295,7 +295,7 @@ func resolveEnv(ctx context.Context, client client.Client, logger logr.Logger, c // ignore error when ConfigMap is marked as optional continue default: - return nil, fmt.Errorf("error reading config ref %s on namespace %s/: %s", source.ConfigMapRef, namespace, err) + return nil, fmt.Errorf("error reading config ref %s on namespace %s/: %w", source.ConfigMapRef, namespace, err) } } else if source.SecretRef != nil { secretsMap, err := resolveSecretMap(ctx, client, logger, source.SecretRef, namespace, secretsLister) @@ -308,7 +308,7 @@ func resolveEnv(ctx context.Context, client client.Client, logger logr.Logger, c // ignore error when Secret is marked as optional continue default: - return nil, fmt.Errorf("error reading secret ref %s on namespace %s: %s", source.SecretRef, namespace, err) + return nil, fmt.Errorf("error reading secret ref %s on namespace %s: %w", source.SecretRef, namespace, err) } } } diff --git a/pkg/scaling/scale_handler.go b/pkg/scaling/scale_handler.go index 765a97dd6fc..9b87b46790d 100644 --- a/pkg/scaling/scale_handler.go +++ b/pkg/scaling/scale_handler.go @@ -393,7 +393,7 @@ func (h *scaleHandler) GetScaledObjectMetrics(ctx context.Context, scaledObjectN exportedPromMetrics.ScaledObjectErr = (err != nil) if err != nil { - return nil, &exportedPromMetrics, fmt.Errorf("error when getting scalers %s", err) + return nil, &exportedPromMetrics, fmt.Errorf("error when getting scalers %w", err) } var scaledObject *kedav1alpha1.ScaledObject @@ -510,7 +510,7 @@ func (h *scaleHandler) buildScalers(ctx context.Context, withTriggers *kedav1alp if podTemplateSpec != nil { resolvedEnv, err = resolver.ResolveContainerEnv(ctx, h.client, logger, &podTemplateSpec.Spec, containerName, withTriggers.Namespace, h.secretsLister) if err != nil { - return nil, nil, fmt.Errorf("error resolving secrets for ScaleTarget: %s", err) + return nil, nil, fmt.Errorf("error resolving secrets for ScaleTarget: %w", err) } } config := &scalers.ScalerConfig{ diff --git a/pkg/util/parse_string.go b/pkg/util/parse_string.go index f61a1c5ad76..878360474e7 100644 --- a/pkg/util/parse_string.go +++ b/pkg/util/parse_string.go @@ -25,11 +25,11 @@ import ( func ParseRange(from, to string) ([]int32, error) { f, err := strconv.ParseInt(from, 10, 32) if err != nil { - return nil, fmt.Errorf("parse error for '%s': %s", from, err) + return nil, fmt.Errorf("parse error for '%s': %w", from, err) } t, err := strconv.ParseInt(to, 10, 32) if err != nil { - return nil, fmt.Errorf("parse error for '%s': %s", to, err) + return nil, fmt.Errorf("parse error for '%s': %w", to, err) } var parsed []int32 for i := int32(f); i <= int32(t); i++ { @@ -47,13 +47,13 @@ func ParseInt32List(pattern string) ([]int32, error) { case len(literals) == 1: i, err := strconv.ParseInt(literals[0], 10, 32) if err != nil { - return nil, fmt.Errorf("parse error: %s", err) + return nil, fmt.Errorf("parse error: %w", err) } parsed = append(parsed, int32(i)) case len(literals) == 2: r, err := ParseRange(literals[0], literals[1]) if err != nil { - return nil, fmt.Errorf("error in range: %s", err) + return nil, fmt.Errorf("error in range: %w", err) } parsed = append(parsed, r...) diff --git a/pkg/util/tls_config.go b/pkg/util/tls_config.go index 7e8dbd4c81f..cb6e6932fdb 100644 --- a/pkg/util/tls_config.go +++ b/pkg/util/tls_config.go @@ -62,13 +62,13 @@ func NewTLSConfigWithPassword(clientCert, clientKey, clientKeyPassword, caCert s var err error key, err = decryptClientKey(clientKey, clientKeyPassword) if err != nil { - return nil, fmt.Errorf("error decrypt X509Key: %s", err) + return nil, fmt.Errorf("error decrypt X509Key: %w", err) } } cert, err := tls.X509KeyPair([]byte(clientCert), key) if err != nil { - return nil, fmt.Errorf("error parse X509KeyPair: %s", err) + return nil, fmt.Errorf("error parse X509KeyPair: %w", err) } config.Certificates = []tls.Certificate{cert} valid = true diff --git a/vendor/golang.org/x/net/http2/hpack/encode.go b/vendor/golang.org/x/net/http2/hpack/encode.go index 6886dc163cb..46219da2b01 100644 --- a/vendor/golang.org/x/net/http2/hpack/encode.go +++ b/vendor/golang.org/x/net/http2/hpack/encode.go @@ -116,6 +116,11 @@ func (e *Encoder) SetMaxDynamicTableSize(v uint32) { e.dynTab.setMaxSize(v) } +// MaxDynamicTableSize returns the current dynamic header table size. +func (e *Encoder) MaxDynamicTableSize() (v uint32) { + return e.dynTab.maxSize +} + // SetMaxDynamicTableSizeLimit changes the maximum value that can be // specified in SetMaxDynamicTableSize to v. By default, it is set to // 4096, which is the same size of the default dynamic header table diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index d8a17aa9b02..4eb7617fa0d 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -98,6 +98,19 @@ type Server struct { // the HTTP/2 spec's recommendations. MaxConcurrentStreams uint32 + // MaxDecoderHeaderTableSize optionally specifies the http2 + // SETTINGS_HEADER_TABLE_SIZE to send in the initial settings frame. It + // informs the remote endpoint of the maximum size of the header compression + // table used to decode header blocks, in octets. If zero, the default value + // of 4096 is used. + MaxDecoderHeaderTableSize uint32 + + // MaxEncoderHeaderTableSize optionally specifies an upper limit for the + // header compression table used for encoding request headers. Received + // SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero, + // the default value of 4096 is used. + MaxEncoderHeaderTableSize uint32 + // MaxReadFrameSize optionally specifies the largest frame // this server is willing to read. A valid value is between // 16k and 16M, inclusive. If zero or otherwise invalid, a @@ -170,6 +183,20 @@ func (s *Server) maxConcurrentStreams() uint32 { return defaultMaxStreams } +func (s *Server) maxDecoderHeaderTableSize() uint32 { + if v := s.MaxDecoderHeaderTableSize; v > 0 { + return v + } + return initialHeaderTableSize +} + +func (s *Server) maxEncoderHeaderTableSize() uint32 { + if v := s.MaxEncoderHeaderTableSize; v > 0 { + return v + } + return initialHeaderTableSize +} + // maxQueuedControlFrames is the maximum number of control frames like // SETTINGS, PING and RST_STREAM that will be queued for writing before // the connection is closed to prevent memory exhaustion attacks. @@ -394,7 +421,6 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { advMaxStreams: s.maxConcurrentStreams(), initialStreamSendWindowSize: initialWindowSize, maxFrameSize: initialMaxFrameSize, - headerTableSize: initialHeaderTableSize, serveG: newGoroutineLock(), pushEnabled: true, sawClientPreface: opts.SawClientPreface, @@ -424,12 +450,13 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { sc.flow.add(initialWindowSize) sc.inflow.add(initialWindowSize) sc.hpackEncoder = hpack.NewEncoder(&sc.headerWriteBuf) + sc.hpackEncoder.SetMaxDynamicTableSizeLimit(s.maxEncoderHeaderTableSize()) fr := NewFramer(sc.bw, c) if s.CountError != nil { fr.countError = s.CountError } - fr.ReadMetaHeaders = hpack.NewDecoder(initialHeaderTableSize, nil) + fr.ReadMetaHeaders = hpack.NewDecoder(s.maxDecoderHeaderTableSize(), nil) fr.MaxHeaderListSize = sc.maxHeaderListSize() fr.SetMaxReadFrameSize(s.maxReadFrameSize()) sc.framer = fr @@ -559,9 +586,9 @@ type serverConn struct { streams map[uint32]*stream initialStreamSendWindowSize int32 maxFrameSize int32 - headerTableSize uint32 peerMaxHeaderListSize uint32 // zero means unknown (default) canonHeader map[string]string // http2-lower-case -> Go-Canonical-Case + canonHeaderKeysSize int // canonHeader keys size in bytes writingFrame bool // started writing a frame (on serve goroutine or separate) writingFrameAsync bool // started a frame on its own goroutine but haven't heard back on wroteFrameCh needsFrameFlush bool // last frame write wasn't a flush @@ -740,6 +767,13 @@ func (sc *serverConn) condlogf(err error, format string, args ...interface{}) { } } +// maxCachedCanonicalHeadersKeysSize is an arbitrarily-chosen limit on the size +// of the entries in the canonHeader cache. +// This should be larger than the size of unique, uncommon header keys likely to +// be sent by the peer, while not so high as to permit unreasonable memory usage +// if the peer sends an unbounded number of unique header keys. +const maxCachedCanonicalHeadersKeysSize = 2048 + func (sc *serverConn) canonicalHeader(v string) string { sc.serveG.check() buildCommonHeaderMapsOnce() @@ -755,14 +789,10 @@ func (sc *serverConn) canonicalHeader(v string) string { sc.canonHeader = make(map[string]string) } cv = http.CanonicalHeaderKey(v) - // maxCachedCanonicalHeaders is an arbitrarily-chosen limit on the number of - // entries in the canonHeader cache. This should be larger than the number - // of unique, uncommon header keys likely to be sent by the peer, while not - // so high as to permit unreasonable memory usage if the peer sends an unbounded - // number of unique header keys. - const maxCachedCanonicalHeaders = 32 - if len(sc.canonHeader) < maxCachedCanonicalHeaders { + size := 100 + len(v)*2 // 100 bytes of map overhead + key + value + if sc.canonHeaderKeysSize+size <= maxCachedCanonicalHeadersKeysSize { sc.canonHeader[v] = cv + sc.canonHeaderKeysSize += size } return cv } @@ -864,6 +894,7 @@ func (sc *serverConn) serve() { {SettingMaxFrameSize, sc.srv.maxReadFrameSize()}, {SettingMaxConcurrentStreams, sc.advMaxStreams}, {SettingMaxHeaderListSize, sc.maxHeaderListSize()}, + {SettingHeaderTableSize, sc.srv.maxDecoderHeaderTableSize()}, {SettingInitialWindowSize, uint32(sc.srv.initialStreamRecvWindowSize())}, }, }) @@ -1661,7 +1692,6 @@ func (sc *serverConn) processSetting(s Setting) error { } switch s.ID { case SettingHeaderTableSize: - sc.headerTableSize = s.Val sc.hpackEncoder.SetMaxDynamicTableSize(s.Val) case SettingEnablePush: sc.pushEnabled = s.Val != 0 diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index 46dda4dc316..30f706e6cb8 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -118,6 +118,28 @@ type Transport struct { // to mean no limit. MaxHeaderListSize uint32 + // MaxReadFrameSize is the http2 SETTINGS_MAX_FRAME_SIZE to send in the + // initial settings frame. It is the size in bytes of the largest frame + // payload that the sender is willing to receive. If 0, no setting is + // sent, and the value is provided by the peer, which should be 16384 + // according to the spec: + // https://datatracker.ietf.org/doc/html/rfc7540#section-6.5.2. + // Values are bounded in the range 16k to 16M. + MaxReadFrameSize uint32 + + // MaxDecoderHeaderTableSize optionally specifies the http2 + // SETTINGS_HEADER_TABLE_SIZE to send in the initial settings frame. It + // informs the remote endpoint of the maximum size of the header compression + // table used to decode header blocks, in octets. If zero, the default value + // of 4096 is used. + MaxDecoderHeaderTableSize uint32 + + // MaxEncoderHeaderTableSize optionally specifies an upper limit for the + // header compression table used for encoding request headers. Received + // SETTINGS_HEADER_TABLE_SIZE settings are capped at this limit. If zero, + // the default value of 4096 is used. + MaxEncoderHeaderTableSize uint32 + // StrictMaxConcurrentStreams controls whether the server's // SETTINGS_MAX_CONCURRENT_STREAMS should be respected // globally. If false, new TCP connections are created to the @@ -171,6 +193,19 @@ func (t *Transport) maxHeaderListSize() uint32 { return t.MaxHeaderListSize } +func (t *Transport) maxFrameReadSize() uint32 { + if t.MaxReadFrameSize == 0 { + return 0 // use the default provided by the peer + } + if t.MaxReadFrameSize < minMaxFrameSize { + return minMaxFrameSize + } + if t.MaxReadFrameSize > maxFrameSize { + return maxFrameSize + } + return t.MaxReadFrameSize +} + func (t *Transport) disableCompression() bool { return t.DisableCompression || (t.t1 != nil && t.t1.DisableCompression) } @@ -293,10 +328,11 @@ type ClientConn struct { lastActive time.Time lastIdle time.Time // time last idle // Settings from peer: (also guarded by wmu) - maxFrameSize uint32 - maxConcurrentStreams uint32 - peerMaxHeaderListSize uint64 - initialWindowSize uint32 + maxFrameSize uint32 + maxConcurrentStreams uint32 + peerMaxHeaderListSize uint64 + peerMaxHeaderTableSize uint32 + initialWindowSize uint32 // reqHeaderMu is a 1-element semaphore channel controlling access to sending new requests. // Write to reqHeaderMu to lock it, read from it to unlock. @@ -681,6 +717,20 @@ func (t *Transport) expectContinueTimeout() time.Duration { return t.t1.ExpectContinueTimeout } +func (t *Transport) maxDecoderHeaderTableSize() uint32 { + if v := t.MaxDecoderHeaderTableSize; v > 0 { + return v + } + return initialHeaderTableSize +} + +func (t *Transport) maxEncoderHeaderTableSize() uint32 { + if v := t.MaxEncoderHeaderTableSize; v > 0 { + return v + } + return initialHeaderTableSize +} + func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) { return t.newClientConn(c, t.disableKeepAlives()) } @@ -721,15 +771,19 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro }) cc.br = bufio.NewReader(c) cc.fr = NewFramer(cc.bw, cc.br) + if t.maxFrameReadSize() != 0 { + cc.fr.SetMaxReadFrameSize(t.maxFrameReadSize()) + } if t.CountError != nil { cc.fr.countError = t.CountError } - cc.fr.ReadMetaHeaders = hpack.NewDecoder(initialHeaderTableSize, nil) + maxHeaderTableSize := t.maxDecoderHeaderTableSize() + cc.fr.ReadMetaHeaders = hpack.NewDecoder(maxHeaderTableSize, nil) cc.fr.MaxHeaderListSize = t.maxHeaderListSize() - // TODO: SetMaxDynamicTableSize, SetMaxDynamicTableSizeLimit on - // henc in response to SETTINGS frames? cc.henc = hpack.NewEncoder(&cc.hbuf) + cc.henc.SetMaxDynamicTableSizeLimit(t.maxEncoderHeaderTableSize()) + cc.peerMaxHeaderTableSize = initialHeaderTableSize if t.AllowHTTP { cc.nextStreamID = 3 @@ -744,9 +798,15 @@ func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, erro {ID: SettingEnablePush, Val: 0}, {ID: SettingInitialWindowSize, Val: transportDefaultStreamFlow}, } + if max := t.maxFrameReadSize(); max != 0 { + initialSettings = append(initialSettings, Setting{ID: SettingMaxFrameSize, Val: max}) + } if max := t.maxHeaderListSize(); max != 0 { initialSettings = append(initialSettings, Setting{ID: SettingMaxHeaderListSize, Val: max}) } + if maxHeaderTableSize != initialHeaderTableSize { + initialSettings = append(initialSettings, Setting{ID: SettingHeaderTableSize, Val: maxHeaderTableSize}) + } cc.bw.Write(clientPreface) cc.fr.WriteSettings(initialSettings...) @@ -2773,8 +2833,10 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { cc.cond.Broadcast() cc.initialWindowSize = s.Val + case SettingHeaderTableSize: + cc.henc.SetMaxDynamicTableSize(s.Val) + cc.peerMaxHeaderTableSize = s.Val default: - // TODO(bradfitz): handle more settings? SETTINGS_HEADER_TABLE_SIZE probably. cc.vlogf("Unhandled Setting: %v", s) } return nil diff --git a/vendor/golang.org/x/net/publicsuffix/data/children b/vendor/golang.org/x/net/publicsuffix/data/children new file mode 100644 index 0000000000000000000000000000000000000000..1038c561ade4683e91b37e8298fc5ead7c306779 GIT binary patch literal 2876 zcmWO8`CAib0svrUzRb+`nSk6zK|{VtNTRiJd7yyG8JU16mRliLD^_b=t;%||>na8l zP!yF%fdB@t+Ui#Avu#}!)CeZrS5%ZMplz*Iv9&5~*B{>h;dOCwadCeq;GIS9q`Z^& z4zVS!huE^`0kP%QL!#hTKe0dV5pkd}k|?!C6Nl&oqRgryj?$?_d0`G=rZt2)emhZX z-9en7jfADpL|Ci`i8}faai*}0IAc9YoTX2R&&HotpS7M5e;NNJao+kBaiQ><_=2^8 zxJch1F2>u5ONGtEC2I%qt+kW*&U&Bt!TN}}690_2YJE;zx4sqEGeBIQz$5DSQiP46 z346kOMDyNYqMeyTbTF|*XM&RGx}8MyGpQt*u$=@DVW1RXU~nZTDBVa8s31KJv7}dH zBIym6lHSS`(z|gP>8ng7eGQqUP?<$eHK@s{jhpc_xP=T*Zp8tHe~|%=yGSwoHz`r> z)<_JcSPBnfsj`ez7!GR`jVH+&@Dv%`cn*ia+c-qoh(iobI27K&p-MXrH8hiA?+&y|}@M@D2V1e1j9<8#Y&blbeWd+C1_t-LV zFPDvbjVnn9e-(BZ^RUCF!FO$1e2@DG-!tapd$u+BKKC)cZ(N7__@9t{+^1xpZ3BK_ z+^BiTZN?961>`V)8y?}C@Ca9iM~sK@DE|l^HJ0O1+cErze;hwDR^UgrD*Tvl#*evb z^0Bc7|IF3mpN(JPpKV{`C;ao|6Yc_jV*C$&V*3XF!oP@r;V$8){LA<$_h0g<@jLPv z|9kS8?F#uTca40(uP4WhjpT3q7V>v~7x}x*LB6)#C*N?7@EhZgCI~j&0$~Cx8>VVw!|d%~wxAQtHFbe- z!9%dvKG>A@uAl4OuxMFt@*X#=tTqgl#u|G&m!hma509ElUken0(Qe4A9O41^* zym>KL(aeFg;#82@KJFwSYKQPHo9H~8wqhMdMH`rIA02L+E*-E#6u$9T1*vgX6*vgj8Y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nqm5d_}q!P)U)ktAE zfu`$Dq8XAiXom9~de3qm&D4E^f+Uwwkn=hUw%kA=Ix7m5G@($Z9fj#y(QHXOn(gdD zb1c1RuI?V1CwYM8IR{X2h9V^|P^9xEiqgG83nj17LgzSI zWceE{){`h&N}=cxh+^vaC|2)=V(UCmoZb_~kNBVjsUK2G{ZXPc043_>XsKR-mexh0 zl#wX3LK=h8q$wy(pMlawGEurT8)fQqP?lbgvPbgKO8t7YYUDGd)^9_ax;;oI-G_Ag Z1B%rnr6^x|0)0GUL2F0Oqfew4{}2BS2s{7) literal 0 HcmV?d00001 diff --git a/vendor/golang.org/x/net/publicsuffix/data/nodes b/vendor/golang.org/x/net/publicsuffix/data/nodes new file mode 100644 index 0000000000000000000000000000000000000000..34751cd5b9d1b14c3a0977e4fa4b04db058b241d GIT binary patch literal 48280 zcmaH!2Xs``*2m9GGBc?V0-=T?iYSVxfMUZtbEnr#dJh5?RIDhrr;tup#4a`z6&1yT zVja>GniRXJ*q+b+?A`CTPk2UM?|qB4_Bv&k|K4Yxa?iaJlqxv8RVnAhWTmPq>`ImF zN)ke;Jk+67WgWf#E9&VT(xg;@k)o1}309S~=N5-jWrG7s#s9Tf$P%SoyXurOzi3d& z&dgd$%Mr_KpsoB-+7jo`R#MffZ0^%UpSwZXT8e4&-eoFP(_>e5BdtZL;zFNNZg+>W zC+5183OeXD9`FJ(+N@M~JE+WfvT_(F&|9z}@18xvrhIXFN((+_ea?XCXxs@vUeMvff|nREqPdT1qMS z;lD4aQWBrFf_@KT@vrEpXirtCiE&_Y9)w#3Uc`ch4Pd#wUZriGhz(;LF1T)Yt8^n5 z7{%vM+IvZxQogf$REA--!jgj1CHHly{>Euk12<4D8il^1QBB0}Hygy+Np(U8FfK)D zX&IQkA)m@NhNIMc*;Lt^Z*wVCz06btjp?=U9ow!3Cd$y~DM3|W8<<@^=yOl%MwSWOzy zs5uBgmG9KiTVyKho`_ZD7^i|D_#S~UP9-FjO<1eC9tHkYR70cGQ@ZG>d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publicsuffix/data/text new file mode 100644 index 00000000000..124dcd61f40 --- /dev/null +++ b/vendor/golang.org/x/net/publicsuffix/data/text @@ -0,0 +1 @@ +billustrationionjukudoyamakeupowiathletajimageandsoundandvision-riopretobishimagentositecnologiabiocelotenkawabipanasonicatfoodnetworkinggroupperbirdartcenterprisecloudaccesscamdvrcampaniabirkenesoddtangenovarahkkeravjuegoshikikiraraholtalenishikatakazakindependent-revieweirbirthplaceu-1bitbucketrzynishikatsuragirlyuzawabitternidiscoverybjarkoybjerkreimdbaltimore-og-romsdalp1bjugnishikawazukamishihoronobeautydalwaysdatabaseballangenkainanaejrietisalatinabenogatabitorderblackfridaybloombergbauernishimerabloxcms3-website-us-west-2blushakotanishinomiyashironocparachutingjovikarateu-2bmoattachmentsalangenishinoomotegovtattoolforgerockartuzybmsalon-1bmwellbeingzoneu-3bnrwesteuropenairbusantiquesaltdalomzaporizhzhedmarkaratsuginamikatagamilanotairesistanceu-4bondigitaloceanspacesaludishangrilanciabonnishinoshimatsusakahoginankokubunjindianapolis-a-bloggerbookonlinewjerseyboomlahppiacenzachpomorskienishiokoppegardiskussionsbereichattanooganordkapparaglidinglassassinationalheritageu-north-1boschaefflerdalondonetskarelianceu-south-1bostik-serveronagasukevje-og-hornnesalvadordalibabalatinord-aurdalipaywhirlondrinaplesknsalzburgleezextraspace-to-rentalstomakomaibarabostonakijinsekikogentappssejnyaarparalleluxembourglitcheltenham-radio-opensocialorenskogliwicebotanicalgardeno-staginglobodoes-itcouldbeworldisrechtranakamurataiwanairforcechireadthedocsxeroxfinitybotanicgardenishitosashimizunaminamiawajikindianmarketinglogowestfalenishiwakindielddanuorrindigenamsskoganeindustriabotanyanagawallonieruchomoscienceandindustrynissandiegoddabouncemerckmsdnipropetrovskjervoyageorgeorgiabounty-fullensakerrypropertiesamegawaboutiquebecommerce-shopselectaxihuanissayokkaichintaifun-dnsaliasamnangerboutireservditchyouriparasiteboyfriendoftheinternetflixjavaldaostathellevangerbozen-sudtirolottokorozawabozen-suedtirolouvreisenissedalovepoparisor-fronisshingucciprianiigataipeidsvollovesickariyakumodumeloyalistoragebplaceducatorprojectcmembersampalermomahaccapooguybrandywinevalleybrasiliadboxosascoli-picenorddalpusercontentcp4bresciaokinawashirosatobamagazineuesamsclubartowestus2brindisibenikitagataikikuchikumagayagawalmartgorybristoloseyouriparliamentjeldsundivtasvuodnakaniikawatanagurabritishcolumbialowiezaganiyodogawabroadcastlebtimnetzlgloomy-routerbroadwaybroke-itvedestrandivttasvuotnakanojohanamakindlefrakkestadiybrokerbrothermesaverdeatnulmemergencyachtsamsungloppennebrowsersafetymarketsandnessjoenl-ams-1brumunddalublindesnesandoybrunelastxn--0trq7p7nnbrusselsandvikcoromantovalle-daostavangerbruxellesanfranciscofreakunekobayashikaoirmemorialucaniabryanskodjedugit-pagespeedmobilizeroticagliaricoharuovatlassian-dev-builderscbglugsjcbnpparibashkiriabrynewmexicoacharterbuzzwfarmerseinebwhalingmbhartiffany-2bzhitomirbzzcodyn-vpndnsantacruzsantafedjeffersoncoffeedbackdropocznordlandrudupontariobranconavstackasaokamikoaniikappudownloadurbanamexhibitioncogretakamatsukawacollectioncolognewyorkshirebungoonordre-landurhamburgrimstadynamisches-dnsantamariakecolonialwilliamsburgripeeweeklylotterycoloradoplateaudnedalncolumbusheycommunexus-3community-prochowicecomobaravendbambleborkapsicilyonagoyauthgear-stagingivestbyglandroverhallair-traffic-controlleyombomloabaths-heilbronnoysunddnslivegarsheiheijibigawaustraliaustinnfshostrolekamisatokaizukameyamatotakadaustevollivornowtv-infolldalolipopmcdircompanychipstmncomparemarkerryhotelsantoandrepbodynaliasnesoddenmarkhangelskjakdnepropetrovskiervaapsteigenflfannefrankfurtjxn--12cfi8ixb8lutskashibatakashimarshallstatebankashiharacomsecaaskimitsubatamibuildingriwatarailwaycondoshichinohealth-carereformemsettlersanukindustriesteamfamberlevagangaviikanonjinfinitigotembaixadaconferenceconstructionconsuladogadollsaobernardomniweatherchanneluxuryconsultanthropologyconsultingroks-thisayamanobeokakegawacontactkmaxxn--12co0c3b4evalled-aostamayukinsuregruhostingrondarcontagematsubaravennaharimalborkashiwaracontemporaryarteducationalchikugodonnakaiwamizawashtenawsmppl-wawdev-myqnapcloudcontrolledogawarabikomaezakirunoopschlesischesaogoncartoonartdecologiacontractorskenconventureshinodearthickashiwazakiyosatokamachilloutsystemscloudsitecookingchannelsdvrdnsdojogaszkolancashirecifedexetercoolblogdnsfor-better-thanawassamukawatarikuzentakatairavpagecooperativano-frankivskygearapparochernigovernmentksatxn--1ck2e1bananarepublic-inquiryggeebinatsukigatajimidsundevelopmentatarantours3-external-1copenhagencyclopedichiropracticatholicaxiashorokanaiecoproductionsaotomeinforumzcorporationcorsicahcesuoloanswatch-and-clockercorvettenrissagaeroclubmedecincinnativeamericanantiquest-le-patron-k3sapporomuracosenzamamidorittoeigersundynathomebuiltwithdarkasserverrankoshigayaltakasugaintelligencecosidnshome-webservercellikescandypoppdaluzerncostumedicallynxn--1ctwolominamatargets-itlon-2couchpotatofriesardegnarutomobegetmyiparsardiniacouncilvivanovoldacouponsarlcozoracq-acranbrookuwanalyticsarpsborgrongausdalcrankyowariasahikawatchandclockasukabeauxartsandcraftsarufutsunomiyawakasaikaitabashijonawatecrdyndns-at-homedepotaruinterhostsolutionsasayamatta-varjjatmpartinternationalfirearmsaseboknowsitallcreditcardyndns-at-workshoppingrossetouchigasakitahiroshimansionsaskatchewancreditunioncremonashgabadaddjaguarqcxn--1lqs03ncrewhmessinarashinomutashinaintuitoyosatoyokawacricketnedalcrimeast-kazakhstanangercrotonecrownipartsassarinuyamashinazawacrsaudacruisesauheradyndns-blogsitextilegnicapetownnews-stagingroundhandlingroznycuisinellancasterculturalcentertainmentoyotapartysvardocuneocupcakecuritibabymilk3curvallee-d-aosteinkjerusalempresashibetsurugashimaringatlantajirinvestmentsavannahgacutegirlfriendyndns-freeboxoslocalzonecymrulvikasumigaurawa-mazowszexnetlifyinzairtrafficplexus-1cyonabarumesswithdnsaveincloudyndns-homednsaves-the-whalessandria-trani-barletta-andriatranibarlettaandriacyouthruherecipescaracaltanissettaishinomakilovecollegefantasyleaguernseyfembetsukumiyamazonawsglobalacceleratorahimeshimabaridagawatchesciencecentersciencehistoryfermockasuyamegurownproviderferraraferraris-a-catererferrerotikagoshimalopolskanlandyndns-picsaxofetsundyndns-remotewdyndns-ipasadenaroyfgujoinvilleitungsenfhvalerfidontexistmein-iservschulegallocalhostrodawarafieldyndns-serverdalfigueresindevicenzaolkuszczytnoipirangalsaceofilateliafilegear-augustowhoswholdingsmall-webthingscientistordalfilegear-debianfilegear-gbizfilegear-iefilegear-jpmorganfilegear-sg-1filminamiechizenfinalfinancefineartscrapper-sitefinlandyndns-weblikes-piedmonticellocus-4finnoyfirebaseappaviancarrdyndns-wikinkobearalvahkijoetsuldalvdalaskanittedallasalleasecuritytacticschoenbrunnfirenetoystre-slidrettozawafirenzefirestonefirewebpaascrappingulenfirmdaleikangerfishingoldpoint2thisamitsukefitjarvodkafjordyndns-workangerfitnessettlementozsdellogliastradingunmanxn--1qqw23afjalerfldrvalleeaosteflekkefjordyndns1flesberguovdageaidnunjargaflickragerogerscrysecretrosnubar0flierneflirfloginlinefloppythonanywhereggio-calabriafloraflorencefloridatsunangojomedicinakamagayahabackplaneapplinzis-a-celticsfanfloripadoval-daostavalleyfloristanohatakahamalselvendrellflorokunohealthcareerscwienflowerservehalflifeinsurancefltrani-andria-barletta-trani-andriaflynnhosting-clusterfnchiryukyuragifuchungbukharanzanfndynnschokokekschokoladenfnwkaszubytemarkatowicefoolfor-ourfor-somedio-campidano-mediocampidanomediofor-theaterforexrothachijolsterforgotdnservehttpbin-butterforli-cesena-forlicesenaforlillesandefjordynservebbscholarshipschoolbusinessebyforsaleirfjordynuniversityforsandasuolodingenfortalfortefortmissoulangevagrigentomologyeonggiehtavuoatnagahamaroygardencowayfortworthachinoheavyfosneservehumourfotraniandriabarlettatraniandriafoxfordecampobassociatest-iserveblogsytemp-dnserveirchitachinakagawashingtondchernivtsiciliafozfr-par-1fr-par-2franamizuhobby-sitefrancaiseharafranziskanerimalvikatsushikabedzin-addrammenuorochesterfredrikstadtvserveminecraftranoyfreeddnsfreebox-oservemp3freedesktopfizerfreemasonryfreemyiphosteurovisionfreesitefreetlservep2pgfoggiafreiburgushikamifuranorfolkebibleksvikatsuyamarugame-hostyhostingxn--2m4a15efrenchkisshikirkeneservepicservequakefreseniuscultureggio-emilia-romagnakasatsunairguardiannakadomarinebraskaunicommbankaufentigerfribourgfriuli-v-giuliafriuli-ve-giuliafriuli-vegiuliafriuli-venezia-giuliafriuli-veneziagiuliafriuli-vgiuliafriuliv-giuliafriulive-giuliafriulivegiuliafriulivenezia-giuliafriuliveneziagiuliafriulivgiuliafrlfroganservesarcasmatartanddesignfrognfrolandynv6from-akrehamnfrom-alfrom-arfrom-azurewebsiteshikagamiishibukawakepnoorfrom-capitalonewportransipharmacienservicesevastopolefrom-coalfrom-ctranslatedynvpnpluscountryestateofdelawareclaimschoolsztynsettsupportoyotomiyazakis-a-candidatefrom-dchitosetodayfrom-dediboxafrom-flandersevenassisienarvikautokeinoticeablewismillerfrom-gaulardalfrom-hichisochikuzenfrom-iafrom-idyroyrvikingruenoharafrom-ilfrom-in-berlindasewiiheyaizuwakamatsubushikusakadogawafrom-ksharpharmacyshawaiijimarcheapartmentshellaspeziafrom-kyfrom-lanshimokawafrom-mamurogawatsonfrom-mdfrom-medizinhistorischeshimokitayamattelekommunikationfrom-mifunefrom-mnfrom-modalenfrom-mshimonitayanagit-reposts-and-telecommunicationshimonosekikawafrom-mtnfrom-nchofunatoriginstantcloudfrontdoorfrom-ndfrom-nefrom-nhktistoryfrom-njshimosuwalkis-a-chefarsundyndns-mailfrom-nminamifuranofrom-nvalleedaostefrom-nynysagamiharafrom-ohdattorelayfrom-oketogolffanshimotsukefrom-orfrom-padualstackazoologicalfrom-pratogurafrom-ris-a-conservativegashimotsumayfirstockholmestrandfrom-schmidtre-gauldalfrom-sdscloudfrom-tnfrom-txn--2scrj9chonanbunkyonanaoshimakanegasakikugawaltervistailscaleforcefrom-utsiracusaikirovogradoyfrom-vald-aostarostwodzislawildlifestylefrom-vtransportefrom-wafrom-wiardwebview-assetshinichinanfrom-wvanylvenneslaskerrylogisticshinjournalismartlabelingfrom-wyfrosinonefrostalowa-wolawafroyal-commissionfruskydivingfujiiderafujikawaguchikonefujiminokamoenairkitapps-auction-rancherkasydneyfujinomiyadattowebhoptogakushimotoganefujiokayamandalfujisatoshonairlinedre-eikerfujisawafujishiroishidakabiratoridedyn-berlincolnfujitsuruokazakiryuohkurafujiyoshidavvenjargap-east-1fukayabeardubaiduckdnsncfdfukuchiyamadavvesiidappnodebalancertmgrazimutheworkpccwilliamhillfukudomigawafukuis-a-cpalacefukumitsubishigakisarazure-mobileirvikazteleportlligatransurlfukuokakamigaharafukuroishikarikaturindalfukusakishiwadazaifudaigokaseljordfukuyamagatakaharunusualpersonfunabashiriuchinadafunagatakahashimamakisofukushimangonnakatombetsumy-gatewayfunahashikamiamakusatsumasendaisenergyfundaciofunkfeuerfuoiskujukuriyamangyshlakasamatsudoomdnstracefuosskoczowinbar1furubirafurudonostiaafurukawajimaniwakuratefusodegaurafussaintlouis-a-anarchistoireggiocalabriafutabayamaguchinomihachimanagementrapaniizafutboldlygoingnowhere-for-morenakatsugawafuttsurutaharafuturecmshinjukumamotoyamashikefuturehostingfuturemailingfvghamurakamigoris-a-designerhandcraftedhandsonyhangglidinghangoutwentehannanmokuizumodenaklodzkochikuseihidorahannorthwesternmutualhanyuzenhapmircloudletshintokushimahappounzenharvestcelebrationhasamap-northeast-3hasaminami-alpshintomikasaharahashbangryhasudahasura-apphiladelphiaareadmyblogspotrdhasvikfh-muensterhatogayahoooshikamaishimofusartshinyoshitomiokamisunagawahatoyamazakitakatakanabeatshiojirishirifujiedahatsukaichikaiseiyoichimkentrendhostinghattfjelldalhayashimamotobusellfylkesbiblackbaudcdn-edgestackhero-networkisboringhazuminobushistoryhelplfinancialhelsinkitakyushuaiahembygdsforbundhemneshioyanaizuerichardlimanowarudahemsedalhepforgeblockshirahamatonbetsurgeonshalloffameiwamasoyheroyhetemlbfanhgtvaohigashiagatsumagoianiahigashichichibuskerudhigashihiroshimanehigashiizumozakitamigrationhigashikagawahigashikagurasoedahigashikawakitaaikitamotosunndalhigashikurumeeresinstaginghigashimatsushimarburghigashimatsuyamakitaakitadaitoigawahigashimurayamamotorcycleshirakokonoehigashinarusells-for-lesshiranukamitondabayashiogamagoriziahigashinehigashiomitamanortonsberghigashiosakasayamanakakogawahigashishirakawamatakanezawahigashisumiyoshikawaminamiaikitanakagusukumodernhigashitsunosegawahigashiurausukitashiobarahigashiyamatokoriyamanashifteditorxn--30rr7yhigashiyodogawahigashiyoshinogaris-a-doctorhippyhiraizumisatohnoshoohirakatashinagawahiranairportland-4-salernogiessennanjobojis-a-financialadvisor-aurdalhirarahiratsukaerusrcfastlylbanzaicloudappspotagerhirayaitakaokalmykiahistorichouseshiraois-a-geekhakassiahitachiomiyagildeskaliszhitachiotagonohejis-a-greenhitraeumtgeradegreehjartdalhjelmelandholeckodairaholidayholyhomegoodshiraokamitsuehomeiphilatelyhomelinkyard-cloudjiffyresdalhomelinuxn--32vp30hachiojiyahikobierzycehomeofficehomesecuritymacaparecidahomesecuritypchoseikarugamvikarlsoyhomesenseeringhomesklepphilipsynology-diskstationhomeunixn--3bst00minamiiserniahondahongooglecodebergentinghonjyoitakarazukaluganskharkivaporcloudhornindalhorsells-for-ustkanmakiwielunnerhortendofinternet-dnshiratakahagitapphoenixn--3ds443ghospitalhoteleshishikuis-a-guruhotelwithflightshisognehotmailhoyangerhoylandetakasagophonefosshisuifuettertdasnetzhumanitieshitaramahungryhurdalhurumajis-a-hard-workershizukuishimogosenhyllestadhyogoris-a-hunterhyugawarahyundaiwafuneis-into-carsiiitesilkharkovaresearchaeologicalvinklein-the-bandairtelebitbridgestoneenebakkeshibechambagricultureadymadealstahaugesunderseaportsinfolionetworkdalaheadjudygarlandis-into-cartoonsimple-urlis-into-gamesserlillyis-leetrentin-suedtirolis-lostre-toteneis-a-lawyeris-not-certifiedis-savedis-slickhersonis-uberleetrentino-a-adigeis-very-badajozis-a-liberalis-very-evillageis-very-goodyearis-very-niceis-very-sweetpepperugiais-with-thebandovre-eikerisleofmanaustdaljellybeanjenv-arubahccavuotnagaragusabaerobaticketsirdaljeonnamerikawauejetztrentino-aadigejevnakershusdecorativeartslupskhmelnytskyivarggatrentino-alto-adigejewelryjewishartgalleryjfkhplaystation-cloudyclusterjgorajlljls-sto1jls-sto2jls-sto3jmphotographysiojnjaworznospamproxyjoyentrentino-altoadigejoyokaichibajddarchitecturealtorlandjpnjprslzjurkotohiradomainstitutekotourakouhokutamamurakounosupabasembokukizunokunimilitarykouyamarylhurstjordalshalsenkouzushimasfjordenkozagawakozakis-a-llamarnardalkozowindowskrakowinnersnoasakatakkokamiminersokndalkpnkppspbarcelonagawakkanaibetsubamericanfamilyds3-fips-us-gov-west-1krasnikahokutokashikis-a-musiciankrasnodarkredstonekrelliankristiansandcatsolarssonkristiansundkrodsheradkrokstadelvalle-aostatic-accessolognekryminamiizukaminokawanishiaizubangekumanotteroykumatorinovecoregontrailroadkumejimashikis-a-nascarfankumenantokonamegatakatoris-a-nursells-itrentin-sud-tirolkunisakis-a-painteractivelvetrentin-sudtirolkunitachiaraindropilotsolundbecknx-serversellsyourhomeftphxn--3e0b707ekunitomigusukuleuvenetokigawakunneppuboliviajessheimpertrixcdn77-secureggioemiliaromagnamsosnowiechristiansburgminakamichiharakunstsammlungkunstunddesignkuokgroupimientaketomisatoolsomakurehabmerkurgankurobeeldengeluidkurogimimatakatsukis-a-patsfankuroisoftwarezzoologykuromatsunais-a-personaltrainerkuronkurotakikawasakis-a-photographerokussldkushirogawakustanais-a-playershiftcryptonomichigangwonkusupersalezajskomakiyosemitekutchanelkutnowruzhgorodeokuzumakis-a-republicanonoichinomiyakekvafjordkvalsundkvamscompute-1kvanangenkvinesdalkvinnheradkviteseidatingkvitsoykwpspdnsomnatalkzmisakis-a-soxfanmisasaguris-a-studentalmisawamisconfusedmishimasudamissilemisugitokuyamatsumaebashikshacknetrentino-sued-tirolmitakeharamitourismilemitoyoakemiuramiyazurecontainerdpolicemiyotamatsukuris-a-teacherkassyno-dshowamjondalenmonstermontrealestatefarmequipmentrentino-suedtirolmonza-brianzapposor-odalmonza-e-della-brianzaptokyotangotpantheonsitemonzabrianzaramonzaebrianzamonzaedellabrianzamoonscalebookinghostedpictetrentinoa-adigemordoviamoriyamatsumotofukemoriyoshiminamiashigaramormonmouthachirogatakamoriokakudamatsuemoroyamatsunomortgagemoscowiosor-varangermoseushimodatemosjoenmoskenesorfoldmossorocabalena-devicesorreisahayakawakamiichikawamisatottoris-a-techietis-a-landscaperspectakasakitchenmosvikomatsushimarylandmoteginowaniihamatamakinoharamoviemovimientolgamozilla-iotrentinoaadigemtranbytomaritimekeepingmuginozawaonsensiositemuikaminoyamaxunispacemukoebenhavnmulhouseoullensvanguardmunakatanemuncienciamuosattemupinbarclaycards3-sa-east-1murmanskomforbar2murotorcraftrentinoalto-adigemusashinoharamuseetrentinoaltoadigemuseumverenigingmusicargodaddyn-o-saurlandesortlandmutsuzawamy-wanggoupilemyactivedirectorymyamazeplaymyasustor-elvdalmycdmycloudnsoruminamimakis-a-rockstarachowicemydattolocalcertificationmyddnsgeekgalaxymydissentrentinos-tirolmydobissmarterthanyoumydrobofageologymydsoundcastronomy-vigorlicemyeffectrentinostirolmyfastly-terrariuminamiminowamyfirewalledreplittlestargardmyforuminamioguni5myfritzmyftpaccessouthcarolinaturalhistorymuseumcentermyhome-servermyjinomykolaivencloud66mymailermymediapchristmasakillucernemyokohamamatsudamypepinkommunalforbundmypetsouthwest1-uslivinghistorymyphotoshibalashovhadanorth-kazakhstanmypicturestaurantrentinosud-tirolmypsxn--3pxu8kommunemysecuritycamerakermyshopblocksowamyshopifymyspreadshopwarendalenugmythic-beastspectruminamisanrikubetsuppliesoomytis-a-bookkeepermaritimodspeedpartnermytuleap-partnersphinxn--41amyvnchromediatechnologymywirepaircraftingvollohmusashimurayamashikokuchuoplantationplantspjelkavikomorotsukagawaplatformsharis-a-therapistoiaplatter-appinokofuefukihaboromskogplatterpioneerplazaplcube-serversicherungplumbingoplurinacionalpodhalepodlasiellaktyubinskiptveterinairealmpmnpodzonepohlpoivronpokerpokrovskomvuxn--3hcrj9choyodobashichikashukujitawaraumalatvuopmicrosoftbankarmoypoliticarrierpolitiendapolkowicepoltavalle-d-aostaticspydebergpomorzeszowitdkongsbergponpesaro-urbino-pesarourbinopesaromasvuotnarusawapordenonepornporsangerporsangugeporsgrunnanyokoshibahikariwanumatakinouepoznanpraxis-a-bruinsfanprdpreservationpresidioprgmrprimetelemarkongsvingerprincipeprivatizehealthinsuranceprofesionalprogressivestfoldpromombetsupplypropertyprotectionprotonetrentinosued-tirolprudentialpruszkowithgoogleapiszprvcyberprzeworskogpulawypunyufuelveruminamiuonumassa-carrara-massacarraramassabuyshousesopotrentino-sud-tirolpupugliapussycateringebuzentsujiiepvhadselfiphdfcbankazunoticiashinkamigototalpvtrentinosuedtirolpwchungnamdalseidsbergmodellingmxn--11b4c3dray-dnsupdaterpzqhaebaruericssongdalenviknakayamaoris-a-cubicle-slavellinodeobjectshinshinotsurfashionstorebaselburguidefinimamateramochizukimobetsumidatlantichirurgiens-dentistes-en-franceqldqotoyohashimotoshimatsuzakis-an-accountantshowtimelbourneqponiatowadaqslgbtrentinsud-tirolqualifioappippueblockbusternopilawaquickconnectrentinsudtirolquicksytesrhtrentinsued-tirolquipelementsrltunestuff-4-saletunkonsulatrobeebyteappigboatsmolaquilanxessmushcdn77-sslingturystykaniepcetuscanytushuissier-justicetuvalleaostaverntuxfamilytwmailvestvagoyvevelstadvibo-valentiavibovalentiavideovillastufftoread-booksnestorfjordvinnicasadelamonedagestangevinnytsiavipsinaappiwatevirginiavirtual-uservecounterstrikevirtualcloudvirtualservervirtualuserveexchangevirtuelvisakuhokksundviterbolognagasakikonaikawagoevivianvivolkenkundenvixn--42c2d9avlaanderennesoyvladikavkazimierz-dolnyvladimirvlogintoyonezawavminanovologdanskonyveloftrentino-stirolvolvolkswagentstuttgartrentinsuedtirolvolyngdalvoorlopervossevangenvotevotingvotoyonovps-hostrowiecircustomer-ocimmobilienwixsitewloclawekoobindalwmcloudwmflabsurnadalwoodsidelmenhorstabackyardsurreyworse-thandawowithyoutuberspacekitagawawpdevcloudwpenginepoweredwphostedmailwpmucdnpixolinodeusercontentrentinosudtirolwpmudevcdnaccessokanagawawritesthisblogoipizzawroclawiwatsukiyonoshiroomgwtcirclerkstagewtfastvps-serverisignwuozuwzmiuwajimaxn--4gbriminingxn--4it168dxn--4it797kooris-a-libertarianxn--4pvxs4allxn--54b7fta0ccivilaviationredumbrellajollamericanexpressexyxn--55qw42gxn--55qx5dxn--5dbhl8dxn--5js045dxn--5rtp49civilisationrenderxn--5rtq34koperviklabudhabikinokawachinaganoharamcocottempurlxn--5su34j936bgsgxn--5tzm5gxn--6btw5axn--6frz82gxn--6orx2rxn--6qq986b3xlxn--7t0a264civilizationthewifiatmallorcafederation-webspacexn--80aaa0cvacationsusonoxn--80adxhksuzakananiimiharuxn--80ao21axn--80aqecdr1axn--80asehdbarclays3-us-east-2xn--80aswgxn--80aukraanghkembuchikujobservableusercontentrevisohughestripperxn--8dbq2axn--8ltr62koryokamikawanehonbetsuwanouchijiwadeliveryxn--8pvr4uxn--8y0a063axn--90a1affinitylotterybnikeisenbahnxn--90a3academiamicable-modemoneyxn--90aeroportalabamagasakishimabaraffleentry-snowplowiczeladzxn--90aishobarakawaharaoxn--90amckinseyxn--90azhytomyrxn--9dbhblg6dietritonxn--9dbq2axn--9et52uxn--9krt00axn--andy-iraxn--aroport-byandexcloudxn--asky-iraxn--aurskog-hland-jnbarefootballooningjerstadgcapebretonamicrolightingjesdalombardiadembroideryonagunicloudiherokuappanamasteiermarkaracoldwarszawauthgearappspacehosted-by-previderxn--avery-yuasakuragawaxn--b-5gaxn--b4w605ferdxn--balsan-sdtirol-nsbsuzukanazawaxn--bck1b9a5dre4civilwarmiasadoesntexisteingeekarpaczest-a-la-maisondre-landrayddns5yxn--bdddj-mrabdxn--bearalvhki-y4axn--berlevg-jxaxn--bhcavuotna-s4axn--bhccavuotna-k7axn--bidr-5nachikatsuuraxn--bievt-0qa2xn--bjarky-fyaotsurgeryxn--bjddar-ptargithubpreviewsaitohmannore-og-uvdalxn--blt-elabourxn--bmlo-graingerxn--bod-2naturalsciencesnaturellesuzukis-an-actorxn--bozen-sdtirol-2obanazawaxn--brnny-wuacademy-firewall-gatewayxn--brnnysund-m8accident-investigation-acornxn--brum-voagatroandinosaureportrentoyonakagyokutoyakomaganexn--btsfjord-9zaxn--bulsan-sdtirol-nsbaremetalpha-myqnapcloud9guacuiababia-goracleaningitpagexlimoldell-ogliastraderxn--c1avgxn--c2br7gxn--c3s14mincomcastreserve-onlinexn--cck2b3bargainstances3-us-gov-west-1xn--cckwcxetdxn--cesena-forl-mcbremangerxn--cesenaforl-i8axn--cg4bkis-an-actresshwindmillxn--ciqpnxn--clchc0ea0b2g2a9gcdxn--comunicaes-v6a2oxn--correios-e-telecomunicaes-ghc29axn--czr694barreaudiblebesbydgoszczecinemagnethnologyoriikaragandauthordalandroiddnss3-ap-southeast-2ix4432-balsan-suedtirolimiteddnskinggfakefurniturecreationavuotnaritakoelnayorovigotsukisosakitahatakahatakaishimoichinosekigaharaurskog-holandingitlaborxn--czrs0trogstadxn--czru2dxn--czrw28barrel-of-knowledgeappgafanquanpachicappacificurussiautomotivelandds3-ca-central-16-balsan-sudtirollagdenesnaaseinet-freaks3-ap-southeast-123websiteleaf-south-123webseiteckidsmynasushiobarackmazerbaijan-mayen-rootaribeiraogakibichuobiramusementdllpages3-ap-south-123sitewebhareidfjordvagsoyerhcloudd-dnsiskinkyolasiteastcoastaldefenceastus2038xn--d1acj3barrell-of-knowledgecomputerhistoryofscience-fictionfabricafjs3-us-west-1xn--d1alfaromeoxn--d1atromsakegawaxn--d5qv7z876clanbibaidarmeniaxn--davvenjrga-y4axn--djrs72d6uyxn--djty4kosaigawaxn--dnna-grajewolterskluwerxn--drbak-wuaxn--dyry-iraxn--e1a4cldmailukowhitesnow-dnsangohtawaramotoineppubtlsanjotelulubin-brbambinagisobetsuitagajoburgjerdrumcprequalifymein-vigorgebetsukuibmdeveloperauniteroizumizakinderoyomitanobninskanzakiyokawaraustrheimatunduhrennebulsan-suedtirololitapunk123kotisivultrobjectselinogradimo-siemenscaledekaascolipiceno-ipifony-1337xn--eckvdtc9dxn--efvn9svalbardunloppaderbornxn--efvy88hagakhanamigawaxn--ehqz56nxn--elqq16hagebostadxn--eveni-0qa01gaxn--f6qx53axn--fct429kosakaerodromegallupaasdaburxn--fhbeiarnxn--finny-yuaxn--fiq228c5hsvchurchaseljeepsondriodejaneirockyotobetsuliguriaxn--fiq64barsycenterprisesakievennodesadistcgrouplidlugolekagaminord-frontierxn--fiqs8sveioxn--fiqz9svelvikoninjambylxn--fjord-lraxn--fjq720axn--fl-ziaxn--flor-jraxn--flw351exn--forl-cesena-fcbssvizzeraxn--forlcesena-c8axn--fpcrj9c3dxn--frde-grandrapidsvn-repostorjcloud-ver-jpchowderxn--frna-woaraisaijosoyroroswedenxn--frya-hraxn--fzc2c9e2cleverappsannanxn--fzys8d69uvgmailxn--g2xx48clicketcloudcontrolapparmatsuuraxn--gckr3f0fauskedsmokorsetagayaseralingenoamishirasatogliattipschulserverxn--gecrj9clickrisinglesannohekinannestadraydnsanokaruizawaxn--ggaviika-8ya47haibarakitakamiizumisanofidelitysfjordxn--gildeskl-g0axn--givuotna-8yasakaiminatoyookaneyamazoexn--gjvik-wuaxn--gk3at1exn--gls-elacaixaxn--gmq050is-an-anarchistoricalsocietysnesigdalxn--gmqw5axn--gnstigbestellen-zvbrplsbxn--45br5cylxn--gnstigliefern-wobihirosakikamijimatsushigexn--h-2failxn--h1aeghair-surveillancexn--h1ahnxn--h1alizxn--h2breg3eveneswidnicasacampinagrandebungotakadaemongolianxn--h2brj9c8clinichippubetsuikilatironporterxn--h3cuzk1digickoseis-a-linux-usershoujis-a-knightpointtohoboleslawieconomiastalbanshizuokamogawaxn--hbmer-xqaxn--hcesuolo-7ya35barsyonlinewhampshirealtychyattorneyagawakuyabukihokumakogeniwaizumiotsurugimbalsfjordeportexaskoyabeagleboardetroitskypecorivneatonoshoes3-eu-west-3utilitiesquare7xn--hebda8basicserversaillesjabbottateshinanomachildrensgardenhlfanhsbc66xn--hery-iraxn--hgebostad-g3axn--hkkinen-5waxn--hmmrfeasta-s4accident-prevention-aptibleangaviikadenaamesjevuemielnoboribetsuckswidnikkolobrzegersundxn--hnefoss-q1axn--hobl-iraxn--holtlen-hxaxn--hpmir-xqaxn--hxt814exn--hyanger-q1axn--hylandet-54axn--i1b6b1a6a2exn--imr513nxn--indery-fyasugithubusercontentromsojamisonxn--io0a7is-an-artistgstagexn--j1adpkomonotogawaxn--j1aefbsbxn--1lqs71dyndns-office-on-the-webhostingrpassagensavonarviikamiokameokamakurazakiwakunigamihamadaxn--j1ael8basilicataniautoscanadaeguambulancentralus-2xn--j1amhakatanorthflankddiamondshinshiroxn--j6w193gxn--jlq480n2rgxn--jlq61u9w7basketballfinanzgorzeleccodespotenzakopanewspaperxn--jlster-byasuokannamihokkaidopaaskvollxn--jrpeland-54axn--jvr189miniserversusakis-a-socialistg-builderxn--k7yn95exn--karmy-yuaxn--kbrq7oxn--kcrx77d1x4axn--kfjord-iuaxn--klbu-woaxn--klt787dxn--kltp7dxn--kltx9axn--klty5xn--45brj9cistrondheimperiaxn--koluokta-7ya57hakodatexn--kprw13dxn--kpry57dxn--kput3is-an-engineeringxn--krager-gyatominamibosogndalxn--kranghke-b0axn--krdsherad-m8axn--krehamn-dxaxn--krjohka-hwab49jdevcloudfunctionsimplesitexn--ksnes-uuaxn--kvfjord-nxaxn--kvitsy-fyatsukanoyakagexn--kvnangen-k0axn--l-1fairwindswiebodzin-dslattuminamiyamashirokawanabeepilepsykkylvenicexn--l1accentureklamborghinikolaeventswinoujscienceandhistoryxn--laheadju-7yatsushiroxn--langevg-jxaxn--lcvr32dxn--ldingen-q1axn--leagaviika-52batochigifts3-us-west-2xn--lesund-huaxn--lgbbat1ad8jdfaststackschulplattformetacentrumeteorappassenger-associationxn--lgrd-poacctrusteexn--lhppi-xqaxn--linds-pramericanartrvestnestudioxn--lns-qlavagiskexn--loabt-0qaxn--lrdal-sraxn--lrenskog-54axn--lt-liacliniquedapliexn--lten-granexn--lury-iraxn--m3ch0j3axn--mely-iraxn--merker-kuaxn--mgb2ddeswisstpetersburgxn--mgb9awbfbx-ostrowwlkpmguitarschwarzgwangjuifminamidaitomanchesterxn--mgba3a3ejtrycloudflarevistaplestudynamic-dnsrvaroyxn--mgba3a4f16axn--mgba3a4fra1-deloittevaksdalxn--mgba7c0bbn0axn--mgbaakc7dvfstdlibestadxn--mgbaam7a8hakonexn--mgbab2bdxn--mgbah1a3hjkrdxn--mgbai9a5eva00batsfjordiscordsays3-website-ap-northeast-1xn--mgbai9azgqp6jejuniperxn--mgbayh7gpalmaseratis-an-entertainerxn--mgbbh1a71exn--mgbc0a9azcgxn--mgbca7dzdoxn--mgbcpq6gpa1axn--mgberp4a5d4a87gxn--mgberp4a5d4arxn--mgbgu82axn--mgbi4ecexposedxn--mgbpl2fhskosherbrookegawaxn--mgbqly7c0a67fbclintonkotsukubankarumaifarmsteadrobaknoluoktachikawakayamadridvallee-aosteroyxn--mgbqly7cvafr-1xn--mgbt3dhdxn--mgbtf8flapymntrysiljanxn--mgbtx2bauhauspostman-echocolatemasekd1xn--mgbx4cd0abbvieeexn--mix082fbxoschweizxn--mix891fedorainfraclouderaxn--mjndalen-64axn--mk0axin-vpnclothingdustdatadetectjmaxxxn--12c1fe0bradescotlandrrxn--mk1bu44cn-northwest-1xn--mkru45is-bykleclerchoshibuyachiyodancexn--mlatvuopmi-s4axn--mli-tlavangenxn--mlselv-iuaxn--moreke-juaxn--mori-qsakurais-certifiedxn--mosjen-eyawaraxn--mot-tlazioxn--mre-og-romsdal-qqbuseranishiaritakurashikis-foundationxn--msy-ula0hakubaghdadultravelchannelxn--mtta-vrjjat-k7aflakstadaokagakicks-assnasaarlandxn--muost-0qaxn--mxtq1minisitexn--ngbc5azdxn--ngbe9e0axn--ngbrxn--45q11citadelhicampinashikiminohostfoldnavyxn--nit225koshimizumakiyosunnydayxn--nmesjevuemie-tcbalestrandabergamoarekeymachineustarnbergxn--nnx388axn--nodessakyotanabelaudiopsysynology-dstreamlitappittsburghofficialxn--nqv7fs00emaxn--nry-yla5gxn--ntso0iqx3axn--ntsq17gxn--nttery-byaeserveftplanetariuminamitanexn--nvuotna-hwaxn--nyqy26axn--o1achernihivgubsxn--o3cw4hakuis-a-democratravelersinsurancexn--o3cyx2axn--od0algxn--od0aq3belementorayoshiokanumazuryukuhashimojibxos3-website-ap-southeast-1xn--ogbpf8flatangerxn--oppegrd-ixaxn--ostery-fyawatahamaxn--osyro-wuaxn--otu796dxn--p1acfedorapeoplegoismailillehammerfeste-ipatriaxn--p1ais-gonexn--pgbs0dhlx3xn--porsgu-sta26fedoraprojectoyotsukaidoxn--pssu33lxn--pssy2uxn--q7ce6axn--q9jyb4cngreaterxn--qcka1pmcpenzaporizhzhiaxn--qqqt11minnesotaketakayamassivegridxn--qxa6axn--qxamsterdamnserverbaniaxn--rady-iraxn--rdal-poaxn--rde-ulaxn--rdy-0nabaris-into-animeetrentin-sued-tirolxn--rennesy-v1axn--rhkkervju-01afeiraquarelleasingujaratoyouraxn--rholt-mragowoltlab-democraciaxn--rhqv96gxn--rht27zxn--rht3dxn--rht61exn--risa-5naturbruksgymnxn--risr-iraxn--rland-uuaxn--rlingen-mxaxn--rmskog-byaxn--rny31hakusanagochihayaakasakawaiishopitsitexn--rovu88bellevuelosangeles3-website-ap-southeast-2xn--rros-granvindafjordxn--rskog-uuaxn--rst-0naturhistorischesxn--rsta-framercanvasxn--rvc1e0am3exn--ryken-vuaxn--ryrvik-byaxn--s-1faithaldenxn--s9brj9cnpyatigorskolecznagatorodoyxn--sandnessjen-ogbellunord-odalombardyn53xn--sandy-yuaxn--sdtirol-n2axn--seral-lraxn--ses554gxn--sgne-graphoxn--4dbgdty6citichernovtsyncloudrangedaluccarbonia-iglesias-carboniaiglesiascarboniaxn--skierv-utazasxn--skjervy-v1axn--skjk-soaxn--sknit-yqaxn--sknland-fxaxn--slat-5natuurwetenschappenginexn--slt-elabcieszynh-servebeero-stageiseiroumuenchencoreapigeelvinckoshunantankmpspawnextdirectrentino-s-tirolxn--smla-hraxn--smna-gratangentlentapisa-geekosugexn--snase-nraxn--sndre-land-0cbeneventochiokinoshimaintenancebinordreisa-hockeynutazurestaticappspaceusercontentateyamaveroykenglandeltaitogitsumitakagiizeasypanelblagrarchaeologyeongbuk0emmafann-arboretumbriamallamaceiobbcg123homepagefrontappchizip61123minsidaarborteaches-yogasawaracingroks-theatree123hjemmesidealerimo-i-rana4u2-localhistorybolzano-altoadigeometre-experts-comptables3-ap-northeast-123miwebcambridgehirn4t3l3p0rtarumizusawabogadobeaemcloud-fr123paginaweberkeleyokosukanrabruzzombieidskoguchikushinonsenasakuchinotsuchiurakawafaicloudineat-url-o-g-i-naval-d-aosta-valleyokote164-b-datacentermezproxyzgoraetnabudejjudaicadaquest-mon-blogueurodirumaceratabuseating-organicbcn-north-123saitamakawabartheshopencraftrainingdyniajuedischesapeakebayernavigationavoi234lima-cityeats3-ap-northeast-20001wwwedeployokozeastasiamunemurorangecloudplatform0xn--snes-poaxn--snsa-roaxn--sr-aurdal-l8axn--sr-fron-q1axn--sr-odal-q1axn--sr-varanger-ggbentleyurihonjournalistjohnikonanporovnobserverxn--srfold-byaxn--srreisa-q1axn--srum-gratis-a-bulls-fanxn--stfold-9xaxn--stjrdal-s1axn--stjrdalshalsen-sqbeppublishproxyusuharavocatanzarowegroweiboltashkentatamotorsitestingivingjemnes3-eu-central-1kappleadpages-12hpalmspringsakerxn--stre-toten-zcbeskidyn-ip24xn--t60b56axn--tckweddingxn--tiq49xqyjelasticbeanstalkhmelnitskiyamarumorimachidaxn--tjme-hraxn--tn0agrocerydxn--tnsberg-q1axn--tor131oxn--trany-yuaxn--trentin-sd-tirol-rzbestbuyshoparenagareyamaizurugbyenvironmentalconservationflashdrivefsnillfjordiscordsezjampaleoceanographics3-website-eu-west-1xn--trentin-sdtirol-7vbetainaboxfuseekloges3-website-sa-east-1xn--trentino-sd-tirol-c3bhzcasertainaioirasebastopologyeongnamegawafflecellclstagemologicaliforniavoues3-eu-west-1xn--trentino-sdtirol-szbielawalbrzycharitypedreamhostersvp4xn--trentinosd-tirol-rzbiellaakesvuemieleccebizenakanotoddeninoheguriitatebayashiibahcavuotnagaivuotnagaokakyotambabybluebitelevisioncilla-speziaxarnetbank8s3-eu-west-2xn--trentinosdtirol-7vbieszczadygeyachimataijiiyamanouchikuhokuryugasakitaurayasudaxn--trentinsd-tirol-6vbievat-band-campaignieznombrendlyngengerdalces3-website-us-east-1xn--trentinsdtirol-nsbifukagawalesundiscountypeformelhusgardeninomiyakonojorpelandiscourses3-website-us-west-1xn--trgstad-r1axn--trna-woaxn--troms-zuaxn--tysvr-vraxn--uc0atvestre-slidrexn--uc0ay4axn--uist22halsakakinokiaxn--uisz3gxn--unjrga-rtarnobrzegyptianxn--unup4yxn--uuwu58axn--vads-jraxn--valle-aoste-ebbtularvikonskowolayangroupiemontexn--valle-d-aoste-ehboehringerikexn--valleaoste-e7axn--valledaoste-ebbvadsoccerxn--vard-jraxn--vegrshei-c0axn--vermgensberater-ctb-hostingxn--vermgensberatung-pwbigvalledaostaobaomoriguchiharag-cloud-championshiphoplixboxenirasakincheonishiazaindependent-commissionishigouvicasinordeste-idclkarasjohkamikitayamatsurindependent-inquest-a-la-masionishiharaxn--vestvgy-ixa6oxn--vg-yiabkhaziaxn--vgan-qoaxn--vgsy-qoa0jelenia-goraxn--vgu402cnsantabarbaraxn--vhquvestre-totennishiawakuraxn--vler-qoaxn--vre-eiker-k8axn--vrggt-xqadxn--vry-yla5gxn--vuq861biharstadotsubetsugaruhrxn--w4r85el8fhu5dnraxn--w4rs40lxn--wcvs22dxn--wgbh1cntjomeldaluroyxn--wgbl6axn--xhq521bihorologyusuisservegame-serverxn--xkc2al3hye2axn--xkc2dl3a5ee0hammarfeastafricaravantaaxn--y9a3aquariumintereitrentino-sudtirolxn--yer-znaumburgxn--yfro4i67oxn--ygarden-p1axn--ygbi2ammxn--4dbrk0cexn--ystre-slidre-ujbikedaejeonbukarasjokarasuyamarriottatsunoceanographiquehimejindependent-inquiryuufcfanishiizunazukindependent-panelomoliseminemrxn--zbx025dxn--zf0ao64axn--zf0avxlxn--zfr164bilbaogashimadachicagoboavistanbulsan-sudtirolbia-tempio-olbiatempioolbialystokkeliwebredirectme-south-1xnbayxz \ No newline at end of file diff --git a/vendor/golang.org/x/net/publicsuffix/list.go b/vendor/golang.org/x/net/publicsuffix/list.go index 7caeeaa696d..d56e9e76244 100644 --- a/vendor/golang.org/x/net/publicsuffix/list.go +++ b/vendor/golang.org/x/net/publicsuffix/list.go @@ -101,10 +101,10 @@ loop: break } - u := uint32(nodeValue(f) >> (nodesBitsTextOffset + nodesBitsTextLength)) + u := uint32(nodes.get(f) >> (nodesBitsTextOffset + nodesBitsTextLength)) icannNode = u&(1<>= nodesBitsICANN - u = children[u&(1<>= childrenBitsLo hi = u & (1<>= nodesBitsTextLength offset := x & (1< golang.org/x/net v0.4.0 ## explicit; go 1.17 golang.org/x/net/context golang.org/x/net/context/ctxhttp @@ -1280,7 +1280,7 @@ golang.org/x/oauth2/jwt ## explicit golang.org/x/sync/errgroup golang.org/x/sync/singleflight -# golang.org/x/sys v0.2.0 +# golang.org/x/sys v0.3.0 ## explicit; go 1.17 golang.org/x/sys/cpu golang.org/x/sys/execabs @@ -1289,10 +1289,10 @@ golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry -# golang.org/x/term v0.2.0 +# golang.org/x/term v0.3.0 ## explicit; go 1.17 golang.org/x/term -# golang.org/x/text v0.4.0 => golang.org/x/text v0.4.0 +# golang.org/x/text v0.5.0 => golang.org/x/text v0.4.0 ## explicit; go 1.17 golang.org/x/text/cases golang.org/x/text/encoding @@ -2396,5 +2396,6 @@ sigs.k8s.io/yaml # github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.1.0 # github.com/emicklei/go-restful => github.com/emicklei/go-restful v2.16.0+incompatible # golang.org/x/crypto => golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 +# golang.org/x/net => golang.org/x/net v0.4.0 # golang.org/x/text => golang.org/x/text v0.4.0 # gopkg.in/yaml.v3 => gopkg.in/yaml.v3 v3.0.1