From df0af8dd0cf6102d3dcf59bac5f9be53e51b573f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 19:56:52 +0000 Subject: [PATCH 01/14] chore(deps): update actions/cache action to v3.0.8 (#3577) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/main-build.yml | 4 ++-- .github/workflows/pr-validation.yml | 4 ++-- .github/workflows/release-build.yml | 4 ++-- .github/workflows/v1-build.yml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index 311877ae083..8e5ede8726a 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -29,13 +29,13 @@ jobs: echo ::set-output name=build_cache::$(go env GOCACHE) - name: Go modules cache - uses: actions/cache@v3.0.7 + uses: actions/cache@v3.0.8 with: path: ${{ steps.go-paths.outputs.mod_cache }} key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - name: Go build cache - uses: actions/cache@v3.0.7 + uses: actions/cache@v3.0.8 with: path: ${{ steps.go-paths.outputs.build_cache }} key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index 9d18807b4de..d49229aadaf 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -33,13 +33,13 @@ jobs: echo ::set-output name=build_cache::$(go env GOCACHE) - name: Go modules cache - uses: actions/cache@v3.0.7 + uses: actions/cache@v3.0.8 with: path: ${{ steps.go-paths.outputs.mod_cache }} key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - name: Go build cache - uses: actions/cache@v3.0.7 + uses: actions/cache@v3.0.8 with: path: ${{ steps.go-paths.outputs.build_cache }} key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 638b3ec52d3..89a63e8d88e 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -29,13 +29,13 @@ jobs: echo ::set-output name=build_cache::$(go env GOCACHE) - name: Go modules cache - uses: actions/cache@v3.0.7 + uses: actions/cache@v3.0.8 with: path: ${{ steps.go-paths.outputs.mod_cache }} key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - name: Go build cache - uses: actions/cache@v3.0.7 + uses: actions/cache@v3.0.8 with: path: ${{ steps.go-paths.outputs.build_cache }} key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} diff --git a/.github/workflows/v1-build.yml b/.github/workflows/v1-build.yml index 190ccb26410..5347a26e034 100644 --- a/.github/workflows/v1-build.yml +++ b/.github/workflows/v1-build.yml @@ -16,7 +16,7 @@ jobs: fetch-depth: 1 - name: Go modules cache - uses: actions/cache@v3.0.7 + uses: actions/cache@v3.0.8 with: path: /go/pkg key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} From 7276794515635824eb8ad679bc7407b7f69f3cc9 Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Wed, 24 Aug 2022 14:29:01 +0200 Subject: [PATCH 02/14] docs: Improve documentation about how to debug metrics server (#3585) --- BUILD.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/BUILD.md b/BUILD.md index f5f291c182e..def4aa2a023 100644 --- a/BUILD.md +++ b/BUILD.md @@ -122,9 +122,9 @@ to deploy it as part of KEDA. Do the following: kubectl logs -l app=keda-metrics-apiserver -n keda -f ``` -## Debugging +## Debugging with VS Code -### Using VS Code +### Operator Follow these instructions if you want to debug the KEDA operator using VS Code. @@ -133,7 +133,7 @@ Follow these instructions if you want to debug the KEDA operator using VS Code. { "configurations": [ { - "name": "Launch file", + "name": "Launch operator", "type": "go", "request": "launch", "mode": "debug", @@ -155,6 +155,66 @@ Follow these instructions if you want to debug the KEDA operator using VS Code. 4. Set breakpoints in the code as required. 5. Select `Run > Start Debugging` or press `F5` to start debugging. +### Metrics server + +Follow these instructions if you want to debug the KEDA metrics server using VS Code. + +1. Create a `launch.json` file inside the `.vscode/` folder in the repo with the following configuration: + ```json + { + "configurations": [ + { + "name": "Launch metrics-server", + "type": "go", + "request": "launch", + "mode": "auto", + "program": "${workspaceFolder}/adapter/main.go", + "env": {"WATCH_NAMESPACE": ""}, + "args": [ + "--authentication-kubeconfig=PATH_TO_YOUR_KUBECONFIG", + "--authentication-skip-lookup", + "--authorization-kubeconfig=PATH_TO_YOUR_KUBECONFIG", + "--lister-kubeconfig=PATH_TO_YOUR_KUBECONFIG", + "--secure-port=6443", + "--v=5" + ], + } + ] + } + ``` + Refer to [this](https://code.visualstudio.com/docs/editor/debugging) for more information about debugging with VS Code. +2. Deploy CRDs and KEDA into `keda` namespace + ```bash + make deploy + ``` +3. Set breakpoints in the code as required. +4. Select `Run > Start Debugging` or press `F5` to start debugging. + +In order to perform queries against the metrics server, you need to use an authenticated user (with enough permissions) or give permissions over external metrics API to `system:anonymous`. + +To grant access over external metrics API to `system:anonymous`, you only need to deploy this manifest (and remove it once you have finished): + +```yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: grant-anonymous-access-to-external-metrics +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: keda-external-metrics-reader +subjects: +- kind: User + name: system:anonymous + namespace: default +``` + +**NOTE:** This granting allows to any unauthenticated user to do any operation in external metrics API, this is potentially unsecure, and we strongly discourage doing it on production clusters. + +You can query list metrics executing `curl --insecure https://localhost:6443/apis/external.metrics.k8s.io/v1beta1/` or query a specific metrics value executing `curl --insecure https://localhost:6443/apis/external.metrics.k8s.io/v1beta1/namespaces/NAMESPACE/METRIC_NAME` ([similar to the process using `kubectl get --raw`](https://keda.sh/docs/latest/operate/metrics-server/#querying-metrics-exposed-by-keda-metrics-server) but using `curl --insecure https://localhost:6443` instead) + +If you prefer to use an authenticated user, you can use a user or service account with access over external metrics API adding their token as authorization header in `curl`, ie: `curl -H "Authorization:Bearer TOKEN" --insecure https://localhost:6443/apis/external.metrics.k8s.io/v1beta1/` + ## Miscellaneous ### Setting log levels From 40da2e2bb4f06ecbd591d1a48fc3fabbb321997a Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Wed, 24 Aug 2022 15:31:03 +0200 Subject: [PATCH 03/14] fix: Cron Scaler e2e test works during min 59 (#3590) --- tests/scalers/cron/cron_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/scalers/cron/cron_test.go b/tests/scalers/cron/cron_test.go index df96f3a11d9..bca0938754c 100644 --- a/tests/scalers/cron/cron_test.go +++ b/tests/scalers/cron/cron_test.go @@ -25,8 +25,8 @@ var ( scaledObjectName = fmt.Sprintf("%s-so", testName) now = time.Now().Local() - start = (now.Minute() + 1) - end = (start + 1) + start = (now.Minute() + 1) % 60 + end = (start + 1) % 60 ) type templateData struct { From ef481772be2a06cb766ca3715b6e4cc20c3e8595 Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Thu, 25 Aug 2022 19:14:20 +0200 Subject: [PATCH 04/14] fix: Metrics endpoint returns correct HPA value (#3584) --- CHANGELOG.md | 2 +- config/metrics-server/deployment.yaml | 2 + config/metrics-server/service.yaml | 3 + pkg/metrics/prometheus_metrics.go | 4 +- pkg/provider/provider.go | 2 +- .../prometheus_metrics_test.go | 184 ++++++++++++++++++ 6 files changed, 193 insertions(+), 4 deletions(-) create mode 100644 tests/internals/prometheus_metrics/prometheus_metrics_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e7c186c6c6..ed5849b2eb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,7 +45,7 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md ### Fixes -- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX)) +- **General:** Metrics endpoint returns correct HPA values ([#3554](https://github.com/kedacore/keda/issues/3554)) ### Deprecations diff --git a/config/metrics-server/deployment.yaml b/config/metrics-server/deployment.yaml index 1bea981656c..f9b382b3e23 100644 --- a/config/metrics-server/deployment.yaml +++ b/config/metrics-server/deployment.yaml @@ -60,6 +60,8 @@ spec: name: https - containerPort: 8080 name: http + - containerPort: 9022 + name: metrics volumeMounts: - mountPath: /tmp name: temp-vol diff --git a/config/metrics-server/service.yaml b/config/metrics-server/service.yaml index e1281b12bae..e3880adc927 100644 --- a/config/metrics-server/service.yaml +++ b/config/metrics-server/service.yaml @@ -16,5 +16,8 @@ spec: - name: http port: 80 targetPort: 8080 + - name: metrics + port: 9022 + targetPort: 9022 selector: app: keda-metrics-apiserver diff --git a/pkg/metrics/prometheus_metrics.go b/pkg/metrics/prometheus_metrics.go index dbbd1d39a07..a05529682b1 100644 --- a/pkg/metrics/prometheus_metrics.go +++ b/pkg/metrics/prometheus_metrics.go @@ -100,8 +100,8 @@ func (metricsServer PrometheusMetricServer) NewServer(address string, pattern st } // RecordHPAScalerMetric create a measurement of the external metric used by the HPA -func (metricsServer PrometheusMetricServer) RecordHPAScalerMetric(namespace string, scaledObject string, scaler string, scalerIndex int, metric string, value int64) { - scalerMetricsValue.With(getLabels(namespace, scaledObject, scaler, scalerIndex, metric)).Set(float64(value)) +func (metricsServer PrometheusMetricServer) RecordHPAScalerMetric(namespace string, scaledObject string, scaler string, scalerIndex int, metric string, value float64) { + scalerMetricsValue.With(getLabels(namespace, scaledObject, scaler, scalerIndex, metric)).Set(value) } // RecordHPAScalerError counts the number of errors occurred in trying get an external metric used by the HPA diff --git a/pkg/provider/provider.go b/pkg/provider/provider.go index e4ab4410b54..6c47215939a 100644 --- a/pkg/provider/provider.go +++ b/pkg/provider/provider.go @@ -124,7 +124,7 @@ func (p *KedaProvider) GetExternalMetric(ctx context.Context, namespace string, logger.Error(err, "error getting metric for scaler", "scaledObject.Namespace", scaledObject.Namespace, "scaledObject.Name", scaledObject.Name, "scaler", scaler) } else { for _, metric := range metrics { - metricValue, _ := metric.Value.AsInt64() + metricValue := metric.Value.AsApproximateFloat64() metricsServer.RecordHPAScalerMetric(namespace, scaledObject.Name, scalerName, scalerIndex, metric.MetricName, metricValue) } matchingMetrics = append(matchingMetrics, metrics...) diff --git a/tests/internals/prometheus_metrics/prometheus_metrics_test.go b/tests/internals/prometheus_metrics/prometheus_metrics_test.go new file mode 100644 index 00000000000..190e548aed3 --- /dev/null +++ b/tests/internals/prometheus_metrics/prometheus_metrics_test.go @@ -0,0 +1,184 @@ +//go:build e2e +// +build e2e + +package prometheus_metrics_test + +import ( + "fmt" + "strings" + "testing" + + "github.com/prometheus/common/expfmt" + "github.com/stretchr/testify/assert" + + . "github.com/kedacore/keda/v2/tests/helper" +) + +const ( + testName = "prometheus-metrics-test" +) + +var ( + testNamespace = fmt.Sprintf("%s-ns", testName) + deploymentName = fmt.Sprintf("%s-deployment", testName) + monitoredDeploymentName = fmt.Sprintf("%s-monitored", testName) + scaledObjectName = fmt.Sprintf("%s-so", testName) + clientName = fmt.Sprintf("%s-client", testName) +) + +type templateData struct { + TestNamespace string + DeploymentName string + ScaledObjectName string + MonitoredDeploymentName string + ClientName string +} + +const ( + monitoredDeploymentTemplate = ` +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{.MonitoredDeploymentName}} + namespace: {{.TestNamespace}} + labels: + app: {{.MonitoredDeploymentName}} +spec: + replicas: 4 + selector: + matchLabels: + app: {{.MonitoredDeploymentName}} + template: + metadata: + labels: + app: {{.MonitoredDeploymentName}} + spec: + containers: + - name: {{.MonitoredDeploymentName}} + image: nginx +` + + deploymentTemplate = ` +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{.DeploymentName}} + namespace: {{.TestNamespace}} + labels: + app: {{.DeploymentName}} +spec: + replicas: 1 + selector: + matchLabels: + app: {{.DeploymentName}} + template: + metadata: + labels: + app: {{.DeploymentName}} + spec: + containers: + - name: {{.DeploymentName}} + image: nginx +` + + scaledObjectTemplate = ` +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: {{.ScaledObjectName}} + namespace: {{.TestNamespace}} +spec: + scaleTargetRef: + name: {{.DeploymentName}} + pollingInterval: 5 + idleReplicaCount: 0 + minReplicaCount: 1 + maxReplicaCount: 2 + cooldownPeriod: 10 + triggers: + - type: kubernetes-workload + metadata: + podSelector: 'app={{.MonitoredDeploymentName}}' + value: '1' +` + + clientTemplate = ` +apiVersion: v1 +kind: Pod +metadata: + name: {{.ClientName}} + namespace: {{.TestNamespace}} +spec: + containers: + - name: {{.ClientName}} + image: curlimages/curl + command: + - sh + - -c + - "exec tail -f /dev/null"` +) + +func TestScaler(t *testing.T) { + // setup + t.Log("--- setting up ---") + + // Create kubernetes resources + kc := GetKubernetesClient(t) + data, templates := getTemplateData() + + CreateKubernetesResources(t, kc, testNamespace, data, templates) + + // scaling to max replica count to ensure the counter is registered before we test it + assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 2, 60, 2), + "replica count should be 2 after 2 minute") + + testHPAScalerMetricValue(t) + + // cleanup + DeleteKubernetesResources(t, kc, testNamespace, data, templates) +} + +func getTemplateData() (templateData, []Template) { + return templateData{ + TestNamespace: testNamespace, + DeploymentName: deploymentName, + ScaledObjectName: scaledObjectName, + MonitoredDeploymentName: monitoredDeploymentName, + ClientName: clientName, + }, []Template{ + {Name: "deploymentTemplate", Config: deploymentTemplate}, + {Name: "monitoredDeploymentTemplate", Config: monitoredDeploymentTemplate}, + {Name: "scaledObjectTemplate", Config: scaledObjectTemplate}, + {Name: "clientTemplate", Config: clientTemplate}, + } +} + +func testHPAScalerMetricValue(t *testing.T) { + t.Log("--- testing hpa scaler metric value ---") + + out, _, err := ExecCommandOnSpecificPod(t, clientName, testNamespace, "curl --insecure http://keda-metrics-apiserver.keda:9022/metrics") + assert.NoErrorf(t, err, "cannot execute command - %s", err) + + parser := expfmt.TextParser{} + // Ensure EOL + reader := strings.NewReader(strings.ReplaceAll(out, "\r\n", "\n")) + family, err := parser.TextToMetricFamilies(reader) + assert.NoErrorf(t, err, "cannot parse metrics - %s", err) + + if val, ok := family["keda_metrics_adapter_scaler_metrics_value"]; ok { + var found bool + metrics := val.GetMetric() + for _, metric := range metrics { + labels := metric.GetLabel() + for _, label := range labels { + if *label.Name == "scaledObject" && *label.Value == scaledObjectName { + assert.Equal(t, float64(4), *metric.Gauge.Value) + found = true + } + } + } + assert.Equal(t, true, found) + } else { + t.Errorf("metric not available") + } +} From 96e5bd25b183e950ed87660ee5ebc0a85dca873a Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Mon, 29 Aug 2022 17:08:51 +0200 Subject: [PATCH 05/14] chore: Add a note about debbugging metrics server (#3608) Co-authored-by: Zbynek Roubalik --- BUILD.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BUILD.md b/BUILD.md index def4aa2a023..5c7d28ca3ff 100644 --- a/BUILD.md +++ b/BUILD.md @@ -157,6 +157,8 @@ Follow these instructions if you want to debug the KEDA operator using VS Code. ### Metrics server +> **Note:** You will be able to manually query metrics to your local version of the KEDA Metrics server. You won't replace the KEDA Metrics server deployed on the Kubernetes cluster. + Follow these instructions if you want to debug the KEDA metrics server using VS Code. 1. Create a `launch.json` file inside the `.vscode/` folder in the repo with the following configuration: From c5d7ae6c8932f1249ccf139d0f3a2bf53c861aa2 Mon Sep 17 00:00:00 2001 From: vflaux <38909103+vflaux@users.noreply.github.com> Date: Wed, 31 Aug 2022 15:50:19 +0200 Subject: [PATCH 06/14] Fix: panic in datadog scaler (#3617) Signed-off-by: Valentin Flaux Signed-off-by: Valentin Flaux --- CHANGELOG.md | 1 + pkg/scalers/datadog_scaler.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed5849b2eb4..df4a491578b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md ### Fixes - **General:** Metrics endpoint returns correct HPA values ([#3554](https://github.com/kedacore/keda/issues/3554)) +- **Datadog Scaler:** Fix: panic in datadog scaler ([#3448](https://github.com/kedacore/keda/issues/3448)) ### Deprecations diff --git a/pkg/scalers/datadog_scaler.go b/pkg/scalers/datadog_scaler.go index 559e3f47198..f3c2ab131a6 100644 --- a/pkg/scalers/datadog_scaler.go +++ b/pkg/scalers/datadog_scaler.go @@ -286,7 +286,7 @@ func (s *datadogScaler) getQueryResult(ctx context.Context) (float64, error) { points := series[0].GetPointlist() index := len(points) - 1 - if len(points) == 0 || len(points[index]) < 2 { + if len(points) == 0 || len(points[index]) < 2 || points[index][1] == nil { if !s.metadata.useFiller { return 0, fmt.Errorf("no Datadog metrics returned for the given time window") } From 7bd9e22ccca5e23e1d024f3ef6a208a9998de9aa Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Wed, 31 Aug 2022 16:10:39 +0200 Subject: [PATCH 07/14] feat: Add scaler governance to PR checklist (#3616) --- .github/PULL_REQUEST_TEMPLATE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b665ed34d7c..66a6e8cbd98 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,6 +8,7 @@ _Provide a description of what has been changed_ ### Checklist +- [ ] When introducing a new scaler, I agree with the [scaling governance policy](https://github.com/kedacore/governance/blob/main/SCALERS.md) - [ ] Commits are signed with Developer Certificate of Origin (DCO - [learn more](https://github.com/kedacore/keda/blob/main/CONTRIBUTING.md#developer-certificate-of-origin-signing-your-work)) - [ ] Tests have been added - [ ] A PR is opened to update our Helm chart ([repo](https://github.com/kedacore/charts)) *(if applicable, ie. when deployment manifests are modified)* From 8d06f6fe7fde60d4178222d655a4dbdb9190a2a6 Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Thu, 1 Sep 2022 11:17:43 +0200 Subject: [PATCH 08/14] chore: bump deps and get rid of `github.com/golang/protobuf` (as a direct dep) (#3618) --- .devcontainer/Dockerfile | 8 +- Makefile | 14 +- go.mod | 57 +- go.sum | 109 +- .../azure/azure_aad_workload_identity.go | 9 +- pkg/scalers/external_scaler.go | 6 +- pkg/scalers/external_scaler_test.go | 3 + .../externalscaler/externalscaler.pb.go | 955 +++++++++--------- .../externalscaler/externalscaler_grpc.pb.go | 241 +++++ pkg/scalers/liiklus/LiiklusService.pb.go | 4 +- pkg/scalers/liiklus/LiiklusService_grpc.pb.go | 345 +++---- pkg/scalers/stackdriver_client.go | 6 +- tests/utils/setup_test.go | 2 +- 13 files changed, 993 insertions(+), 766 deletions(-) create mode 100644 pkg/scalers/externalscaler/externalscaler_grpc.pb.go diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f0e233c8be1..0bcf8ef4aa4 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -20,7 +20,7 @@ ENV GO111MODULE=auto # Configure apt, install packages and tools RUN apt-get update \ - && apt-get -y install --no-install-recommends apt-utils dialog 2>&1 \ + && apt-get -y install --no-install-recommends apt-utils dialog unzip 2>&1 \ # # Verify git, process tools, lsb-release (common in install instructions for CLIs) installed && apt-get -y install git iproute2 procps lsb-release \ @@ -54,6 +54,12 @@ RUN apt-get update \ # github.com/derekparker/delve/cmd/dlv 2>&1 \ # This pkg deps use generics, we cannot use it till we use go 1.18 && go install honnef.co/go/tools/cmd/staticcheck@latest \ && go install golang.org/x/tools/gopls@latest \ + # Protocol Buffer Compiler + && if [ $(dpkg --print-architecture) == "amd64" ]; then PROTOC_ARCH="x86_64"; else PROTOC_ARCH="aarch_64" ; fi \ + && curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1/protoc-3.20.1-linux-$PROTOC_ARCH.zip" \ + && unzip "protoc-3.20.1-linux-$PROTOC_ARCH.zip" -d $HOME/.local \ + && mv $HOME/.local/bin/protoc /usr/local/bin/protoc \ + && mv $HOME/.local/include/ /usr/local/bin/include/ \ # Install golangci-lint && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2 \ # diff --git a/Makefile b/Makefile index aa146a3b63d..164c0220a8b 100644 --- a/Makefile +++ b/Makefile @@ -154,8 +154,16 @@ clientset-generate: ## Generate client-go clientset, listers and informers. rm -rf vendor # Generate Liiklus proto -pkg/scalers/liiklus/LiiklusService.pb.go: hack/LiiklusService.proto - protoc -I hack/ hack/LiiklusService.proto --go_out=pkg/scalers/liiklus --go-grpc_out=pkg/scalers/liiklus +pkg/scalers/liiklus/LiiklusService.pb.go: protoc-gen-go + protoc --proto_path=hack LiiklusService.proto --go_out=pkg/scalers/liiklus --go-grpc_out=pkg/scalers/liiklus + +# Generate ExternalScaler proto +pkg/scalers/externalscaler/externalscaler.pb.go: protoc-gen-go + protoc --proto_path=pkg/scalers/externalscaler externalscaler.proto --go-grpc_out=pkg/scalers/externalscaler + +protoc-gen-go: ## Download protoc-gen-go + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 .PHONY: mockgen-gen mockgen-gen: mockgen pkg/mock/mock_scaling/mock_interface.go pkg/mock/mock_scaler/mock_scaler.go pkg/mock/mock_scale/mock_interfaces.go pkg/mock/mock_client/mock_interfaces.go pkg/scalers/liiklus/mocks/mock_liiklus.go @@ -168,7 +176,7 @@ pkg/mock/mock_scale/mock_interfaces.go: $(shell go list -mod=readonly -f '{{ .Di $(MOCKGEN) -destination=$@ -package=mock_scale -source=$^ pkg/mock/mock_client/mock_interfaces.go: $(shell go list -mod=readonly -f '{{ .Dir }}' -m sigs.k8s.io/controller-runtime)/pkg/client/interfaces.go $(MOCKGEN) -destination=$@ -package=mock_client -source=$^ -pkg/scalers/liiklus/mocks/mock_liiklus.go: pkg/scalers/liiklus/LiiklusService.pb.go +pkg/scalers/liiklus/mocks/mock_liiklus.go: $(MOCKGEN) -destination=$@ github.com/kedacore/keda/v2/pkg/scalers/liiklus LiiklusServiceClient ################################################## diff --git a/go.mod b/go.mod index db85225c110..f7b699b93b6 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/kedacore/keda/v2 go 1.17 require ( - cloud.google.com/go/compute v1.7.0 - cloud.google.com/go/monitoring v1.5.0 - cloud.google.com/go/storage v1.24.0 + cloud.google.com/go/compute v1.9.0 + cloud.google.com/go/monitoring v1.6.0 + cloud.google.com/go/storage v1.26.0 github.com/Azure/azure-amqp-common-go/v3 v3.2.1 github.com/Azure/azure-event-hubs-go/v3 v3.3.16 github.com/Azure/azure-kusto-go v0.7.0 @@ -15,11 +15,11 @@ require ( github.com/Azure/azure-storage-queue-go v0.0.0-20191125232315-636801874cdd github.com/Azure/go-autorest/autorest v0.11.28 github.com/Azure/go-autorest/autorest/azure/auth v0.5.11 - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.3 + github.com/AzureAD/microsoft-authentication-library-for-go v0.6.1 github.com/DataDog/datadog-api-client-go v1.16.0 github.com/Huawei/gophercloud v1.0.21 - github.com/Shopify/sarama v1.35.0 - github.com/aws/aws-sdk-go v1.44.70 + github.com/Shopify/sarama v1.36.0 + github.com/aws/aws-sdk-go v1.44.88 github.com/denisenkom/go-mssqldb v0.12.2 github.com/dysnix/predictkube-libs v0.0.4-0.20220717101015-44c816c4fb9c github.com/dysnix/predictkube-proto v0.0.0-20220713123213-7135dce1e9c9 @@ -31,36 +31,35 @@ require ( github.com/gobwas/glob v0.2.3 github.com/gocql/gocql v1.2.0 github.com/golang/mock v1.6.0 - github.com/golang/protobuf v1.5.2 github.com/google/go-cmp v0.5.8 - github.com/gophercloud/gophercloud v0.25.0 + github.com/gophercloud/gophercloud v1.0.0 github.com/hashicorp/vault/api v1.7.2 github.com/imdario/mergo v0.3.13 - github.com/influxdata/influxdb-client-go/v2 v2.9.2 + github.com/influxdata/influxdb-client-go/v2 v2.10.0 github.com/joho/godotenv v1.4.0 github.com/lib/pq v1.10.6 github.com/microsoft/ApplicationInsights-Go v0.4.4 github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5 github.com/mitchellh/hashstructure v1.1.0 - github.com/newrelic/newrelic-client-go v0.89.0 + github.com/newrelic/newrelic-client-go v0.91.0 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.20.0 + github.com/onsi/gomega v1.20.1 github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.12.2 + github.com/prometheus/client_golang v1.13.0 github.com/prometheus/common v0.37.0 github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 github.com/robfig/cron/v3 v3.0.1 github.com/streadway/amqp v1.0.0 github.com/stretchr/testify v1.8.0 - github.com/tidwall/gjson v1.14.2 + github.com/tidwall/gjson v1.14.3 github.com/xdg/scram v1.0.5 github.com/xhit/go-str2duration/v2 v2.0.0 github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a go.mongodb.org/mongo-driver v1.10.1 - google.golang.org/api v0.91.0 - google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 - google.golang.org/grpc v1.48.0 + google.golang.org/api v0.94.0 + google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf + google.golang.org/grpc v1.49.0 google.golang.org/protobuf v1.28.1 k8s.io/api v0.24.3 k8s.io/apimachinery v0.24.3 @@ -70,7 +69,7 @@ require ( k8s.io/klog/v2 v2.70.2-0.20220707122935-0990e81f1a8f k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 k8s.io/metrics v0.24.3 - knative.dev/pkg v0.0.0-20220805012121-7b8b06028e4f + knative.dev/pkg v0.0.0-20220826162920-93b66e6a8700 sigs.k8s.io/controller-runtime v0.12.3 sigs.k8s.io/custom-metrics-apiserver v1.24.0 ) @@ -150,11 +149,11 @@ require ( github.com/gobwas/pool v0.2.1 // indirect github.com/gofrs/uuid v4.2.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt v3.2.2+incompatible // indirect - github.com/golang-jwt/jwt/v4 v4.2.0 // indirect + github.com/golang-jwt/jwt/v4 v4.4.2 // indirect github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect github.com/golang-sql/sqlexp v0.1.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/gnostic v0.6.9 // indirect github.com/google/go-querystring v1.1.0 // indirect @@ -178,24 +177,24 @@ require ( github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect github.com/hashicorp/go-sockaddr v1.0.2 // indirect - github.com/hashicorp/go-uuid v1.0.2 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.4.0 // indirect github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hashicorp/vault/sdk v0.5.1 // indirect + github.com/hashicorp/vault/sdk v0.5.3 // indirect github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect - github.com/jcmturner/gofork v1.0.0 // indirect - github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect + github.com/jcmturner/gofork v1.7.6 // indirect + github.com/jcmturner/gokrb5/v8 v8.4.3 // indirect github.com/jcmturner/rpc/v2 v2.0.3 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.15.8 // indirect + github.com/klauspost/compress v1.15.9 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/leodido/go-urn v1.2.1 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -222,7 +221,7 @@ require ( github.com/pierrec/lz4/v4 v4.1.15 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sirupsen/logrus v1.8.1 // indirect github.com/spf13/cobra v1.4.0 // indirect @@ -260,10 +259,10 @@ require ( go.uber.org/zap v1.19.1 // indirect golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect - golang.org/x/net v0.0.0-20220708220712-1185a9018129 // indirect - golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect - golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect - golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect + golang.org/x/net v0.0.0-20220809184613-07c6da5e1ced // indirect + golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 // indirect + golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect + golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect diff --git a/go.sum b/go.sum index a0dd1c5e6ed..028319c434a 100644 --- a/go.sum +++ b/go.sum @@ -42,15 +42,16 @@ cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJW cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0 h1:v/k9Eueb8aAJ0vZuxKMrgm6kPhCLZU9HxFU+AFDs9Uk= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= +cloud.google.com/go/compute v1.9.0 h1:ED/FP4xv8GJw63v556/ASNc1CeeLUO2Bs8nzaHchkHg= +cloud.google.com/go/compute v1.9.0/go.mod h1:lWv1h/zUWTm/LozzfTJhBSkd6ShQq8la8VeeuOEGxfY= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= cloud.google.com/go/iam v0.3.0 h1:exkAomrVUuzx9kWFI1wm3KI0uoDeUFPB4kKGzx6x+Gc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/monitoring v1.5.0 h1:ZltYv8e69fJVga7RTthUBGdx4+Pwz6GRF1V3zylERl4= -cloud.google.com/go/monitoring v1.5.0/go.mod h1:/o9y8NYX5j91JjD/JvGLYbi86kL11OjyJXq2XziLJu4= +cloud.google.com/go/monitoring v1.6.0 h1:+x5AA2mFkiHK/ySN6NWKbeKBV+Z/DN+h51kBzcW08zU= +cloud.google.com/go/monitoring v1.6.0/go.mod h1:w+OY1TYCk4MtvY7WfEHlIp5mP8SV/gDSqOsvGhVa2KM= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -62,8 +63,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.18.2/go.mod h1:AiIj7BWXyhO5gGVmYJ+S8tbkCx3yb0IMjua8Aw4naVM= cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= -cloud.google.com/go/storage v1.24.0 h1:a4N0gIkx83uoVFGz8B2eAV3OhN90QoWF5OZWLKl39ig= -cloud.google.com/go/storage v1.24.0/go.mod h1:3xrJEFMXBsQLgxwThyjuD3aYlroL0TMRec1ypGUQ0KE= +cloud.google.com/go/storage v1.26.0 h1:lYAGjknyDJirSzfwUlkv4Nsnj7od7foxQNH/fqZqles= +cloud.google.com/go/storage v1.26.0/go.mod h1:mk/N7YwIKEWyTvXAWQCIeiCTdLoRH6Pd5xmSnolQLTI= code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c h1:5eeuG0BHx1+DHeT3AP+ISKZ2ht1UjGhm581ljqYpVeQ= code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c/go.mod h1:QD9Lzhd/ux6eNQVUDVRJX/RKTigpewimNYBi7ivZKY8= contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d/go.mod h1:IshRmMJBhDfFj5Y67nVhMYTTIze91RUeT73ipWKs/GY= @@ -142,8 +143,8 @@ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.3 h1:TsFCaaF5tR4XN8b4zLVl/J4qMb0nf80Q4CXcpXDNJDY= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.3/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +github.com/AzureAD/microsoft-authentication-library-for-go v0.6.1 h1:kRc29H9uRZ6dAcxi9g1YRjMcm1tE4Fc8n1zhfYqsOf0= +github.com/AzureAD/microsoft-authentication-library-for-go v0.6.1/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -164,8 +165,8 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/sarama v1.30.0/go.mod h1:zujlQQx1kzHsh4jfV1USnptCQrHAEZ2Hk8fTKCulPVs= -github.com/Shopify/sarama v1.35.0 h1:opEGHcK8s5OpQF99wW0D4ol7A3qUpfSFigrDXnWmOcs= -github.com/Shopify/sarama v1.35.0/go.mod h1:n8obse6Cz5NjjXjKwR1JeYr7CkQn4KG+HENJ8n/T9oQ= +github.com/Shopify/sarama v1.36.0 h1:0OJs3eCcnezkWniVjwBbCJVaa0B1k7ImCRS3WN6NsSk= +github.com/Shopify/sarama v1.36.0/go.mod h1:9glG3eX83tgVYJ5aVtrjVUnEsOPqQIBGx1BWfN+X51I= github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/Shopify/toxiproxy/v2 v2.1.6-0.20210914104332-15ea381dcdae/go.mod h1:/cvHQkZ1fst0EmZnA5dFtiQdWCNCFYzb+uE2vqVgvx0= @@ -191,8 +192,8 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.44.70 h1:wrwAbqJqf+ncEK1F/bXTYpgO6zXIgQXi/2ppBgmYI9g= -github.com/aws/aws-sdk-go v1.44.70/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= +github.com/aws/aws-sdk-go v1.44.88 h1:9jhiZsTx9koQQsM29RTgwI0g4mfyphCdc3bkUcKrdwA= +github.com/aws/aws-sdk-go v1.44.88/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= @@ -435,13 +436,11 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= +github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A= @@ -572,8 +571,8 @@ github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/gophercloud/gophercloud v0.25.0 h1:C3Oae7y0fUVQGSsBrb3zliAjdX+riCSEh4lNMejFNI4= -github.com/gophercloud/gophercloud v0.25.0/go.mod h1:Q8fZtyi5zZxPS/j9aj3sSxtvj41AdQMDwyo1myduD5c= +github.com/gophercloud/gophercloud v1.0.0 h1:9nTGx0jizmHxDobe4mck89FyQHVyA3CaXLIUSGJjP9k= +github.com/gophercloud/gophercloud v1.0.0/go.mod h1:Q8fZtyi5zZxPS/j9aj3sSxtvj41AdQMDwyo1myduD5c= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -644,8 +643,9 @@ github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjG github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4= github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= @@ -662,8 +662,9 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/vault/api v1.7.2 h1:kawHE7s/4xwrdKbkmwQi0wYaIeUhk5ueek7ljuezCVQ= github.com/hashicorp/vault/api v1.7.2/go.mod h1:xbfA+1AvxFseDzxxdWaL0uO99n1+tndus4GCrtouy0M= -github.com/hashicorp/vault/sdk v0.5.1 h1:zly/TmNgOXCGgWIRA8GojyXzG817POtVh3uzIwzZx+8= github.com/hashicorp/vault/sdk v0.5.1/go.mod h1:DoGraE9kKGNcVgPmTuX357Fm6WAx1Okvde8Vp3dPDoU= +github.com/hashicorp/vault/sdk v0.5.3 h1:PWY8sq/9pRrK9vUIy75qCH2Jd8oeENAgkaa/qbhzFrs= +github.com/hashicorp/vault/sdk v0.5.3/go.mod h1:DoGraE9kKGNcVgPmTuX357Fm6WAx1Okvde8Vp3dPDoU= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 h1:xixZ2bWeofWV68J+x6AzmKuVM/JWCQwkWm6GW/MUR6I= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= @@ -676,8 +677,8 @@ github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/influxdb-client-go/v2 v2.9.2 h1:Ikx1PGrowBjDdrREGfptotebzaLFmAAWv6Wq4hSdvcI= -github.com/influxdata/influxdb-client-go/v2 v2.9.2/go.mod h1:x7Jo5UHHl+w8wu8UnGiNobDDHygojXwJX4mx7rXGKMk= +github.com/influxdata/influxdb-client-go/v2 v2.10.0 h1:bWCwNsp0KxBioW9PTG7LPk7/uXj2auHezuUMpztbpZY= +github.com/influxdata/influxdb-client-go/v2 v2.10.0/go.mod h1:x7Jo5UHHl+w8wu8UnGiNobDDHygojXwJX4mx7rXGKMk= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839 h1:W9WBk7wlPfJLvMCdtV4zPulc4uCPrlywQOmbFOhgQNU= github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839/go.mod h1:xaLFMmpvUxqXtVkUJfg9QmT88cDaCJ3ZKgdZ78oO8Qo= github.com/influxdata/tdigest v0.0.0-20180711151920-a7d76c6f093a/go.mod h1:9GkyshztGufsdPQWjH+ifgnIr3xNUL5syI70g2dzU1o= @@ -685,12 +686,14 @@ github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFK github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= -github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg= +github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= -github.com/jcmturner/gokrb5/v8 v8.4.2 h1:6ZIM6b/JJN0X8UM43ZOM6Z4SJzla+a/u7scXFJzodkA= github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= +github.com/jcmturner/gokrb5/v8 v8.4.3 h1:iTonLeSJOn7MVUtyMT+arAn5AKAPrkilzhGw8wE/Tq8= +github.com/jcmturner/gokrb5/v8 v8.4.3/go.mod h1:dqRwJGXznQrzw6cWmyo6kH+E7jksEQG/CyVWsJEsJO0= github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -732,8 +735,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.8 h1:JahtItbkWjf2jzm/T+qgMxkP9EMHsqEUA6vCMGmXvhA= -github.com/klauspost/compress v1.15.8/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.9 h1:wKRjX6JRtDdrE9qwa4b/Cip7ACOshUI4smpCQanqjSY= +github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -838,8 +841,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/newrelic/newrelic-client-go v0.89.0 h1:XqRY6Oi2+DqVjQ7RqPkHUJq0KLKSw9GT9pxEDBvQ4uQ= -github.com/newrelic/newrelic-client-go v0.89.0/go.mod h1:RYMXt7hgYw7nzuXIGd2BH0F1AivgWw7WrBhNBQZEB4k= +github.com/newrelic/newrelic-client-go v0.91.0 h1:C4X4JaStHa6T6PMCBBz4SfMO6LCfrtYqpPeU/Fqfi7E= +github.com/newrelic/newrelic-client-go v0.91.0/go.mod h1:RYMXt7hgYw7nzuXIGd2BH0F1AivgWw7WrBhNBQZEB4k= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= @@ -871,8 +874,8 @@ github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.20.0 h1:8W0cWlwFkflGPLltQvLRB7ZVD5HuP6ng320w2IS245Q= -github.com/onsi/gomega v1.20.0/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= +github.com/onsi/gomega v1.20.1 h1:PA/3qinGoukvymdIDV8pii6tiZgC8kbmJO6Z5+b002Q= +github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.3.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ= @@ -912,8 +915,8 @@ github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -935,8 +938,9 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/statsd_exporter v0.21.0/go.mod h1:rbT83sZq2V+p73lHhPZfMc3MLCHmSHelCh9hSGYNLTQ= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rabbitmq/amqp091-go v1.1.0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= @@ -1011,8 +1015,8 @@ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PK github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= -github.com/tidwall/gjson v1.14.2 h1:6BBkirS0rAHjumnjHF6qgy5d2YAJ1TLIaFE2lzfOLqo= -github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.14.3 h1:9jvXn7olKEHU1S9vwoMGliaT8jq1vJ7IH/n9zD9Dnlw= +github.com/tidwall/gjson v1.14.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -1249,10 +1253,10 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220708220712-1185a9018129 h1:vucSRfWwTsoXro7P+3Cjlr6flUMtzCwzlvkxEQtHHB0= -golang.org/x/net v0.0.0-20220708220712-1185a9018129/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220725212005-46097bf591d3/go.mod h1:AaygXjzTFtRAg2ttMY5RMuhpJ3cNnI0XpyFJD1iQRSM= +golang.org/x/net v0.0.0-20220809184613-07c6da5e1ced h1:3dYNDff0VT5xj+mbj2XucFst9WKk6PdGOrb9n+SbIvw= +golang.org/x/net v0.0.0-20220809184613-07c6da5e1ced/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= 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= @@ -1275,8 +1279,9 @@ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 h1:+jnHzr9VPj32ykQVai5DNahi9+NSp7yYuCsl5eAQtL0= golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 h1:2o1E+E8TpNLklK9nHiPiK1uzIYrIHt+cQx3ynCwq9V8= +golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1288,8 +1293,9 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1384,9 +1390,10 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/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-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/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-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1522,9 +1529,9 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= -google.golang.org/api v0.91.0 h1:731+JzuwaJoZXRQGmPoBiV+SrsAfUaIkdMCWTcQNPyA= google.golang.org/api v0.91.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.94.0 h1:KtKM9ru3nzQioV1HLlUf1cR7vMYJIpgls5VhAYQXIwA= +google.golang.org/api v0.94.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1622,8 +1629,11 @@ google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58 h1:sRT5xdTkj1Kbk30qbYC7VyMj73N5pZYsw6v+Nrzdhno= -google.golang.org/genproto v0.0.0-20220805133916-01dd62135a58/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220804142021-4e6b2dfa6612/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220808131553-a91ffa7f803e/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc= +google.golang.org/genproto v0.0.0-20220810155839-1856144b1d9c/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf h1:Q5xNKbTSFwkuaaGaR7CMcXEM5sy19KYdUU8iF8/iRC0= +google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1659,8 +1669,9 @@ google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11 google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w= google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= +google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= +google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1777,9 +1788,9 @@ k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/ k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed h1:jAne/RjBTyawwAy0utX5eqigAwz/lQhTmy+Hr/Cpue4= k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -knative.dev/hack v0.0.0-20220725145124-782bbaabb8a1/go.mod h1:t/azP8I/Cygaw+87O7rkAPrNRjCelmtfSzWzu/9TM7I= -knative.dev/pkg v0.0.0-20220805012121-7b8b06028e4f h1:kW4K5SsjZ7qMzM8TCqHdDmpv0xKN4Jje4BXhDcByFUI= -knative.dev/pkg v0.0.0-20220805012121-7b8b06028e4f/go.mod h1:nBMKMJvyoaJdkpUrjwLVs/DwaP6d73R3UkXK6lblJyE= +knative.dev/hack v0.0.0-20220823140917-8d1e4ccf9dc3/go.mod h1:t/azP8I/Cygaw+87O7rkAPrNRjCelmtfSzWzu/9TM7I= +knative.dev/pkg v0.0.0-20220826162920-93b66e6a8700 h1:6xjS69vf5Pbwu+dWckqPALmm5pc3p0/XScPpRBhugRc= +knative.dev/pkg v0.0.0-20220826162920-93b66e6a8700/go.mod h1:WIQZyPTLzT+z0V3/gB91aWugIi3E1mkU9rjCrLfjOwY= nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= diff --git a/pkg/scalers/azure/azure_aad_workload_identity.go b/pkg/scalers/azure/azure_aad_workload_identity.go index 24e16bb3bf2..1dc83d72eda 100644 --- a/pkg/scalers/azure/azure_aad_workload_identity.go +++ b/pkg/scalers/azure/azure_aad_workload_identity.go @@ -59,11 +59,14 @@ func GetAzureADWorkloadIdentityToken(ctx context.Context, identityID, resource s return AADToken{}, fmt.Errorf("error reading service account token - %w", err) } - cred, err := confidential.NewCredFromAssertion(signedAssertion) - if err != nil { - return AADToken{}, fmt.Errorf("error getting credentials from service account token - %w", err) + if signedAssertion == "" { + return AADToken{}, fmt.Errorf("assertion can't be empty string") } + cred := confidential.NewCredFromAssertionCallback(func(context.Context, confidential.AssertionRequestOptions) (string, error) { + return signedAssertion, nil + }) + authorityOption := confidential.WithAuthority(fmt.Sprintf("%s%s/oauth2/token", authorityHost, tenantID)) confidentialClient, err := confidential.New( clientID, diff --git a/pkg/scalers/external_scaler.go b/pkg/scalers/external_scaler.go index 9c4591e81f0..8b6c7df644e 100644 --- a/pkg/scalers/external_scaler.go +++ b/pkg/scalers/external_scaler.go @@ -228,7 +228,7 @@ func (s *externalPushScaler) Run(ctx context.Context, active chan<- bool) { s.logger.Error(err, "error running internalRun") return } - if err := handleIsActiveStream(ctx, s.scaledObjectRef, grpcClient, active); err != nil { + if err := handleIsActiveStream(ctx, &s.scaledObjectRef, grpcClient, active); err != nil { s.logger.Error(err, "error running internalRun") return } @@ -264,8 +264,8 @@ func (s *externalPushScaler) Run(ctx context.Context, active chan<- bool) { } // handleIsActiveStream calls blocks on a stream call from the GRPC server. It'll only terminate on error, stream completion, or ctx cancellation. -func handleIsActiveStream(ctx context.Context, scaledObjectRef pb.ScaledObjectRef, grpcClient pb.ExternalScalerClient, active chan<- bool) error { - stream, err := grpcClient.StreamIsActive(ctx, &scaledObjectRef) +func handleIsActiveStream(ctx context.Context, scaledObjectRef *pb.ScaledObjectRef, grpcClient pb.ExternalScalerClient, active chan<- bool) error { + stream, err := grpcClient.StreamIsActive(ctx, scaledObjectRef) if err != nil { return err } diff --git a/pkg/scalers/external_scaler_test.go b/pkg/scalers/external_scaler_test.go index dde0e680281..ec10b67b5b1 100644 --- a/pkg/scalers/external_scaler_test.go +++ b/pkg/scalers/external_scaler_test.go @@ -141,6 +141,9 @@ func createIsActiveChannels(count int) []chan bool { } type testExternalScaler struct { + // Embed the unimplemented server + pb.UnimplementedExternalScalerServer + t *testing.T active chan bool } diff --git a/pkg/scalers/externalscaler/externalscaler.pb.go b/pkg/scalers/externalscaler/externalscaler.pb.go index c01bc76e674..aef3090f6a5 100644 --- a/pkg/scalers/externalscaler/externalscaler.pb.go +++ b/pkg/scalers/externalscaler/externalscaler.pb.go @@ -1,599 +1,622 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc v3.20.1 // source: externalscaler.proto package externalscaler import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) type ScaledObjectRef struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` - ScalerMetadata map[string]string `protobuf:"bytes,3,rep,name=scalerMetadata,proto3" json:"scalerMetadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ScaledObjectRef) Reset() { *m = ScaledObjectRef{} } -func (m *ScaledObjectRef) String() string { return proto.CompactTextString(m) } -func (*ScaledObjectRef) ProtoMessage() {} -func (*ScaledObjectRef) Descriptor() ([]byte, []int) { - return fileDescriptor_3d382708546499d1, []int{0} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + ScalerMetadata map[string]string `protobuf:"bytes,3,rep,name=scalerMetadata,proto3" json:"scalerMetadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } -func (m *ScaledObjectRef) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ScaledObjectRef.Unmarshal(m, b) -} -func (m *ScaledObjectRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ScaledObjectRef.Marshal(b, m, deterministic) -} -func (m *ScaledObjectRef) XXX_Merge(src proto.Message) { - xxx_messageInfo_ScaledObjectRef.Merge(m, src) +func (x *ScaledObjectRef) Reset() { + *x = ScaledObjectRef{} + if protoimpl.UnsafeEnabled { + mi := &file_externalscaler_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ScaledObjectRef) XXX_Size() int { - return xxx_messageInfo_ScaledObjectRef.Size(m) + +func (x *ScaledObjectRef) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ScaledObjectRef) XXX_DiscardUnknown() { - xxx_messageInfo_ScaledObjectRef.DiscardUnknown(m) + +func (*ScaledObjectRef) ProtoMessage() {} + +func (x *ScaledObjectRef) ProtoReflect() protoreflect.Message { + mi := &file_externalscaler_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_ScaledObjectRef proto.InternalMessageInfo +// Deprecated: Use ScaledObjectRef.ProtoReflect.Descriptor instead. +func (*ScaledObjectRef) Descriptor() ([]byte, []int) { + return file_externalscaler_proto_rawDescGZIP(), []int{0} +} -func (m *ScaledObjectRef) GetName() string { - if m != nil { - return m.Name +func (x *ScaledObjectRef) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *ScaledObjectRef) GetNamespace() string { - if m != nil { - return m.Namespace +func (x *ScaledObjectRef) GetNamespace() string { + if x != nil { + return x.Namespace } return "" } -func (m *ScaledObjectRef) GetScalerMetadata() map[string]string { - if m != nil { - return m.ScalerMetadata +func (x *ScaledObjectRef) GetScalerMetadata() map[string]string { + if x != nil { + return x.ScalerMetadata } return nil } type IsActiveResponse struct { - Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *IsActiveResponse) Reset() { *m = IsActiveResponse{} } -func (m *IsActiveResponse) String() string { return proto.CompactTextString(m) } -func (*IsActiveResponse) ProtoMessage() {} -func (*IsActiveResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3d382708546499d1, []int{1} + Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` } -func (m *IsActiveResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_IsActiveResponse.Unmarshal(m, b) -} -func (m *IsActiveResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_IsActiveResponse.Marshal(b, m, deterministic) -} -func (m *IsActiveResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_IsActiveResponse.Merge(m, src) +func (x *IsActiveResponse) Reset() { + *x = IsActiveResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_externalscaler_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *IsActiveResponse) XXX_Size() int { - return xxx_messageInfo_IsActiveResponse.Size(m) + +func (x *IsActiveResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *IsActiveResponse) XXX_DiscardUnknown() { - xxx_messageInfo_IsActiveResponse.DiscardUnknown(m) + +func (*IsActiveResponse) ProtoMessage() {} + +func (x *IsActiveResponse) ProtoReflect() protoreflect.Message { + mi := &file_externalscaler_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_IsActiveResponse proto.InternalMessageInfo +// Deprecated: Use IsActiveResponse.ProtoReflect.Descriptor instead. +func (*IsActiveResponse) Descriptor() ([]byte, []int) { + return file_externalscaler_proto_rawDescGZIP(), []int{1} +} -func (m *IsActiveResponse) GetResult() bool { - if m != nil { - return m.Result +func (x *IsActiveResponse) GetResult() bool { + if x != nil { + return x.Result } return false } type GetMetricSpecResponse struct { - MetricSpecs []*MetricSpec `protobuf:"bytes,1,rep,name=metricSpecs,proto3" json:"metricSpecs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *GetMetricSpecResponse) Reset() { *m = GetMetricSpecResponse{} } -func (m *GetMetricSpecResponse) String() string { return proto.CompactTextString(m) } -func (*GetMetricSpecResponse) ProtoMessage() {} -func (*GetMetricSpecResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3d382708546499d1, []int{2} + MetricSpecs []*MetricSpec `protobuf:"bytes,1,rep,name=metricSpecs,proto3" json:"metricSpecs,omitempty"` } -func (m *GetMetricSpecResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetMetricSpecResponse.Unmarshal(m, b) -} -func (m *GetMetricSpecResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetMetricSpecResponse.Marshal(b, m, deterministic) -} -func (m *GetMetricSpecResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetMetricSpecResponse.Merge(m, src) -} -func (m *GetMetricSpecResponse) XXX_Size() int { - return xxx_messageInfo_GetMetricSpecResponse.Size(m) +func (x *GetMetricSpecResponse) Reset() { + *x = GetMetricSpecResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_externalscaler_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetMetricSpecResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetMetricSpecResponse.DiscardUnknown(m) + +func (x *GetMetricSpecResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_GetMetricSpecResponse proto.InternalMessageInfo +func (*GetMetricSpecResponse) ProtoMessage() {} -func (m *GetMetricSpecResponse) GetMetricSpecs() []*MetricSpec { - if m != nil { - return m.MetricSpecs +func (x *GetMetricSpecResponse) ProtoReflect() protoreflect.Message { + mi := &file_externalscaler_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil -} - -type MetricSpec struct { - MetricName string `protobuf:"bytes,1,opt,name=metricName,proto3" json:"metricName,omitempty"` - TargetSize int64 `protobuf:"varint,2,opt,name=targetSize,proto3" json:"targetSize,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + return mi.MessageOf(x) } -func (m *MetricSpec) Reset() { *m = MetricSpec{} } -func (m *MetricSpec) String() string { return proto.CompactTextString(m) } -func (*MetricSpec) ProtoMessage() {} -func (*MetricSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_3d382708546499d1, []int{3} +// Deprecated: Use GetMetricSpecResponse.ProtoReflect.Descriptor instead. +func (*GetMetricSpecResponse) Descriptor() ([]byte, []int) { + return file_externalscaler_proto_rawDescGZIP(), []int{2} } -func (m *MetricSpec) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MetricSpec.Unmarshal(m, b) -} -func (m *MetricSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MetricSpec.Marshal(b, m, deterministic) -} -func (m *MetricSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricSpec.Merge(m, src) -} -func (m *MetricSpec) XXX_Size() int { - return xxx_messageInfo_MetricSpec.Size(m) -} -func (m *MetricSpec) XXX_DiscardUnknown() { - xxx_messageInfo_MetricSpec.DiscardUnknown(m) +func (x *GetMetricSpecResponse) GetMetricSpecs() []*MetricSpec { + if x != nil { + return x.MetricSpecs + } + return nil } -var xxx_messageInfo_MetricSpec proto.InternalMessageInfo +type MetricSpec struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *MetricSpec) GetMetricName() string { - if m != nil { - return m.MetricName - } - return "" + MetricName string `protobuf:"bytes,1,opt,name=metricName,proto3" json:"metricName,omitempty"` + TargetSize int64 `protobuf:"varint,2,opt,name=targetSize,proto3" json:"targetSize,omitempty"` } -func (m *MetricSpec) GetTargetSize() int64 { - if m != nil { - return m.TargetSize +func (x *MetricSpec) Reset() { + *x = MetricSpec{} + if protoimpl.UnsafeEnabled { + mi := &file_externalscaler_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return 0 } -type GetMetricsRequest struct { - ScaledObjectRef *ScaledObjectRef `protobuf:"bytes,1,opt,name=scaledObjectRef,proto3" json:"scaledObjectRef,omitempty"` - MetricName string `protobuf:"bytes,2,opt,name=metricName,proto3" json:"metricName,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *MetricSpec) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetMetricsRequest) Reset() { *m = GetMetricsRequest{} } -func (m *GetMetricsRequest) String() string { return proto.CompactTextString(m) } -func (*GetMetricsRequest) ProtoMessage() {} -func (*GetMetricsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3d382708546499d1, []int{4} -} +func (*MetricSpec) ProtoMessage() {} -func (m *GetMetricsRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetMetricsRequest.Unmarshal(m, b) -} -func (m *GetMetricsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetMetricsRequest.Marshal(b, m, deterministic) -} -func (m *GetMetricsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetMetricsRequest.Merge(m, src) -} -func (m *GetMetricsRequest) XXX_Size() int { - return xxx_messageInfo_GetMetricsRequest.Size(m) -} -func (m *GetMetricsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetMetricsRequest.DiscardUnknown(m) +func (x *MetricSpec) ProtoReflect() protoreflect.Message { + mi := &file_externalscaler_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -var xxx_messageInfo_GetMetricsRequest proto.InternalMessageInfo - -func (m *GetMetricsRequest) GetScaledObjectRef() *ScaledObjectRef { - if m != nil { - return m.ScaledObjectRef - } - return nil +// Deprecated: Use MetricSpec.ProtoReflect.Descriptor instead. +func (*MetricSpec) Descriptor() ([]byte, []int) { + return file_externalscaler_proto_rawDescGZIP(), []int{3} } -func (m *GetMetricsRequest) GetMetricName() string { - if m != nil { - return m.MetricName +func (x *MetricSpec) GetMetricName() string { + if x != nil { + return x.MetricName } return "" } -type GetMetricsResponse struct { - MetricValues []*MetricValue `protobuf:"bytes,1,rep,name=metricValues,proto3" json:"metricValues,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *MetricSpec) GetTargetSize() int64 { + if x != nil { + return x.TargetSize + } + return 0 } -func (m *GetMetricsResponse) Reset() { *m = GetMetricsResponse{} } -func (m *GetMetricsResponse) String() string { return proto.CompactTextString(m) } -func (*GetMetricsResponse) ProtoMessage() {} -func (*GetMetricsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3d382708546499d1, []int{5} -} +type GetMetricsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *GetMetricsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetMetricsResponse.Unmarshal(m, b) -} -func (m *GetMetricsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetMetricsResponse.Marshal(b, m, deterministic) -} -func (m *GetMetricsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetMetricsResponse.Merge(m, src) -} -func (m *GetMetricsResponse) XXX_Size() int { - return xxx_messageInfo_GetMetricsResponse.Size(m) -} -func (m *GetMetricsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetMetricsResponse.DiscardUnknown(m) + ScaledObjectRef *ScaledObjectRef `protobuf:"bytes,1,opt,name=scaledObjectRef,proto3" json:"scaledObjectRef,omitempty"` + MetricName string `protobuf:"bytes,2,opt,name=metricName,proto3" json:"metricName,omitempty"` } -var xxx_messageInfo_GetMetricsResponse proto.InternalMessageInfo - -func (m *GetMetricsResponse) GetMetricValues() []*MetricValue { - if m != nil { - return m.MetricValues +func (x *GetMetricsRequest) Reset() { + *x = GetMetricsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_externalscaler_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return nil -} - -type MetricValue struct { - MetricName string `protobuf:"bytes,1,opt,name=metricName,proto3" json:"metricName,omitempty"` - MetricValue int64 `protobuf:"varint,2,opt,name=metricValue,proto3" json:"metricValue,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MetricValue) Reset() { *m = MetricValue{} } -func (m *MetricValue) String() string { return proto.CompactTextString(m) } -func (*MetricValue) ProtoMessage() {} -func (*MetricValue) Descriptor() ([]byte, []int) { - return fileDescriptor_3d382708546499d1, []int{6} } -func (m *MetricValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MetricValue.Unmarshal(m, b) -} -func (m *MetricValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MetricValue.Marshal(b, m, deterministic) -} -func (m *MetricValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricValue.Merge(m, src) -} -func (m *MetricValue) XXX_Size() int { - return xxx_messageInfo_MetricValue.Size(m) -} -func (m *MetricValue) XXX_DiscardUnknown() { - xxx_messageInfo_MetricValue.DiscardUnknown(m) +func (x *GetMetricsRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_MetricValue proto.InternalMessageInfo +func (*GetMetricsRequest) ProtoMessage() {} -func (m *MetricValue) GetMetricName() string { - if m != nil { - return m.MetricName +func (x *GetMetricsRequest) ProtoReflect() protoreflect.Message { + mi := &file_externalscaler_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return "" + return mi.MessageOf(x) } -func (m *MetricValue) GetMetricValue() int64 { - if m != nil { - return m.MetricValue - } - return 0 +// Deprecated: Use GetMetricsRequest.ProtoReflect.Descriptor instead. +func (*GetMetricsRequest) Descriptor() ([]byte, []int) { + return file_externalscaler_proto_rawDescGZIP(), []int{4} } -func init() { - proto.RegisterType((*ScaledObjectRef)(nil), "externalscaler.ScaledObjectRef") - proto.RegisterMapType((map[string]string)(nil), "externalscaler.ScaledObjectRef.ScalerMetadataEntry") - proto.RegisterType((*IsActiveResponse)(nil), "externalscaler.IsActiveResponse") - proto.RegisterType((*GetMetricSpecResponse)(nil), "externalscaler.GetMetricSpecResponse") - proto.RegisterType((*MetricSpec)(nil), "externalscaler.MetricSpec") - proto.RegisterType((*GetMetricsRequest)(nil), "externalscaler.GetMetricsRequest") - proto.RegisterType((*GetMetricsResponse)(nil), "externalscaler.GetMetricsResponse") - proto.RegisterType((*MetricValue)(nil), "externalscaler.MetricValue") -} - -func init() { proto.RegisterFile("externalscaler.proto", fileDescriptor_3d382708546499d1) } - -var fileDescriptor_3d382708546499d1 = []byte{ - // 442 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xdf, 0x6b, 0xd4, 0x40, - 0x10, 0x6e, 0x12, 0x2d, 0xed, 0x44, 0xd3, 0x73, 0xac, 0x12, 0xa2, 0x68, 0x5c, 0x10, 0x8a, 0x0f, - 0x87, 0x5c, 0x5f, 0x44, 0x05, 0xa9, 0x50, 0xa4, 0x60, 0x3d, 0xd8, 0x70, 0x15, 0xf5, 0x69, 0x9b, - 0x8e, 0x72, 0x9a, 0xcb, 0xc5, 0xdd, 0xbd, 0xe2, 0xf9, 0xe0, 0x3f, 0xeb, 0xab, 0x7f, 0x84, 0xe4, - 0x77, 0xb2, 0x9c, 0xe6, 0xa5, 0x4f, 0xd9, 0x9d, 0xf9, 0xe6, 0xdb, 0x99, 0x6f, 0x3e, 0x02, 0xfb, - 0xf4, 0x43, 0x93, 0x4c, 0x45, 0xa2, 0x62, 0x91, 0x90, 0x1c, 0x67, 0x72, 0xa9, 0x97, 0xe8, 0xf5, - 0xa3, 0xec, 0xb7, 0x05, 0x7b, 0x51, 0x7e, 0xbc, 0x98, 0x9e, 0x7f, 0xa5, 0x58, 0x73, 0xfa, 0x8c, - 0x08, 0xd7, 0x52, 0xb1, 0x20, 0xdf, 0x0a, 0xad, 0x83, 0x5d, 0x5e, 0x9c, 0xf1, 0x3e, 0xec, 0xe6, - 0x5f, 0x95, 0x89, 0x98, 0x7c, 0xbb, 0x48, 0xb4, 0x01, 0xfc, 0x04, 0x5e, 0xc9, 0x77, 0x4a, 0x5a, - 0x5c, 0x08, 0x2d, 0x7c, 0x27, 0x74, 0x0e, 0xdc, 0xc9, 0xe1, 0xd8, 0x68, 0xc2, 0x78, 0xaa, 0xbc, - 0x37, 0x55, 0xc7, 0xa9, 0x96, 0x6b, 0x6e, 0x50, 0x05, 0x47, 0x70, 0x7b, 0x03, 0x0c, 0x47, 0xe0, - 0x7c, 0xa3, 0x75, 0xd5, 0x64, 0x7e, 0xc4, 0x7d, 0xb8, 0x7e, 0x29, 0x92, 0x55, 0xdd, 0x5f, 0x79, - 0x79, 0x6e, 0x3f, 0xb3, 0xd8, 0x13, 0x18, 0x9d, 0xa8, 0xa3, 0x58, 0xcf, 0x2f, 0x89, 0x93, 0xca, - 0x96, 0xa9, 0x22, 0xbc, 0x0b, 0xdb, 0x92, 0xd4, 0x2a, 0xd1, 0x05, 0xc5, 0x0e, 0xaf, 0x6e, 0x6c, - 0x06, 0x77, 0xde, 0x90, 0x3e, 0x25, 0x2d, 0xe7, 0x71, 0x94, 0x51, 0xdc, 0x14, 0xbc, 0x04, 0x77, - 0xd1, 0x44, 0x95, 0x6f, 0x15, 0x13, 0x06, 0xe6, 0x84, 0x9d, 0xc2, 0x2e, 0x9c, 0xbd, 0x05, 0x68, - 0x53, 0xf8, 0x00, 0xa0, 0x4c, 0xbe, 0x6b, 0x85, 0xee, 0x44, 0xf2, 0xbc, 0x16, 0xf2, 0x0b, 0xe9, - 0x68, 0xfe, 0xb3, 0x9c, 0xc7, 0xe1, 0x9d, 0x08, 0xfb, 0x05, 0xb7, 0x9a, 0x26, 0x15, 0xa7, 0xef, - 0x2b, 0x52, 0x1a, 0x4f, 0x60, 0x4f, 0xf5, 0xf5, 0x2d, 0x98, 0xdd, 0xc9, 0xc3, 0x81, 0x35, 0x70, - 0xb3, 0xce, 0xe8, 0xcf, 0x36, 0xfb, 0x63, 0x33, 0xc0, 0xee, 0xfb, 0x95, 0x42, 0xaf, 0xe0, 0x46, - 0x89, 0x39, 0xcb, 0x95, 0xaf, 0x25, 0xba, 0xb7, 0x59, 0xa2, 0x02, 0xc3, 0x7b, 0x05, 0x6c, 0x0a, - 0x6e, 0x27, 0x39, 0xa8, 0x52, 0x58, 0x6f, 0xe4, 0xac, 0x59, 0xbb, 0xc3, 0xbb, 0xa1, 0xc9, 0x1f, - 0x1b, 0xbc, 0xe3, 0xea, 0xf5, 0xd2, 0x44, 0x38, 0x85, 0x9d, 0xda, 0x0b, 0x38, 0x24, 0x4c, 0x10, - 0x9a, 0x00, 0xd3, 0x46, 0x6c, 0x0b, 0xdf, 0x83, 0x17, 0x69, 0x49, 0x62, 0x71, 0xa5, 0xb4, 0x4f, - 0x2d, 0xfc, 0x00, 0x37, 0x7b, 0x4e, 0x1c, 0xe6, 0x7d, 0x6c, 0x02, 0x36, 0x3a, 0x99, 0x6d, 0xe1, - 0x0c, 0xa0, 0xdd, 0x1f, 0x3e, 0xfa, 0x67, 0x59, 0xed, 0xad, 0x80, 0xfd, 0x0f, 0x52, 0xd3, 0xbe, - 0xc6, 0x8f, 0xa3, 0xf1, 0x8b, 0x3e, 0xf0, 0x7c, 0xbb, 0xf8, 0xf1, 0x1c, 0xfe, 0x0d, 0x00, 0x00, - 0xff, 0xff, 0xdc, 0xf1, 0x73, 0xce, 0x90, 0x04, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ExternalScalerClient is the client API for ExternalScaler service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ExternalScalerClient interface { - IsActive(ctx context.Context, in *ScaledObjectRef, opts ...grpc.CallOption) (*IsActiveResponse, error) - StreamIsActive(ctx context.Context, in *ScaledObjectRef, opts ...grpc.CallOption) (ExternalScaler_StreamIsActiveClient, error) - GetMetricSpec(ctx context.Context, in *ScaledObjectRef, opts ...grpc.CallOption) (*GetMetricSpecResponse, error) - GetMetrics(ctx context.Context, in *GetMetricsRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error) -} - -type externalScalerClient struct { - cc *grpc.ClientConn -} - -func NewExternalScalerClient(cc *grpc.ClientConn) ExternalScalerClient { - return &externalScalerClient{cc} -} - -func (c *externalScalerClient) IsActive(ctx context.Context, in *ScaledObjectRef, opts ...grpc.CallOption) (*IsActiveResponse, error) { - out := new(IsActiveResponse) - err := c.cc.Invoke(ctx, "/externalscaler.ExternalScaler/IsActive", in, out, opts...) - if err != nil { - return nil, err +func (x *GetMetricsRequest) GetScaledObjectRef() *ScaledObjectRef { + if x != nil { + return x.ScaledObjectRef } - return out, nil + return nil } -func (c *externalScalerClient) StreamIsActive(ctx context.Context, in *ScaledObjectRef, opts ...grpc.CallOption) (ExternalScaler_StreamIsActiveClient, error) { - stream, err := c.cc.NewStream(ctx, &_ExternalScaler_serviceDesc.Streams[0], "/externalscaler.ExternalScaler/StreamIsActive", opts...) - if err != nil { - return nil, err - } - x := &externalScalerStreamIsActiveClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err +func (x *GetMetricsRequest) GetMetricName() string { + if x != nil { + return x.MetricName } - return x, nil + return "" } -type ExternalScaler_StreamIsActiveClient interface { - Recv() (*IsActiveResponse, error) - grpc.ClientStream -} +type GetMetricsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -type externalScalerStreamIsActiveClient struct { - grpc.ClientStream + MetricValues []*MetricValue `protobuf:"bytes,1,rep,name=metricValues,proto3" json:"metricValues,omitempty"` } -func (x *externalScalerStreamIsActiveClient) Recv() (*IsActiveResponse, error) { - m := new(IsActiveResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err +func (x *GetMetricsResponse) Reset() { + *x = GetMetricsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_externalscaler_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return m, nil } -func (c *externalScalerClient) GetMetricSpec(ctx context.Context, in *ScaledObjectRef, opts ...grpc.CallOption) (*GetMetricSpecResponse, error) { - out := new(GetMetricSpecResponse) - err := c.cc.Invoke(ctx, "/externalscaler.ExternalScaler/GetMetricSpec", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (x *GetMetricsResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (c *externalScalerClient) GetMetrics(ctx context.Context, in *GetMetricsRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error) { - out := new(GetMetricsResponse) - err := c.cc.Invoke(ctx, "/externalscaler.ExternalScaler/GetMetrics", in, out, opts...) - if err != nil { - return nil, err +func (*GetMetricsResponse) ProtoMessage() {} + +func (x *GetMetricsResponse) ProtoReflect() protoreflect.Message { + mi := &file_externalscaler_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return out, nil + return mi.MessageOf(x) } -// ExternalScalerServer is the server API for ExternalScaler service. -type ExternalScalerServer interface { - IsActive(context.Context, *ScaledObjectRef) (*IsActiveResponse, error) - StreamIsActive(*ScaledObjectRef, ExternalScaler_StreamIsActiveServer) error - GetMetricSpec(context.Context, *ScaledObjectRef) (*GetMetricSpecResponse, error) - GetMetrics(context.Context, *GetMetricsRequest) (*GetMetricsResponse, error) +// Deprecated: Use GetMetricsResponse.ProtoReflect.Descriptor instead. +func (*GetMetricsResponse) Descriptor() ([]byte, []int) { + return file_externalscaler_proto_rawDescGZIP(), []int{5} } -// UnimplementedExternalScalerServer can be embedded to have forward compatible implementations. -type UnimplementedExternalScalerServer struct { +func (x *GetMetricsResponse) GetMetricValues() []*MetricValue { + if x != nil { + return x.MetricValues + } + return nil } -func (*UnimplementedExternalScalerServer) IsActive(ctx context.Context, req *ScaledObjectRef) (*IsActiveResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IsActive not implemented") -} -func (*UnimplementedExternalScalerServer) StreamIsActive(req *ScaledObjectRef, srv ExternalScaler_StreamIsActiveServer) error { - return status.Errorf(codes.Unimplemented, "method StreamIsActive not implemented") -} -func (*UnimplementedExternalScalerServer) GetMetricSpec(ctx context.Context, req *ScaledObjectRef) (*GetMetricSpecResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMetricSpec not implemented") -} -func (*UnimplementedExternalScalerServer) GetMetrics(ctx context.Context, req *GetMetricsRequest) (*GetMetricsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMetrics not implemented") -} +type MetricValue struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func RegisterExternalScalerServer(s *grpc.Server, srv ExternalScalerServer) { - s.RegisterService(&_ExternalScaler_serviceDesc, srv) + MetricName string `protobuf:"bytes,1,opt,name=metricName,proto3" json:"metricName,omitempty"` + MetricValue int64 `protobuf:"varint,2,opt,name=metricValue,proto3" json:"metricValue,omitempty"` } -func _ExternalScaler_IsActive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ScaledObjectRef) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ExternalScalerServer).IsActive(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/externalscaler.ExternalScaler/IsActive", +func (x *MetricValue) Reset() { + *x = MetricValue{} + if protoimpl.UnsafeEnabled { + mi := &file_externalscaler_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ExternalScalerServer).IsActive(ctx, req.(*ScaledObjectRef)) - } - return interceptor(ctx, in, info, handler) } -func _ExternalScaler_StreamIsActive_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(ScaledObjectRef) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(ExternalScalerServer).StreamIsActive(m, &externalScalerStreamIsActiveServer{stream}) +func (x *MetricValue) String() string { + return protoimpl.X.MessageStringOf(x) } -type ExternalScaler_StreamIsActiveServer interface { - Send(*IsActiveResponse) error - grpc.ServerStream -} +func (*MetricValue) ProtoMessage() {} -type externalScalerStreamIsActiveServer struct { - grpc.ServerStream +func (x *MetricValue) ProtoReflect() protoreflect.Message { + mi := &file_externalscaler_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) } -func (x *externalScalerStreamIsActiveServer) Send(m *IsActiveResponse) error { - return x.ServerStream.SendMsg(m) +// Deprecated: Use MetricValue.ProtoReflect.Descriptor instead. +func (*MetricValue) Descriptor() ([]byte, []int) { + return file_externalscaler_proto_rawDescGZIP(), []int{6} } -func _ExternalScaler_GetMetricSpec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ScaledObjectRef) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ExternalScalerServer).GetMetricSpec(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/externalscaler.ExternalScaler/GetMetricSpec", +func (x *MetricValue) GetMetricName() string { + if x != nil { + return x.MetricName } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ExternalScalerServer).GetMetricSpec(ctx, req.(*ScaledObjectRef)) - } - return interceptor(ctx, in, info, handler) + return "" } -func _ExternalScaler_GetMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMetricsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ExternalScalerServer).GetMetrics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/externalscaler.ExternalScaler/GetMetrics", +func (x *MetricValue) GetMetricValue() int64 { + if x != nil { + return x.MetricValue } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ExternalScalerServer).GetMetrics(ctx, req.(*GetMetricsRequest)) - } - return interceptor(ctx, in, info, handler) + return 0 } -var _ExternalScaler_serviceDesc = grpc.ServiceDesc{ - ServiceName: "externalscaler.ExternalScaler", - HandlerType: (*ExternalScalerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "IsActive", - Handler: _ExternalScaler_IsActive_Handler, - }, - { - MethodName: "GetMetricSpec", - Handler: _ExternalScaler_GetMetricSpec_Handler, - }, - { - MethodName: "GetMetrics", - Handler: _ExternalScaler_GetMetrics_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "StreamIsActive", - Handler: _ExternalScaler_StreamIsActive_Handler, - ServerStreams: true, +var File_externalscaler_proto protoreflect.FileDescriptor + +var file_externalscaler_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x72, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x73, 0x63, 0x61, 0x6c, 0x65, 0x72, 0x22, 0xe3, 0x01, 0x0a, 0x0f, 0x53, 0x63, 0x61, 0x6c, 0x65, + 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x5b, 0x0a, 0x0e, + 0x73, 0x63, 0x61, 0x6c, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, + 0x63, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x66, 0x2e, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x73, 0x63, 0x61, 0x6c, 0x65, + 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x41, 0x0a, 0x13, 0x53, 0x63, 0x61, + 0x6c, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2a, 0x0a, 0x10, + 0x49, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x55, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x70, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3c, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x70, 0x65, 0x63, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x70, + 0x65, 0x63, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x70, 0x65, 0x63, 0x73, 0x22, + 0x4c, 0x0a, 0x0a, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, 0x70, 0x65, 0x63, 0x12, 0x1e, 0x0a, + 0x0a, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, + 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x7e, 0x0a, + 0x11, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x49, 0x0a, 0x0f, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x66, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x61, + 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x66, 0x52, 0x0f, 0x73, 0x63, + 0x61, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x66, 0x12, 0x1e, 0x0a, + 0x0a, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x55, 0x0a, + 0x12, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, + 0x63, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x73, 0x22, 0x4f, 0x0a, 0x0b, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x32, 0xec, 0x02, 0x0a, 0x0e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x4f, 0x0a, 0x08, 0x49, 0x73, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x12, 0x1f, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, + 0x63, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x66, 0x1a, 0x20, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x73, 0x63, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x0e, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x49, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x1f, 0x2e, 0x65, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x61, + 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x66, 0x1a, 0x20, 0x2e, 0x65, + 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x49, 0x73, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x30, 0x01, 0x12, 0x59, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, + 0x70, 0x65, 0x63, 0x12, 0x1f, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x63, + 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x66, 0x1a, 0x25, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, + 0x63, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x53, + 0x70, 0x65, 0x63, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, + 0x0a, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x21, 0x2e, 0x65, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x72, 0x2e, 0x47, 0x65, 0x74, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, + 0x2e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x72, 0x2e, + 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x42, 0x12, 0x5a, 0x10, 0x2e, 0x3b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, + 0x61, 0x6c, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_externalscaler_proto_rawDescOnce sync.Once + file_externalscaler_proto_rawDescData = file_externalscaler_proto_rawDesc +) + +func file_externalscaler_proto_rawDescGZIP() []byte { + file_externalscaler_proto_rawDescOnce.Do(func() { + file_externalscaler_proto_rawDescData = protoimpl.X.CompressGZIP(file_externalscaler_proto_rawDescData) + }) + return file_externalscaler_proto_rawDescData +} + +var file_externalscaler_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_externalscaler_proto_goTypes = []interface{}{ + (*ScaledObjectRef)(nil), // 0: externalscaler.ScaledObjectRef + (*IsActiveResponse)(nil), // 1: externalscaler.IsActiveResponse + (*GetMetricSpecResponse)(nil), // 2: externalscaler.GetMetricSpecResponse + (*MetricSpec)(nil), // 3: externalscaler.MetricSpec + (*GetMetricsRequest)(nil), // 4: externalscaler.GetMetricsRequest + (*GetMetricsResponse)(nil), // 5: externalscaler.GetMetricsResponse + (*MetricValue)(nil), // 6: externalscaler.MetricValue + nil, // 7: externalscaler.ScaledObjectRef.ScalerMetadataEntry +} +var file_externalscaler_proto_depIdxs = []int32{ + 7, // 0: externalscaler.ScaledObjectRef.scalerMetadata:type_name -> externalscaler.ScaledObjectRef.ScalerMetadataEntry + 3, // 1: externalscaler.GetMetricSpecResponse.metricSpecs:type_name -> externalscaler.MetricSpec + 0, // 2: externalscaler.GetMetricsRequest.scaledObjectRef:type_name -> externalscaler.ScaledObjectRef + 6, // 3: externalscaler.GetMetricsResponse.metricValues:type_name -> externalscaler.MetricValue + 0, // 4: externalscaler.ExternalScaler.IsActive:input_type -> externalscaler.ScaledObjectRef + 0, // 5: externalscaler.ExternalScaler.StreamIsActive:input_type -> externalscaler.ScaledObjectRef + 0, // 6: externalscaler.ExternalScaler.GetMetricSpec:input_type -> externalscaler.ScaledObjectRef + 4, // 7: externalscaler.ExternalScaler.GetMetrics:input_type -> externalscaler.GetMetricsRequest + 1, // 8: externalscaler.ExternalScaler.IsActive:output_type -> externalscaler.IsActiveResponse + 1, // 9: externalscaler.ExternalScaler.StreamIsActive:output_type -> externalscaler.IsActiveResponse + 2, // 10: externalscaler.ExternalScaler.GetMetricSpec:output_type -> externalscaler.GetMetricSpecResponse + 5, // 11: externalscaler.ExternalScaler.GetMetrics:output_type -> externalscaler.GetMetricsResponse + 8, // [8:12] is the sub-list for method output_type + 4, // [4:8] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_externalscaler_proto_init() } +func file_externalscaler_proto_init() { + if File_externalscaler_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_externalscaler_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ScaledObjectRef); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_externalscaler_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IsActiveResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_externalscaler_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMetricSpecResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_externalscaler_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MetricSpec); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_externalscaler_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMetricsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_externalscaler_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetMetricsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_externalscaler_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MetricValue); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_externalscaler_proto_rawDesc, + NumEnums: 0, + NumMessages: 8, + NumExtensions: 0, + NumServices: 1, }, - }, - Metadata: "externalscaler.proto", + GoTypes: file_externalscaler_proto_goTypes, + DependencyIndexes: file_externalscaler_proto_depIdxs, + MessageInfos: file_externalscaler_proto_msgTypes, + }.Build() + File_externalscaler_proto = out.File + file_externalscaler_proto_rawDesc = nil + file_externalscaler_proto_goTypes = nil + file_externalscaler_proto_depIdxs = nil } diff --git a/pkg/scalers/externalscaler/externalscaler_grpc.pb.go b/pkg/scalers/externalscaler/externalscaler_grpc.pb.go new file mode 100644 index 00000000000..48adb96f2d2 --- /dev/null +++ b/pkg/scalers/externalscaler/externalscaler_grpc.pb.go @@ -0,0 +1,241 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.20.1 +// source: externalscaler.proto + +package externalscaler + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ExternalScalerClient is the client API for ExternalScaler service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ExternalScalerClient interface { + IsActive(ctx context.Context, in *ScaledObjectRef, opts ...grpc.CallOption) (*IsActiveResponse, error) + StreamIsActive(ctx context.Context, in *ScaledObjectRef, opts ...grpc.CallOption) (ExternalScaler_StreamIsActiveClient, error) + GetMetricSpec(ctx context.Context, in *ScaledObjectRef, opts ...grpc.CallOption) (*GetMetricSpecResponse, error) + GetMetrics(ctx context.Context, in *GetMetricsRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error) +} + +type externalScalerClient struct { + cc grpc.ClientConnInterface +} + +func NewExternalScalerClient(cc grpc.ClientConnInterface) ExternalScalerClient { + return &externalScalerClient{cc} +} + +func (c *externalScalerClient) IsActive(ctx context.Context, in *ScaledObjectRef, opts ...grpc.CallOption) (*IsActiveResponse, error) { + out := new(IsActiveResponse) + err := c.cc.Invoke(ctx, "/externalscaler.ExternalScaler/IsActive", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *externalScalerClient) StreamIsActive(ctx context.Context, in *ScaledObjectRef, opts ...grpc.CallOption) (ExternalScaler_StreamIsActiveClient, error) { + stream, err := c.cc.NewStream(ctx, &ExternalScaler_ServiceDesc.Streams[0], "/externalscaler.ExternalScaler/StreamIsActive", opts...) + if err != nil { + return nil, err + } + x := &externalScalerStreamIsActiveClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type ExternalScaler_StreamIsActiveClient interface { + Recv() (*IsActiveResponse, error) + grpc.ClientStream +} + +type externalScalerStreamIsActiveClient struct { + grpc.ClientStream +} + +func (x *externalScalerStreamIsActiveClient) Recv() (*IsActiveResponse, error) { + m := new(IsActiveResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *externalScalerClient) GetMetricSpec(ctx context.Context, in *ScaledObjectRef, opts ...grpc.CallOption) (*GetMetricSpecResponse, error) { + out := new(GetMetricSpecResponse) + err := c.cc.Invoke(ctx, "/externalscaler.ExternalScaler/GetMetricSpec", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *externalScalerClient) GetMetrics(ctx context.Context, in *GetMetricsRequest, opts ...grpc.CallOption) (*GetMetricsResponse, error) { + out := new(GetMetricsResponse) + err := c.cc.Invoke(ctx, "/externalscaler.ExternalScaler/GetMetrics", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ExternalScalerServer is the server API for ExternalScaler service. +// All implementations must embed UnimplementedExternalScalerServer +// for forward compatibility +type ExternalScalerServer interface { + IsActive(context.Context, *ScaledObjectRef) (*IsActiveResponse, error) + StreamIsActive(*ScaledObjectRef, ExternalScaler_StreamIsActiveServer) error + GetMetricSpec(context.Context, *ScaledObjectRef) (*GetMetricSpecResponse, error) + GetMetrics(context.Context, *GetMetricsRequest) (*GetMetricsResponse, error) + mustEmbedUnimplementedExternalScalerServer() +} + +// UnimplementedExternalScalerServer must be embedded to have forward compatible implementations. +type UnimplementedExternalScalerServer struct { +} + +func (UnimplementedExternalScalerServer) IsActive(context.Context, *ScaledObjectRef) (*IsActiveResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method IsActive not implemented") +} +func (UnimplementedExternalScalerServer) StreamIsActive(*ScaledObjectRef, ExternalScaler_StreamIsActiveServer) error { + return status.Errorf(codes.Unimplemented, "method StreamIsActive not implemented") +} +func (UnimplementedExternalScalerServer) GetMetricSpec(context.Context, *ScaledObjectRef) (*GetMetricSpecResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMetricSpec not implemented") +} +func (UnimplementedExternalScalerServer) GetMetrics(context.Context, *GetMetricsRequest) (*GetMetricsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMetrics not implemented") +} +func (UnimplementedExternalScalerServer) mustEmbedUnimplementedExternalScalerServer() {} + +// UnsafeExternalScalerServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ExternalScalerServer will +// result in compilation errors. +type UnsafeExternalScalerServer interface { + mustEmbedUnimplementedExternalScalerServer() +} + +func RegisterExternalScalerServer(s grpc.ServiceRegistrar, srv ExternalScalerServer) { + s.RegisterService(&ExternalScaler_ServiceDesc, srv) +} + +func _ExternalScaler_IsActive_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ScaledObjectRef) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExternalScalerServer).IsActive(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/externalscaler.ExternalScaler/IsActive", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExternalScalerServer).IsActive(ctx, req.(*ScaledObjectRef)) + } + return interceptor(ctx, in, info, handler) +} + +func _ExternalScaler_StreamIsActive_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ScaledObjectRef) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ExternalScalerServer).StreamIsActive(m, &externalScalerStreamIsActiveServer{stream}) +} + +type ExternalScaler_StreamIsActiveServer interface { + Send(*IsActiveResponse) error + grpc.ServerStream +} + +type externalScalerStreamIsActiveServer struct { + grpc.ServerStream +} + +func (x *externalScalerStreamIsActiveServer) Send(m *IsActiveResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _ExternalScaler_GetMetricSpec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ScaledObjectRef) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExternalScalerServer).GetMetricSpec(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/externalscaler.ExternalScaler/GetMetricSpec", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExternalScalerServer).GetMetricSpec(ctx, req.(*ScaledObjectRef)) + } + return interceptor(ctx, in, info, handler) +} + +func _ExternalScaler_GetMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMetricsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ExternalScalerServer).GetMetrics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/externalscaler.ExternalScaler/GetMetrics", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ExternalScalerServer).GetMetrics(ctx, req.(*GetMetricsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// ExternalScaler_ServiceDesc is the grpc.ServiceDesc for ExternalScaler service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ExternalScaler_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "externalscaler.ExternalScaler", + HandlerType: (*ExternalScalerServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "IsActive", + Handler: _ExternalScaler_IsActive_Handler, + }, + { + MethodName: "GetMetricSpec", + Handler: _ExternalScaler_GetMetricSpec_Handler, + }, + { + MethodName: "GetMetrics", + Handler: _ExternalScaler_GetMetrics_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "StreamIsActive", + Handler: _ExternalScaler_StreamIsActive_Handler, + ServerStreams: true, + }, + }, + Metadata: "externalscaler.proto", +} diff --git a/pkg/scalers/liiklus/LiiklusService.pb.go b/pkg/scalers/liiklus/LiiklusService.pb.go index ba0eebf525d..335b5fab329 100644 --- a/pkg/scalers/liiklus/LiiklusService.pb.go +++ b/pkg/scalers/liiklus/LiiklusService.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v3.17.3 +// protoc-gen-go v1.28.1 +// protoc v3.20.1 // source: LiiklusService.proto package liiklus diff --git a/pkg/scalers/liiklus/LiiklusService_grpc.pb.go b/pkg/scalers/liiklus/LiiklusService_grpc.pb.go index 7c770a8459a..63e96a8d065 100644 --- a/pkg/scalers/liiklus/LiiklusService_grpc.pb.go +++ b/pkg/scalers/liiklus/LiiklusService_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.20.1 +// source: LiiklusService.proto package liiklus @@ -12,6 +16,7 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 // LiiklusServiceClient is the client API for LiiklusService service. @@ -34,10 +39,6 @@ func NewLiiklusServiceClient(cc grpc.ClientConnInterface) LiiklusServiceClient { return &liiklusServiceClient{cc} } -var liiklusServicePublishStreamDesc = &grpc.StreamDesc{ - StreamName: "Publish", -} - func (c *liiklusServiceClient) Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishReply, error) { out := new(PublishReply) err := c.cc.Invoke(ctx, "/com.github.bsideup.liiklus.LiiklusService/Publish", in, out, opts...) @@ -47,13 +48,8 @@ func (c *liiklusServiceClient) Publish(ctx context.Context, in *PublishRequest, return out, nil } -var liiklusServiceSubscribeStreamDesc = &grpc.StreamDesc{ - StreamName: "Subscribe", - ServerStreams: true, -} - func (c *liiklusServiceClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (LiiklusService_SubscribeClient, error) { - stream, err := c.cc.NewStream(ctx, liiklusServiceSubscribeStreamDesc, "/com.github.bsideup.liiklus.LiiklusService/Subscribe", opts...) + stream, err := c.cc.NewStream(ctx, &LiiklusService_ServiceDesc.Streams[0], "/com.github.bsideup.liiklus.LiiklusService/Subscribe", opts...) if err != nil { return nil, err } @@ -84,13 +80,8 @@ func (x *liiklusServiceSubscribeClient) Recv() (*SubscribeReply, error) { return m, nil } -var liiklusServiceReceiveStreamDesc = &grpc.StreamDesc{ - StreamName: "Receive", - ServerStreams: true, -} - func (c *liiklusServiceClient) Receive(ctx context.Context, in *ReceiveRequest, opts ...grpc.CallOption) (LiiklusService_ReceiveClient, error) { - stream, err := c.cc.NewStream(ctx, liiklusServiceReceiveStreamDesc, "/com.github.bsideup.liiklus.LiiklusService/Receive", opts...) + stream, err := c.cc.NewStream(ctx, &LiiklusService_ServiceDesc.Streams[1], "/com.github.bsideup.liiklus.LiiklusService/Receive", opts...) if err != nil { return nil, err } @@ -121,10 +112,6 @@ func (x *liiklusServiceReceiveClient) Recv() (*ReceiveReply, error) { return m, nil } -var liiklusServiceAckStreamDesc = &grpc.StreamDesc{ - StreamName: "Ack", -} - func (c *liiklusServiceClient) Ack(ctx context.Context, in *AckRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { out := new(emptypb.Empty) err := c.cc.Invoke(ctx, "/com.github.bsideup.liiklus.LiiklusService/Ack", in, out, opts...) @@ -134,10 +121,6 @@ func (c *liiklusServiceClient) Ack(ctx context.Context, in *AckRequest, opts ... return out, nil } -var liiklusServiceGetOffsetsStreamDesc = &grpc.StreamDesc{ - StreamName: "GetOffsets", -} - func (c *liiklusServiceClient) GetOffsets(ctx context.Context, in *GetOffsetsRequest, opts ...grpc.CallOption) (*GetOffsetsReply, error) { out := new(GetOffsetsReply) err := c.cc.Invoke(ctx, "/com.github.bsideup.liiklus.LiiklusService/GetOffsets", in, out, opts...) @@ -147,10 +130,6 @@ func (c *liiklusServiceClient) GetOffsets(ctx context.Context, in *GetOffsetsReq return out, nil } -var liiklusServiceGetEndOffsetsStreamDesc = &grpc.StreamDesc{ - StreamName: "GetEndOffsets", -} - func (c *liiklusServiceClient) GetEndOffsets(ctx context.Context, in *GetEndOffsetsRequest, opts ...grpc.CallOption) (*GetEndOffsetsReply, error) { out := new(GetEndOffsetsReply) err := c.cc.Invoke(ctx, "/com.github.bsideup.liiklus.LiiklusService/GetEndOffsets", in, out, opts...) @@ -160,249 +139,203 @@ func (c *liiklusServiceClient) GetEndOffsets(ctx context.Context, in *GetEndOffs return out, nil } -// LiiklusServiceService is the service API for LiiklusService service. -// Fields should be assigned to their respective handler implementations only before -// RegisterLiiklusServiceService is called. Any unassigned fields will result in the -// handler for that method returning an Unimplemented error. -type LiiklusServiceService struct { - Publish func(context.Context, *PublishRequest) (*PublishReply, error) - Subscribe func(*SubscribeRequest, LiiklusService_SubscribeServer) error - Receive func(*ReceiveRequest, LiiklusService_ReceiveServer) error - Ack func(context.Context, *AckRequest) (*emptypb.Empty, error) - GetOffsets func(context.Context, *GetOffsetsRequest) (*GetOffsetsReply, error) - GetEndOffsets func(context.Context, *GetEndOffsetsRequest) (*GetEndOffsetsReply, error) +// LiiklusServiceServer is the server API for LiiklusService service. +// All implementations must embed UnimplementedLiiklusServiceServer +// for forward compatibility +type LiiklusServiceServer interface { + Publish(context.Context, *PublishRequest) (*PublishReply, error) + Subscribe(*SubscribeRequest, LiiklusService_SubscribeServer) error + Receive(*ReceiveRequest, LiiklusService_ReceiveServer) error + Ack(context.Context, *AckRequest) (*emptypb.Empty, error) + GetOffsets(context.Context, *GetOffsetsRequest) (*GetOffsetsReply, error) + GetEndOffsets(context.Context, *GetEndOffsetsRequest) (*GetEndOffsetsReply, error) + mustEmbedUnimplementedLiiklusServiceServer() +} + +// UnimplementedLiiklusServiceServer must be embedded to have forward compatible implementations. +type UnimplementedLiiklusServiceServer struct { +} + +func (UnimplementedLiiklusServiceServer) Publish(context.Context, *PublishRequest) (*PublishReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method Publish not implemented") +} +func (UnimplementedLiiklusServiceServer) Subscribe(*SubscribeRequest, LiiklusService_SubscribeServer) error { + return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") +} +func (UnimplementedLiiklusServiceServer) Receive(*ReceiveRequest, LiiklusService_ReceiveServer) error { + return status.Errorf(codes.Unimplemented, "method Receive not implemented") +} +func (UnimplementedLiiklusServiceServer) Ack(context.Context, *AckRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ack not implemented") +} +func (UnimplementedLiiklusServiceServer) GetOffsets(context.Context, *GetOffsetsRequest) (*GetOffsetsReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetOffsets not implemented") +} +func (UnimplementedLiiklusServiceServer) GetEndOffsets(context.Context, *GetEndOffsetsRequest) (*GetEndOffsetsReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEndOffsets not implemented") +} +func (UnimplementedLiiklusServiceServer) mustEmbedUnimplementedLiiklusServiceServer() {} + +// UnsafeLiiklusServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LiiklusServiceServer will +// result in compilation errors. +type UnsafeLiiklusServiceServer interface { + mustEmbedUnimplementedLiiklusServiceServer() } -func (s *LiiklusServiceService) publish(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func RegisterLiiklusServiceServer(s grpc.ServiceRegistrar, srv LiiklusServiceServer) { + s.RegisterService(&LiiklusService_ServiceDesc, srv) +} + +func _LiiklusService_Publish_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(PublishRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return s.Publish(ctx, in) + return srv.(LiiklusServiceServer).Publish(ctx, in) } info := &grpc.UnaryServerInfo{ - Server: s, + Server: srv, FullMethod: "/com.github.bsideup.liiklus.LiiklusService/Publish", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return s.Publish(ctx, req.(*PublishRequest)) + return srv.(LiiklusServiceServer).Publish(ctx, req.(*PublishRequest)) } return interceptor(ctx, in, info, handler) } -func (s *LiiklusServiceService) subscribe(_ interface{}, stream grpc.ServerStream) error { + +func _LiiklusService_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(SubscribeRequest) if err := stream.RecvMsg(m); err != nil { return err } - return s.Subscribe(m, &liiklusServiceSubscribeServer{stream}) + return srv.(LiiklusServiceServer).Subscribe(m, &liiklusServiceSubscribeServer{stream}) +} + +type LiiklusService_SubscribeServer interface { + Send(*SubscribeReply) error + grpc.ServerStream +} + +type liiklusServiceSubscribeServer struct { + grpc.ServerStream +} + +func (x *liiklusServiceSubscribeServer) Send(m *SubscribeReply) error { + return x.ServerStream.SendMsg(m) } -func (s *LiiklusServiceService) receive(_ interface{}, stream grpc.ServerStream) error { + +func _LiiklusService_Receive_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(ReceiveRequest) if err := stream.RecvMsg(m); err != nil { return err } - return s.Receive(m, &liiklusServiceReceiveServer{stream}) + return srv.(LiiklusServiceServer).Receive(m, &liiklusServiceReceiveServer{stream}) +} + +type LiiklusService_ReceiveServer interface { + Send(*ReceiveReply) error + grpc.ServerStream +} + +type liiklusServiceReceiveServer struct { + grpc.ServerStream +} + +func (x *liiklusServiceReceiveServer) Send(m *ReceiveReply) error { + return x.ServerStream.SendMsg(m) } -func (s *LiiklusServiceService) ack(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + +func _LiiklusService_Ack_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AckRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return s.Ack(ctx, in) + return srv.(LiiklusServiceServer).Ack(ctx, in) } info := &grpc.UnaryServerInfo{ - Server: s, + Server: srv, FullMethod: "/com.github.bsideup.liiklus.LiiklusService/Ack", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return s.Ack(ctx, req.(*AckRequest)) + return srv.(LiiklusServiceServer).Ack(ctx, req.(*AckRequest)) } return interceptor(ctx, in, info, handler) } -func (s *LiiklusServiceService) getOffsets(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + +func _LiiklusService_GetOffsets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetOffsetsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return s.GetOffsets(ctx, in) + return srv.(LiiklusServiceServer).GetOffsets(ctx, in) } info := &grpc.UnaryServerInfo{ - Server: s, + Server: srv, FullMethod: "/com.github.bsideup.liiklus.LiiklusService/GetOffsets", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return s.GetOffsets(ctx, req.(*GetOffsetsRequest)) + return srv.(LiiklusServiceServer).GetOffsets(ctx, req.(*GetOffsetsRequest)) } return interceptor(ctx, in, info, handler) } -func (s *LiiklusServiceService) getEndOffsets(_ interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + +func _LiiklusService_GetEndOffsets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetEndOffsetsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return s.GetEndOffsets(ctx, in) + return srv.(LiiklusServiceServer).GetEndOffsets(ctx, in) } info := &grpc.UnaryServerInfo{ - Server: s, + Server: srv, FullMethod: "/com.github.bsideup.liiklus.LiiklusService/GetEndOffsets", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return s.GetEndOffsets(ctx, req.(*GetEndOffsetsRequest)) + return srv.(LiiklusServiceServer).GetEndOffsets(ctx, req.(*GetEndOffsetsRequest)) } return interceptor(ctx, in, info, handler) } -type LiiklusService_SubscribeServer interface { - Send(*SubscribeReply) error - grpc.ServerStream -} - -type liiklusServiceSubscribeServer struct { - grpc.ServerStream -} - -func (x *liiklusServiceSubscribeServer) Send(m *SubscribeReply) error { - return x.ServerStream.SendMsg(m) -} - -type LiiklusService_ReceiveServer interface { - Send(*ReceiveReply) error - grpc.ServerStream -} - -type liiklusServiceReceiveServer struct { - grpc.ServerStream -} - -func (x *liiklusServiceReceiveServer) Send(m *ReceiveReply) error { - return x.ServerStream.SendMsg(m) -} - -// RegisterLiiklusServiceService registers a service implementation with a gRPC server. -func RegisterLiiklusServiceService(s grpc.ServiceRegistrar, srv *LiiklusServiceService) { - srvCopy := *srv - if srvCopy.Publish == nil { - srvCopy.Publish = func(context.Context, *PublishRequest) (*PublishReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Publish not implemented") - } - } - if srvCopy.Subscribe == nil { - srvCopy.Subscribe = func(*SubscribeRequest, LiiklusService_SubscribeServer) error { - return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") - } - } - if srvCopy.Receive == nil { - srvCopy.Receive = func(*ReceiveRequest, LiiklusService_ReceiveServer) error { - return status.Errorf(codes.Unimplemented, "method Receive not implemented") - } - } - if srvCopy.Ack == nil { - srvCopy.Ack = func(context.Context, *AckRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Ack not implemented") - } - } - if srvCopy.GetOffsets == nil { - srvCopy.GetOffsets = func(context.Context, *GetOffsetsRequest) (*GetOffsetsReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetOffsets not implemented") - } - } - if srvCopy.GetEndOffsets == nil { - srvCopy.GetEndOffsets = func(context.Context, *GetEndOffsetsRequest) (*GetEndOffsetsReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetEndOffsets not implemented") - } - } - sd := grpc.ServiceDesc{ - ServiceName: "com.github.bsideup.liiklus.LiiklusService", - Methods: []grpc.MethodDesc{ - { - MethodName: "Publish", - Handler: srvCopy.publish, - }, - { - MethodName: "Ack", - Handler: srvCopy.ack, - }, - { - MethodName: "GetOffsets", - Handler: srvCopy.getOffsets, - }, - { - MethodName: "GetEndOffsets", - Handler: srvCopy.getEndOffsets, - }, +// LiiklusService_ServiceDesc is the grpc.ServiceDesc for LiiklusService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var LiiklusService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "com.github.bsideup.liiklus.LiiklusService", + HandlerType: (*LiiklusServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Publish", + Handler: _LiiklusService_Publish_Handler, }, - Streams: []grpc.StreamDesc{ - { - StreamName: "Subscribe", - Handler: srvCopy.subscribe, - ServerStreams: true, - }, - { - StreamName: "Receive", - Handler: srvCopy.receive, - ServerStreams: true, - }, + { + MethodName: "Ack", + Handler: _LiiklusService_Ack_Handler, }, - Metadata: "LiiklusService.proto", - } - - s.RegisterService(&sd, nil) -} - -// NewLiiklusServiceService creates a new LiiklusServiceService containing the -// implemented methods of the LiiklusService service in s. Any unimplemented -// methods will result in the gRPC server returning an UNIMPLEMENTED status to the client. -// This includes situations where the method handler is misspelled or has the wrong -// signature. For this reason, this function should be used with great care and -// is not recommended to be used by most users. -func NewLiiklusServiceService(s interface{}) *LiiklusServiceService { - ns := &LiiklusServiceService{} - if h, ok := s.(interface { - Publish(context.Context, *PublishRequest) (*PublishReply, error) - }); ok { - ns.Publish = h.Publish - } - if h, ok := s.(interface { - Subscribe(*SubscribeRequest, LiiklusService_SubscribeServer) error - }); ok { - ns.Subscribe = h.Subscribe - } - if h, ok := s.(interface { - Receive(*ReceiveRequest, LiiklusService_ReceiveServer) error - }); ok { - ns.Receive = h.Receive - } - if h, ok := s.(interface { - Ack(context.Context, *AckRequest) (*emptypb.Empty, error) - }); ok { - ns.Ack = h.Ack - } - if h, ok := s.(interface { - GetOffsets(context.Context, *GetOffsetsRequest) (*GetOffsetsReply, error) - }); ok { - ns.GetOffsets = h.GetOffsets - } - if h, ok := s.(interface { - GetEndOffsets(context.Context, *GetEndOffsetsRequest) (*GetEndOffsetsReply, error) - }); ok { - ns.GetEndOffsets = h.GetEndOffsets - } - return ns -} - -// UnstableLiiklusServiceService is the service API for LiiklusService service. -// New methods may be added to this interface if they are added to the service -// definition, which is not a backward-compatible change. For this reason, -// use of this type is not recommended. -type UnstableLiiklusServiceService interface { - Publish(context.Context, *PublishRequest) (*PublishReply, error) - Subscribe(*SubscribeRequest, LiiklusService_SubscribeServer) error - Receive(*ReceiveRequest, LiiklusService_ReceiveServer) error - Ack(context.Context, *AckRequest) (*emptypb.Empty, error) - GetOffsets(context.Context, *GetOffsetsRequest) (*GetOffsetsReply, error) - GetEndOffsets(context.Context, *GetEndOffsetsRequest) (*GetEndOffsetsReply, error) + { + MethodName: "GetOffsets", + Handler: _LiiklusService_GetOffsets_Handler, + }, + { + MethodName: "GetEndOffsets", + Handler: _LiiklusService_GetEndOffsets_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Subscribe", + Handler: _LiiklusService_Subscribe_Handler, + ServerStreams: true, + }, + { + StreamName: "Receive", + Handler: _LiiklusService_Receive_Handler, + ServerStreams: true, + }, + }, + Metadata: "LiiklusService.proto", } diff --git a/pkg/scalers/stackdriver_client.go b/pkg/scalers/stackdriver_client.go index 49eccb555d0..38a45715ab8 100644 --- a/pkg/scalers/stackdriver_client.go +++ b/pkg/scalers/stackdriver_client.go @@ -10,11 +10,11 @@ import ( "cloud.google.com/go/compute/metadata" monitoring "cloud.google.com/go/monitoring/apiv3/v2" - timestamp "github.com/golang/protobuf/ptypes/timestamp" "google.golang.org/api/iterator" option "google.golang.org/api/option" monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3" durationpb "google.golang.org/protobuf/types/known/durationpb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) // StackDriverClient is a generic client to fetch metrics from Stackdriver. Can be used @@ -177,8 +177,8 @@ func (s StackDriverClient) GetMetrics( var req = &monitoringpb.ListTimeSeriesRequest{ Filter: filter, Interval: &monitoringpb.TimeInterval{ - StartTime: ×tamp.Timestamp{Seconds: startTime.Unix()}, - EndTime: ×tamp.Timestamp{Seconds: endTime.Unix()}, + StartTime: ×tamppb.Timestamp{Seconds: startTime.Unix()}, + EndTime: ×tamppb.Timestamp{Seconds: endTime.Unix()}, }, Aggregation: aggregation, } diff --git a/tests/utils/setup_test.go b/tests/utils/setup_test.go index b7aa3888c2a..46cfe831029 100644 --- a/tests/utils/setup_test.go +++ b/tests/utils/setup_test.go @@ -71,7 +71,7 @@ func TestSetupWorkloadIdentityComponents(t *testing.T) { KubeClient = GetKubernetesClient(t) CreateNamespace(t, KubeClient, AzureWorkloadIdentityNamespace) - _, err = ExecuteCommand(fmt.Sprintf("helm upgrade --install workload-identity-webhook azure-workload-identity/workload-identity-webhook --namespace %s --set azureTenantID=%s", + _, err = ExecuteCommand(fmt.Sprintf("helm upgrade --install workload-identity-webhook azure-workload-identity/workload-identity-webhook --namespace %s --set azureTenantID=%s --set image.release=v0.12.0", AzureWorkloadIdentityNamespace, AzureADTenantID)) require.NoErrorf(t, err, "cannot install workload identity webhook - %s", err) From f5b723461eda95a7a0354385e2533d774072d6b9 Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Thu, 1 Sep 2022 11:53:31 +0200 Subject: [PATCH 09/14] fix(rabbitmq): Parse vhost correctly if it's provided in the host url (#3604) --- CHANGELOG.md | 1 + pkg/scalers/rabbitmq_scaler.go | 27 +--- pkg/scalers/rabbitmq_scaler_test.go | 33 +++-- .../rabbitmq_queue_amqp_test.go | 4 +- .../rabbitmq_queue_amqp_vhost_test.go | 130 ++++++++++++++++++ .../rabbitmq_queue_http_test.go | 6 +- .../rabbitmq_queue_http_regex_test.go | 6 +- .../rabbitmq_queue_http_vhost_test.go | 121 ++++++++++++++++ 8 files changed, 286 insertions(+), 42 deletions(-) create mode 100644 tests/scalers/rabbitmq/rabbitmq_queue_amqp_vhost/rabbitmq_queue_amqp_vhost_test.go create mode 100644 tests/scalers/rabbitmq/rabbitmq_queue_http_vhost/rabbitmq_queue_http_vhost_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index df4a491578b..72c20e42ebc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md - **General:** Metrics endpoint returns correct HPA values ([#3554](https://github.com/kedacore/keda/issues/3554)) - **Datadog Scaler:** Fix: panic in datadog scaler ([#3448](https://github.com/kedacore/keda/issues/3448)) +- **RabbitMQ Scaler:** Parse vhost correctly if it's provided in the host url ([#3602](https://github.com/kedacore/keda/issues/3602)) ### Deprecations diff --git a/pkg/scalers/rabbitmq_scaler.go b/pkg/scalers/rabbitmq_scaler.go index e6ef61b9b9f..abc23ebcbc0 100644 --- a/pkg/scalers/rabbitmq_scaler.go +++ b/pkg/scalers/rabbitmq_scaler.go @@ -68,7 +68,7 @@ type rabbitMQMetadata struct { activationValue float64 // activation value host string // connection string for either HTTP or AMQP protocol protocol string // either http or amqp protocol - vhostName *string // override the vhost from the connection info + vhostName string // override the vhost from the connection info useRegex bool // specify if the queueName contains a rexeg excludeUnacknowledged bool // specify if the QueueLength value should exclude Unacknowledged messages (Ready messages only) pageSize int64 // specify the page size if useRegex is enabled @@ -121,12 +121,12 @@ func NewRabbitMQScaler(config *ScalerConfig) (Scaler, error) { if meta.protocol == amqpProtocol { // Override vhost if requested. host := meta.host - if meta.vhostName != nil { + if meta.vhostName != "" { hostURI, err := amqp.ParseURI(host) if err != nil { return nil, fmt.Errorf("error parsing rabbitmq connection string: %s", err) } - hostURI.Vhost = *meta.vhostName + hostURI.Vhost = meta.vhostName host = hostURI.String() } @@ -193,7 +193,7 @@ func parseRabbitMQMetadata(config *ScalerConfig) (*rabbitMQMetadata, error) { // Resolve vhostName if val, ok := config.TriggerMetadata["vhostName"]; ok { - meta.vhostName = &val + meta.vhostName = val } err := parseRabbitMQHttpProtocolMetadata(config, &meta) @@ -457,24 +457,11 @@ func (s *rabbitMQScaler) getQueueInfoViaHTTP() (*queueInfo, error) { // Extract vhost from URL's path. vhost := parsedURL.Path - // If the URL's path only contains a slash, it represents the trailing slash and - // must be ignored because it may cause confusion with the '/' vhost. - if vhost == "/" { - vhost = "" + if s.metadata.vhostName != "" { + vhost = "/" + url.QueryEscape(s.metadata.vhostName) } - // Override vhost if requested. - if s.metadata.vhostName != nil { - // If the desired vhost is "All" vhosts, no path is necessary - if *s.metadata.vhostName == "" { - vhost = "" - } else { - vhost = "/" + url.QueryEscape(*s.metadata.vhostName) - } - } - - // Encode the '/' vhost if necessary. - if vhost == "//" { + if vhost == "" || vhost == "/" || vhost == "//" { vhost = rabbitRootVhostPath } diff --git a/pkg/scalers/rabbitmq_scaler_test.go b/pkg/scalers/rabbitmq_scaler_test.go index 958ca130f30..7bc7f74d8eb 100644 --- a/pkg/scalers/rabbitmq_scaler_test.go +++ b/pkg/scalers/rabbitmq_scaler_test.go @@ -225,18 +225,8 @@ func TestGetQueueInfo(t *testing.T) { for _, testData := range allTestData { testData := testData - var expectedVhostPath string - switch testData.vhostPath { - case "/myhost": - expectedVhostPath = "/myhost" - case rabbitRootVhostPath, "//": - expectedVhostPath = rabbitRootVhostPath - default: - expectedVhostPath = "" - } - var apiStub = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - expectedPath := fmt.Sprintf("/api/queues%s/evaluate_trials", expectedVhostPath) + expectedPath := fmt.Sprintf("/api/queues%s/evaluate_trials", getExpectedVhost(testData.vhostPath)) if r.RequestURI != expectedPath { t.Error("Expect request path to =", expectedPath, "but it is", r.RequestURI) } @@ -373,7 +363,7 @@ func TestGetQueueInfoWithRegex(t *testing.T) { for _, testData := range allTestData { var apiStub = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - expectedPath := fmt.Sprintf("/api/queues%s?page=1&use_regex=true&pagination=false&name=%%5Eevaluate_trials%%24&page_size=100", testData.vhostPath) + expectedPath := fmt.Sprintf("/api/queues%s?page=1&use_regex=true&pagination=false&name=%%5Eevaluate_trials%%24&page_size=100", getExpectedVhost(testData.vhostPath)) if r.RequestURI != expectedPath { t.Error("Expect request path to =", expectedPath, "but it is", r.RequestURI) } @@ -453,7 +443,7 @@ func TestGetPageSizeWithRegex(t *testing.T) { for _, testData := range allTestData { var apiStub = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - expectedPath := fmt.Sprintf("/api/queues%s?page=1&use_regex=true&pagination=false&name=%%5Eevaluate_trials%%24&page_size=%d", testData.queueInfo.vhostPath, testData.pageSize) + expectedPath := fmt.Sprintf("/api/queues%s?page=1&use_regex=true&pagination=false&name=%%5Eevaluate_trials%%24&page_size=%d", getExpectedVhost(testData.queueInfo.vhostPath), testData.pageSize) if r.RequestURI != expectedPath { t.Error("Expect request path to =", expectedPath, "but it is", r.RequestURI) } @@ -575,7 +565,7 @@ var testRegexQueueInfoNavigationTestData = []getQueueInfoNavigationTestData{ func TestRegexQueueMissingError(t *testing.T) { for _, testData := range testRegexQueueInfoNavigationTestData { var apiStub = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - expectedPath := "/api/queues?page=1&use_regex=true&pagination=false&name=evaluate_trials&page_size=100" + expectedPath := "/api/queues/%2F?page=1&use_regex=true&pagination=false&name=evaluate_trials&page_size=100" if r.RequestURI != expectedPath { t.Error("Expect request path to =", expectedPath, "but it is", r.RequestURI) } @@ -619,3 +609,18 @@ func TestRegexQueueMissingError(t *testing.T) { } } } + +func getExpectedVhost(vhostPath string) string { + switch vhostPath { + case "": + return rabbitRootVhostPath + case "/": + return rabbitRootVhostPath + case "//": + return rabbitRootVhostPath + case rabbitRootVhostPath: + return rabbitRootVhostPath + default: + return vhostPath + } +} diff --git a/tests/scalers/rabbitmq/rabbitmq_queue_amqp/rabbitmq_queue_amqp_test.go b/tests/scalers/rabbitmq/rabbitmq_queue_amqp/rabbitmq_queue_amqp_test.go index 76b04bc4a6c..c84f87ef741 100644 --- a/tests/scalers/rabbitmq/rabbitmq_queue_amqp/rabbitmq_queue_amqp_test.go +++ b/tests/scalers/rabbitmq/rabbitmq_queue_amqp/rabbitmq_queue_amqp_test.go @@ -32,8 +32,8 @@ var ( queueName = "hello" user = fmt.Sprintf("%s-user", testName) password = fmt.Sprintf("%s-password", testName) - vhost = fmt.Sprintf("%s-vhost", testName) - connectionString = fmt.Sprintf("amqp://%s:%s@rabbitmq.%s.svc.cluster.local/%s", user, password, rmqNamespace, vhost) + vhost = "/" + connectionString = fmt.Sprintf("amqp://%s:%s@rabbitmq.%s.svc.cluster.local", user, password, rmqNamespace) messageCount = 100 ) diff --git a/tests/scalers/rabbitmq/rabbitmq_queue_amqp_vhost/rabbitmq_queue_amqp_vhost_test.go b/tests/scalers/rabbitmq/rabbitmq_queue_amqp_vhost/rabbitmq_queue_amqp_vhost_test.go new file mode 100644 index 00000000000..f0606d58919 --- /dev/null +++ b/tests/scalers/rabbitmq/rabbitmq_queue_amqp_vhost/rabbitmq_queue_amqp_vhost_test.go @@ -0,0 +1,130 @@ +//go:build e2e +// +build e2e + +package rabbitmq_queue_amqp_vhost_test + +import ( + "encoding/base64" + "fmt" + "testing" + + "github.com/joho/godotenv" + "github.com/stretchr/testify/assert" + "k8s.io/client-go/kubernetes" + + . "github.com/kedacore/keda/v2/tests/helper" + . "github.com/kedacore/keda/v2/tests/scalers/rabbitmq" +) + +// Load environment variables from .env file +var _ = godotenv.Load("../../.env") + +const ( + testName = "rmq-queue-amqp-vhost-test" +) + +var ( + testNamespace = fmt.Sprintf("%s-ns", testName) + rmqNamespace = fmt.Sprintf("%s-rmq", testName) + deploymentName = fmt.Sprintf("%s-deployment", testName) + secretName = fmt.Sprintf("%s-secret", testName) + scaledObjectName = fmt.Sprintf("%s-so", testName) + queueName = "hello" + user = fmt.Sprintf("%s-user", testName) + password = fmt.Sprintf("%s-password", testName) + vhost = fmt.Sprintf("%s-vhost", testName) + connectionString = fmt.Sprintf("amqp://%s:%s@rabbitmq.%s.svc.cluster.local/%s", user, password, rmqNamespace, vhost) + messageCount = 100 +) + +const ( + scaledObjectTemplate = ` +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: {{.ScaledObjectName}} + namespace: {{.TestNamespace}} +spec: + scaleTargetRef: + name: {{.DeploymentName}} + pollingInterval: 5 + cooldownPeriod: 10 + minReplicaCount: 0 + maxReplicaCount: 4 + triggers: + - type: rabbitmq + metadata: + queueName: {{.QueueName}} + hostFromEnv: RabbitApiHost + mode: QueueLength + value: '10' + activationValue: '5' +` +) + +type templateData struct { + TestNamespace string + DeploymentName string + ScaledObjectName string + SecretName string + QueueName string + Connection, Base64Connection string +} + +func TestScaler(t *testing.T) { + // setup + t.Log("--- setting up ---") + + // Create kubernetes resources + kc := GetKubernetesClient(t) + data, templates := getTemplateData() + + RMQInstall(t, kc, rmqNamespace, user, password, vhost) + CreateKubernetesResources(t, kc, testNamespace, data, templates) + + assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1), + "replica count should be 0 after 1 minute") + + testScaling(t, kc) + + testActivationValue(t, kc) + + // cleanup + t.Log("--- cleaning up ---") + DeleteKubernetesResources(t, kc, testNamespace, data, templates) + RMQUninstall(t, kc, rmqNamespace, user, password, vhost) +} + +func getTemplateData() (templateData, []Template) { + return templateData{ + TestNamespace: testNamespace, + DeploymentName: deploymentName, + ScaledObjectName: scaledObjectName, + SecretName: secretName, + QueueName: queueName, + Connection: connectionString, + Base64Connection: base64.StdEncoding.EncodeToString([]byte(connectionString)), + }, []Template{ + {Name: "deploymentTemplate", Config: RMQTargetDeploymentTemplate}, + {Name: "scaledObjectTemplate", Config: scaledObjectTemplate}, + } +} + +func testScaling(t *testing.T, kc *kubernetes.Clientset) { + t.Log("--- testing scale up ---") + RMQPublishMessages(t, rmqNamespace, connectionString, queueName, messageCount) + assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 4, 60, 1), + "replica count should be 4 after 1 minute") + + t.Log("--- testing scale down ---") + assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1), + "replica count should be 0 after 1 minute") +} + +func testActivationValue(t *testing.T, kc *kubernetes.Clientset) { + t.Log("--- testing activation value ---") + messagesToQueue := 3 + RMQPublishMessages(t, rmqNamespace, connectionString, queueName, messagesToQueue) + + AssertReplicaCountNotChangeDuringTimePeriod(t, kc, deploymentName, testNamespace, 0, 60) +} diff --git a/tests/scalers/rabbitmq/rabbitmq_queue_http/rabbitmq_queue_http_test.go b/tests/scalers/rabbitmq/rabbitmq_queue_http/rabbitmq_queue_http_test.go index 21908729ca1..8bd0af83cc3 100644 --- a/tests/scalers/rabbitmq/rabbitmq_queue_http/rabbitmq_queue_http_test.go +++ b/tests/scalers/rabbitmq/rabbitmq_queue_http/rabbitmq_queue_http_test.go @@ -32,9 +32,9 @@ var ( queueName = "hello" user = fmt.Sprintf("%s-user", testName) password = fmt.Sprintf("%s-password", testName) - vhost = fmt.Sprintf("%s-vhost", testName) - connectionString = fmt.Sprintf("amqp://%s:%s@rabbitmq.%s.svc.cluster.local/%s", user, password, rmqNamespace, vhost) - httpConnectionString = fmt.Sprintf("http://%s:%s@rabbitmq.%s.svc.cluster.local/%s", user, password, rmqNamespace, vhost) + vhost = "/" + connectionString = fmt.Sprintf("amqp://%s:%s@rabbitmq.%s.svc.cluster.local/", user, password, rmqNamespace) + httpConnectionString = fmt.Sprintf("http://%s:%s@rabbitmq.%s.svc.cluster.local/", user, password, rmqNamespace) messageCount = 100 ) diff --git a/tests/scalers/rabbitmq/rabbitmq_queue_http_regex/rabbitmq_queue_http_regex_test.go b/tests/scalers/rabbitmq/rabbitmq_queue_http_regex/rabbitmq_queue_http_regex_test.go index 47bce5a2c6e..6412fb849a7 100644 --- a/tests/scalers/rabbitmq/rabbitmq_queue_http_regex/rabbitmq_queue_http_regex_test.go +++ b/tests/scalers/rabbitmq/rabbitmq_queue_http_regex/rabbitmq_queue_http_regex_test.go @@ -33,9 +33,9 @@ var ( queueRegex = "^hell.{1}$" user = fmt.Sprintf("%s-user", testName) password = fmt.Sprintf("%s-password", testName) - vhost = fmt.Sprintf("%s-vhost", testName) - connectionString = fmt.Sprintf("amqp://%s:%s@rabbitmq.%s.svc.cluster.local/%s", user, password, rmqNamespace, vhost) - httpConnectionString = fmt.Sprintf("http://%s:%s@rabbitmq.%s.svc.cluster.local/%s", user, password, rmqNamespace, vhost) + vhost = "/" + connectionString = fmt.Sprintf("amqp://%s:%s@rabbitmq.%s.svc.cluster.local/", user, password, rmqNamespace) + httpConnectionString = fmt.Sprintf("http://%s:%s@rabbitmq.%s.svc.cluster.local/", user, password, rmqNamespace) messageCount = 100 ) diff --git a/tests/scalers/rabbitmq/rabbitmq_queue_http_vhost/rabbitmq_queue_http_vhost_test.go b/tests/scalers/rabbitmq/rabbitmq_queue_http_vhost/rabbitmq_queue_http_vhost_test.go new file mode 100644 index 00000000000..2be4b745d78 --- /dev/null +++ b/tests/scalers/rabbitmq/rabbitmq_queue_http_vhost/rabbitmq_queue_http_vhost_test.go @@ -0,0 +1,121 @@ +//go:build e2e +// +build e2e + +package rabbitmq_queue_http_vhost_test + +import ( + "encoding/base64" + "fmt" + "testing" + + "github.com/joho/godotenv" + "github.com/stretchr/testify/assert" + "k8s.io/client-go/kubernetes" + + . "github.com/kedacore/keda/v2/tests/helper" + . "github.com/kedacore/keda/v2/tests/scalers/rabbitmq" +) + +// Load environment variables from .env file +var _ = godotenv.Load("../../.env") + +const ( + testName = "rmq-queue-http-vhost-test" +) + +var ( + testNamespace = fmt.Sprintf("%s-ns", testName) + rmqNamespace = fmt.Sprintf("%s-rmq", testName) + deploymentName = fmt.Sprintf("%s-deployment", testName) + secretName = fmt.Sprintf("%s-secret", testName) + scaledObjectName = fmt.Sprintf("%s-so", testName) + queueName = "hello" + user = fmt.Sprintf("%s-user", testName) + password = fmt.Sprintf("%s-password", testName) + vhost = fmt.Sprintf("%s-vhost", testName) + connectionString = fmt.Sprintf("amqp://%s:%s@rabbitmq.%s.svc.cluster.local/%s", user, password, rmqNamespace, vhost) + httpConnectionString = fmt.Sprintf("http://%s:%s@rabbitmq.%s.svc.cluster.local/%s", user, password, rmqNamespace, vhost) + messageCount = 100 +) + +const ( + scaledObjectTemplate = ` +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: {{.ScaledObjectName}} + namespace: {{.TestNamespace}} +spec: + scaleTargetRef: + name: {{.DeploymentName}} + pollingInterval: 5 + cooldownPeriod: 10 + minReplicaCount: 0 + maxReplicaCount: 4 + triggers: + - type: rabbitmq + metadata: + queueName: {{.QueueName}} + hostFromEnv: RabbitApiHost + protocol: http + mode: QueueLength + value: '10' +` +) + +type templateData struct { + TestNamespace string + DeploymentName string + ScaledObjectName string + SecretName string + QueueName string + Connection, Base64Connection string +} + +func TestScaler(t *testing.T) { + // setup + t.Log("--- setting up ---") + + // Create kubernetes resources + kc := GetKubernetesClient(t) + data, templates := getTemplateData() + + RMQInstall(t, kc, rmqNamespace, user, password, vhost) + CreateKubernetesResources(t, kc, testNamespace, data, templates) + + assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1), + "replica count should be 0 after 1 minute") + + testScaling(t, kc) + + // cleanup + t.Log("--- cleaning up ---") + DeleteKubernetesResources(t, kc, testNamespace, data, templates) + RMQUninstall(t, kc, rmqNamespace, user, password, vhost) +} + +func getTemplateData() (templateData, []Template) { + return templateData{ + TestNamespace: testNamespace, + DeploymentName: deploymentName, + ScaledObjectName: scaledObjectName, + SecretName: secretName, + QueueName: queueName, + Connection: connectionString, + Base64Connection: base64.StdEncoding.EncodeToString([]byte(httpConnectionString)), + }, []Template{ + {Name: "deploymentTemplate", Config: RMQTargetDeploymentTemplate}, + {Name: "scaledObjectTemplate", Config: scaledObjectTemplate}, + } +} + +func testScaling(t *testing.T, kc *kubernetes.Clientset) { + t.Log("--- testing scale up ---") + RMQPublishMessages(t, rmqNamespace, connectionString, queueName, messageCount) + assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 4, 60, 1), + "replica count should be 4 after 1 minute") + + t.Log("--- testing scale down ---") + assert.True(t, WaitForDeploymentReplicaReadyCount(t, kc, deploymentName, testNamespace, 0, 60, 1), + "replica count should be 0 after 1 minute") +} From 12783c1340a13ba6776d1d6a64127d88e7828aab Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Thu, 1 Sep 2022 13:28:05 +0200 Subject: [PATCH 10/14] chore: prepare release v2.8.1 (#3625) --- .github/ISSUE_TEMPLATE/3_bug_report.yml | 1 + .github/ISSUE_TEMPLATE/4_release_tracker.md | 2 +- CHANGELOG.md | 29 ++++++++++++++++----- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/3_bug_report.yml b/.github/ISSUE_TEMPLATE/3_bug_report.yml index 70f3fb49ceb..1bc83be0c6e 100644 --- a/.github/ISSUE_TEMPLATE/3_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/3_bug_report.yml @@ -57,6 +57,7 @@ body: label: KEDA Version description: What version of KEDA that are you running? options: + - "2.8.1" - "2.8.0" - "2.7.1" - "2.7.0" diff --git a/.github/ISSUE_TEMPLATE/4_release_tracker.md b/.github/ISSUE_TEMPLATE/4_release_tracker.md index aca3282c969..1e5f18978ce 100644 --- a/.github/ISSUE_TEMPLATE/4_release_tracker.md +++ b/.github/ISSUE_TEMPLATE/4_release_tracker.md @@ -8,7 +8,7 @@ assignees: tomkerkhove,zroubalik,jorturfer This issue template is used to track the rollout of a new KEDA version. -For the full release process, we recommend reading [this document](https://github.com/kedacore/keda/blob/main/RELEASE-PROCESS.MD). +For the full release process, we recommend reading [this document](https://github.com/kedacore/keda/blob/main/RELEASE-PROCESS.md). ## Progress diff --git a/CHANGELOG.md b/CHANGELOG.md index 72c20e42ebc..f9c90c122c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md ## History - [Unreleased](#unreleased) +- [v2.8.1](#v281) - [v2.8.0](#v280) - [v2.7.1](#v271) - [v2.7.0](#v270) @@ -33,15 +34,31 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md - [v1.1.0](#v110) - [v1.0.0](#v100) -## Unreleased +### Improvements -### New +- TODO ([#XXX](https://github.com/kedacore/keda/issue/XXX)) + +### Fixes + +- TODO ([#XXX](https://github.com/kedacore/keda/issue/XXX)) -- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX)) +### Deprecations + +- TODO ([#XXX](https://github.com/kedacore/keda/issue/XXX)) + +### Breaking Changes + +- TODO ([#XXX](https://github.com/kedacore/keda/issue/XXX)) + +### Other + +- TODO ([#XXX](https://github.com/kedacore/keda/issue/XXX)) + +## v2.8.1 ### Improvements -- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX)) +None. ### Fixes @@ -51,11 +68,11 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md ### Deprecations -- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX)) +None. ### Breaking Changes -- TODO ([#XXX](https://github.com/kedacore/keda/issues/XXX)) +None. ### Other From c37990e0f8fa6de7af5e0c14a66e354df2a8e894 Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Thu, 1 Sep 2022 14:34:42 +0200 Subject: [PATCH 11/14] chore: Streamline changelog (#3628) --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9c90c122c4..b07b5256a91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md ## Deprecations +To learn more about active deprecations, we recommend checking [GitHub Discussions](https://github.com/kedacore/keda/discussions/categories/deprecations). + ## History - [Unreleased](#unreleased) @@ -34,6 +36,12 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md - [v1.1.0](#v110) - [v1.0.0](#v100) +## Unreleased + +### New + +- TODO ([#XXX](https://github.com/kedacore/keda/issue/XXX)) + ### Improvements - TODO ([#XXX](https://github.com/kedacore/keda/issue/XXX)) @@ -56,6 +64,10 @@ To learn more about our roadmap, we recommend reading [this document](ROADMAP.md ## v2.8.1 +### New + +None. + ### Improvements None. From 6b359b3713c2efaf13bae9b190b7bd8c0bee5d4d Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Thu, 1 Sep 2022 15:57:07 +0200 Subject: [PATCH 12/14] chore: update k8s versions in bug template (#3627) --- .github/ISSUE_TEMPLATE/3_bug_report.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/3_bug_report.yml b/.github/ISSUE_TEMPLATE/3_bug_report.yml index 1bc83be0c6e..ec3897667c8 100644 --- a/.github/ISSUE_TEMPLATE/3_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/3_bug_report.yml @@ -79,15 +79,13 @@ body: label: Kubernetes Version description: What version of Kubernetes that are you running? options: + - "1.25" + - "1.24" - "1.23" - "1.22" - "1.21" - "1.20" - - "1.19" - - "1.18" - - "1.17" - - "1.16" - - "< 1.16" + - "< 1.20" - "Other" validations: required: false From 098a966b86b1d6c99475553769521ce3962b180c Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Thu, 1 Sep 2022 17:52:50 +0200 Subject: [PATCH 13/14] automation: Use reusable workflows to avoid duplications (#3593) * move smoke test to resuable workflows for ARM and multi versions Signed-off-by: Jorge Turrado * fix styles Signed-off-by: Jorge Turrado * add needed permission to script Signed-off-by: Jorge Turrado * dummy Signed-off-by: Jorge Turrado * undo dummy changes Signed-off-by: Jorge Turrado * add rw to trivy Signed-off-by: Jorge Turrado * use main for rw Signed-off-by: Jorge Turrado * add rw for e2e test on main Signed-off-by: Jorge Turrado * undo dummy change Signed-off-by: Jorge Turrado * use current branch on PR Signed-off-by: Jorge Turrado * update changelog Signed-off-by: Jorge Turrado * remove whitespace Signed-off-by: Jorge Turrado * rename templates Signed-off-by: Jorge Turrado * Update trivy to set severity Signed-off-by: Jorge Turrado Signed-off-by: Jorge Turrado --- .github/workflows/main-build.yml | 198 +++--------------- .github/workflows/nightly-e2e.yml | 101 +-------- .github/workflows/pr-validation.yml | 32 +-- .../workflows/template-arm64-smoke-tests.yml | 13 ++ .github/workflows/template-main-e2e-test.yml | 75 +++++++ .github/workflows/template-smoke-tests.yml | 44 ++++ .github/workflows/template-trivy-scan.yml | 52 +++++ .../template-versions-smoke-tests.yml | 29 +++ CHANGELOG.md | 1 + Makefile | 6 +- ...-arm-smoke-tests.sh => run-smoke-tests.sh} | 1 + 11 files changed, 264 insertions(+), 288 deletions(-) create mode 100644 .github/workflows/template-arm64-smoke-tests.yml create mode 100644 .github/workflows/template-main-e2e-test.yml create mode 100644 .github/workflows/template-smoke-tests.yml create mode 100644 .github/workflows/template-trivy-scan.yml create mode 100644 .github/workflows/template-versions-smoke-tests.yml rename tests/{run-arm-smoke-tests.sh => run-smoke-tests.sh} (98%) diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index 8e5ede8726a..dfaee03acd6 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -76,183 +76,51 @@ jobs: validate: needs: build - name: validate - runs-on: ubuntu-latest - # build-tools is built from ../../tools/build-tools.Dockerfile - container: ghcr.io/kedacore/build-tools:1.17.13 - concurrency: e2e-tests - steps: - - name: Check out code - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - - name: Register workspace path - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - - name: Run end to end tests - env: - AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} - AWS_REGION: ${{ secrets.AWS_REGION }} - AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} - AZURE_APP_INSIGHTS_APP_ID: ${{ secrets.AZURE_APP_INSIGHTS_APP_ID }} - AZURE_APP_INSIGHTS_CONNECTION_STRING: ${{ secrets.AZURE_APP_INSIGHTS_CONNECTION_STRING }} - AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY: ${{ secrets.AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY }} - AZURE_DATA_EXPLORER_DB: ${{ secrets.AZURE_DATA_EXPLORER_DB }} - AZURE_DATA_EXPLORER_ENDPOINT: ${{ secrets.AZURE_DATA_EXPLORER_ENDPOINT }} - AZURE_DEVOPS_BUILD_DEFINITION_ID: ${{ secrets.AZURE_DEVOPS_BUILD_DEFINITION_ID }} - AZURE_DEVOPS_ORGANIZATION_URL: ${{ secrets.AZURE_DEVOPS_ORGANIZATION_URL }} - AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} - AZURE_DEVOPS_POOL_NAME: ${{ secrets.AZURE_DEVOPS_POOL_NAME }} - AZURE_DEVOPS_PROJECT: ${{ secrets.AZURE_DEVOPS_PROJECT }} - AZURE_KEYVAULT_URI: ${{ secrets.AZURE_KEYVAULT_URI }} - AZURE_LOG_ANALYTICS_WORKSPACE_ID: ${{ secrets.AZURE_LOG_ANALYTICS_WORKSPACE_ID }} - AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }} - AZURE_RUN_WORKLOAD_IDENTITY_TESTS: true - AZURE_SERVICE_BUS_CONNECTION_STRING: ${{ secrets.AZURE_SERVICE_BUS_CONNECTION_STRING }} - AZURE_SERVICE_BUS_ALTERNATIVE_CONNECTION_STRING: ${{ secrets.AZURE_SERVICE_BUS_ALTERNATIVE_CONNECTION_STRING }} - AZURE_SP_APP_ID: ${{ secrets.AZURE_SP_APP_ID }} - AZURE_SP_OBJECT_ID: ${{ secrets.AZURE_SP_OBJECT_ID }} - AZURE_SP_KEY: ${{ secrets.AZURE_SP_KEY }} - AZURE_SP_ALTERNATIVE_APP_ID: ${{ secrets.AZURE_SP_ALTERNATIVE_APP_ID }} - AZURE_SP_ALTERNATIVE_OBJECT_ID: ${{ secrets.AZURE_SP_ALTERNATIVE_OBJECT_ID }} - AZURE_SP_ALTERNATIVE_KEY: ${{ secrets.AZURE_SP_ALTERNATIVE_KEY }} - AZURE_SP_TENANT: ${{ secrets.AZURE_SP_TENANT }} - AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }} - AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }} - DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY}} - DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY}} - DATADOG_SITE: ${{ secrets.DATADOG_SITE}} - GCP_SP_KEY: ${{ secrets.GCP_SP_KEY }} - NEWRELIC_ACCOUNT_ID: ${{ secrets.NEWRELIC_ACCOUNT_ID}} - NEWRELIC_API_KEY: ${{ secrets.NEWRELIC_API_KEY}} - NEWRELIC_LICENSE: ${{ secrets.NEWRELIC_LICENSE}} - OIDC_ISSUER_URL: ${{ secrets.OIDC_ISSUER_URLNIGHTLY }} - OPENSTACK_AUTH_URL: ${{ secrets.OPENSTACK_AUTH_URL }} - OPENSTACK_PASSWORD: ${{ secrets.OPENSTACK_PASSWORD }} - OPENSTACK_PROJECT_ID: ${{ secrets.OPENSTACK_PROJECT_ID }} - OPENSTACK_USER_ID: ${{ secrets.OPENSTACK_USER_ID }} - PREDICTKUBE_API_KEY: ${{ secrets.PREDICTKUBE_API_KEY }} - run: make e2e-test - - - name: Delete all e2e related namespaces - if: ${{ always() }} - run: make e2e-test-clean - env: - AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }} - AZURE_SP_APP_ID: ${{ secrets.AZURE_SP_APP_ID }} - AZURE_SP_KEY: ${{ secrets.AZURE_SP_KEY }} - AZURE_SP_TENANT: ${{ secrets.AZURE_SP_TENANT }} - AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }} + uses: kedacore/keda/.github/workflows/template-main-e2e-test.yml@main + secrets: inherit validate-arm64: needs: build - name: validate-arm64 - runs-on: ARM64 - concurrency: arm-smoke-tests - steps: - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: 1.17 - - - name: Install prerequisites - run: | - apt update - apt install curl make ca-certificates gcc libc-dev -y - env: - DEBIAN_FRONTEND: noninteractive - - - name: Check out code - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - - name: Create k8s v1.23 Kind Cluster - uses: helm/kind-action@main - with: - node_image: kindest/node:v1.23.0@sha256:49824ab1727c04e56a21a5d8372a402fcd32ea51ac96a2706a12af38934f81ac - cluster_name: smoke-tests-cluster + uses: kedacore/keda/.github/workflows/template-arm64-smoke-tests.yml@main - - name: Run smoke test - run: make arm-smoke-test + validate-k8s-versions: + needs: build + uses: kedacore/keda/.github/workflows/template-versions-smoke-tests.yml@main trivy-scan: - name: Trivy scan code needs: build - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Run Trivy vulnerability scanner in repo mode - uses: aquasecurity/trivy-action@0.6.1 - with: - scan-type: 'fs' - ignore-unfixed: false - format: 'sarif' - output: 'code.sarif' - exit-code: 1 - skip-dirs: tests # Remove this once the ts files are removed - - - name: Upload Trivy scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v2 - if: always() - with: - sarif_file: 'code.sarif' + uses: kedacore/keda/.github/workflows/template-trivy-scan.yml@main + with: + runs-on: 'ubuntu-latest' + scan-type: 'fs' + format: 'sarif' + exit-code: 0 + publish: true trivy-scan-metrics-server: - name: Trivy scan metrics server image - ${{ matrix.name }} needs: build - runs-on: ${{ matrix.runner }} strategy: - matrix: - include: - - runner: ARM64 - name: arm64 - - runner: ubuntu-latest - name: amd64 - - steps: - - uses: actions/checkout@v3 - - - name: Run Trivy on metrics-server - uses: aquasecurity/trivy-action@0.6.1 - with: - scan-type: 'image' - image-ref: ghcr.io/kedacore/keda-metrics-apiserver:main - format: 'sarif' - output: 'metrics-server.sarif' - - - name: Upload Trivy scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: 'metrics-server.sarif' + matrix: + runner: [ARM64, ubuntu-latest] + uses: kedacore/keda/.github/workflows/template-trivy-scan.yml@main + with: + runs-on: ${{ matrix.runner }} + scan-type: 'image' + image-ref: ghcr.io/kedacore/keda-metrics-apiserver:main + format: 'sarif' + exit-code: 0 + publish: true trivy-scan-keda: - name: Trivy scan keda image - ${{ matrix.name }} needs: build - runs-on: ${{ matrix.runner }} strategy: - matrix: - include: - - runner: ARM64 - name: arm64 - - runner: ubuntu-latest - name: amd64 - - steps: - - uses: actions/checkout@v3 - - - name: Run Trivy on operator - uses: aquasecurity/trivy-action@0.6.1 - with: - scan-type: 'image' - image-ref: ghcr.io/kedacore/keda:main - format: 'sarif' - output: 'keda.sarif' - - - name: Upload Trivy scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: 'keda.sarif' + matrix: + runner: [ARM64, ubuntu-latest] + uses: kedacore/keda/.github/workflows/template-trivy-scan.yml@main + with: + runs-on: ${{ matrix.runner }} + scan-type: 'image' + image-ref: ghcr.io/kedacore/keda:main + format: 'sarif' + exit-code: 0 + publish: true diff --git a/.github/workflows/nightly-e2e.yml b/.github/workflows/nightly-e2e.yml index e582f3e550c..a5e8576400b 100644 --- a/.github/workflows/nightly-e2e.yml +++ b/.github/workflows/nightly-e2e.yml @@ -5,102 +5,11 @@ on: jobs: validate: - name: Test - runs-on: ubuntu-latest - concurrency: e2e-tests - # build-tools is built from ../../tools/build-tools.Dockerfile - container: ghcr.io/kedacore/build-tools:1.17.13 - steps: - - name: Check out code - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - - name: Register workspace path - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - - name: Run end to end test - env: - AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} - AWS_REGION: ${{ secrets.AWS_REGION }} - AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} - AZURE_APP_INSIGHTS_APP_ID: ${{ secrets.AZURE_APP_INSIGHTS_APP_ID }} - AZURE_APP_INSIGHTS_CONNECTION_STRING: ${{ secrets.AZURE_APP_INSIGHTS_CONNECTION_STRING }} - AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY: ${{ secrets.AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY }} - AZURE_DATA_EXPLORER_DB: ${{ secrets.AZURE_DATA_EXPLORER_DB }} - AZURE_DATA_EXPLORER_ENDPOINT: ${{ secrets.AZURE_DATA_EXPLORER_ENDPOINT }} - AZURE_DEVOPS_BUILD_DEFINITION_ID: ${{ secrets.AZURE_DEVOPS_BUILD_DEFINITION_ID }} - AZURE_DEVOPS_ORGANIZATION_URL: ${{ secrets.AZURE_DEVOPS_ORGANIZATION_URL }} - AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} - AZURE_DEVOPS_POOL_NAME: ${{ secrets.AZURE_DEVOPS_POOL_NAME }} - AZURE_DEVOPS_PROJECT: ${{ secrets.AZURE_DEVOPS_PROJECT }} - AZURE_KEYVAULT_URI: ${{ secrets.AZURE_KEYVAULT_URI }} - AZURE_LOG_ANALYTICS_WORKSPACE_ID: ${{ secrets.AZURE_LOG_ANALYTICS_WORKSPACE_ID }} - AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }} - AZURE_RUN_WORKLOAD_IDENTITY_TESTS: true - AZURE_SERVICE_BUS_CONNECTION_STRING: ${{ secrets.AZURE_SERVICE_BUS_CONNECTION_STRING }} - AZURE_SERVICE_BUS_ALTERNATIVE_CONNECTION_STRING: ${{ secrets.AZURE_SERVICE_BUS_ALTERNATIVE_CONNECTION_STRING }} - AZURE_SP_APP_ID: ${{ secrets.AZURE_SP_APP_ID }} - AZURE_SP_OBJECT_ID: ${{ secrets.AZURE_SP_OBJECT_ID }} - AZURE_SP_KEY: ${{ secrets.AZURE_SP_KEY }} - AZURE_SP_ALTERNATIVE_APP_ID: ${{ secrets.AZURE_SP_ALTERNATIVE_APP_ID }} - AZURE_SP_ALTERNATIVE_OBJECT_ID: ${{ secrets.AZURE_SP_ALTERNATIVE_OBJECT_ID }} - AZURE_SP_ALTERNATIVE_KEY: ${{ secrets.AZURE_SP_ALTERNATIVE_KEY }} - AZURE_SP_TENANT: ${{ secrets.AZURE_SP_TENANT }} - AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }} - AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }} - DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY}} - DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY}} - DATADOG_SITE: ${{ secrets.DATADOG_SITE}} - GCP_SP_KEY: ${{ secrets.GCP_SP_KEY }} - NEWRELIC_ACCOUNT_ID: ${{ secrets.NEWRELIC_ACCOUNT_ID}} - NEWRELIC_API_KEY: ${{ secrets.NEWRELIC_API_KEY}} - NEWRELIC_LICENSE: ${{ secrets.NEWRELIC_LICENSE}} - OIDC_ISSUER_URL: ${{ secrets.OIDC_ISSUER_URLNIGHTLY }} - OPENSTACK_AUTH_URL: ${{ secrets.OPENSTACK_AUTH_URL }} - OPENSTACK_PASSWORD: ${{ secrets.OPENSTACK_PASSWORD }} - OPENSTACK_PROJECT_ID: ${{ secrets.OPENSTACK_PROJECT_ID }} - OPENSTACK_USER_ID: ${{ secrets.OPENSTACK_USER_ID }} - PREDICTKUBE_API_KEY: ${{ secrets.PREDICTKUBE_API_KEY }} - run: make e2e-test - - - name: Delete all e2e related namespaces - if: ${{ always() }} - run: make e2e-test-clean - env: - AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }} - AZURE_SP_APP_ID: ${{ secrets.AZURE_SP_APP_ID }} - AZURE_SP_KEY: ${{ secrets.AZURE_SP_KEY }} - AZURE_SP_TENANT: ${{ secrets.AZURE_SP_TENANT }} - AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }} + uses: kedacore/keda/.github/workflows/template-main-e2e-test.yml@main + secrets: inherit validate-arm64: - name: validate-arm64 - runs-on: ARM64 - concurrency: arm-smoke-tests - steps: - - name: Setup Go - uses: actions/setup-go@v3 - with: - go-version: 1.17 - - - name: Install prerequisites - run: | - apt update - apt install curl make ca-certificates gcc libc-dev -y - env: - DEBIAN_FRONTEND: noninteractive - - - name: Check out code - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - - name: Create k8s v1.23 Kind Cluster - uses: helm/kind-action@main - with: - node_image: kindest/node:v1.23.0@sha256:49824ab1727c04e56a21a5d8372a402fcd32ea51ac96a2706a12af38934f81ac - cluster_name: smoke-tests-cluster + uses: kedacore/keda/.github/workflows/template-arm64-smoke-tests.yml@main - - name: Run smoke test - run: make arm-smoke-test + validate-k8s-versions: + uses: kedacore/keda/.github/workflows/template-versions-smoke-tests.yml@main diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index d49229aadaf..d687d24ef3a 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -209,27 +209,11 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 - trivy-scanner: - name: Trivy Scan - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - uses: dorny/paths-filter@v2 - id: filter - with: - filters: | - deps: - - 'go.mod' - - 'go.sum' - - - name: Run Trivy vulnerability scanner in repo mode - if: steps.filter.outputs.deps == 'true' - uses: aquasecurity/trivy-action@0.6.1 - with: - scan-type: 'fs' - ignore-unfixed: false - format: 'table' - exit-code: 1 - skip-dirs: tests # Remove this once the ts files are removed + trivy-scan: + uses: kedacore/keda/.github/workflows/template-trivy-scan.yml@main + with: + runs-on: 'ubuntu-latest' + scan-type: 'fs' + format: 'table' + exit-code: 1 + publish: false diff --git a/.github/workflows/template-arm64-smoke-tests.yml b/.github/workflows/template-arm64-smoke-tests.yml new file mode 100644 index 00000000000..84405eb0cbf --- /dev/null +++ b/.github/workflows/template-arm64-smoke-tests.yml @@ -0,0 +1,13 @@ +name: Reusable workflow to run smoke tests on ARM64 + +on: + workflow_call: + +jobs: + smoke-tests-ARM64: + name: ARM64 + uses: kedacore/keda/.github/workflows/template-smoke-tests.yml@main + with: + runs-on: ARM64 + kubernetesVersion: v1.24 + kindImage: kindest/node:v1.24.0@sha256:406fd86d48eaf4c04c7280cd1d2ca1d61e7d0d61ddef0125cb097bc7b82ed6a1 diff --git a/.github/workflows/template-main-e2e-test.yml b/.github/workflows/template-main-e2e-test.yml new file mode 100644 index 00000000000..d8b7c584b81 --- /dev/null +++ b/.github/workflows/template-main-e2e-test.yml @@ -0,0 +1,75 @@ +name: Reusable workflow to run e2e tests on main branch + +on: + workflow_call: + +jobs: + e2e-tests: + name: Run e2e test + runs-on: ubuntu-latest + # build-tools is built from ../../tools/build-tools.Dockerfile + container: ghcr.io/kedacore/build-tools:1.17.13 + concurrency: e2e-tests + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Register workspace path + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + + - name: Run end to end tests + env: + AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} + AWS_REGION: ${{ secrets.AWS_REGION }} + AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }} + AZURE_APP_INSIGHTS_APP_ID: ${{ secrets.AZURE_APP_INSIGHTS_APP_ID }} + AZURE_APP_INSIGHTS_CONNECTION_STRING: ${{ secrets.AZURE_APP_INSIGHTS_CONNECTION_STRING }} + AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY: ${{ secrets.AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY }} + AZURE_DATA_EXPLORER_DB: ${{ secrets.AZURE_DATA_EXPLORER_DB }} + AZURE_DATA_EXPLORER_ENDPOINT: ${{ secrets.AZURE_DATA_EXPLORER_ENDPOINT }} + AZURE_DEVOPS_BUILD_DEFINITION_ID: ${{ secrets.AZURE_DEVOPS_BUILD_DEFINITION_ID }} + AZURE_DEVOPS_ORGANIZATION_URL: ${{ secrets.AZURE_DEVOPS_ORGANIZATION_URL }} + AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }} + AZURE_DEVOPS_POOL_NAME: ${{ secrets.AZURE_DEVOPS_POOL_NAME }} + AZURE_DEVOPS_PROJECT: ${{ secrets.AZURE_DEVOPS_PROJECT }} + AZURE_KEYVAULT_URI: ${{ secrets.AZURE_KEYVAULT_URI }} + AZURE_LOG_ANALYTICS_WORKSPACE_ID: ${{ secrets.AZURE_LOG_ANALYTICS_WORKSPACE_ID }} + AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }} + AZURE_RUN_WORKLOAD_IDENTITY_TESTS: true + AZURE_SERVICE_BUS_CONNECTION_STRING: ${{ secrets.AZURE_SERVICE_BUS_CONNECTION_STRING }} + AZURE_SERVICE_BUS_ALTERNATIVE_CONNECTION_STRING: ${{ secrets.AZURE_SERVICE_BUS_ALTERNATIVE_CONNECTION_STRING }} + AZURE_SP_APP_ID: ${{ secrets.AZURE_SP_APP_ID }} + AZURE_SP_OBJECT_ID: ${{ secrets.AZURE_SP_OBJECT_ID }} + AZURE_SP_KEY: ${{ secrets.AZURE_SP_KEY }} + AZURE_SP_ALTERNATIVE_APP_ID: ${{ secrets.AZURE_SP_ALTERNATIVE_APP_ID }} + AZURE_SP_ALTERNATIVE_OBJECT_ID: ${{ secrets.AZURE_SP_ALTERNATIVE_OBJECT_ID }} + AZURE_SP_ALTERNATIVE_KEY: ${{ secrets.AZURE_SP_ALTERNATIVE_KEY }} + AZURE_SP_TENANT: ${{ secrets.AZURE_SP_TENANT }} + AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }} + AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }} + DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY}} + DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY}} + DATADOG_SITE: ${{ secrets.DATADOG_SITE}} + GCP_SP_KEY: ${{ secrets.GCP_SP_KEY }} + NEWRELIC_ACCOUNT_ID: ${{ secrets.NEWRELIC_ACCOUNT_ID}} + NEWRELIC_API_KEY: ${{ secrets.NEWRELIC_API_KEY}} + NEWRELIC_LICENSE: ${{ secrets.NEWRELIC_LICENSE}} + OIDC_ISSUER_URL: ${{ secrets.OIDC_ISSUER_URLNIGHTLY }} + OPENSTACK_AUTH_URL: ${{ secrets.OPENSTACK_AUTH_URL }} + OPENSTACK_PASSWORD: ${{ secrets.OPENSTACK_PASSWORD }} + OPENSTACK_PROJECT_ID: ${{ secrets.OPENSTACK_PROJECT_ID }} + OPENSTACK_USER_ID: ${{ secrets.OPENSTACK_USER_ID }} + PREDICTKUBE_API_KEY: ${{ secrets.PREDICTKUBE_API_KEY }} + run: make e2e-test + + - name: Delete all e2e related namespaces + if: ${{ always() }} + run: make e2e-test-clean + env: + AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }} + AZURE_SP_APP_ID: ${{ secrets.AZURE_SP_APP_ID }} + AZURE_SP_KEY: ${{ secrets.AZURE_SP_KEY }} + AZURE_SP_TENANT: ${{ secrets.AZURE_SP_TENANT }} + AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }} diff --git a/.github/workflows/template-smoke-tests.yml b/.github/workflows/template-smoke-tests.yml new file mode 100644 index 00000000000..cd871d3f26d --- /dev/null +++ b/.github/workflows/template-smoke-tests.yml @@ -0,0 +1,44 @@ +name: Reusable workflow to run smoke tests + +on: + workflow_call: + inputs: + runs-on: + required: true + type: string + kubernetesVersion: + required: true + type: string + kindImage: + required: true + type: string +jobs: + smoke-tests: + name: Validate k8s-${{ inputs.kubernetesVersion }} + runs-on: ${{ inputs.runs-on }} + steps: + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: 1.17 + + - name: Install prerequisites + run: | + sudo apt update + sudo apt install curl make ca-certificates gcc libc-dev -y + env: + DEBIAN_FRONTEND: noninteractive + + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Create k8s ${{ inputs.kubernetesVersion }} Kind Cluster + uses: helm/kind-action@main + with: + node_image: ${{ inputs.kindImage }} + cluster_name: smoke-tests-cluster-${{ inputs.kubernetesVersion }} + + - name: Run smoke test + run: make smoke-test diff --git a/.github/workflows/template-trivy-scan.yml b/.github/workflows/template-trivy-scan.yml new file mode 100644 index 00000000000..60ca5d2df7f --- /dev/null +++ b/.github/workflows/template-trivy-scan.yml @@ -0,0 +1,52 @@ +name: Reusable workflow to run trivy scan + +on: + workflow_call: + inputs: + runs-on: + required: true + type: string + scan-type: + required: true + type: string + format: + required: true + type: string + image-ref: + required: false + type: string + default: "" + severity: + required: false + type: string + default: "CRITICAL,HIGH" + exit-code: + required: true + type: number + publish: + required: true + type: boolean + +jobs: + trivy-scan: + name: Trivy - ${{ inputs.runs-on }} - ${{ inputs.scan-type }} ${{ inputs.image-ref }} + runs-on: ${{ inputs.runs-on }} + steps: + - uses: actions/checkout@v3 + + - name: Run Trivy + uses: aquasecurity/trivy-action@0.7.1 + with: + scan-type: ${{ inputs.scan-type }} + image-ref: ${{ inputs.image-ref }} + ignore-unfixed: false + format: ${{ inputs.format }} + output: trivy.sarif + exit-code: ${{ inputs.exit-code }} + severity: ${{ inputs.severity }} + + - name: Upload Trivy scan results to GitHub Security tab + uses: github/codeql-action/upload-sarif@v2 + if: ${{ inputs.publish }} + with: + sarif_file: trivy.sarif diff --git a/.github/workflows/template-versions-smoke-tests.yml b/.github/workflows/template-versions-smoke-tests.yml new file mode 100644 index 00000000000..e67799bf511 --- /dev/null +++ b/.github/workflows/template-versions-smoke-tests.yml @@ -0,0 +1,29 @@ +name: Reusable workflow to run smoke tests on different k8s versions + +on: + workflow_call: + +jobs: + smoke-tests: + name: ubuntu-latest + strategy: + fail-fast: false + matrix: + kubernetesVersion: [v1.24, v1.23, v1.22, v1.21, v1.20] + include: + - kubernetesVersion: v1.24 + kindImage: kindest/node:v1.24.0@sha256:406fd86d48eaf4c04c7280cd1d2ca1d61e7d0d61ddef0125cb097bc7b82ed6a1 + - kubernetesVersion: v1.23 + kindImage: kindest/node:v1.23.6@sha256:1af0f1bee4c3c0fe9b07de5e5d3fafeb2eec7b4e1b268ae89fcab96ec67e8355 + - kubernetesVersion: v1.22 + kindImage: kindest/node:v1.22.9@sha256:6e57a6b0c493c7d7183a1151acff0bfa44bf37eb668826bf00da5637c55b6d5e + - kubernetesVersion: v1.21 + kindImage: kindest/node:v1.21.12@sha256:ae05d44cc636ee961068399ea5123ae421790f472c309900c151a44ee35c3e3e + - kubernetesVersion: v1.20 + kindImage: kindest/node:v1.20.15@sha256:a6ce604504db064c5e25921c6c0fffea64507109a1f2a512b1b562ac37d652f3 + + uses: kedacore/keda/.github/workflows/template-smoke-tests.yml@main + with: + runs-on: ubuntu-latest + kubernetesVersion: ${{ matrix.kubernetesVersion }} + kindImage: ${{ matrix.kindImage }} diff --git a/CHANGELOG.md b/CHANGELOG.md index b07b5256a91..114108ab41c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -89,6 +89,7 @@ None. ### Other - **General:** Execute trivy scan (on PRs) only if there are changes in deps ([#3540](https://github.com/kedacore/keda/issues/3540)) +- **General:** Use re-usable workflows for GitHub Actions ([#2569](https://github.com/kedacore/keda/issues/2569)) ## v2.8.0 diff --git a/Makefile b/Makefile index 164c0220a8b..65a197da549 100644 --- a/Makefile +++ b/Makefile @@ -103,9 +103,9 @@ e2e-test-clean-crds: ## Delete all scaled objects and jobs across all namespaces e2e-test-clean: get-cluster-context ## Delete all namespaces labeled with type=e2e kubectl delete ns -l type=e2e -.PHONY: arm-smoke-test -arm-smoke-test: ## Run e2e tests against Kubernetes cluster configured in ~/.kube/config. - ./tests/run-arm-smoke-tests.sh +.PHONY: smoke-test +smoke-test: ## Run e2e tests against Kubernetes cluster configured in ~/.kube/config. + ./tests/run-smoke-tests.sh ################################################## # Development # diff --git a/tests/run-arm-smoke-tests.sh b/tests/run-smoke-tests.sh similarity index 98% rename from tests/run-arm-smoke-tests.sh rename to tests/run-smoke-tests.sh index c4516e62764..e31e9af3ae8 100755 --- a/tests/run-arm-smoke-tests.sh +++ b/tests/run-smoke-tests.sh @@ -4,6 +4,7 @@ set -u DIR=$(dirname "$0") cd $DIR +# use only e2e test which support running on ARM test_files=( "scalers/kubernetes_workload/kubernetes_workload_test.go" "scalers/activemq/activemq_test.go" From 5aa25560dc30c578e41188e205e639dc7f7995ec Mon Sep 17 00:00:00 2001 From: Jorge Turrado Ferrero Date: Thu, 1 Sep 2022 20:08:04 +0200 Subject: [PATCH 14/14] fix: Address style issue in template (#3641) --- .github/workflows/template-trivy-scan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/template-trivy-scan.yml b/.github/workflows/template-trivy-scan.yml index 60ca5d2df7f..6873ce94432 100644 --- a/.github/workflows/template-trivy-scan.yml +++ b/.github/workflows/template-trivy-scan.yml @@ -19,7 +19,7 @@ on: severity: required: false type: string - default: "CRITICAL,HIGH" + default: "CRITICAL,HIGH" exit-code: required: true type: number