From bc312d7dc1222c34ca0e6e58cdc21bf8d81b19ac Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Tue, 13 Oct 2020 15:52:35 -0700 Subject: [PATCH 1/8] using dedicated HTTP clients fixes https://github.com/kedacore/keda/issues/1133 Signed-off-by: Aaron Schlesinger --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 2 +- .github/ISSUE_TEMPLATE/config.yml | 5 +- .github/dependabot.yml | 26 +++ .github/workflows/build-tools.yml | 6 +- .github/workflows/fossa.yml | 10 +- .../{master-build.yml => main-build.yml} | 8 +- .github/workflows/nightly-e2e.yml | 4 +- .github/workflows/pr-validation.yml | 16 +- .github/workflows/release-build.yml | 16 +- .../workflows/{v2-build.yml => v1-build.yml} | 8 +- .golangci.yml | 8 +- BRANDING.md | 59 ------ BUILD.md | 2 +- CHANGELOG.md | 17 ++ CONTRIBUTING.md | 11 +- CREATE-NEW-SCALER.md | 10 +- Dockerfile | 6 +- Dockerfile.adapter | 6 +- GOVERNANCE.md | 46 ---- MAINTAINERS.md | 19 -- Makefile | 13 +- README.md | 50 ++--- adapter/main.go | 31 ++- config/default/kustomization.yaml | 2 +- config/manager/kustomization.yaml | 2 +- config/metrics-server/kustomization.yaml | 2 +- controllers/hpa.go | 6 +- controllers/scaledjob_controller.go | 14 +- controllers/scaledjob_finalizer.go | 4 +- controllers/scaledobject_controller.go | 13 +- controllers/scaledobject_finalizer.go | 4 +- controllers/suite_test.go | 2 +- controllers/util/status.go | 2 +- go.mod | 30 +-- go.sum | 197 ++++-------------- hack/update-codegen.sh | 19 +- hack/verify-codegen.sh | 5 +- main.go | 8 +- .../clientset/versioned/clientset.go | 2 +- .../versioned/fake/clientset_generated.go | 6 +- .../clientset/versioned/fake/register.go | 2 +- .../clientset/versioned/scheme/register.go | 2 +- .../keda/v1alpha1/fake/fake_keda_client.go | 2 +- .../keda/v1alpha1/fake/fake_scaledjob.go | 2 +- .../keda/v1alpha1/fake/fake_scaledobject.go | 2 +- .../fake/fake_triggerauthentication.go | 2 +- .../typed/keda/v1alpha1/keda_client.go | 4 +- .../typed/keda/v1alpha1/scaledjob.go | 4 +- .../typed/keda/v1alpha1/scaledobject.go | 4 +- .../keda/v1alpha1/triggerauthentication.go | 4 +- .../informers/externalversions/factory.go | 6 +- .../informers/externalversions/generic.go | 2 +- .../internalinterfaces/factory_interfaces.go | 2 +- .../externalversions/keda/interface.go | 4 +- .../keda/v1alpha1/interface.go | 2 +- .../keda/v1alpha1/scaledjob.go | 8 +- .../keda/v1alpha1/scaledobject.go | 8 +- .../keda/v1alpha1/triggerauthentication.go | 8 +- .../listers/keda/v1alpha1/scaledjob.go | 2 +- .../listers/keda/v1alpha1/scaledobject.go | 2 +- .../keda/v1alpha1/triggerauthentication.go | 2 +- pkg/provider/provider.go | 10 +- pkg/scalers/artemis_scaler.go | 18 +- pkg/scalers/artemis_scaler_test.go | 6 +- pkg/scalers/aws_cloudwatch_scaler.go | 2 +- pkg/scalers/aws_iam_authorization.go | 2 +- pkg/scalers/aws_kinesis_stream_scaler.go | 2 +- pkg/scalers/aws_sqs_queue_scaler.go | 2 +- pkg/scalers/azure/azure_aad_podidentity.go | 11 +- pkg/scalers/azure/azure_blob.go | 7 +- pkg/scalers/azure/azure_blob_test.go | 6 +- pkg/scalers/azure/azure_eventhub.go | 51 ++++- pkg/scalers/azure/azure_monitor.go | 2 +- pkg/scalers/azure/azure_queue.go | 7 +- pkg/scalers/azure/azure_queue_test.go | 5 +- pkg/scalers/azure/azure_storage.go | 11 +- pkg/scalers/azure_blob_scaler.go | 11 +- pkg/scalers/azure_blob_scaler_test.go | 9 +- pkg/scalers/azure_eventhub_scaler.go | 63 ++++-- pkg/scalers/azure_eventhub_scaler_test.go | 36 +++- pkg/scalers/azure_log_analytics_scaler.go | 191 ++++++++--------- .../azure_log_analytics_scaler_test.go | 11 +- pkg/scalers/azure_monitor_scaler.go | 43 ++-- pkg/scalers/azure_monitor_scaler_test.go | 2 +- pkg/scalers/azure_queue_scaler.go | 13 +- pkg/scalers/azure_queue_scaler_test.go | 9 +- pkg/scalers/azure_servicebus_scaler.go | 18 +- pkg/scalers/azure_servicebus_scaler_test.go | 51 +++-- pkg/scalers/cron_scaler.go | 2 +- pkg/scalers/external_scaler.go | 2 +- pkg/scalers/external_scaler_test.go | 2 +- pkg/scalers/gcp_pub_sub_scaler.go | 41 +++- pkg/scalers/gcp_pubsub_scaler_test.go | 23 +- pkg/scalers/huawei_cloudeye_scaler.go | 2 +- pkg/scalers/ibmmq_scaler.go | 2 +- pkg/scalers/kafka_scaler.go | 25 ++- pkg/scalers/liiklus/mocks/mock_liiklus.go | 4 +- pkg/scalers/liiklus_scaler.go | 4 +- pkg/scalers/liiklus_scaler_test.go | 4 +- pkg/scalers/metrics_api_scaler.go | 26 +-- pkg/scalers/mysql_scaler.go | 2 +- pkg/scalers/postgresql_scaler.go | 2 +- pkg/scalers/prometheus_scaler.go | 14 +- pkg/scalers/prometheus_scaler_test.go | 6 +- pkg/scalers/rabbitmq_scaler.go | 18 +- pkg/scalers/rabbitmq_scaler_test.go | 17 +- pkg/scalers/redis_scaler.go | 2 +- pkg/scalers/redis_streams_scaler.go | 2 +- pkg/scalers/scaler.go | 6 +- pkg/scalers/stan_scaler.go | 22 +- pkg/scalers/stan_scaler_test.go | 7 +- pkg/scaling/executor/scale_executor.go | 2 +- pkg/scaling/executor/scale_jobs.go | 23 +- pkg/scaling/executor/scale_jobs_test.go | 4 +- pkg/scaling/executor/scale_scaledobjects.go | 2 +- .../resolver/hashicorpvault_handler.go | 2 +- pkg/scaling/resolver/scale_resolvers.go | 2 +- pkg/scaling/resolver/scale_resolvers_test.go | 2 +- pkg/scaling/scale_handler.go | 61 +++--- pkg/util/gvkr.go | 2 +- pkg/util/http.go | 27 +++ tests/scalers/stan-helpers.ts | 189 +++++++++++++++++ tests/scalers/stan.test.ts | 96 +++++++++ tools/build-tools.Dockerfile | 4 +- version/version.go | 2 +- 126 files changed, 1198 insertions(+), 827 deletions(-) create mode 100644 .github/dependabot.yml rename .github/workflows/{master-build.yml => main-build.yml} (92%) rename .github/workflows/{v2-build.yml => v1-build.yml} (93%) delete mode 100644 BRANDING.md delete mode 100644 GOVERNANCE.md delete mode 100644 MAINTAINERS.md create mode 100644 pkg/util/http.go create mode 100644 tests/scalers/stan-helpers.ts create mode 100644 tests/scalers/stan.test.ts diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f1ef3857371..286495786c0 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -3,7 +3,7 @@ # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. #------------------------------------------------------------------------------------------------------------- -FROM golang:1.15.1 +FROM golang:1.15.3 # Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ac16988e453..4c295ad7c37 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -29,6 +29,6 @@ // Add the IDs of extensions you want installed when the container is created in the array below. "extensions": [ - "ms-vscode.go" + "golang.go" ] } diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index d60106bb583..5823801af6d 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,8 @@ blank_issues_enabled: false contact_links: - - name: Ask a question or get support + - name: Ask a question about KEDA or get support url: https://github.com/kedacore/keda/discussions/new about: Ask a question or request support for using KEDA + - name: Ask a question related to governance + url: https://github.com/kedacore/governance/discussions/new + about: Ask a question about the governance of KEDA diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000000..9df99c3d114 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,26 @@ +version: 2 +updates: +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 + labels: + - enhancement + - dependency-management +- package-ecosystem: gomod + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 + labels: + - enhancement + - dependency-management +- package-ecosystem: docker + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 + labels: + - enhancement + - dependency-management diff --git a/.github/workflows/build-tools.yml b/.github/workflows/build-tools.yml index 1bfd1f9c2c7..2120a9813b5 100644 --- a/.github/workflows/build-tools.yml +++ b/.github/workflows/build-tools.yml @@ -1,9 +1,9 @@ -name: build-tools CI +name: build-tools-CI on: push: branches: - - master - - v2 + - main + - v1 paths: - 'tools/**' jobs: diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml index 941eaff0f97..d22b4c94ed9 100644 --- a/.github/workflows/fossa.yml +++ b/.github/workflows/fossa.yml @@ -1,20 +1,20 @@ name: FOSSA on: push: - branches: [master] + branches: [main] pull_request: - branches: [master] + branches: [main] jobs: build: runs-on: ubuntu-latest # build-tools is built from ../../tools/build-tools.Dockerfile - container: kedacore/build-tools:latest + container: kedacore/build-tools:main steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v1 - uses: actions/setup-go@v2 with: - go-version: "^1.13.1" + go-version: "^1.15.5" - run: go version # Runs a set of commands to initialize and analyze with FOSSA - name: run FOSSA analysis diff --git a/.github/workflows/master-build.yml b/.github/workflows/main-build.yml similarity index 92% rename from .github/workflows/master-build.yml rename to .github/workflows/main-build.yml index 1a2dab4d0d6..66b216816bd 100644 --- a/.github/workflows/master-build.yml +++ b/.github/workflows/main-build.yml @@ -1,14 +1,14 @@ -name: master build +name: main-build on: push: branches: - - master + - main jobs: validate: name: Validate runs-on: ubuntu-latest # build-tools is built from ../../tools/build-tools.Dockerfile - container: kedacore/build-tools:latest + container: kedacore/build-tools:main steps: - name: Check out code uses: actions/checkout@v1 @@ -16,7 +16,7 @@ jobs: fetch-depth: 1 - name: Go modules cache - uses: actions/cache@v1 + uses: actions/cache@v2.1.3 with: path: /go/pkg key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} diff --git a/.github/workflows/nightly-e2e.yml b/.github/workflows/nightly-e2e.yml index 829225f4822..32b813bf0ab 100644 --- a/.github/workflows/nightly-e2e.yml +++ b/.github/workflows/nightly-e2e.yml @@ -1,4 +1,4 @@ -name: nightly e2e test +name: nightly-e2e-test on: schedule: - cron: "0 0 * * *" @@ -7,7 +7,7 @@ jobs: name: Test runs-on: ubuntu-latest # build-tools is built from ../../tools/build-tools.Dockerfile - container: kedacore/build-tools:latest + container: kedacore/build-tools:main steps: - name: Check out code uses: actions/checkout@v1 diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml index ee329870048..60e106454d8 100644 --- a/.github/workflows/pr-validation.yml +++ b/.github/workflows/pr-validation.yml @@ -8,7 +8,7 @@ jobs: name: Validate PR runs-on: ubuntu-latest # build-tools is built from ../../tools/build-tools.Dockerfile - container: kedacore/build-tools:v2 + container: kedacore/build-tools:main steps: - name: Check out code uses: actions/checkout@v1 @@ -16,7 +16,7 @@ jobs: fetch-depth: 1 - name: Go modules cache - uses: actions/cache@v1 + uses: actions/cache@v2.1.3 with: path: /go/pkg key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -36,14 +36,14 @@ jobs: name: Static Checks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 - - uses: actions/setup-go@v2-beta + - uses: actions/checkout@v1 + - uses: actions/setup-python@v2.1.4 + - uses: actions/setup-go@v2 with: - go-version: 1.15.1 + go-version: 1.15.5 - name: Get golangci run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.31.0 - - uses: pre-commit/action@v1.0.1 + - uses: pre-commit/action@v2.0.0 codeScanning: name: Code Scanning @@ -57,7 +57,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v1 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 78b8829f5ee..ba5e11b39f9 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -1,4 +1,4 @@ -name: release build +name: release-build on: push: tags: @@ -8,7 +8,7 @@ jobs: name: Push Release runs-on: ubuntu-latest # build-tools is built from ../../tools/build-tools.Dockerfile - container: kedacore/build-tools:latest + container: kedacore/build-tools:main steps: - name: Check out code uses: actions/checkout@v1 @@ -16,7 +16,7 @@ jobs: fetch-depth: 1 - name: Go modules cache - uses: actions/cache@v1 + uses: actions/cache@v2.1.3 with: path: /go/pkg key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} @@ -33,20 +33,20 @@ jobs: id: get_version run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/v} - - name: Publish KEDA images to Docker Hub - run: make publish + - name: Release Deployment YAML file + run: make release env: VERSION: ${{ steps.get_version.outputs.VERSION }} - - name: Release Deployment YAML file - run: make release + - name: Publish KEDA images to Docker Hub + run: make publish env: VERSION: ${{ steps.get_version.outputs.VERSION }} # Get release information to determine id of the current release - name: Get Release id: get-release-info - uses: bruceadams/get-release@v1.2.0 + uses: bruceadams/get-release@v1.2.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/v2-build.yml b/.github/workflows/v1-build.yml similarity index 93% rename from .github/workflows/v2-build.yml rename to .github/workflows/v1-build.yml index c8612e78a44..ec2b5edcae1 100644 --- a/.github/workflows/v2-build.yml +++ b/.github/workflows/v1-build.yml @@ -1,14 +1,14 @@ -name: v2 build +name: v1-build on: push: branches: - - v2 + - v1 jobs: validate: name: Validate runs-on: ubuntu-latest # build-tools is built from ../../tools/build-tools.Dockerfile - container: kedacore/build-tools:v2 + container: kedacore/build-tools:v1 steps: - name: Check out code uses: actions/checkout@v1 @@ -16,7 +16,7 @@ jobs: fetch-depth: 1 - name: Go modules cache - uses: actions/cache@v1 + uses: actions/cache@v2.1.3 with: path: /go/pkg key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} diff --git a/.golangci.yml b/.golangci.yml index 8406ad0eece..2b32473fd77 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -28,13 +28,13 @@ linters: - scopelint - structcheck - deadcode - #- depguard - #- dogsled + - depguard + - dogsled #- errcheck #- funlen - #- goconst + - goconst #- gocritic - #- gocyclo + - gocyclo - gosimple - stylecheck - unused diff --git a/BRANDING.md b/BRANDING.md deleted file mode 100644 index 07c216b8a9f..00000000000 --- a/BRANDING.md +++ /dev/null @@ -1,59 +0,0 @@ -# Branding - -Kubernetes-based Event Driven Autoscaling is a CNCF Sandbox project and follows to the [CNCF/LF trademark usage](https://www.linuxfoundation.org/trademark-usage/). - -When referring to Kubernetes-based Event Driven Autoscaling in short, it should be called "KEDA" with full upper-casing. - -## Logos - -We provide various logos to use for both online & print usage: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PNGSVG
HorizontalIconHorizontalIcon
OnlineColor
Black
White
Print
- - They can also be found on the [official CNCF Artwork](https://github.com/cncf/artwork/blob/master/examples/sandbox.md#keda-logos) page. diff --git a/BUILD.md b/BUILD.md index ae4479196c4..f9c04fc5368 100644 --- a/BUILD.md +++ b/BUILD.md @@ -52,7 +52,7 @@ make build This project is using [Operator SDK framework](https://github.com/operator-framework/operator-sdk), make sure you have installed the right version. To check the current version used for KEDA check the `RELEASE_VERSION` in file -[tools/build-tools.Dockerfile](https://github.com/kedacore/keda/blob/master/tools/build-tools.Dockerfile). +[tools/build-tools.Dockerfile](https://github.com/kedacore/keda/blob/main/tools/build-tools.Dockerfile). ```bash git clone git@github.com:kedacore/keda.git diff --git a/CHANGELOG.md b/CHANGELOG.md index 656fa08f3d2..8fad8642b66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ## History +- [Unreleased](#unreleased) - [v2.0.0](#v200) - [v1.5.0](#v150) - [v1.4.1](#v141) @@ -13,10 +14,25 @@ - [v1.1.0](#v110) - [v1.0.0](#v100) +## Unreleased + +### New +- Can use Pod Identity with Azure Event Hub scaler ([#994](https://github.com/kedacore/keda/issues/994)) + +### Improvements +- Support add ScaledJob's label to its job ([#1311](https://github.com/kedacore/keda/issues/1311)) +- Bug fix in aws_iam_authorization to utilize correct secret from env key name ([PR #1332](https://github.com/kedacore/keda/pull/1332)) + +### Breaking Changes + +### Other +- Bump go module version to v2 ([#1324](https://github.com/kedacore/keda/pull/1324)) + ## v2.0.0 ### New +- KEDA uses a dedicated [HTTP client](https://pkg.go.dev/net/http#Client), connection pool, and (optional) TLS certificate for each configured scaler - KEDA scales any CustomResource that implements Scale subresource ([#703](https://github.com/kedacore/keda/issues/703)) - Provide KEDA go-client ([#494](https://github.com/kedacore/keda/issues/494)) - Define KEDA readiness and liveness probes ([#788](https://github.com/kedacore/keda/issues/788)) @@ -43,6 +59,7 @@ - Added ScaledObject Status Conditions to display status of scaling ([#750](https://github.com/kedacore/keda/pull/750)) - Added optional authentication parameters for the Redis Scaler ([#962](https://github.com/kedacore/keda/pull/962)) - Improved GCP PubSub Scaler performance by closing the client correctly ([#1087](https://github.com/kedacore/keda/pull/1087)) +- Added support for Trigger Authentication for GCP PubSub scaler ([#1291](https://github.com/kedacore/keda/pull/1291)) ### Breaking Changes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 78a2a795c44..bafdbb064b9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,18 +23,17 @@ There are many areas we can use contributions - ranging from code, documentation ## Project governance -KEDA project is an open source project governed according to rules described in [`GOVERNANCE`](GOVERNANCE.md). If you -would love to become a maintainer to support our project please create an issue as described in [`GOVERNANCE`](GOVERNANCE.md). +You can learn about the governance of KEDA [here](https://github.com/kedacore/governance). ## Getting Help -If you have a question about KEDA or how best to contribute, the [#KEDA](https://kubernetes.slack.com/archives/CKZJ36A5D) channel on the Kubernetes slack channel ([get an invite if you don't have one already](https://slack.k8s.io/)) is a good place to start. We also have regular [community stand-ups](https://github.com/kedacore/keda#community-standup) to track ongoing work and discuss areas of contribution. For any issues with the product you can [create an issue](https://github.com/kedacore/keda/issues/new) in this repo. +If you have a question about KEDA or how best to contribute, the [#KEDA](https://kubernetes.slack.com/archives/CKZJ36A5D) channel on the Kubernetes slack channel ([get an invite if you don't have one already](https://slack.k8s.io/)) is a good place to start. We also have regular [community stand-ups](https://github.com/kedacore/keda#community) to track ongoing work and discuss areas of contribution. For any issues with the product you can [create an issue](https://github.com/kedacore/keda/issues/new) in this repo. ## Contributing Scalers -One of the easiest ways to contribute is adding scalers. Scalers are the logic on when to activate a container (scaling from zero to one) and also how to serve metrics for an event source. You can view [the code for existing scalers here](https://github.com/kedacore/keda/tree/master/pkg/scalers). When writing a scaler, please consider: +One of the easiest ways to contribute is adding scalers. Scalers are the logic on when to activate a container (scaling from zero to one) and also how to serve metrics for an event source. You can view [the code for existing scalers here](https://github.com/kedacore/keda/tree/main/pkg/scalers). When writing a scaler, please consider: -1. Is this an event source that many others will access from Kubernetes? If not, potentially consider [creating an external scaler](https://github.com/kedacore/keda/blob/master/pkg/scalers/externalscaler/externalscaler.proto). +1. Is this an event source that many others will access from Kubernetes? If not, potentially consider [creating an external scaler](https://github.com/kedacore/keda/blob/main/pkg/scalers/externalscaler/externalscaler.proto). 1. Provide tests 1. Provide [documentation and examples](https://github.com/kedacore/keda-docs#adding-scaler-documentation) for [keda.sh](https://keda.sh) @@ -91,7 +90,7 @@ No worries - You can easily replay your changes, sign them and force push them! ``` git checkout -git reset $(git merge-base master ) +git reset $(git merge-base main ) git add -A git commit -sm "one commit on " git push --force diff --git a/CREATE-NEW-SCALER.md b/CREATE-NEW-SCALER.md index e42bd8d5ff5..d8662b5091f 100644 --- a/CREATE-NEW-SCALER.md +++ b/CREATE-NEW-SCALER.md @@ -13,12 +13,12 @@ In order to develop a scaler, a developer should do the following: If you want to deploy locally 1. Open the terminal and go to the root of the source code -2. Run `IMAGE_REPO=johndoe make publish`, where `johndoe ` is your Docker Hub repo, this will create and publis images with your build of KEDA into your repo. Please refer [the guide for local deployment](Readme.md#deploying-custom-keda-locally-outside-cluster) for more details. +2. Run `IMAGE_REPO=johndoe make publish`, where `johndoe` is your Docker Hub repo, this will create and publish images with your build of KEDA into your repo. Please refer [the guide for local deployment](Readme.md#deploying-custom-keda-locally-outside-cluster) for more details. 3. Run `IMAGE_REPO=johndoe make deploy`, this will deploy KEDA to your cluster. ## Scaler interface -The scalers in KEDA are implementations of a KEDA `Scaler` Go interface declared in `pkg/scalers/scaler.go`. This documentation describes how scalers works and is targeted towards contributors and maintainers. +The scalers in KEDA are implementations of a KEDA `Scaler` Go interface declared in `pkg/scalers/scaler.go`. This documentation describes how scalers work and is targeted towards contributors and maintainers. ### GetMetrics @@ -28,7 +28,7 @@ This is the key function of a scaler; it returns a value that represents a curre - `WindowSeconds`: //TODO - `Value`: A numerical value that represents the state of the metric. It could be the length of a queue, or it can be the amount of lag in a stream, but it can also be a simple representation of the state. -Kubernetes HPA (Horizontal Pod Autoscaler) will poll `GetMetrics` reulgarly through KEDA's metric server (as long as there is at least one pod), and compare the returned value to a configured value in the ScaledObject configuration. Kubernetes will use the following formula to decide whether to scale the pods up and down: +Kubernetes HPA (Horizontal Pod Autoscaler) will poll `GetMetrics` regularly through KEDA's metric server (as long as there is at least one pod), and compare the returned value to a configured value in the ScaledObject configuration. Kubernetes will use the following formula to decide whether to scale the pods up and down: `desiredReplicas = ceil[currentReplicas * ( currentMetricValue / desiredMetricValue )]`. @@ -48,12 +48,14 @@ The return type of this function is `MetricSpec`, but in KEDA's case we will mos For some reason, the scaler might need to declare itself as in-active, and the way it can do this is through implementing the function `IsActive`. -KEDA polls ScaledObject object according to the `pollingInterval` confiugred in the ScaledObject; it checks the last time it was polled, it checks if the number of replicas is greater than 0, and if the scaler itself is active. So if the scaler returns false for `IsActive`, and if current number of replicas is greater than 0, and there is no configured minimum pods, then KEDA scales down to 0. +KEDA polls ScaledObject object according to the `pollingInterval` configured in the ScaledObject; it checks the last time it was polled, it checks if the number of replicas is greater than 0, and if the scaler itself is active. So if the scaler returns false for `IsActive`, and if current number of replicas is greater than 0, and there is no configured minimum pods, then KEDA scales down to 0. ### Close + After each poll on the scaler to retrieve the metrics, KEDA calls this function for each scaler to give the scaler the opportunity to close any resources, like http clients for example. ### Constructor + What is missing from the `scaler` interface is a function that constructs the scaler itself. Up until the moment of writing this document, KEDA does not have a dynamic way to load scalers (at least not officially)[***]; instead scalers are part of KEDA's code-base, and they are shipped with KEDA's binary. Thus, each scaler should have a constructing function, KEDA will [explicitly invoke](https://github.com/kedacore/keda/blob/4d0cf5ef09ef348cf3a158634910f00741ae5258/pkg/handler/scale_handler.go#L565) the construction function based on the `trigger` property configured in the ScaledObject. diff --git a/Dockerfile b/Dockerfile index 4c5e94bd512..303245bfd05 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ # Build the manager binary -FROM golang:1.15.1 as builder +FROM golang:1.15.5 as builder + +ARG BUILD_VERSION WORKDIR /workspace @@ -24,7 +26,7 @@ COPY pkg/ pkg/ COPY .git/ .git/ # Build -RUN make manager +RUN VERSION=${BUILD_VERSION} make manager # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/Dockerfile.adapter b/Dockerfile.adapter index efc0561b810..749001fb73e 100644 --- a/Dockerfile.adapter +++ b/Dockerfile.adapter @@ -1,5 +1,7 @@ # Build the manager binary -FROM golang:1.15.1 as builder +FROM golang:1.15.5 as builder + +ARG BUILD_VERSION WORKDIR /workspace @@ -26,7 +28,7 @@ COPY .git/ .git/ RUN mkdir -p /apiserver.local.config/certificates && chmod -R 777 /apiserver.local.config # Build -RUN make adapter +RUN VERSION=${BUILD_VERSION} make adapter # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/GOVERNANCE.md b/GOVERNANCE.md deleted file mode 100644 index ebf8d2a0380..00000000000 --- a/GOVERNANCE.md +++ /dev/null @@ -1,46 +0,0 @@ -# Governance - -## Project Maintainers - -[Project maintainers](MAINTAINERS.md) are responsible for activities around -maintaining and updating the KEDA. Final decisions on the features -reside with the project maintainers. - -Maintainers MUST remain active. If they are unresponsive for >3 months, they -will be automatically removed unless a -[super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) of -the other project maintainers agrees to extend the period to be greater than 3 -months. - -New maintainers can be added to the project by a -[super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) -vote of the existing maintainers. A potential maintainer may be nominated by an -existing maintainer. A vote is conducted in private between the current -maintainers over the course of a one week voting period. At the end of the week, -votes are counted and a pull request is made on the repo adding the new -maintainer to the [MAINTAINERS](MAINTAINERS.md) file. - -Individuals interested in becoming maintainers may submit an [issue](https://github.com/kedacore/keda/issues/new) -stating their interest. Existing maintainers can choose if they would -like to nominate these individuals to be a maintainer following the process -above. - -A maintainer may step down by submitting an -[issue](https://github.com/kedacore/keda/issues/new) stating their intent. - -Changes to this governance document require a pull request with approval from a -[super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) of -the current maintainers. - -## Managing Projects - -New projects can be added to the organization after a successful -[super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) -vote of the existing maintainers. - -Contributors who want to donate an add-on scaler, sample or donate a repo must -create an issue explaining what the benefit would be for KEDA after which the -maintainers will vote and require a [super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) -of the current maintainers. - -When KEDA wants to archive an existing project, maintainers have to take vote where a [super-majority](https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote) of the current maintainers agrees to archive the project with a clear indication of why it is being archived. We must not delete projects to avoid customer confusion. diff --git a/MAINTAINERS.md b/MAINTAINERS.md deleted file mode 100644 index 70ec76cc12a..00000000000 --- a/MAINTAINERS.md +++ /dev/null @@ -1,19 +0,0 @@ -# Kubernetes Event-driven Autoscaling (KEDA) Maintainers - -## Current - -| Maintainer | GitHub ID | Affiliation | -| -------------------- | --------------------------------------------- | ----------- | -| Jeff Hollan | [jeffhollan](https://github.com/jeffhollan) | Microsoft | -| Anirudh Garg | [anirudhgarg](https://github.com/anirudhgarg) | Microsoft | -| Ahmed ElSayed | [ahmelsayed](https://github.com/ahmelsayed) | Microsoft | -| Zbynek Roubalik | [zroubalik](https://github.com/zroubalik) | Red Hat | -| Tom Kerkhove | [tomkerkhove](https://github.com/tomkerkhove) | Codit | - -## Alumni - -| Maintainer | GitHub ID | Affiliation | -| -------------------- | --------------------------------------------- | ----------- | -| Aarthi Saravanakumar | [Aarthisk](https://github.com/Aarthisk) | Microsoft | -| Yaron Schneider | [yaron2](https://github.com/yaron2) | Microsoft | -| Ben Browning | [bbrowning](https://github.com/bbrowning) | Red Hat | diff --git a/Makefile b/Makefile index 3bcb250f070..dcd2bc63c59 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,14 @@ ################################################## # Variables # ################################################## -VERSION ?= v2 +VERSION ?= main IMAGE_REGISTRY ?= docker.io IMAGE_REPO ?= kedacore IMAGE_CONTROLLER = $(IMAGE_REGISTRY)/$(IMAGE_REPO)/keda:$(VERSION) IMAGE_ADAPTER = $(IMAGE_REGISTRY)/$(IMAGE_REPO)/keda-metrics-apiserver:$(VERSION) -IMAGE_BUILD_TOOLS = $(IMAGE_REGISTRY)/$(IMAGE_REPO)/build-tools:v2 +IMAGE_BUILD_TOOLS = $(IMAGE_REGISTRY)/$(IMAGE_REPO)/build-tools:main ARCH ?=amd64 CGO ?=0 @@ -130,9 +130,9 @@ undeploy: build: manifests set-version manager adapter # Build the docker image -docker-build: build - docker build . -t ${IMAGE_CONTROLLER} - docker build -f Dockerfile.adapter -t ${IMAGE_ADAPTER} . +docker-build: + docker build . -t ${IMAGE_CONTROLLER} --build-arg BUILD_VERSION=${VERSION} + docker build -f Dockerfile.adapter -t ${IMAGE_ADAPTER} . --build-arg BUILD_VERSION=${VERSION} # Build KEDA Operator binary .PHONY: manager @@ -233,9 +233,6 @@ clientset-verify: clientset-prepare .PHONY: clientset-generate clientset-generate: clientset-prepare ./hack/update-codegen.sh - find ./pkg/generated -type f -name "*.go" |\ - xargs sed -i".out" -e "s#github.com/kedacore/keda/api/keda/v1alpha1#github.com/kedacore/keda/api/v1alpha1#g" - find ./pkg/generated -type f -name "*.go.out" | xargs rm -rf rm -rf api/keda ################################################## diff --git a/README.md b/README.md index 6c7e65fec27..0474f7e6084 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,8 @@ -

This branch contains KEDA v2.0.0 Release Candidate 2, currently under development

- -## How can I try KEDA v2 Release Candidate 2 version? -Make sure to remove previous KEDA (including CRD) from the cluster. You can use KEDA Helm chart (include `--devel` when listing) or deploy directly this yaml file: -```bash -kubectl apply -f https://github.com/kedacore/keda/releases/download/v2.0.0-rc2/keda-2.0.0-rc2.yaml -``` -To uninstall run: -```bash -kubectl delete -f https://github.com/kedacore/keda/releases/download/v2.0.0-rc2/keda-2.0.0-rc2.yaml -``` -

Kubernetes-based Event Driven Autoscaling

-v2 build -nightly e2e +main build +nightly e2e Twitter

@@ -26,22 +14,21 @@ KEDA can run on both the cloud and the edge, integrates natively with Kubernetes Pod Autoscaler, and has no external dependencies. We are a Cloud Native Computing Foundation (CNCF) sandbox project. -

+

**Table of contents** - [Getting started](#getting-started) -- [Deploying KEDA](#deploying-keda) + - [Deploying KEDA](#deploying-keda) - [Documentation](#documentation) -- [Guidelines](#guidelines) - - [Branding](#branding) -- [FAQ](#faq) +- [Governance & Policies](#governance--policies) - [Community](#community) -- [Become a listed KEDA user!](#become-a-listed-keda-user) + - [Become a listed KEDA user!](#become-a-listed-keda-user) - [Releases](#releases) - [Contributing](#contributing) + - [Building & deploying locally](#building--deploying-locally) @@ -54,7 +41,7 @@ We are a Cloud Native Computing Foundation (CNCF) sandbox project. You can find several samples for various event sources [here](https://github.com/kedacore/samples). -## Deploying KEDA +### Deploying KEDA There are many ways to [deploy KEDA including Helm, Operator Hub and YAML files](https://keda.sh/docs/latest/deploy/). @@ -62,21 +49,15 @@ There are many ways to [deploy KEDA including Helm, Operator Hub and YAML files] Interested to learn more? Head over to [keda.sh](https://keda.sh). -## Guidelines - -### Branding - -We provide guidelines around branding of KEDA and related logos, learn more in our [guidelines](./BRANDING.md). +## Governance & Policies -## FAQ - -You can find a [FAQ here](https://keda.sh/docs/latest/faq/) with some common questions. +You can learn about the governance of KEDA [here](https://github.com/kedacore/governance). ## Community If interested in contributing or participating in the direction of KEDA, you can join our community meetings. -* **Meeting time:** Bi-weekly Thurs 16:00 UTC (does follow US daylight savings). +* **Meeting time:** Bi-weekly Tues 16:00 UTC (does follow US daylight savings). ([Subscribe to Google Agenda](https://calendar.google.com/calendar?cid=bjE0bjJtNWM0MHVmam1ob2ExcTgwdXVkOThAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ) | [Convert to your timezone](https://www.thetimezoneconverter.com/?t=04%3A00%20pm&tz=UTC)) * **Zoom link:** [https://us02web.zoom.us/j/150360492?pwd=eUVtQzBPMzFoQUR2K1dqUWhENjJJdz09](https://us02web.zoom.us/j/150360492?pwd=eUVtQzBPMzFoQUR2K1dqUWhENjJJdz09) (Password: keda) @@ -85,9 +66,9 @@ If interested in contributing or participating in the direction of KEDA, you can Just want to learn or chat about KEDA? Feel free to join the conversation in **[#KEDA](https://kubernetes.slack.com/messages/CKZJ36A5D)** on the **[Kubernetes Slack](https://slack.k8s.io/)**! -## Become a listed KEDA user! +### Become a listed KEDA user! -We are always happy to [list users](https://keda.sh/community/#users) who run KEDA in production, learn more about it [here](./README.md#become-a-listed-keda-user). +We are always happy to [list users](https://keda.sh/community/#users) who run KEDA in production, learn more about it [here](https://github.com/kedacore/keda-docs#become-a-listed-keda-user). ## Releases @@ -95,4 +76,7 @@ You can find the latest releases [here](https://github.com/kedacore/keda/release ## Contributing -You can find contributing guide [here](./CONTRIBUTING.md) or learn how to build & deploy KEDA locally [here](./BUILD.md). +You can find contributing guide [here](./CONTRIBUTING.md). + +### Building & deploying locally +Learn how to build & deploy KEDA locally [here](./BUILD.md). diff --git a/adapter/main.go b/adapter/main.go index 80f93ef9328..432adeaf71b 100644 --- a/adapter/main.go +++ b/adapter/main.go @@ -5,6 +5,8 @@ import ( "fmt" "os" "runtime" + "strconv" + "time" appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/util/wait" @@ -17,11 +19,11 @@ import ( basecmd "github.com/kubernetes-incubator/custom-metrics-apiserver/pkg/cmd" "github.com/kubernetes-incubator/custom-metrics-apiserver/pkg/provider" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - prommetrics "github.com/kedacore/keda/pkg/metrics" - kedaprovider "github.com/kedacore/keda/pkg/provider" - "github.com/kedacore/keda/pkg/scaling" - "github.com/kedacore/keda/version" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + prommetrics "github.com/kedacore/keda/v2/pkg/metrics" + kedaprovider "github.com/kedacore/keda/v2/pkg/provider" + "github.com/kedacore/keda/v2/pkg/scaling" + "github.com/kedacore/keda/v2/version" ) // Adapter creates External Metrics Provider @@ -39,7 +41,7 @@ var ( prometheusMetricsPath string ) -func (a *Adapter) makeProviderOrDie() provider.MetricsProvider { +func (a *Adapter) makeProviderOrDie(globalHTTPTimeout time.Duration) provider.MetricsProvider { // Get a config to talk to the apiserver cfg, err := config.GetConfig() if err != nil { @@ -65,7 +67,7 @@ func (a *Adapter) makeProviderOrDie() provider.MetricsProvider { os.Exit(1) } - handler := scaling.NewScaleHandler(kubeclient, nil, scheme) + handler := scaling.NewScaleHandler(kubeclient, nil, scheme, globalHTTPTimeout) namespace, err := getWatchNamespace() if err != nil { @@ -106,9 +108,22 @@ func main() { cmd.Flags().AddGoFlagSet(flag.CommandLine) // make sure we get the klog flags cmd.Flags().IntVar(&prometheusMetricsPort, "metrics-port", 9022, "Set the port to expose prometheus metrics") cmd.Flags().StringVar(&prometheusMetricsPath, "metrics-path", "/metrics", "Set the path for the prometheus metrics endpoint") + cmd.Flags().Parse(os.Args) - kedaProvider := cmd.makeProviderOrDie() + globalHTTPTimeoutStr := os.Getenv("KEDA_HTTP_DEFAULT_TIMEOUT") + if globalHTTPTimeoutStr == "" { + // default to 3 seconds if they don't pass the env var + globalHTTPTimeoutStr = "3000" + } + + globalHTTPTimeoutMS, err := strconv.Atoi(globalHTTPTimeoutStr) + if err != nil { + logger.Error(err, "Invalid KEDA_HTTP_DEFAULT_TIMEOUT") + os.Exit(1) + } + + kedaProvider := cmd.makeProviderOrDie(time.Duration(globalHTTPTimeoutMS) * time.Millisecond) cmd.WithExternalMetrics(kedaProvider) logger.Info(cmd.Message) diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 3507dc08ea9..215ae6e3fce 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -19,7 +19,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization commonLabels: app.kubernetes.io/part-of: keda-operator - app.kubernetes.io/version: v2 + app.kubernetes.io/version: main resources: diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 95d231a284e..b317047a84d 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -6,4 +6,4 @@ kind: Kustomization images: - name: docker.io/kedacore/keda newName: docker.io/kedacore/keda - newTag: v2 + newTag: main diff --git a/config/metrics-server/kustomization.yaml b/config/metrics-server/kustomization.yaml index 51249078823..743a08ca4f7 100644 --- a/config/metrics-server/kustomization.yaml +++ b/config/metrics-server/kustomization.yaml @@ -11,4 +11,4 @@ kind: Kustomization images: - name: docker.io/kedacore/keda-metrics-apiserver newName: docker.io/kedacore/keda-metrics-apiserver - newTag: v2 + newTag: main diff --git a/controllers/hpa.go b/controllers/hpa.go index 26076ccad56..33548899fed 100644 --- a/controllers/hpa.go +++ b/controllers/hpa.go @@ -5,14 +5,14 @@ import ( "fmt" "github.com/go-logr/logr" - version "github.com/kedacore/keda/version" + version "github.com/kedacore/keda/v2/version" autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - kedacontrollerutil "github.com/kedacore/keda/controllers/util" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + kedacontrollerutil "github.com/kedacore/keda/v2/controllers/util" ) const ( diff --git a/controllers/scaledjob_controller.go b/controllers/scaledjob_controller.go index 80cdcf31cf2..df7726f2ab9 100644 --- a/controllers/scaledjob_controller.go +++ b/controllers/scaledjob_controller.go @@ -3,6 +3,7 @@ package controllers import ( "context" "fmt" + "time" "github.com/go-logr/logr" batchv1 "k8s.io/api/batch/v1" @@ -14,8 +15,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/predicate" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - "github.com/kedacore/keda/pkg/scaling" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + "github.com/kedacore/keda/v2/pkg/scaling" ) // +kubebuilder:rbac:groups=keda.sh,resources=scaledjobs;scaledjobs/finalizers;scaledjobs/status,verbs="*" @@ -25,14 +26,15 @@ import ( // ScaledJobReconciler reconciles a ScaledJob object type ScaledJobReconciler struct { client.Client - Log logr.Logger - Scheme *runtime.Scheme - scaleHandler scaling.ScaleHandler + Log logr.Logger + Scheme *runtime.Scheme + scaleHandler scaling.ScaleHandler + globalHTTPTimeout time.Duration } // SetupWithManager initializes the ScaledJobReconciler instance and starts a new controller managed by the passed Manager instance. func (r *ScaledJobReconciler) SetupWithManager(mgr ctrl.Manager) error { - r.scaleHandler = scaling.NewScaleHandler(mgr.GetClient(), nil, mgr.GetScheme()) + r.scaleHandler = scaling.NewScaleHandler(mgr.GetClient(), nil, mgr.GetScheme(), r.globalHTTPTimeout) return ctrl.NewControllerManagedBy(mgr). // Ignore updates to ScaledJob Status (in this case metadata.Generation does not change) diff --git a/controllers/scaledjob_finalizer.go b/controllers/scaledjob_finalizer.go index 82aa68328e3..aa0ca78c7a6 100644 --- a/controllers/scaledjob_finalizer.go +++ b/controllers/scaledjob_finalizer.go @@ -5,8 +5,8 @@ import ( "github.com/go-logr/logr" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - "github.com/kedacore/keda/controllers/util" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + "github.com/kedacore/keda/v2/controllers/util" ) const ( diff --git a/controllers/scaledobject_controller.go b/controllers/scaledobject_controller.go index 8cfd297aab2..9fd3f8ffde0 100644 --- a/controllers/scaledobject_controller.go +++ b/controllers/scaledobject_controller.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "sync" + "time" "github.com/go-logr/logr" autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" @@ -23,10 +24,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/predicate" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - kedacontrollerutil "github.com/kedacore/keda/controllers/util" - "github.com/kedacore/keda/pkg/scaling" - kedautil "github.com/kedacore/keda/pkg/util" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + kedacontrollerutil "github.com/kedacore/keda/v2/controllers/util" + "github.com/kedacore/keda/v2/pkg/scaling" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) // +kubebuilder:rbac:groups=keda.sh,resources=scaledobjects;scaledobjects/finalizers;scaledobjects/status,verbs="*" @@ -48,6 +49,8 @@ type ScaledObjectReconciler struct { scaledObjectsGenerations *sync.Map scaleHandler scaling.ScaleHandler kubeVersion kedautil.K8sVersion + + globalHTTPTimeout time.Duration } // SetupWithManager initializes the ScaledObjectReconciler instance and starts a new controller managed by the passed Manager instance. @@ -75,7 +78,7 @@ func (r *ScaledObjectReconciler) SetupWithManager(mgr ctrl.Manager) error { // Init the rest of ScaledObjectReconciler r.restMapper = mgr.GetRESTMapper() r.scaledObjectsGenerations = &sync.Map{} - r.scaleHandler = scaling.NewScaleHandler(mgr.GetClient(), r.scaleClient, mgr.GetScheme()) + r.scaleHandler = scaling.NewScaleHandler(mgr.GetClient(), r.scaleClient, mgr.GetScheme(), r.globalHTTPTimeout) // Start controller return ctrl.NewControllerManagedBy(mgr). diff --git a/controllers/scaledobject_finalizer.go b/controllers/scaledobject_finalizer.go index 355285d98a3..778ee67ee25 100644 --- a/controllers/scaledobject_finalizer.go +++ b/controllers/scaledobject_finalizer.go @@ -7,8 +7,8 @@ import ( "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - "github.com/kedacore/keda/controllers/util" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + "github.com/kedacore/keda/v2/controllers/util" ) const ( diff --git a/controllers/suite_test.go b/controllers/suite_test.go index b33532b935b..452350c81ad 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -29,7 +29,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/log/zap" - //kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + //kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" // +kubebuilder:scaffold:imports ) diff --git a/controllers/util/status.go b/controllers/util/status.go index 7fee1862d15..0449f4d2d38 100644 --- a/controllers/util/status.go +++ b/controllers/util/status.go @@ -8,7 +8,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" ) // SetStatusConditions patches given object with passed list of conditions based on the object's type or returns an error. diff --git a/go.mod b/go.mod index ce293d448d2..4696199ddfe 100644 --- a/go.mod +++ b/go.mod @@ -1,30 +1,31 @@ -module github.com/kedacore/keda +module github.com/kedacore/keda/v2 go 1.15 require ( - cloud.google.com/go v0.65.0 - github.com/Azure/azure-amqp-common-go/v3 v3.0.1 - github.com/Azure/azure-event-hubs-go v1.3.1 - github.com/Azure/azure-sdk-for-go v47.0.0+incompatible + cloud.google.com/go v0.72.0 + github.com/Azure/azure-amqp-common-go/v3 v3.1.0 + github.com/Azure/azure-event-hubs-go/v3 v3.3.2 + github.com/Azure/azure-sdk-for-go v48.2.0+incompatible github.com/Azure/azure-service-bus-go v0.10.6 - github.com/Azure/azure-storage-blob-go v0.10.0 + github.com/Azure/azure-storage-blob-go v0.11.0 github.com/Azure/azure-storage-queue-go v0.0.0-20191125232315-636801874cdd + github.com/Azure/go-autorest/autorest v0.11.12 github.com/Azure/go-autorest/autorest/azure/auth v0.5.3 github.com/Huawei/gophercloud v1.0.21 - github.com/Shopify/sarama v1.27.1 - github.com/aws/aws-sdk-go v1.35.9 + github.com/Shopify/sarama v1.27.2 + github.com/aws/aws-sdk-go v1.35.35 github.com/go-logr/logr v0.1.0 github.com/go-redis/redis v6.15.9+incompatible github.com/go-sql-driver/mysql v1.5.0 github.com/golang/mock v1.4.4 github.com/golang/protobuf v1.4.3 - github.com/google/go-cmp v0.5.2 + github.com/google/go-cmp v0.5.4 github.com/hashicorp/vault/api v1.0.4 github.com/imdario/mergo v0.3.11 github.com/kubernetes-incubator/custom-metrics-apiserver v0.0.0-20200618121405-54026617ec44 github.com/lib/pq v1.8.0 - github.com/mitchellh/hashstructure v1.0.0 + github.com/mitchellh/hashstructure v1.1.0 github.com/onsi/ginkgo v1.14.2 github.com/onsi/gomega v1.10.3 github.com/pkg/errors v0.9.1 @@ -32,11 +33,12 @@ require ( github.com/robfig/cron/v3 v3.0.1 github.com/streadway/amqp v1.0.0 github.com/stretchr/testify v1.6.1 - github.com/tidwall/gjson v1.6.1 + github.com/tidwall/gjson v1.6.3 github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c - google.golang.org/api v0.31.0 + golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect + google.golang.org/api v0.35.0 google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d - google.golang.org/grpc v1.31.1 + google.golang.org/grpc v1.33.2 k8s.io/api v0.18.8 k8s.io/apimachinery v0.18.8 k8s.io/client-go v12.0.0+incompatible @@ -44,7 +46,7 @@ require ( k8s.io/klog v1.0.0 k8s.io/metrics v0.18.8 knative.dev/pkg v0.0.0-20201019114258-95e9532f0457 - sigs.k8s.io/controller-runtime v0.6.2 + sigs.k8s.io/controller-runtime v0.6.4 ) replace ( diff --git a/go.sum b/go.sum index 06b1dc4b172..6f9cc074841 100644 --- a/go.sum +++ b/go.sum @@ -29,7 +29,6 @@ contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0= contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeSEBLPA9YJp5bjrofdU3pIXs= -contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200615190824-f8c219d2d895/go.mod h1:IshRmMJBhDfFj5Y67nVhMYTTIze91RUeT73ipWKs/GY= contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d/go.mod h1:IshRmMJBhDfFj5Y67nVhMYTTIze91RUeT73ipWKs/GY= contrib.go.opencensus.io/exporter/prometheus v0.1.0/go.mod h1:cGFniUXGZlKRjzOyuZJ6mgB+PgBcCIa79kEKR8YCW+A= contrib.go.opencensus.io/exporter/prometheus v0.2.1-0.20200609204449-6bcf6f8577f0/go.mod h1:MjHoxkI7Ny27toPeFkRbXbzVjzIGkwOAptrAy8Mxtm8= @@ -44,23 +43,24 @@ contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcig dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -github.com/Azure/azure-amqp-common-go v1.1.4 h1:DmPXxmLZwi/71CgRTZIKR6yiKEW3eC42S4gSBhfG7y0= -github.com/Azure/azure-amqp-common-go v1.1.4/go.mod h1:FhZtXirFANw40UXI2ntweO+VOkfaw8s6vZxUiRhLYW8= github.com/Azure/azure-amqp-common-go/v2 v2.1.0 h1:+QbFgmWCnPzdaRMfsI0Yb6GrRdBj5jVL8N3EXuEUcBQ= github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU= github.com/Azure/azure-amqp-common-go/v3 v3.0.1 h1:mXh+eyOxGLBfqDtfmbtby0l7XfG/6b2NkuZ3B7i6zHA= github.com/Azure/azure-amqp-common-go/v3 v3.0.1/go.mod h1:PBIGdzcO1teYoufTKMcGibdKaYZv4avS+O6LNIp8bq0= -github.com/Azure/azure-event-hubs-go v1.3.1 h1:vKw7tLOFJ8kVMkhNvOXZWz+3purRQ/WTe60+bavZ5qc= -github.com/Azure/azure-event-hubs-go v1.3.1/go.mod h1:me2m3+0WC7G7JRBTWI5SQ81s2TYyOqgV3JIpYg86jZA= +github.com/Azure/azure-amqp-common-go/v3 v3.1.0 h1:1N4YSkWYWffOpQHromYdOucBSQXhNRKzqtgICy6To8Q= +github.com/Azure/azure-amqp-common-go/v3 v3.1.0/go.mod h1:PBIGdzcO1teYoufTKMcGibdKaYZv4avS+O6LNIp8bq0= +github.com/Azure/azure-event-hubs-go/v3 v3.3.2 h1:R3HoM9QiZ2uBcxfMPROBJPSsCXUL31TiV5vQ3dRsRNg= +github.com/Azure/azure-event-hubs-go/v3 v3.3.2/go.mod h1:sszMsQpFy8Au2s2NColbnJY8lRVm1koW0XxBJ3rN5TY= github.com/Azure/azure-pipeline-go v0.1.8/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg= github.com/Azure/azure-pipeline-go v0.1.9/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2 h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= +github.com/Azure/azure-pipeline-go v0.2.3 h1:7U9HBg1JFK3jHl5qmo4CTZKFTVgMwdFHMVtCdfBE21U= +github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v19.1.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v21.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v21.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v28.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v29.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= @@ -69,34 +69,26 @@ github.com/Azure/azure-sdk-for-go v37.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo github.com/Azure/azure-sdk-for-go v38.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v42.3.0+incompatible h1:PAHkmPqd/vQV4LJcqzEUM1elCyTMWjbrO8oFMl0dvBE= github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v46.0.0+incompatible h1:4qlEOCDcDQZTGczYGzbGYCdJfVpZLIs8AEo5+MoXBPw= -github.com/Azure/azure-sdk-for-go v46.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v47.0.0+incompatible h1:Hn9OhJUtoLjm27f17/JKw38KBQny0cjpnsBHn7kPpTI= -github.com/Azure/azure-sdk-for-go v47.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-service-bus-go v0.9.1 h1:G1qBLQvHCFDv9pcpgwgFkspzvnGknJRR0PYJ9ytY/JA= +github.com/Azure/azure-sdk-for-go v48.2.0+incompatible h1:+t2P1j1r5N6lYgPiiz7ZbEVZFkWjVe9WhHbMm0gg8hw= +github.com/Azure/azure-sdk-for-go v48.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-service-bus-go v0.9.1/go.mod h1:yzBx6/BUGfjfeqbRZny9AQIbIe3AcV9WZbAdpkoXOa0= github.com/Azure/azure-service-bus-go v0.10.6 h1:xjxJf6rnEoX5yCCoKiXe5VPJAxdXZU1e2zgSkHMBRR8= github.com/Azure/azure-service-bus-go v0.10.6/go.mod h1:1tX7Ap1oTgovUJ9iUtMOjM9I/xcvjyZ0VMWzNF0cBf0= -github.com/Azure/azure-storage-blob-go v0.0.0-20181023070848-cf01652132cc/go.mod h1:oGfmITT1V6x//CswqY2gtAHND+xIP64/qL7a5QJix0Y= github.com/Azure/azure-storage-blob-go v0.0.0-20190123011202-457680cc0804/go.mod h1:oGfmITT1V6x//CswqY2gtAHND+xIP64/qL7a5QJix0Y= -github.com/Azure/azure-storage-blob-go v0.8.0 h1:53qhf0Oxa0nOjgbDeeYPUeyiNmafAFEY95rZLK0Tj6o= +github.com/Azure/azure-storage-blob-go v0.6.0/go.mod h1:oGfmITT1V6x//CswqY2gtAHND+xIP64/qL7a5QJix0Y= github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0= -github.com/Azure/azure-storage-blob-go v0.10.0 h1:evCwGreYo3XLeBV4vSxLbLiYb6e0SzsJiXQVRGsRXxs= -github.com/Azure/azure-storage-blob-go v0.10.0/go.mod h1:ep1edmW+kNQx4UfWM9heESNmQdijykocJ0YOxmMX8SE= +github.com/Azure/azure-storage-blob-go v0.11.0 h1:WCTHKKNkHlzm7lzUNXRSD11784LwJqdrxnwWJxsJQHg= +github.com/Azure/azure-storage-blob-go v0.11.0/go.mod h1:A0u4VjtpgZJ7Y7um/+ix2DHBuEKFC6sEIlj0xc13a4Q= github.com/Azure/azure-storage-queue-go v0.0.0-20191125232315-636801874cdd h1:b3wyxBl3vvr15tUAziPBPK354y+LSdfPCpex5oBttHo= github.com/Azure/azure-storage-queue-go v0.0.0-20191125232315-636801874cdd/go.mod h1:K6am8mT+5iFXgingS9LUc7TmbsW6XBw3nxaRyaMyWc8= -github.com/Azure/go-amqp v0.13.0 h1:Iu9KCsgiWK7RNFlL0EkfvlulVX5tm8x9jSxnUUtPYEI= github.com/Azure/go-amqp v0.13.0/go.mod h1:qj+o8xPCz9tMSbQ83Vp8boHahuRDl5mkNHyt1xlxUTs= github.com/Azure/go-amqp v0.13.1 h1:dXnEJ89Hf7wMkcBbLqvocZlM4a3uiX9uCxJIvU77+Oo= github.com/Azure/go-amqp v0.13.1/go.mod h1:qj+o8xPCz9tMSbQ83Vp8boHahuRDl5mkNHyt1xlxUTs= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v10.15.5+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v11.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v11.1.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v11.1.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest v14.1.1+incompatible h1:m2F62e1Zk5DV3HENGdH/wEuzvJZIynHG4fHF7oiQwgE= github.com/Azure/go-autorest v14.1.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= @@ -105,70 +97,51 @@ github.com/Azure/go-autorest/autorest v0.2.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwC github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= -github.com/Azure/go-autorest/autorest v0.10.2 h1:NuSF3gXetiHyUbVdneJMEVyPUYAe5wh+aN08JYAf1tI= github.com/Azure/go-autorest/autorest v0.10.2/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= -github.com/Azure/go-autorest/autorest v0.11.0/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest v0.11.3 h1:fyYnmYujkIXUgv88D9/Wo2ybE4Zwd/TmQd5sSI5u2Ws= github.com/Azure/go-autorest/autorest v0.11.3/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest v0.11.9 h1:P0ZF0dEYoUPUVDQo3mA1CvH5b8mKev7DDcmTwauuNME= github.com/Azure/go-autorest/autorest v0.11.9/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= +github.com/Azure/go-autorest/autorest v0.11.12 h1:gI8ytXbxMfI+IVbI9mP2JGCTXIuhHLgRlvQ9X4PsnHE= +github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.8.3 h1:O1AGG9Xig71FxdX9HO5pGNyZ7TbSyHaVg+5eJO/jSGw= github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= -github.com/Azure/go-autorest/autorest/adal v0.9.0 h1:SigMbuFNuKgc1xcGhaeapbh+8fgsu+GxgDRFyg7f5lM= github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.1 h1:xjPqigMQe2+0DAJ5A6MLUPp5D2r2Io8qHCuCMMI/yJU= github.com/Azure/go-autorest/autorest/adal v0.9.1/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.2 h1:Aze/GQeAN1RRbGmnUJvUj+tFGBzFdIg3293/A9rbxC4= github.com/Azure/go-autorest/autorest/adal v0.9.2/go.mod h1:/3SMAM86bP6wC9Ev35peQDUeqFZBMH07vvUOmg4z/fE= github.com/Azure/go-autorest/autorest/adal v0.9.5 h1:Y3bBUV4rTuxenJJs41HU3qmqsb+auo+a3Lz+PlJPpL0= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= -github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk= github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM= -github.com/Azure/go-autorest/autorest/azure/auth v0.5.1 h1:bvUhZciHydpBxBmCheUgxxbSwJy7xcfjkUsjUcqSojc= -github.com/Azure/go-autorest/autorest/azure/auth v0.5.1/go.mod h1:ea90/jvmnAwDrSooLH4sRIehEPtG/EPUXavDh31MnA4= github.com/Azure/go-autorest/autorest/azure/auth v0.5.3 h1:lZifaPRAk1bqg5vGqreL6F8uLC5V0fDpY8nFvc3boFc= github.com/Azure/go-autorest/autorest/azure/auth v0.5.3/go.mod h1:4bJZhUhcq8LB20TruwHbAQsmUs2Xh+QR7utuJpLXX3A= -github.com/Azure/go-autorest/autorest/azure/cli v0.3.1 h1:LXl088ZQlP0SBppGFsRZonW6hSvwgL5gRByMbvUbx8U= github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw= -github.com/Azure/go-autorest/autorest/azure/cli v0.4.0 h1:Ml+UCrnlKD+cJmSzrZ/RDcDw86NjkRUpnFh7V5JUhzU= -github.com/Azure/go-autorest/autorest/azure/cli v0.4.0/go.mod h1:JljT387FplPzBA31vUcvsetLKF3pec5bdAxjVU4kI2s= github.com/Azure/go-autorest/autorest/azure/cli v0.4.2 h1:dMOmEJfkLKW/7JsokJqkyoYSgmR08hi9KrhjZb+JALY= github.com/Azure/go-autorest/autorest/azure/cli v0.4.2/go.mod h1:7qkJkT+j6b+hIpzMOwPChJhTqS8VbsqqgULzMNRugoM= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0 h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM= github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0 h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc= github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/autorest/mocks v0.4.0 h1:z20OWOSG5aCye0HEkDp6TPmP17ZcfeMxPi6HnSALa8c= github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/to v0.1.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc= -github.com/Azure/go-autorest/autorest/to v0.3.0 h1:zebkZaadz7+wIQYgC7GXaz3Wb28yKYfVkkBKwc38VF8= github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8= -github.com/Azure/go-autorest/autorest/validation v0.2.0 h1:15vMO4y76dehZSq7pAaOLQxC6dZYsSrj2GQpflyM/L4= github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= github.com/Azure/go-autorest/autorest/validation v0.3.0 h1:3I9AAI63HfcLtphd9g39ruUwRI+Ca+z/f36KHPFRUss= github.com/Azure/go-autorest/autorest/validation v0.3.0/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= -github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/logger v0.2.0 h1:e4RVHVZKC5p6UANLJHkM4OfR1UKZPj8Wt8Pcx+3oqrE= github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88= -github.com/Azure/go-autorest/tracing v0.5.0 h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k= 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= @@ -176,7 +149,6 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/zstd v1.3.6-0.20190409195224-796139022798/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/DataDog/zstd v1.4.1 h1:3oxKN3wbHibqx897utPC2LTQU4J+IHWWJO+glkAkpFM= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/Djarvur/go-err113 v0.1.0/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= @@ -212,12 +184,9 @@ 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/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/sarama v1.23.1 h1:XxJBCZEoWJtoWjf/xRbmGUpAmTZGnuuF0ON0EvxxBrs= github.com/Shopify/sarama v1.23.1/go.mod h1:XLH1GYJnLVE0XCr6KdJGVJRTwY30moWNJ4sERjXX6fs= -github.com/Shopify/sarama v1.27.0 h1:tqo2zmyzPf1+gwTTwhI6W+EXDw4PVSczynpHKFtVAmo= -github.com/Shopify/sarama v1.27.0/go.mod h1:aCdj6ymI8uyPEux1JJ9gcaDT6cinjGhNCAhs54taSUo= -github.com/Shopify/sarama v1.27.1 h1:iUlzHymqWsITyttu6KxazcAz8WEj5FqcwFK/oEi7rE8= -github.com/Shopify/sarama v1.27.1/go.mod h1:g5s5osgELxgM+Md9Qni9rzo7Rbt+vvFQI4bt/Mc93II= +github.com/Shopify/sarama v1.27.2 h1:1EyY1dsxNDUQEv0O/4TsjosHI2CgB1uo9H/v56xzTxc= +github.com/Shopify/sarama v1.27.2/go.mod h1:g5s5osgELxgM+Md9Qni9rzo7Rbt+vvFQI4bt/Mc93II= github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= @@ -277,12 +246,9 @@ github.com/aws/aws-sdk-go v1.30.4/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU github.com/aws/aws-sdk-go v1.30.5/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.30.16/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.31.12 h1:SxRRGyhlCagI0DYkhOg+FgdXGXzRTE3vEX/gsgFaiKQ= github.com/aws/aws-sdk-go v1.31.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.34.18 h1:Mo/Clq3u1dQFzpg8YQqBii8m+Vl3fWIfHi6kXs5wpuM= -github.com/aws/aws-sdk-go v1.34.18/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.35.9 h1:b1HiUpdkFLJyoOQ7zas36YHzjNHH0ivHx/G5lWBeg+U= -github.com/aws/aws-sdk-go v1.35.9/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9+muhnW+k= +github.com/aws/aws-sdk-go v1.35.35 h1:o/EbgEcIPWga7GWhJhb3tiaxqk4/goTdo5YEMdnVxgE= +github.com/aws/aws-sdk-go v1.35.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/bazelbuild/buildtools v0.0.0-20190917191645-69366ca98f89/go.mod h1:5JP0TXzWDHXv8qvxRC4InIazwdyDseBDbzESUMKk1yU= @@ -387,7 +353,6 @@ github.com/dgryski/go-gk v0.0.0-20140819190930-201884a44051/go.mod h1:qm+vckxRlD github.com/dgryski/go-gk v0.0.0-20200319235926-a69029f61654/go.mod h1:qm+vckxRlDt0aOla0RYJJVeqHZlWfOm2UIxHaqPB46E= github.com/dgryski/go-lttb v0.0.0-20180810165845-318fcdf10a77/go.mod h1:Va5MyIzkU0rAM92tn3hb3Anb7oz7KcnixF49+2wOMe4= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dimchansky/utfbom v1.0.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dimchansky/utfbom v1.1.0 h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/djherbis/atime v1.0.0/go.mod h1:5W+KBIuTwVGcqjIfaTwt+KSYX1o6uep8dtevevQP/f8= @@ -439,12 +404,12 @@ github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= @@ -455,10 +420,8 @@ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8 github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.8.1 h1:PvpJR0Uq8SdX+zagCMsarBMlhz6ysGTf1+pRmCsRXqY= github.com/frankban/quicktest v1.8.1/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= -github.com/frankban/quicktest v1.10.0 h1:Gfh+GAJZOAoKZsIZeZbdn2JF10kN1XHNvjsvQK8gVkE= -github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= +github.com/frankban/quicktest v1.10.2 h1:19ARM85nVi4xH7xPXuc5eM/udya5ieh7b/Sv+d844Tk= github.com/frankban/quicktest v1.10.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= @@ -494,7 +457,6 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/zapr v0.1.0 h1:h+WVe9j6HAA01niTJPA/kKH0i7e0rLZBCwauQFcRE54= github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-logr/zapr v0.1.1 h1:qXBXPDdNncunGs7XeEpsJt8wCjYBygluzfdLO0G5baE= github.com/go-logr/zapr v0.1.1/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= @@ -603,7 +565,6 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekf github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef h1:veQD95Isof8w9/WXiA+pa3tz3fJXkt5B7QaRBrM62gk= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -628,7 +589,6 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= @@ -674,15 +634,13 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-containerregistry v0.0.0-20191010200024-a3d713f9b7f8/go.mod h1:KyKXa9ciM8+lgMXwOVsXi7UxGrsf9mM61Mzs+xKUrKE= github.com/google/go-containerregistry v0.0.0-20200115214256-379933c9c22b/go.mod h1:Wtl/v6YdQxv397EREtzwgd9+Ud7Q5D8XMbi3Zazgkrs= github.com/google/go-containerregistry v0.0.0-20200123184029-53ce695e4179/go.mod h1:Wtl/v6YdQxv397EREtzwgd9+Ud7Q5D8XMbi3Zazgkrs= @@ -727,7 +685,6 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/googleapis/gnostic v0.4.0 h1:BXDUo8p/DaxC+4FJY/SSx3gvnx9C1VdHNgaUkiEL5mk= github.com/googleapis/gnostic v0.4.0/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= @@ -764,17 +721,15 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.4.1/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.2/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.4/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.12.1 h1:zCy2xE9ablevUOrUZc3Dl72Dt+ya2FNAvC2yLYMHzi4= github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= github.com/grpc-ecosystem/grpc-gateway v1.12.2/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= -github.com/grpc-ecosystem/grpc-gateway v1.14.6 h1:8ERzHx8aj1Sc47mu9n/AksaKCSWrMchFtkdrS4BIj5o= github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= +github.com/grpc-ecosystem/grpc-gateway v1.14.8 h1:hXClj+iFpmLM8i3lkO6i4Psli4P2qObQuQReiII26U8= github.com/grpc-ecosystem/grpc-gateway v1.14.8/go.mod h1:NZE8t6vs6TnwLL/ITkaK8W3ecMLGAbh2jXTclvpiwYo= github.com/h2non/gock v1.0.9/go.mod h1:CZMcB0Lg5IWnr9bF79pPMg9WeV6WumxQiUJ1UvdO1iE= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= @@ -811,7 +766,6 @@ github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0S github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= 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 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= 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= @@ -842,7 +796,6 @@ github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -872,10 +825,10 @@ github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= @@ -883,7 +836,6 @@ github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7 h1:K//n/AqR5HjG3qxbrBCL4vJPW0MVFSs9CPK1OOJdRME= github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -911,8 +863,6 @@ github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0 github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.10.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.10.10 h1:a/y8CglcM7gLGYmlbP/stPE5sR3hbhFRUjCBfd/0B3I= -github.com/klauspost/compress v1.10.10/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.0 h1:wJbzvpYMVGG9iTI9VxpnNZfd4DzMPoCWze3GgSqz8yg= github.com/klauspost/compress v1.11.0/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= @@ -926,16 +876,14 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.0.0/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= @@ -943,7 +891,6 @@ github.com/kubernetes-incubator/custom-metrics-apiserver v0.0.0-20200618121405-5 github.com/kubernetes-incubator/custom-metrics-apiserver v0.0.0-20200618121405-54026617ec44/go.mod h1:PNkabgNiouaJupBK9usDKpVqzjBKh3aZYRZ8fgGMzLQ= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.8.0 h1:9xohqzkUwzR4Ga4ivdTcawVS89YSDVxXMa3xJX3cGzg= github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= @@ -960,7 +907,6 @@ github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.1-0.20191009090205-6c0755d89d1e h1:jcoUdG1TzY/M/eM5BLFLP8DJeMximx5NQYSlLL9YeWc= github.com/mailru/easyjson v0.7.1-0.20191009090205-6c0755d89d1e/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= @@ -973,7 +919,6 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= @@ -984,10 +929,8 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.8 h1:3tS41NlGYSmhhe/8fhGRzc+z3AYCw1Fe1WAyLuujKs0= github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-shellwords v1.0.9/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= @@ -1015,13 +958,12 @@ github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go. github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= -github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= -github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= +github.com/mitchellh/hashstructure v1.1.0 h1:P6P1hdjqAAknpY/M1CGipelZgp+4y9ja9kmUZPXP+H0= +github.com/mitchellh/hashstructure v1.1.0/go.mod h1:xUDAozZz0Wmdiufv0uyhnHkUTN6/6d8ulp4AwfLKrmA= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e/go.mod h1:waEya8ee1Ro/lgxpVhkJI4BVASzkm3UZqkx/cFJiYHM= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.1 h1:cCBH2gTD2K0OtLlv/Y5H01VQCqmlDxz30kS5Y5bqfLA= github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -1076,10 +1018,7 @@ github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= -github.com/onsi/ginkgo v1.12.1 h1:mFwc4LvZ0xpSvDZ3E+k8Yte0hLOMxXUlP+yXtJqkYfQ= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4= -github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.14.2 h1:8mVmC9kjFFmA8H4pKMUhcblgifdkOIXPvbhN1T36q1M= github.com/onsi/ginkgo v1.14.2/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= @@ -1091,10 +1030,7 @@ github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs= -github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= @@ -1136,13 +1072,11 @@ github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rK github.com/pierrec/lz4 v0.0.0-20190327172049-315a67e90e41/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.2.6+incompatible h1:6aCX4/YZ9v8q69hTyiR7dNLnTA3fgtKHVVW5BCd5Znw= github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUMhxq9m9ZXI= github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -1158,14 +1092,12 @@ github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXP github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.5.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4= -github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.8.0 h1:zvJNkoCFAnYFNC24FV8nW4JdRJ3GIFcLbg65lL/JDcw= github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM= @@ -1186,13 +1118,10 @@ github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7q github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= -github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.14.0 h1:RHRyE8UocrbjU+6UvRzwi6HjiDfxrrBU91TtbKzkGp4= github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= @@ -1209,9 +1138,7 @@ github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDa github.com/prometheus/procfs v0.0.6/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.0.10/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.0.11 h1:DhHlBtkHWPYi8O2y31JkK0TF+DGM+51OopZjH/Ia5qI= github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -1220,7 +1147,6 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= github.com/quasilyte/go-ruleguard v0.1.2-0.20200318202121-b00d7a75d3d8/go.mod h1:CGFX09Ci3pq9QZdj86B+VGIdNj4VyCo2iPOGS9esB/k= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rcrowley/go-metrics v0.0.0-20190706150252-9beb055b7962 h1:eUm8ma4+yPknhXtkYlWh3tMkE6gBjXZToDned9s2gbQ= github.com/rcrowley/go-metrics v0.0.0-20190706150252-9beb055b7962/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1311,7 +1237,6 @@ github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfD github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= -github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94 h1:0ngsPmuP6XIjiFRNFYlvKwSr5zff2v+uPHaffZ6/M4k= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= @@ -1324,11 +1249,8 @@ github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= @@ -1345,8 +1267,8 @@ github.com/tektoncd/plumbing v0.0.0-20200430135134-e53521e1d887/go.mod h1:cZPJIe github.com/tektoncd/plumbing/pipelinerun-logs v0.0.0-20191206114338-712d544c2c21/go.mod h1:S62EUWtqmejjJgUMOGB1CCCHRp6C706laH06BoALkzU= github.com/tetafro/godot v0.3.7/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= github.com/tetafro/godot v0.4.2/go.mod h1:/7NLHhv08H1+8DNj0MElpAACw1ajsCuf3TKNQxA5S+0= -github.com/tidwall/gjson v1.6.1 h1:LRbvNuNuvAiISWg6gxLEFuCe72UKy5hDqhxW/8183ws= -github.com/tidwall/gjson v1.6.1/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0= +github.com/tidwall/gjson v1.6.3 h1:aHoiiem0dr7GHkW001T1SMTJ7X5PvyekH5WX0whWGnI= +github.com/tidwall/gjson v1.6.3/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0= github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc= github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -1423,7 +1345,6 @@ go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qL go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0= go.opencensus.io v0.17.0/go.mod h1:mp1VrMQxhlqqDpKvH4UcQUa4YwlzNmymAjPrDdfxNpI= -go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -1434,14 +1355,12 @@ go.opencensus.io v0.22.4-0.20200608061201-1901b56b9515/go.mod h1:yxeiOL68Rb0Xd1d go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA= -go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= @@ -1451,10 +1370,8 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEa go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.9.2-0.20180814183419-67bc79d13d15/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= @@ -1462,7 +1379,6 @@ gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180608092829-8ac0e0d97ce4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181001203147-e3636079e1a4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181015023909-0c41d7ab0a0e/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1487,18 +1403,16 @@ golang.org/x/crypto v0.0.0-20191117063200-497ca9f6d64f/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 h1:/Tl7pH94bvbAAHBdZJT947M/+gp0+CqQXDtMRC0fseo= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= +golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1573,26 +1487,21 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200528225125-3c3fba18258b/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0 h1:wBouT66WTYFXdxfVdz9sVWARVd/2vfGcmI45D2gj45M= golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/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-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= @@ -1664,7 +1573,6 @@ golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200327173247-9dae0f8f5775/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1675,12 +1583,10 @@ golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200610111108-226ff32320da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200802091954-4b90ce9b60b3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f h1:Fqb3ao1hUmOR3GkUOg/Y+BadLwykBIzs5q8Ez2SbHyc= +golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 h1:9UQO31fZ+0aKQOFldThf7BKPMJTiBfWycGh/u3UoO88= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1693,10 +1599,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e h1:EHBhcS0mlXEAVwNyO2dLfjToGsyY4j24pTs2ScHnX7s= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1778,17 +1682,13 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200701000337-a32c0cb1d5b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200709181711-e327e1019dfe/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200725200936-102e7d357031/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200731060945-b5fad4ed8dd6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858 h1:xLt+iB5ksWcZVxqc+g9K41ZHy+6MKWfXCDsjSThnsPA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3 h1:DywqrEscRX7O2phNjkT0L6lhHKGBoMLCNX+XcAe7t6s= golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0= gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gomodules.xyz/jsonpatch/v2 v2.1.0 h1:Phva6wqu+xR//Njw6iorylFFgn/z547tw5Ne3HZPQ+k= gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= @@ -1803,7 +1703,6 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -1821,7 +1720,6 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= @@ -1832,10 +1730,9 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= @@ -1857,7 +1754,6 @@ gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eR gopkg.in/jcmturner/goidentity.v3 v3.0.0 h1:1duIyWiTaYvVx3YX2CYtpJbUFd7/UuPYCfgXtQ3VTbI= gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= -gopkg.in/jcmturner/gokrb5.v7 v7.3.0 h1:0709Jtq/6QXEuWRfAm260XqlpcwL1vxtO1tUE2qK8Z4= gopkg.in/jcmturner/gokrb5.v7 v7.3.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= gopkg.in/jcmturner/gokrb5.v7 v7.5.0 h1:a9tsXlIDD9SKxotJMK3niV7rPZAJeX2aD/0yg3qlIrg= gopkg.in/jcmturner/gokrb5.v7 v7.5.0/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= @@ -1888,10 +1784,7 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200601152816-913338de1bd2 h1:VEmvx0P+GVTgkNu2EdTN988YCZPcD3lo9AoczZpucwc= -gopkg.in/yaml.v3 v3.0.0-20200601152816-913338de1bd2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= @@ -1902,8 +1795,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.2/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k= honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.0.0-20180904230853-4e7be11eab3f/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.0.0-20181018013834-843ad2d9b9ae/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= @@ -1916,7 +1809,6 @@ k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA= k8s.io/api v0.17.6/go.mod h1:1jKVwkj0UZ4huak/yRt3MFfU5wc32+B41SkNN5HhyFg= k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= k8s.io/api v0.18.4/go.mod h1:lOIQAKYgai1+vz9J7YcDZwC26Z0zQewYOGWdyIPUUQ4= -k8s.io/api v0.18.6 h1:osqrAXbOQjkKIWDTjrqxWQ3w0GkKb1KA1XkUGHHYpeE= k8s.io/api v0.18.6/go.mod h1:eeyxr+cwCjMdLAmr2W3RyDI0VvTawSg/3RFFBEnmZGI= k8s.io/api v0.18.7-rc.0/go.mod h1:v6x7KyKMJ7W/BbG7E9olOQshfszuXKKsxfnjaq+ylrk= k8s.io/api v0.18.8 h1:aIKUzJPb96f3fKec2lxtY7acZC9gQNDLVhfSGpxBAC4= @@ -1944,12 +1836,10 @@ k8s.io/apimachinery v0.17.6/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbb k8s.io/apimachinery v0.18.2/go.mod h1:9SnR/e11v5IbyPCGbvJViimtJ0SwHG4nfZFjU77ftcA= k8s.io/apimachinery v0.18.4/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apimachinery v0.18.5/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= -k8s.io/apimachinery v0.18.6 h1:RtFHnfGNfd1N0LeSrKCUznz5xtUP1elRGvHJbL3Ntag= k8s.io/apimachinery v0.18.6/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apimachinery v0.18.7-rc.0/go.mod h1:OaXp26zu/5J7p0f92ASynJa1pZo06YlV9fG7BoWbCko= k8s.io/apimachinery v0.18.8 h1:jimPrycCqgx2QPearX3to1JePz7wSbVLq+7PdBTTwQ0= k8s.io/apimachinery v0.18.8/go.mod h1:6sQd+iHEqmOtALqOFjSWp2KZ9F0wlU/nWm0ZgsYWMig= -k8s.io/apimachinery v0.19.2 h1:5Gy9vQpAGTKHPVOh5c4plE274X8D/6cuEiTO2zve7tc= k8s.io/apiserver v0.18.8 h1:Au4kMn8sb1zFdyKqc8iMHLsYLxRI6Y+iAhRNKKQtlBY= k8s.io/apiserver v0.18.8/go.mod h1:12u5FuGql8Cc497ORNj79rhPdiXQC4bf53X/skR/1YM= k8s.io/cli-runtime v0.17.2/go.mod h1:aa8t9ziyQdbkuizkNLAw3qe3srSyWh9zlSB7zTqRNPI= @@ -1968,7 +1858,6 @@ k8s.io/code-generator v0.17.6/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9 k8s.io/code-generator v0.18.0/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.2/go.mod h1:+UHX5rSbxmR8kzS+FAv7um6dtYrZokQvjHpDSYRVkTc= k8s.io/code-generator v0.18.4/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= -k8s.io/code-generator v0.18.6 h1:QdfvGfs4gUCS1dru+rLbCKIFxYEV0IRfF8MXwY/ozLk= k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/code-generator v0.18.8 h1:lgO1P1wjikEtzNvj7ia+x1VC4svJ28a/r0wnOLhhOTU= k8s.io/code-generator v0.18.8/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= @@ -1980,7 +1869,6 @@ k8s.io/component-base v0.17.4/go.mod h1:5BRqHMbbQPm2kKu35v3G+CpVq4K0RJKC7TRioF0I k8s.io/component-base v0.17.6/go.mod h1:jgRLWl0B0rOzFNtxQ9E4BphPmDqoMafujdau6AdG2Xo= k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/component-base v0.18.4/go.mod h1:7jr/Ef5PGmKwQhyAz/pjByxJbC58mhKAhiaDu0vXfPk= -k8s.io/component-base v0.18.6 h1:Wd6cHGwJN2qpufnirVOB3oMhyhbioGsKEi5HeDBsV+s= k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14= k8s.io/component-base v0.18.8 h1:BW5CORobxb6q5mb+YvdwQlyXXS6NVH5fDXWbU7tf2L8= k8s.io/component-base v0.18.8/go.mod h1:00frPRDas29rx58pPCxNkhUfPbwajlyyvu8ruNgSErU= @@ -2011,9 +1899,7 @@ k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/kubernetes v1.14.7/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/legacy-cloud-providers v0.17.0/go.mod h1:DdzaepJ3RtRy+e5YhNtrCYwlgyK87j/5+Yfp0L9Syp8= k8s.io/legacy-cloud-providers v0.17.4/go.mod h1:FikRNoD64ECjkxO36gkDgJeiQWwyZTuBkhu+yxOc1Js= -k8s.io/metrics v0.17.2 h1:cuN1ScyUS9/tj4YFI8d0/7yO0BveFHhyQpPNWS8uLr8= k8s.io/metrics v0.17.2/go.mod h1:3TkNHET4ROd+NfzNxkjoVfQ0Ob4iZnaHmSEA4vYpwLw= -k8s.io/metrics v0.18.2 h1:v4J7WKu/Zo/htSH3w//UWJZT9/CpUThXWYyUbQ/F/jY= k8s.io/metrics v0.18.2/go.mod h1:qga8E7QfYNR9Q89cSCAjinC9pTZ7yv1XSVGUB0vJypg= k8s.io/metrics v0.18.8 h1:Obf262GVd2Uy+WbPkOXNiZroI5mT8zYoKK3Y/8KF7Yc= k8s.io/metrics v0.18.8/go.mod h1:j7JzZdiyhLP2BsJm/Fzjs+j5Lb1Y7TySjhPWqBPwRXA= @@ -2046,8 +1932,6 @@ knative.dev/pkg v0.0.0-20200505191044-3da93ebb24c2/go.mod h1:Q6sL35DdGs8hIQZKdaC knative.dev/pkg v0.0.0-20200515002500-16d7b963416f/go.mod h1:tMOHGbxtRz8zYFGEGpV/bpoTEM1o89MwYFC4YJXl3GY= knative.dev/pkg v0.0.0-20200528142800-1c6815d7e4c9/go.mod h1:QgNZTxnwpB/oSpNcfnLVlw+WpEwwyKAvJlvR3hgeltA= knative.dev/pkg v0.0.0-20200711004937-22502028e31a/go.mod h1:AqAJV6rYi8IGikDjJ/9ZQd9qKdkXVlesVnVjwx62YB8= -knative.dev/pkg v0.0.0-20200911145400-2d4efecc6bc1 h1:YO9A5F0xo6sTeJZyrV9/IIeVNfKqNz9udsWsofe9eQk= -knative.dev/pkg v0.0.0-20200911145400-2d4efecc6bc1/go.mod h1:igZfLQk2QpRo+cxbH4NfsgbdavqsXr1rMr818/xVu3c= knative.dev/pkg v0.0.0-20201019114258-95e9532f0457 h1:FYTkblGgEnRffT22HvPQa2G+Q/T9MDxumHtzKVDvVqE= knative.dev/pkg v0.0.0-20201019114258-95e9532f0457/go.mod h1:Gd7eJYKYPveffVad0/wImHpQSYn+Pt9q09HGJyL/b54= knative.dev/test-infra v0.0.0-20200407185800-1b88cb3b45a5/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ= @@ -2055,7 +1939,6 @@ knative.dev/test-infra v0.0.0-20200505052144-5ea2f705bb55/go.mod h1:WqF1Azka+FxP knative.dev/test-infra v0.0.0-20200513011557-d03429a76034/go.mod h1:aMif0KXL4g19YCYwsy4Ocjjz5xgPlseYV+B95Oo4JGE= knative.dev/test-infra v0.0.0-20200519015156-82551620b0a9/go.mod h1:A5b2OAXTOeHT3hHhVQm3dmtbuWvIDP7qzgtqxA3/2pE= knative.dev/test-infra v0.0.0-20200707183444-aed09e56ddc7/go.mod h1:RjYAhXnZqeHw9+B0zsbqSPlae0lCvjekO/nw5ZMpLCs= -knative.dev/test-infra v0.0.0-20200909211651-72eb6ae3c773/go.mod h1:Pmg2c7Z7q7BGFUV/GOpU5BlrD3ePJft4MPqx8AYBplc= knative.dev/test-infra v0.0.0-20201015231956-d236fb0ea9ff/go.mod h1:lm0U0k6ARXr8Po0LcSTCfETg63LOF3ajUxcoqy5JSH0= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= @@ -2067,9 +1950,7 @@ mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jC mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw= mvdan.cc/unparam v0.0.0-20200501210554-b37ab49443f7/go.mod h1:HGC5lll35J70Y5v7vCGb9oLhHoScFwkHDJm/05RdSTc= mvdan.cc/xurls/v2 v2.0.0/go.mod h1:2/webFPYOXN9jp/lzuj0zuAVlF+9g4KPFJANH1oJhRU= -pack.ag/amqp v0.8.0/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= pack.ag/amqp v0.11.0/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= -pack.ag/amqp v0.11.2 h1:cuNDWLUTbKRtEZwhB0WQBXf9pGbm87pUBXQhvcFxBWg= pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= rsc.io/letsencrypt v0.0.3/go.mod h1:buyQKZ6IXrRnB7TdkHP0RyEybLx18HHyOSoTyoOLqNY= @@ -2084,8 +1965,8 @@ sigs.k8s.io/controller-runtime v0.3.0/go.mod h1:Cw6PkEg0Sa7dAYovGT4R0tRkGhHXpYij sigs.k8s.io/controller-runtime v0.5.0/go.mod h1:REiJzC7Y00U+2YkMbT8wxgrsX5USpXKGhb2sCtAXiT8= sigs.k8s.io/controller-runtime v0.5.4/go.mod h1:JZUwSMVbxDupo0lTJSSFP5pimEyxGynROImSsqIOx1A= sigs.k8s.io/controller-runtime v0.6.1/go.mod h1:XRYBPdbf5XJu9kpS84VJiZ7h/u1hF3gEORz0efEja7A= -sigs.k8s.io/controller-runtime v0.6.2 h1:jkAnfdTYBpFwlmBn3pS5HFO06SfxvnTZ1p5PeEF/zAA= -sigs.k8s.io/controller-runtime v0.6.2/go.mod h1:vhcq/rlnENJ09SIRp3EveTaZ0yqH526hjf9iJdbUJ/E= +sigs.k8s.io/controller-runtime v0.6.4 h1:4013CKsBs5bEqo+LevzDett+LLxag/FjQWG94nVZ/9g= +sigs.k8s.io/controller-runtime v0.6.4/go.mod h1:WlZNXcM0++oyaQt4B7C2lEE5JYRs8vJUzRP4N4JpdAY= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 80fb847fccc..c1820ccf796 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -14,9 +14,22 @@ CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${SCRIPT_ROOT}"; ls -d -1 ./vendor/k8s.io/code- # bash "${CODEGEN_PKG}"/generate-groups.sh "deepcopy,client,informer,lister" \ # Deepcopy is generated by operator-sdk bash "${CODEGEN_PKG}"/generate-groups.sh "client,informer,lister" \ - github.com/kedacore/keda/pkg/generated github.com/kedacore/keda/api \ + github.com/kedacore/keda/v2/pkg/generated github.com/kedacore/keda/v2/api \ keda:v1alpha1 \ --go-header-file "${SCRIPT_ROOT}"/hack/boilerplate.go.txt -# To use your own boilerplate text append: -# --go-header-file "${SCRIPT_ROOT}"/hack/custom-boilerplate.go.txt +# (Zbynek): If v2 is specified in go.mod, codegen unfortunately outputs to 'v2/pkg/generated' instead of 'pkg/generated', +# therefore we need to move the generated code around the repo a bit +if [ -d v2/pkg/generated ]; then + rm -rf pkg/generated + mv v2/pkg/generated pkg/ + rm -rf v2 +fi + +# (Zbynek): Kubebuilder project layout has api under 'api/v1alpha1' +# client-go codegen expects group name in the path ie. 'api/keda/v1alpha' +# Because there's no way how to modify any of these settings, +# we need to hack things a little bit (replace the name of package) +find pkg/generated -type f -name "*.go" |\ +xargs sed -i".out" -e "s#github.com/kedacore/keda/v2/api/keda/v1alpha1#github.com/kedacore/keda/v2/api/v1alpha1#g" +find pkg/generated -type f -name "*.go.out" | xargs rm -rf diff --git a/hack/verify-codegen.sh b/hack/verify-codegen.sh index cefcd4677a7..b2c49767f2a 100755 --- a/hack/verify-codegen.sh +++ b/hack/verify-codegen.sh @@ -22,11 +22,12 @@ cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}" "${SCRIPT_ROOT}/hack/update-codegen.sh" -# Kubebuilder project layout has api under 'api/v1alpha1' +# (Zbynek): Kubebuilder project layout has api under 'api/v1alpha1' # client-go codegen expects group name in the path ie. 'api/keda/v1alpha' # Because there's no way how to modify any of these settings, # we need to hack things a little bit (replace the name of package) -find "${DIFFROOT}/generated" -type f -name "*.go" | xargs sed -i "s#github.com/kedacore/keda/api/keda/v1alpha1#github.com/kedacore/keda/api/v1alpha1#g" +find "${DIFFROOT}/generated" -type f -name "*.go" |\ +xargs sed -i "s#github.com/kedacore/keda/v2/api/keda/v1alpha1#github.com/kedacore/keda/v2/api/v1alpha1#g" echo "diffing ${DIFFROOT} against freshly generated codegen" ret=0 diff --git a/main.go b/main.go index a7d770b4cfa..d768fdaeea6 100644 --- a/main.go +++ b/main.go @@ -30,9 +30,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/healthz" "sigs.k8s.io/controller-runtime/pkg/log/zap" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - "github.com/kedacore/keda/controllers" - "github.com/kedacore/keda/version" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + "github.com/kedacore/keda/v2/controllers" + "github.com/kedacore/keda/v2/version" // +kubebuilder:scaffold:imports ) @@ -111,7 +111,7 @@ func main() { setupLog.Info("Starting manager") setupLog.Info(fmt.Sprintf("KEDA Version: %s", version.Version)) - setupLog.Info(fmt.Sprintf("KEDA Commit: %s", version.GitCommit)) + setupLog.Info(fmt.Sprintf("Git Commit: %s", version.GitCommit)) setupLog.Info(fmt.Sprintf("Go Version: %s", runtime.Version())) setupLog.Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH)) diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index c8dac2b3a44..2d28ac0d9cb 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -21,7 +21,7 @@ package versioned import ( "fmt" - kedav1alpha1 "github.com/kedacore/keda/pkg/generated/clientset/versioned/typed/keda/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned/typed/keda/v1alpha1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index dff4a6365f5..04ba826dfb3 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -19,9 +19,9 @@ limitations under the License. package fake import ( - clientset "github.com/kedacore/keda/pkg/generated/clientset/versioned" - kedav1alpha1 "github.com/kedacore/keda/pkg/generated/clientset/versioned/typed/keda/v1alpha1" - fakekedav1alpha1 "github.com/kedacore/keda/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake" + clientset "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned" + kedav1alpha1 "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned/typed/keda/v1alpha1" + fakekedav1alpha1 "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go index 04ff2fe5526..3cdfe7e59ce 100644 --- a/pkg/generated/clientset/versioned/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go index 5d5909d70f5..382f0f81822 100644 --- a/pkg/generated/clientset/versioned/scheme/register.go +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -19,7 +19,7 @@ limitations under the License. package scheme import ( - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_keda_client.go b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_keda_client.go index e9b92ebd1e2..d0a922524e1 100644 --- a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_keda_client.go +++ b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_keda_client.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1alpha1 "github.com/kedacore/keda/pkg/generated/clientset/versioned/typed/keda/v1alpha1" + v1alpha1 "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned/typed/keda/v1alpha1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) diff --git a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_scaledjob.go b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_scaledjob.go index 12431a99376..2131bf6c758 100644 --- a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_scaledjob.go +++ b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_scaledjob.go @@ -21,7 +21,7 @@ package fake import ( "context" - v1alpha1 "github.com/kedacore/keda/api/v1alpha1" + v1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_scaledobject.go b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_scaledobject.go index 64b49ea664f..5b5e4386b14 100644 --- a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_scaledobject.go +++ b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_scaledobject.go @@ -21,7 +21,7 @@ package fake import ( "context" - v1alpha1 "github.com/kedacore/keda/api/v1alpha1" + v1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_triggerauthentication.go b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_triggerauthentication.go index f8563efc042..a48b1b43ff7 100644 --- a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_triggerauthentication.go +++ b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_triggerauthentication.go @@ -21,7 +21,7 @@ package fake import ( "context" - v1alpha1 "github.com/kedacore/keda/api/v1alpha1" + v1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/keda_client.go b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/keda_client.go index 45bc97ec9d4..fa3b9067ade 100644 --- a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/keda_client.go +++ b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/keda_client.go @@ -19,8 +19,8 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/kedacore/keda/api/v1alpha1" - "github.com/kedacore/keda/pkg/generated/clientset/versioned/scheme" + v1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) diff --git a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/scaledjob.go b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/scaledjob.go index 7901db85eb9..73087a3451a 100644 --- a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/scaledjob.go +++ b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/scaledjob.go @@ -22,8 +22,8 @@ import ( "context" "time" - v1alpha1 "github.com/kedacore/keda/api/v1alpha1" - scheme "github.com/kedacore/keda/pkg/generated/clientset/versioned/scheme" + v1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + scheme "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/scaledobject.go b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/scaledobject.go index 8abd7660e34..bfe9e1af755 100644 --- a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/scaledobject.go +++ b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/scaledobject.go @@ -22,8 +22,8 @@ import ( "context" "time" - v1alpha1 "github.com/kedacore/keda/api/v1alpha1" - scheme "github.com/kedacore/keda/pkg/generated/clientset/versioned/scheme" + v1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + scheme "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/triggerauthentication.go b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/triggerauthentication.go index 1dee1cff530..ddeafcafa63 100644 --- a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/triggerauthentication.go +++ b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/triggerauthentication.go @@ -22,8 +22,8 @@ import ( "context" "time" - v1alpha1 "github.com/kedacore/keda/api/v1alpha1" - scheme "github.com/kedacore/keda/pkg/generated/clientset/versioned/scheme" + v1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + scheme "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/generated/informers/externalversions/factory.go b/pkg/generated/informers/externalversions/factory.go index b574ce91b9b..e76f4b0fa49 100644 --- a/pkg/generated/informers/externalversions/factory.go +++ b/pkg/generated/informers/externalversions/factory.go @@ -23,9 +23,9 @@ import ( sync "sync" time "time" - versioned "github.com/kedacore/keda/pkg/generated/clientset/versioned" - internalinterfaces "github.com/kedacore/keda/pkg/generated/informers/externalversions/internalinterfaces" - keda "github.com/kedacore/keda/pkg/generated/informers/externalversions/keda" + versioned "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned" + internalinterfaces "github.com/kedacore/keda/v2/pkg/generated/informers/externalversions/internalinterfaces" + keda "github.com/kedacore/keda/v2/pkg/generated/informers/externalversions/keda" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index c6896af6107..7c3a21c19a3 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -21,7 +21,7 @@ package externalversions import ( "fmt" - v1alpha1 "github.com/kedacore/keda/api/v1alpha1" + v1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) diff --git a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go index 36b53219d34..6185090c4a9 100644 --- a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -21,7 +21,7 @@ package internalinterfaces import ( time "time" - versioned "github.com/kedacore/keda/pkg/generated/clientset/versioned" + versioned "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" diff --git a/pkg/generated/informers/externalversions/keda/interface.go b/pkg/generated/informers/externalversions/keda/interface.go index 77e69f635eb..80de0694ba8 100644 --- a/pkg/generated/informers/externalversions/keda/interface.go +++ b/pkg/generated/informers/externalversions/keda/interface.go @@ -19,8 +19,8 @@ limitations under the License. package keda import ( - internalinterfaces "github.com/kedacore/keda/pkg/generated/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/kedacore/keda/pkg/generated/informers/externalversions/keda/v1alpha1" + internalinterfaces "github.com/kedacore/keda/v2/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/kedacore/keda/v2/pkg/generated/informers/externalversions/keda/v1alpha1" ) // Interface provides access to each of this group's versions. diff --git a/pkg/generated/informers/externalversions/keda/v1alpha1/interface.go b/pkg/generated/informers/externalversions/keda/v1alpha1/interface.go index 7d2c56838da..66502e45034 100644 --- a/pkg/generated/informers/externalversions/keda/v1alpha1/interface.go +++ b/pkg/generated/informers/externalversions/keda/v1alpha1/interface.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - internalinterfaces "github.com/kedacore/keda/pkg/generated/informers/externalversions/internalinterfaces" + internalinterfaces "github.com/kedacore/keda/v2/pkg/generated/informers/externalversions/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/pkg/generated/informers/externalversions/keda/v1alpha1/scaledjob.go b/pkg/generated/informers/externalversions/keda/v1alpha1/scaledjob.go index 8efa1b07469..03994c72fe8 100644 --- a/pkg/generated/informers/externalversions/keda/v1alpha1/scaledjob.go +++ b/pkg/generated/informers/externalversions/keda/v1alpha1/scaledjob.go @@ -22,10 +22,10 @@ import ( "context" time "time" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - versioned "github.com/kedacore/keda/pkg/generated/clientset/versioned" - internalinterfaces "github.com/kedacore/keda/pkg/generated/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/kedacore/keda/pkg/generated/listers/keda/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + versioned "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned" + internalinterfaces "github.com/kedacore/keda/v2/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/kedacore/keda/v2/pkg/generated/listers/keda/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/generated/informers/externalversions/keda/v1alpha1/scaledobject.go b/pkg/generated/informers/externalversions/keda/v1alpha1/scaledobject.go index 33a904569ba..7738b7e1865 100644 --- a/pkg/generated/informers/externalversions/keda/v1alpha1/scaledobject.go +++ b/pkg/generated/informers/externalversions/keda/v1alpha1/scaledobject.go @@ -22,10 +22,10 @@ import ( "context" time "time" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - versioned "github.com/kedacore/keda/pkg/generated/clientset/versioned" - internalinterfaces "github.com/kedacore/keda/pkg/generated/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/kedacore/keda/pkg/generated/listers/keda/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + versioned "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned" + internalinterfaces "github.com/kedacore/keda/v2/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/kedacore/keda/v2/pkg/generated/listers/keda/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/generated/informers/externalversions/keda/v1alpha1/triggerauthentication.go b/pkg/generated/informers/externalversions/keda/v1alpha1/triggerauthentication.go index 2bca1227bcf..bf010c6d63a 100644 --- a/pkg/generated/informers/externalversions/keda/v1alpha1/triggerauthentication.go +++ b/pkg/generated/informers/externalversions/keda/v1alpha1/triggerauthentication.go @@ -22,10 +22,10 @@ import ( "context" time "time" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - versioned "github.com/kedacore/keda/pkg/generated/clientset/versioned" - internalinterfaces "github.com/kedacore/keda/pkg/generated/informers/externalversions/internalinterfaces" - v1alpha1 "github.com/kedacore/keda/pkg/generated/listers/keda/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + versioned "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned" + internalinterfaces "github.com/kedacore/keda/v2/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/kedacore/keda/v2/pkg/generated/listers/keda/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" diff --git a/pkg/generated/listers/keda/v1alpha1/scaledjob.go b/pkg/generated/listers/keda/v1alpha1/scaledjob.go index 0a1b9f6c513..4d70d3d640e 100644 --- a/pkg/generated/listers/keda/v1alpha1/scaledjob.go +++ b/pkg/generated/listers/keda/v1alpha1/scaledjob.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/kedacore/keda/api/v1alpha1" + v1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/generated/listers/keda/v1alpha1/scaledobject.go b/pkg/generated/listers/keda/v1alpha1/scaledobject.go index 785adcd4265..2d185c6817c 100644 --- a/pkg/generated/listers/keda/v1alpha1/scaledobject.go +++ b/pkg/generated/listers/keda/v1alpha1/scaledobject.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/kedacore/keda/api/v1alpha1" + v1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/generated/listers/keda/v1alpha1/triggerauthentication.go b/pkg/generated/listers/keda/v1alpha1/triggerauthentication.go index e0aa7d6b0c3..a0f28d3834a 100644 --- a/pkg/generated/listers/keda/v1alpha1/triggerauthentication.go +++ b/pkg/generated/listers/keda/v1alpha1/triggerauthentication.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - v1alpha1 "github.com/kedacore/keda/api/v1alpha1" + v1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" diff --git a/pkg/provider/provider.go b/pkg/provider/provider.go index eb90ba462da..1528c6847cc 100644 --- a/pkg/provider/provider.go +++ b/pkg/provider/provider.go @@ -5,9 +5,9 @@ import ( "fmt" "strings" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - prommetrics "github.com/kedacore/keda/pkg/metrics" - "github.com/kedacore/keda/pkg/scaling" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + prommetrics "github.com/kedacore/keda/v2/pkg/metrics" + "github.com/kedacore/keda/v2/pkg/scaling" "github.com/go-logr/logr" "github.com/kubernetes-incubator/custom-metrics-apiserver/pkg/provider" @@ -88,6 +88,10 @@ func (p *KedaProvider) GetExternalMetric(namespace string, metricSelector labels scalerName := strings.Replace(fmt.Sprintf("%T", scaler), "*scalers.", "", 1) for _, metricSpec := range metricSpecs { + //skip cpu/memory resource scaler + if metricSpec.External == nil { + continue + } // Filter only the desired metric if strings.EqualFold(metricSpec.External.Metric.Name, info.Metric) { metrics, err := scaler.GetMetrics(context.TODO(), info.Metric, metricSelector) diff --git a/pkg/scalers/artemis_scaler.go b/pkg/scalers/artemis_scaler.go index 5017fe022fe..d13f36fbc5b 100644 --- a/pkg/scalers/artemis_scaler.go +++ b/pkg/scalers/artemis_scaler.go @@ -8,7 +8,6 @@ import ( "net/http" "strconv" "strings" - "time" v2beta2 "k8s.io/api/autoscaling/v2beta2" "k8s.io/apimachinery/pkg/api/resource" @@ -17,11 +16,12 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) type artemisScaler struct { - metadata *artemisMetadata + metadata *artemisMetadata + httpClient *http.Client } //revive:disable:var-naming breaking change on restApiTemplate, wouldn't bring any benefit to users @@ -55,13 +55,19 @@ var artemisLog = logf.Log.WithName("artemis_queue_scaler") // NewArtemisQueueScaler creates a new artemis queue Scaler func NewArtemisQueueScaler(config *ScalerConfig) (Scaler, error) { + // do we need to guarantee this timeout for a specific + // reason? if not, we can have buildScaler pass in + // the global client + httpClient := kedautil.CreateHTTPClient(config.GlobalHTTPTimeout) + artemisMetadata, err := parseArtemisMetadata(config) if err != nil { return nil, fmt.Errorf("error parsing artemis metadata: %s", err) } return &artemisScaler{ - metadata: artemisMetadata, + metadata: artemisMetadata, + httpClient: httpClient, }, nil } @@ -165,9 +171,7 @@ func (s *artemisScaler) getQueueMessageCount() (int, error) { var monitoringInfo *artemisMonitoring messageCount := 0 - client := &http.Client{ - Timeout: time.Second * 3, - } + client := s.httpClient url := s.getMonitoringEndpoint() req, err := http.NewRequest("GET", url, nil) diff --git a/pkg/scalers/artemis_scaler_test.go b/pkg/scalers/artemis_scaler_test.go index 835d7ca165e..fecb7276e28 100644 --- a/pkg/scalers/artemis_scaler_test.go +++ b/pkg/scalers/artemis_scaler_test.go @@ -1,6 +1,7 @@ package scalers import ( + "net/http" "testing" ) @@ -117,7 +118,10 @@ func TestArtemisGetMetricSpecForScaling(t *testing.T) { if err != nil { t.Fatal("Could not parse metadata:", err) } - mockArtemisScaler := artemisScaler{meta} + mockArtemisScaler := artemisScaler{ + metadata: meta, + httpClient: http.DefaultClient, + } metricSpec := mockArtemisScaler.GetMetricSpecForScaling() metricName := metricSpec[0].External.Metric.Name diff --git a/pkg/scalers/aws_cloudwatch_scaler.go b/pkg/scalers/aws_cloudwatch_scaler.go index 800e905fcbb..554d53bac06 100644 --- a/pkg/scalers/aws_cloudwatch_scaler.go +++ b/pkg/scalers/aws_cloudwatch_scaler.go @@ -19,7 +19,7 @@ import ( logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( diff --git a/pkg/scalers/aws_iam_authorization.go b/pkg/scalers/aws_iam_authorization.go index bdd33d830d7..e542ad01cad 100644 --- a/pkg/scalers/aws_iam_authorization.go +++ b/pkg/scalers/aws_iam_authorization.go @@ -30,7 +30,7 @@ func getAwsAuthorization(authParams, metadata, resolvedEnv map[string]string) (a if metadata["awsAccessKeyID"] != "" { meta.awsAccessKeyID = metadata["awsAccessKeyID"] } else if metadata["awsAccessKeyIDFromEnv"] != "" { - meta.awsAccessKeyID = resolvedEnv[metadata["awsAccessKeyID"]] + meta.awsAccessKeyID = resolvedEnv[metadata["awsAccessKeyIDFromEnv"]] } if len(meta.awsAccessKeyID) == 0 { diff --git a/pkg/scalers/aws_kinesis_stream_scaler.go b/pkg/scalers/aws_kinesis_stream_scaler.go index 486c1353309..57afa871703 100644 --- a/pkg/scalers/aws_kinesis_stream_scaler.go +++ b/pkg/scalers/aws_kinesis_stream_scaler.go @@ -18,7 +18,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( diff --git a/pkg/scalers/aws_sqs_queue_scaler.go b/pkg/scalers/aws_sqs_queue_scaler.go index b0c1edd152f..2610bbacb35 100644 --- a/pkg/scalers/aws_sqs_queue_scaler.go +++ b/pkg/scalers/aws_sqs_queue_scaler.go @@ -20,7 +20,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( diff --git a/pkg/scalers/azure/azure_aad_podidentity.go b/pkg/scalers/azure/azure_aad_podidentity.go index 528d837e20d..446ef011a90 100644 --- a/pkg/scalers/azure/azure_aad_podidentity.go +++ b/pkg/scalers/azure/azure_aad_podidentity.go @@ -7,6 +7,8 @@ import ( "io/ioutil" "net/http" "net/url" + + "github.com/kedacore/keda/v2/pkg/util" ) const ( @@ -14,10 +16,15 @@ const ( ) // GetAzureADPodIdentityToken returns the AADToken for resource -func GetAzureADPodIdentityToken(audience string) (AADToken, error) { +func GetAzureADPodIdentityToken(httpClient util.HTTPDoer, audience string) (AADToken, error) { var token AADToken - resp, err := http.Get(fmt.Sprintf(msiURL, url.QueryEscape(audience))) + urlStr := fmt.Sprintf(msiURL, url.QueryEscape(audience)) + req, err := http.NewRequest("GET", urlStr, nil) + if err != nil { + return token, err + } + resp, err := httpClient.Do(req) if err != nil { return token, err } diff --git a/pkg/scalers/azure/azure_blob.go b/pkg/scalers/azure/azure_blob.go index afd6edb48ce..5b7a5189df5 100644 --- a/pkg/scalers/azure/azure_blob.go +++ b/pkg/scalers/azure/azure_blob.go @@ -5,12 +5,13 @@ import ( "github.com/Azure/azure-storage-blob-go/azblob" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + "github.com/kedacore/keda/v2/pkg/util" ) // GetAzureBlobListLength returns the count of the blobs in blob container in int -func GetAzureBlobListLength(ctx context.Context, podIdentity kedav1alpha1.PodIdentityProvider, connectionString, blobContainerName string, accountName string, blobDelimiter string, blobPrefix string) (int, error) { - credential, endpoint, err := ParseAzureStorageBlobConnection(podIdentity, connectionString, accountName) +func GetAzureBlobListLength(ctx context.Context, httpClient util.HTTPDoer, podIdentity kedav1alpha1.PodIdentityProvider, connectionString, blobContainerName string, accountName string, blobDelimiter string, blobPrefix string) (int, error) { + credential, endpoint, err := ParseAzureStorageBlobConnection(httpClient, podIdentity, connectionString, accountName) if err != nil { return -1, err } diff --git a/pkg/scalers/azure/azure_blob_test.go b/pkg/scalers/azure/azure_blob_test.go index 471e1a76229..352829dd961 100644 --- a/pkg/scalers/azure/azure_blob_test.go +++ b/pkg/scalers/azure/azure_blob_test.go @@ -2,12 +2,14 @@ package azure import ( "context" + "net/http" "strings" "testing" ) func TestGetBlobLength(t *testing.T) { - length, err := GetAzureBlobListLength(context.TODO(), "", "", "blobContainerName", "", "", "") + httpClient := http.DefaultClient + length, err := GetAzureBlobListLength(context.TODO(), httpClient, "", "", "blobContainerName", "", "", "") if length != -1 { t.Error("Expected length to be -1, but got", length) } @@ -20,7 +22,7 @@ func TestGetBlobLength(t *testing.T) { t.Error("Expected error to contain parsing error message, but got", err.Error()) } - length, err = GetAzureBlobListLength(context.TODO(), "", "DefaultEndpointsProtocol=https;AccountName=name;AccountKey=key==;EndpointSuffix=core.windows.net", "blobContainerName", "", "", "") + length, err = GetAzureBlobListLength(context.TODO(), httpClient, "", "DefaultEndpointsProtocol=https;AccountName=name;AccountKey=key==;EndpointSuffix=core.windows.net", "blobContainerName", "", "", "") if length != -1 { t.Error("Expected length to be -1, but got", length) diff --git a/pkg/scalers/azure/azure_eventhub.go b/pkg/scalers/azure/azure_eventhub.go index 03edd66900f..6a1c0ac5eec 100644 --- a/pkg/scalers/azure/azure_eventhub.go +++ b/pkg/scalers/azure/azure_eventhub.go @@ -11,10 +11,13 @@ import ( "github.com/imdario/mergo" - eventhub "github.com/Azure/azure-event-hubs-go" + "github.com/Azure/azure-amqp-common-go/v3/aad" + eventhub "github.com/Azure/azure-event-hubs-go/v3" "github.com/Azure/azure-storage-blob-go/azblob" + "github.com/Azure/go-autorest/autorest/azure" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + "github.com/kedacore/keda/v2/pkg/util" ) type baseCheckpoint struct { @@ -46,28 +49,54 @@ type EventHubInfo struct { EventHubConsumerGroup string StorageConnection string BlobContainer string + Namespace string + EventHubName string } // GetEventHubClient returns eventhub client func GetEventHubClient(info EventHubInfo) (*eventhub.Hub, error) { - hub, err := eventhub.NewHubFromConnectionString(info.EventHubConnection) - if err != nil { - return nil, fmt.Errorf("failed to create hub client: %s", err) + // The user wants to use a connectionstring, not a pod identity + if info.EventHubConnection != "" { + hub, err := eventhub.NewHubFromConnectionString(info.EventHubConnection) + if err != nil { + return nil, fmt.Errorf("failed to create hub client: %s", err) + } + return hub, nil + } + + // Since there is no connectionstring, then user wants to use pod identity + // Internally, the JWTProvider will use Managed Service Identity to authenticate if no Service Principal info supplied + provider, aadErr := aad.NewJWTProvider(func(config *aad.TokenProviderConfiguration) error { + if config.Env == nil { + config.Env = &azure.PublicCloud + } + return nil + }) + + if aadErr == nil { + return eventhub.NewHub(info.Namespace, info.EventHubName, provider) } - return hub, nil + return nil, aadErr } // GetCheckpointFromBlobStorage accesses Blob storage and gets checkpoint information of a partition -func GetCheckpointFromBlobStorage(ctx context.Context, info EventHubInfo, partitionID string) (Checkpoint, error) { - blobCreds, storageEndpoint, err := ParseAzureStorageBlobConnection(kedav1alpha1.PodIdentityProviderNone, info.StorageConnection, "") +func GetCheckpointFromBlobStorage(ctx context.Context, httpClient util.HTTPDoer, info EventHubInfo, partitionID string) (Checkpoint, error) { + blobCreds, storageEndpoint, err := ParseAzureStorageBlobConnection(httpClient, kedav1alpha1.PodIdentityProviderNone, info.StorageConnection, "") if err != nil { return Checkpoint{}, err } - eventHubNamespace, eventHubName, err := ParseAzureEventHubConnectionString(info.EventHubConnection) - if err != nil { - return Checkpoint{}, err + var eventHubNamespace string + var eventHubName string + if info.EventHubConnection != "" { + eventHubNamespace, eventHubName, err = ParseAzureEventHubConnectionString(info.EventHubConnection) + if err != nil { + return Checkpoint{}, err + } + } else { + eventHubNamespace = info.Namespace + eventHubName = info.EventHubName } // TODO: add more ways to read from different types of storage and read checkpoints/leases written in different JSON formats diff --git a/pkg/scalers/azure/azure_monitor.go b/pkg/scalers/azure/azure_monitor.go index 53a2baf9b36..a55fcdfd019 100644 --- a/pkg/scalers/azure/azure_monitor.go +++ b/pkg/scalers/azure/azure_monitor.go @@ -12,7 +12,7 @@ import ( "github.com/Azure/go-autorest/autorest/azure/auth" "k8s.io/klog" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" ) // Much of the code in this file is taken from the Azure Kubernetes Metrics Adapter diff --git a/pkg/scalers/azure/azure_queue.go b/pkg/scalers/azure/azure_queue.go index a5fa02eb7fc..730b5ef96c8 100644 --- a/pkg/scalers/azure/azure_queue.go +++ b/pkg/scalers/azure/azure_queue.go @@ -5,12 +5,13 @@ import ( "github.com/Azure/azure-storage-queue-go/azqueue" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + "github.com/kedacore/keda/v2/pkg/util" ) // GetAzureQueueLength returns the length of a queue in int -func GetAzureQueueLength(ctx context.Context, podIdentity kedav1alpha1.PodIdentityProvider, connectionString, queueName string, accountName string) (int32, error) { - credential, endpoint, err := ParseAzureStorageQueueConnection(podIdentity, connectionString, accountName) +func GetAzureQueueLength(ctx context.Context, httpClient util.HTTPDoer, podIdentity kedav1alpha1.PodIdentityProvider, connectionString, queueName string, accountName string) (int32, error) { + credential, endpoint, err := ParseAzureStorageQueueConnection(httpClient, podIdentity, connectionString, accountName) if err != nil { return -1, err } diff --git a/pkg/scalers/azure/azure_queue_test.go b/pkg/scalers/azure/azure_queue_test.go index 15c55899ea8..9c81a1adf71 100644 --- a/pkg/scalers/azure/azure_queue_test.go +++ b/pkg/scalers/azure/azure_queue_test.go @@ -2,12 +2,13 @@ package azure import ( "context" + "net/http" "strings" "testing" ) func TestGetQueueLength(t *testing.T) { - length, err := GetAzureQueueLength(context.TODO(), "", "", "queueName", "") + length, err := GetAzureQueueLength(context.TODO(), http.DefaultClient, "", "", "queueName", "") if length != -1 { t.Error("Expected length to be -1, but got", length) } @@ -20,7 +21,7 @@ func TestGetQueueLength(t *testing.T) { t.Error("Expected error to contain parsing error message, but got", err.Error()) } - length, err = GetAzureQueueLength(context.TODO(), "", "DefaultEndpointsProtocol=https;AccountName=name;AccountKey=key==;EndpointSuffix=core.windows.net", "queueName", "") + length, err = GetAzureQueueLength(context.TODO(), http.DefaultClient, "", "DefaultEndpointsProtocol=https;AccountName=name;AccountKey=key==;EndpointSuffix=core.windows.net", "queueName", "") if length != -1 { t.Error("Expected length to be -1, but got", length) diff --git a/pkg/scalers/azure/azure_storage.go b/pkg/scalers/azure/azure_storage.go index 74ba03e4b19..c8483e972fd 100644 --- a/pkg/scalers/azure/azure_storage.go +++ b/pkg/scalers/azure/azure_storage.go @@ -9,7 +9,8 @@ import ( "github.com/Azure/azure-storage-blob-go/azblob" "github.com/Azure/azure-storage-queue-go/azqueue" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + "github.com/kedacore/keda/v2/pkg/util" ) /* ParseAzureStorageConnectionString parses a storage account connection string into (endpointProtocol, accountName, key, endpointSuffix) @@ -42,10 +43,10 @@ func (e StorageEndpointType) Name() string { } // ParseAzureStorageQueueConnection parses queue connection string and returns credential and resource url -func ParseAzureStorageQueueConnection(podIdentity kedav1alpha1.PodIdentityProvider, connectionString, accountName string) (azqueue.Credential, *url.URL, error) { +func ParseAzureStorageQueueConnection(httpClient util.HTTPDoer, podIdentity kedav1alpha1.PodIdentityProvider, connectionString, accountName string) (azqueue.Credential, *url.URL, error) { switch podIdentity { case kedav1alpha1.PodIdentityProviderAzure: - token, err := GetAzureADPodIdentityToken("https://storage.azure.com/") + token, err := GetAzureADPodIdentityToken(httpClient, "https://storage.azure.com/") if err != nil { return nil, nil, err } @@ -75,10 +76,10 @@ func ParseAzureStorageQueueConnection(podIdentity kedav1alpha1.PodIdentityProvid } // ParseAzureStorageBlobConnection parses blob connection string and returns credential and resource url -func ParseAzureStorageBlobConnection(podIdentity kedav1alpha1.PodIdentityProvider, connectionString, accountName string) (azblob.Credential, *url.URL, error) { +func ParseAzureStorageBlobConnection(httpClient util.HTTPDoer, podIdentity kedav1alpha1.PodIdentityProvider, connectionString, accountName string) (azblob.Credential, *url.URL, error) { switch podIdentity { case kedav1alpha1.PodIdentityProviderAzure: - token, err := GetAzureADPodIdentityToken("https://storage.azure.com/") + token, err := GetAzureADPodIdentityToken(httpClient, "https://storage.azure.com/") if err != nil { return nil, nil, err } diff --git a/pkg/scalers/azure_blob_scaler.go b/pkg/scalers/azure_blob_scaler.go index 6b4779da520..d669c9398fb 100644 --- a/pkg/scalers/azure_blob_scaler.go +++ b/pkg/scalers/azure_blob_scaler.go @@ -3,9 +3,10 @@ package scalers import ( "context" "fmt" + "net/http" "strconv" - "github.com/kedacore/keda/pkg/scalers/azure" + "github.com/kedacore/keda/v2/pkg/scalers/azure" v2beta2 "k8s.io/api/autoscaling/v2beta2" "k8s.io/apimachinery/pkg/api/resource" @@ -14,8 +15,8 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - kedautil "github.com/kedacore/keda/pkg/util" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( @@ -28,6 +29,7 @@ const ( type azureBlobScaler struct { metadata *azureBlobMetadata podIdentity kedav1alpha1.PodIdentityProvider + httpClient *http.Client } type azureBlobMetadata struct { @@ -51,6 +53,7 @@ func NewAzureBlobScaler(config *ScalerConfig) (Scaler, error) { return &azureBlobScaler{ metadata: meta, podIdentity: podIdentity, + httpClient: kedautil.CreateHTTPClient(config.GlobalHTTPTimeout), }, nil } @@ -121,6 +124,7 @@ func parseAzureBlobMetadata(config *ScalerConfig) (*azureBlobMetadata, kedav1alp func (s *azureBlobScaler) IsActive(ctx context.Context) (bool, error) { length, err := azure.GetAzureBlobListLength( ctx, + s.httpClient, s.podIdentity, s.metadata.connection, s.metadata.blobContainerName, @@ -160,6 +164,7 @@ func (s *azureBlobScaler) GetMetricSpecForScaling() []v2beta2.MetricSpec { func (s *azureBlobScaler) GetMetrics(ctx context.Context, metricName string, metricSelector labels.Selector) ([]external_metrics.ExternalMetricValue, error) { bloblen, err := azure.GetAzureBlobListLength( ctx, + s.httpClient, s.podIdentity, s.metadata.connection, s.metadata.blobContainerName, diff --git a/pkg/scalers/azure_blob_scaler_test.go b/pkg/scalers/azure_blob_scaler_test.go index 403fd612ce9..533b76d5680 100644 --- a/pkg/scalers/azure_blob_scaler_test.go +++ b/pkg/scalers/azure_blob_scaler_test.go @@ -1,9 +1,10 @@ package scalers import ( + "net/http" "testing" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" ) var testAzBlobResolvedEnv = map[string]string{ @@ -68,7 +69,11 @@ func TestAzBlobGetMetricSpecForScaling(t *testing.T) { if err != nil { t.Fatal("Could not parse metadata:", err) } - mockAzBlobScaler := azureBlobScaler{meta, podIdentity} + mockAzBlobScaler := azureBlobScaler{ + metadata: meta, + podIdentity: podIdentity, + httpClient: http.DefaultClient, + } metricSpec := mockAzBlobScaler.GetMetricSpecForScaling() metricName := metricSpec[0].External.Metric.Name diff --git a/pkg/scalers/azure_eventhub_scaler.go b/pkg/scalers/azure_eventhub_scaler.go index 1dc50eed33f..7ebf6caf439 100644 --- a/pkg/scalers/azure_eventhub_scaler.go +++ b/pkg/scalers/azure_eventhub_scaler.go @@ -5,11 +5,14 @@ import ( "errors" "fmt" "math" + "net/http" "strconv" - "github.com/kedacore/keda/pkg/scalers/azure" + "github.com/kedacore/keda/v2/api/v1alpha1" + "github.com/kedacore/keda/v2/pkg/scalers/azure" + kedautil "github.com/kedacore/keda/v2/pkg/util" - eventhub "github.com/Azure/azure-event-hubs-go" + eventhub "github.com/Azure/azure-event-hubs-go/v3" "github.com/Azure/azure-storage-blob-go/azblob" "k8s.io/api/autoscaling/v2beta2" "k8s.io/apimachinery/pkg/api/resource" @@ -17,8 +20,6 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - - kedautil "github.com/kedacore/keda/pkg/util" ) const ( @@ -32,8 +33,9 @@ const ( var eventhubLog = logf.Log.WithName("azure_eventhub_scaler") type azureEventHubScaler struct { - metadata *eventHubMetadata - client *eventhub.Hub + metadata *eventHubMetadata + client *eventhub.Hub + httpClient *http.Client } type eventHubMetadata struct { @@ -54,8 +56,9 @@ func NewAzureEventHubScaler(config *ScalerConfig) (Scaler, error) { } return &azureEventHubScaler{ - metadata: parsedMetadata, - client: hub, + metadata: parsedMetadata, + client: hub, + httpClient: kedautil.CreateHTTPClient(config.GlobalHTTPTimeout), }, nil } @@ -85,16 +88,6 @@ func parseAzureEventHubMetadata(config *ScalerConfig) (*eventHubMetadata, error) return nil, fmt.Errorf("no storage connection string given") } - if config.AuthParams["connection"] != "" { - meta.eventHubInfo.EventHubConnection = config.AuthParams["connection"] - } else if config.TriggerMetadata["connectionFromEnv"] != "" { - meta.eventHubInfo.EventHubConnection = config.ResolvedEnv[config.TriggerMetadata["connectionFromEnv"]] - } - - if len(meta.eventHubInfo.EventHubConnection) == 0 { - return nil, fmt.Errorf("no event hub connection string given") - } - meta.eventHubInfo.EventHubConsumerGroup = defaultEventHubConsumerGroup if val, ok := config.TriggerMetadata["consumerGroup"]; ok { meta.eventHubInfo.EventHubConsumerGroup = val @@ -105,6 +98,38 @@ func parseAzureEventHubMetadata(config *ScalerConfig) (*eventHubMetadata, error) meta.eventHubInfo.BlobContainer = val } + if config.PodIdentity == "" || config.PodIdentity == v1alpha1.PodIdentityProviderNone { + if config.AuthParams["connection"] != "" { + meta.eventHubInfo.EventHubConnection = config.AuthParams["connection"] + } else if config.TriggerMetadata["connectionFromEnv"] != "" { + meta.eventHubInfo.EventHubConnection = config.ResolvedEnv[config.TriggerMetadata["connectionFromEnv"]] + } + + if len(meta.eventHubInfo.EventHubConnection) == 0 { + return nil, fmt.Errorf("no event hub connection string given") + } + } else { + if config.TriggerMetadata["eventHubNamespace"] != "" { + meta.eventHubInfo.Namespace = config.TriggerMetadata["eventHubNamespace"] + } else if config.TriggerMetadata["eventHubNamespaceFromEnv"] != "" { + meta.eventHubInfo.Namespace = config.ResolvedEnv[config.TriggerMetadata["eventHubNamespaceFromEnv"]] + } + + if len(meta.eventHubInfo.Namespace) == 0 { + return nil, fmt.Errorf("no event hub namespace string given") + } + + if config.TriggerMetadata["eventHubName"] != "" { + meta.eventHubInfo.EventHubName = config.TriggerMetadata["eventHubName"] + } else if config.TriggerMetadata["eventHubNameFromEnv"] != "" { + meta.eventHubInfo.EventHubName = config.ResolvedEnv[config.TriggerMetadata["eventHubNameFromEnv"]] + } + + if len(meta.eventHubInfo.EventHubName) == 0 { + return nil, fmt.Errorf("no event hub name string given") + } + } + return &meta, nil } @@ -115,7 +140,7 @@ func (scaler *azureEventHubScaler) GetUnprocessedEventCountInPartition(ctx conte return 0, azure.Checkpoint{}, nil } - checkpoint, err = azure.GetCheckpointFromBlobStorage(ctx, scaler.metadata.eventHubInfo, partitionInfo.PartitionID) + checkpoint, err = azure.GetCheckpointFromBlobStorage(ctx, scaler.httpClient, scaler.metadata.eventHubInfo, partitionInfo.PartitionID) if err != nil { // if blob not found return the total partition event count err = errors.Unwrap(err) diff --git a/pkg/scalers/azure_eventhub_scaler_test.go b/pkg/scalers/azure_eventhub_scaler_test.go index f760aae04f0..a4bc274144a 100644 --- a/pkg/scalers/azure_eventhub_scaler_test.go +++ b/pkg/scalers/azure_eventhub_scaler_test.go @@ -3,13 +3,14 @@ package scalers import ( "context" "fmt" + "net/http" "net/url" "os" "testing" - "github.com/kedacore/keda/pkg/scalers/azure" + "github.com/kedacore/keda/v2/pkg/scalers/azure" - eventhub "github.com/Azure/azure-event-hubs-go" + eventhub "github.com/Azure/azure-event-hubs-go/v3" "github.com/Azure/azure-storage-blob-go/azblob" ) @@ -51,6 +52,18 @@ var parseEventHubMetadataDataset = []parseEventHubMetadataTestData{ {map[string]string{"storageConnectionFromEnv": storageConnectionSetting, "consumerGroup": eventHubConsumerGroup, "connectionFromEnv": eventHubConnectionSetting, "blobContainer": testContainerName}, false}, } +var parseEventHubMetadataDatasetWithPodIdentity = []parseEventHubMetadataTestData{ + {map[string]string{}, true}, + // Even though connection string is provided, this should fail because the eventhub Namespace is not provided explicitly when using Pod Identity + {map[string]string{"storageConnectionFromEnv": storageConnectionSetting, "consumerGroup": eventHubConsumerGroup, "connectionFromEnv": eventHubConnectionSetting, "unprocessedEventThreshold": "15"}, true}, + // properly formed event hub metadata with Pod Identity + {map[string]string{"storageConnectionFromEnv": storageConnectionSetting, "consumerGroup": eventHubConsumerGroup, "unprocessedEventThreshold": "15", "eventHubName": testEventHubName, "eventHubNamespace": testEventHubNamespace}, false}, + // missing eventHubname + {map[string]string{"storageConnectionFromEnv": storageConnectionSetting, "consumerGroup": eventHubConsumerGroup, "unprocessedEventThreshold": "15", "eventHubNamespace": testEventHubNamespace}, true}, + // missing eventHubNamespace + {map[string]string{"storageConnectionFromEnv": storageConnectionSetting, "consumerGroup": eventHubConsumerGroup, "unprocessedEventThreshold": "15", "eventHubName": testEventHubName}, true}, +} + var eventHubMetricIdentifiers = []eventHubMetricIdentifier{ {&parseEventHubMetadataDataset[1], "azure-eventhub-none-testEventHubConsumerGroup"}, } @@ -76,6 +89,17 @@ func TestParseEventHubMetadata(t *testing.T) { t.Error("Expected error and got success") } } + + for _, testData := range parseEventHubMetadataDatasetWithPodIdentity { + _, err := parseAzureEventHubMetadata(&ScalerConfig{TriggerMetadata: testData.metadata, ResolvedEnv: sampleEventHubResolvedEnv, AuthParams: map[string]string{}, PodIdentity: "Azure"}) + + if err != nil && !testData.isError { + t.Errorf("Expected success but got error: %s", err) + } + if testData.isError && err == nil { + t.Error("Expected error and got success") + } + } } func TestGetUnprocessedEventCountInPartition(t *testing.T) { @@ -88,7 +112,7 @@ func TestGetUnprocessedEventCountInPartition(t *testing.T) { if eventHubKey != "" && storageConnectionString != "" { eventHubConnectionString := fmt.Sprintf("Endpoint=sb://%s.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=%s;EntityPath=%s", testEventHubNamespace, eventHubKey, testEventHubName) - storageCredentials, endpoint, err := azure.ParseAzureStorageBlobConnection("none", storageConnectionString, "") + storageCredentials, endpoint, err := azure.ParseAzureStorageBlobConnection(http.DefaultClient, "none", storageConnectionString, "") if err != nil { t.Error(err) t.FailNow() @@ -415,7 +439,11 @@ func TestEventHubGetMetricSpecForScaling(t *testing.T) { if err != nil { t.Fatal("Could not parse metadata:", err) } - mockEventHubScaler := azureEventHubScaler{meta, nil} + mockEventHubScaler := azureEventHubScaler{ + metadata: meta, + client: nil, + httpClient: http.DefaultClient, + } metricSpec := mockEventHubScaler.GetMetricSpecForScaling() metricName := metricSpec[0].External.Metric.Name diff --git a/pkg/scalers/azure_log_analytics_scaler.go b/pkg/scalers/azure_log_analytics_scaler.go index d3a8bae688a..fa3982dc7ab 100644 --- a/pkg/scalers/azure_log_analytics_scaler.go +++ b/pkg/scalers/azure_log_analytics_scaler.go @@ -22,8 +22,8 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - kedautil "github.com/kedacore/keda/pkg/util" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( @@ -33,10 +33,11 @@ const ( ) type azureLogAnalyticsScaler struct { - metadata *azureLogAnalyticsMetadata - cache *sessionCache - name string - namespace string + metadata *azureLogAnalyticsMetadata + cache *sessionCache + name string + namespace string + httpClient *http.Client } type azureLogAnalyticsMetadata struct { @@ -95,10 +96,11 @@ func NewAzureLogAnalyticsScaler(config *ScalerConfig) (Scaler, error) { } return &azureLogAnalyticsScaler{ - metadata: azureLogAnalyticsMetadata, - cache: &sessionCache{metricValue: -1, metricThreshold: -1}, - name: config.Name, - namespace: config.Namespace, + metadata: azureLogAnalyticsMetadata, + cache: &sessionCache{metricValue: -1, metricThreshold: -1}, + name: config.Name, + namespace: config.Namespace, + httpClient: kedautil.CreateHTTPClient(config.GlobalHTTPTimeout), }, nil } @@ -106,38 +108,26 @@ func parseAzureLogAnalyticsMetadata(config *ScalerConfig) (*azureLogAnalyticsMet meta := azureLogAnalyticsMetadata{} if config.PodIdentity == "" || config.PodIdentity == kedav1alpha1.PodIdentityProviderNone { - //Getting tenantId - if val, ok := config.AuthParams["tenantId"]; ok && val != "" { - meta.tenantID = val - } else if val, ok := config.TriggerMetadata["tenantId"]; ok && val != "" { - meta.tenantID = val - } else if val, ok := config.TriggerMetadata["tenantIdFromEnv"]; ok && val != "" { - meta.tenantID = config.ResolvedEnv[config.TriggerMetadata["tenantIdFromEnv"]] - } else { - return nil, fmt.Errorf("error parsing metadata. Details: tenantId was not found in metadata. Check your ScaledObject configuration") + // Getting tenantId + tenantID, err := getParameterFromConfig(config, "tenantId", true) + if err != nil { + return nil, err } + meta.tenantID = tenantID - //Getting clientId - if val, ok := config.AuthParams["clientId"]; ok && val != "" { - meta.clientID = val - } else if val, ok := config.TriggerMetadata["clientId"]; ok && val != "" { - meta.clientID = val - } else if val, ok := config.TriggerMetadata["clientIdFromEnv"]; ok && val != "" { - meta.clientID = config.ResolvedEnv[config.TriggerMetadata["clientIdFromEnv"]] - } else { - return nil, fmt.Errorf("error parsing metadata. Details: clientId was not found in metadata. Check your ScaledObject configuration") + // Getting clientId + clientID, err := getParameterFromConfig(config, "clientId", true) + if err != nil { + return nil, err } + meta.clientID = clientID - //Getting clientSecret - if val, ok := config.AuthParams["clientSecret"]; ok && val != "" { - meta.clientSecret = val - } else if val, ok := config.TriggerMetadata["clientSecret"]; ok && val != "" { - meta.clientSecret = val - } else if val, ok := config.TriggerMetadata["clientSecretFromEnv"]; ok && val != "" { - meta.clientSecret = config.ResolvedEnv[config.TriggerMetadata["clientSecretFromEnv"]] - } else { - return nil, fmt.Errorf("error parsing metadata. Details: clientSecret was not found in metadata. Check your ScaledObject configuration") + // Getting clientSecret + clientSecret, err := getParameterFromConfig(config, "clientSecret", true) + if err != nil { + return nil, err } + meta.clientSecret = clientSecret meta.podIdentity = "" } else if config.PodIdentity == kedav1alpha1.PodIdentityProviderAzure { @@ -146,46 +136,47 @@ func parseAzureLogAnalyticsMetadata(config *ScalerConfig) (*azureLogAnalyticsMet return nil, fmt.Errorf("error parsing metadata. Details: Log Analytics Scaler doesn't support pod identity %s", config.PodIdentity) } - //Getting workspaceId - if val, ok := config.AuthParams["workspaceId"]; ok && val != "" { - meta.workspaceID = val - } else if val, ok := config.TriggerMetadata["workspaceId"]; ok && val != "" { - meta.workspaceID = val - } else if val, ok := config.TriggerMetadata["workspaceIdFromEnv"]; ok && val != "" { - meta.workspaceID = config.ResolvedEnv[config.TriggerMetadata["workspaceIdFromEnv"]] - } else { - return nil, fmt.Errorf("error parsing metadata. Details: workspaceId was not found in metadata. Check your ScaledObject configuration") + // Getting workspaceId + workspaceID, err := getParameterFromConfig(config, "workspaceId", true) + if err != nil { + return nil, err } + meta.workspaceID = workspaceID - //Getting query - if val, ok := config.TriggerMetadata["query"]; ok && val != "" { - meta.query = val - } else if val, ok := config.TriggerMetadata["queryFromEnv"]; ok && val != "" { - meta.query = config.ResolvedEnv[config.TriggerMetadata["queryFromEnv"]] - } else { - return nil, fmt.Errorf("error parsing metadata. Details: query was not found in metadata. Check your ScaledObject configuration") + // Getting query, observe that we dont check AuthParams for query + query, err := getParameterFromConfig(config, "query", false) + if err != nil { + return nil, err } + meta.query = query - //Getting threshold - if val, ok := config.TriggerMetadata["threshold"]; ok && val != "" { - threshold, err := strconv.ParseInt(val, 10, 64) - if err != nil { - return nil, fmt.Errorf("error parsing metadata. Details: can't parse threshold. Inner Error: %v", err) - } - meta.threshold = threshold - } else if val, ok := config.TriggerMetadata["thresholdFromEnv"]; ok && val != "" { - threshold, err := strconv.ParseInt(config.ResolvedEnv[config.TriggerMetadata["thresholdFromEnv"]], 10, 64) - if err != nil { - return nil, fmt.Errorf("error parsing metadata. Details: can't parse threshold. Inner Error: %v", err) - } - meta.threshold = threshold - } else { - return nil, fmt.Errorf("error parsing metadata. Details: threshold was not found in metadata. Check your ScaledObject configuration") + // Getting threshold, observe that we dont check AuthParams for threshold + val, err := getParameterFromConfig(config, "threshold", false) + if err != nil { + return nil, err } + threshold, err := strconv.ParseInt(val, 10, 64) + if err != nil { + return nil, fmt.Errorf("error parsing metadata. Details: can't parse threshold. Inner Error: %v", err) + } + meta.threshold = threshold return &meta, nil } +// getParameterFromConfig gets the parameter from the configs, if checkAuthParams is true +// then AuthParams is also check for the parameter +func getParameterFromConfig(config *ScalerConfig, parameter string, checkAuthParams bool) (string, error) { + if val, ok := config.AuthParams[parameter]; checkAuthParams && ok && val != "" { + return val, nil + } else if val, ok := config.TriggerMetadata[parameter]; ok && val != "" { + return val, nil + } else if val, ok := config.TriggerMetadata[fmt.Sprintf("%sFromEnv", parameter)]; ok && val != "" { + return config.ResolvedEnv[config.TriggerMetadata[fmt.Sprintf("%sFromEnv", parameter)]], nil + } + return "", fmt.Errorf("error parsing metadata. Details: %s was not found in metadata. Check your ScaledObject configuration", parameter) +} + // IsActive determines if we need to scale from zero func (s *azureLogAnalyticsScaler) IsActive(ctx context.Context) (bool, error) { err := s.updateCache() @@ -369,45 +360,21 @@ func (s *azureLogAnalyticsScaler) executeQuery(query string, tokenInfo tokenData if len(queryData.Tables[0].Rows[0]) > 0 { metricDataType := queryData.Tables[0].Columns[0].Type metricVal := queryData.Tables[0].Rows[0][0] - - if metricVal != nil { - //type can be: real, int, long - if metricDataType == "real" || metricDataType == "int" || metricDataType == "long" { - metricValue, isConverted := metricVal.(float64) - if !isConverted { - return metricsData{}, fmt.Errorf("error validating Log Analytics request. Details: can not convert result to type float64. HTTP code: %d. Body: %s", statusCode, string(body)) - } - if metricValue < 0 { - return metricsData{}, fmt.Errorf("error validating Log Analytics request. Details: metric value should be >=0, but received %f. HTTP code: %d. Body: %s", metricValue, statusCode, string(body)) - } - metricsInfo.value = int64(metricValue) - } else { - return metricsData{}, fmt.Errorf("error validating Log Analytics request. Details: metric value data type should be real, int or long, but received %s. HTTP code: %d Body: %s", metricDataType, statusCode, string(body)) - } + parsedMetricVal, err := parseTableValueToInt64(metricVal, metricDataType) + if err != nil { + return metricsData{}, fmt.Errorf("%s. HTTP code: %d. Body: %s", err.Error(), statusCode, string(body)) } + metricsInfo.value = parsedMetricVal } if len(queryData.Tables[0].Rows[0]) > 1 { thresholdDataType := queryData.Tables[0].Columns[1].Type thresholdVal := queryData.Tables[0].Rows[0][1] - - if thresholdVal != nil { - //type can be: real, int, long - if thresholdDataType == "real" || thresholdDataType == "int" || thresholdDataType == "long" { - thresholdValue, isConverted := thresholdVal.(float64) - if !isConverted { - return metricsData{}, fmt.Errorf("error validating Log Analytics request. Details: cannot convert threshold result to type float64. HTTP code: %d. Body: %s", statusCode, string(body)) - } - if thresholdValue < 0 { - return metricsData{}, fmt.Errorf("error validating Log Analytics request. Details: threshold value should be >=0, but received %f. HTTP code: %d. Body: %s", thresholdValue, statusCode, string(body)) - } - metricsInfo.threshold = int64(thresholdValue) - } else { - return metricsData{}, fmt.Errorf("error validating Log Analytics request. Details: threshold value data type should be real, int or long, but received %s. HTTP code: %d. Body: %s", thresholdDataType, statusCode, string(body)) - } - } else { - return metricsData{}, fmt.Errorf("error validating Log Analytics request. Details: threshold value is empty, check your query. HTTP code: %d. Body: %s", statusCode, string(body)) + parsedThresholdVal, err := parseTableValueToInt64(thresholdVal, thresholdDataType) + if err != nil { + return metricsData{}, fmt.Errorf("%s. HTTP code: %d. Body: %s", err.Error(), statusCode, string(body)) } + metricsInfo.threshold = parsedThresholdVal } else { metricsInfo.threshold = -1 } @@ -418,6 +385,24 @@ func (s *azureLogAnalyticsScaler) executeQuery(query string, tokenInfo tokenData return metricsData{}, fmt.Errorf("error processing Log Analytics request. Details: unknown error. HTTP code: %d. Body: %s", statusCode, string(body)) } +func parseTableValueToInt64(value interface{}, dataType string) (int64, error) { + if value != nil { + //type can be: real, int, long + if dataType == "real" || dataType == "int" || dataType == "long" { + convertedValue, isConverted := value.(float64) + if !isConverted { + return 0, fmt.Errorf("error validating Log Analytics request. Details: cannot convert result to type float64") + } + if convertedValue < 0 { + return 0, fmt.Errorf("error validating Log Analytics request. Details: value should be >=0, but received %f", value) + } + return int64(convertedValue), nil + } + return 0, fmt.Errorf("error validating Log Analytics request. Details: value data type should be real, int or long, but received %s", dataType) + } + return 0, fmt.Errorf("error validating Log Analytics request. Details: value is empty, check your query") +} + func (s *azureLogAnalyticsScaler) refreshAccessToken() (tokenData, error) { tokenInfo, err := s.getAuthorizationToken() @@ -525,15 +510,13 @@ func (s *azureLogAnalyticsScaler) runHTTP(request *http.Request, caller string) request.Header.Add("Cache-Control", "no-cache") request.Header.Add("User-Agent", "keda/2.0.0") - httpClient := &http.Client{} - - resp, err := httpClient.Do(request) + resp, err := s.httpClient.Do(request) if err != nil { return nil, resp.StatusCode, fmt.Errorf("error calling %s. Inner Error: %v", caller, err) } defer resp.Body.Close() - httpClient.CloseIdleConnections() + s.httpClient.CloseIdleConnections() body, err := ioutil.ReadAll(resp.Body) if err != nil { diff --git a/pkg/scalers/azure_log_analytics_scaler_test.go b/pkg/scalers/azure_log_analytics_scaler_test.go index 4bbc386adc0..25e343e0ebd 100644 --- a/pkg/scalers/azure_log_analytics_scaler_test.go +++ b/pkg/scalers/azure_log_analytics_scaler_test.go @@ -1,9 +1,10 @@ package scalers import ( + "net/http" "testing" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" ) const ( @@ -147,7 +148,13 @@ func TestLogAnalyticsGetMetricSpecForScaling(t *testing.T) { t.Fatal("Could not parse metadata:", err) } cache := &sessionCache{metricValue: 1, metricThreshold: 2} - mockLogAnalyticsScaler := azureLogAnalyticsScaler{meta, cache, "test-so", "test-ns"} + mockLogAnalyticsScaler := azureLogAnalyticsScaler{ + metadata: meta, + cache: cache, + name: "test-so", + namespace: "test-ns", + httpClient: http.DefaultClient, + } metricSpec := mockLogAnalyticsScaler.GetMetricSpecForScaling() metricName := metricSpec[0].External.Metric.Name diff --git a/pkg/scalers/azure_monitor_scaler.go b/pkg/scalers/azure_monitor_scaler.go index 5d667424f97..0eecc3377f1 100644 --- a/pkg/scalers/azure_monitor_scaler.go +++ b/pkg/scalers/azure_monitor_scaler.go @@ -6,7 +6,7 @@ import ( "strconv" "strings" - "github.com/kedacore/keda/pkg/scalers/azure" + "github.com/kedacore/keda/v2/pkg/scalers/azure" v2beta2 "k8s.io/api/autoscaling/v2beta2" "k8s.io/apimachinery/pkg/api/resource" @@ -15,8 +15,8 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - kedautil "github.com/kedacore/keda/pkg/util" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( @@ -119,33 +119,38 @@ func parseAzureMonitorMetadata(config *ScalerConfig) (*azureMonitorMetadata, err return nil, fmt.Errorf("no tenantId given") } - if config.PodIdentity == "" || config.PodIdentity == kedav1alpha1.PodIdentityProviderNone { - if config.AuthParams["activeDirectoryClientId"] != "" { - meta.azureMonitorInfo.ClientID = config.AuthParams["activeDirectoryClientId"] - } else if config.TriggerMetadata["activeDirectoryClientId"] != "" { - meta.azureMonitorInfo.ClientID = config.TriggerMetadata["activeDirectoryClientId"] - } else if config.TriggerMetadata["activeDirectoryClientIdFromEnv"] != "" { - meta.azureMonitorInfo.ClientID = config.ResolvedEnv[config.TriggerMetadata["activeDirectoryClientIdFromEnv"]] - } + clientID, clientPassword, err := parseAzurePodIdentityParams(config) + if err != nil { + return nil, err + } + meta.azureMonitorInfo.ClientID = clientID + meta.azureMonitorInfo.ClientPassword = clientPassword - if len(meta.azureMonitorInfo.ClientID) == 0 { - return nil, fmt.Errorf("no activeDirectoryClientId given") + return &meta, nil +} + +// parseAzurePodIdentityParams gets the activeDirectory clientID and password +func parseAzurePodIdentityParams(config *ScalerConfig) (clientID string, clientPassword string, err error) { + if config.PodIdentity == "" || config.PodIdentity == kedav1alpha1.PodIdentityProviderNone { + clientID, err = getParameterFromConfig(config, "activeDirectoryClientId", true) + if err != nil || clientID == "" { + return "", "", fmt.Errorf("no activeDirectoryClientId given") } if config.AuthParams["activeDirectoryClientPassword"] != "" { - meta.azureMonitorInfo.ClientPassword = config.AuthParams["activeDirectoryClientPassword"] + clientPassword = config.AuthParams["activeDirectoryClientPassword"] } else if config.TriggerMetadata["activeDirectoryClientPasswordFromEnv"] != "" { - meta.azureMonitorInfo.ClientPassword = config.ResolvedEnv[config.TriggerMetadata["activeDirectoryClientPasswordFromEnv"]] + clientPassword = config.ResolvedEnv[config.TriggerMetadata["activeDirectoryClientPasswordFromEnv"]] } - if len(meta.azureMonitorInfo.ClientPassword) == 0 { - return nil, fmt.Errorf("no activeDirectoryClientPassword given") + if len(clientPassword) == 0 { + return "", "", fmt.Errorf("no activeDirectoryClientPassword given") } } else if config.PodIdentity != kedav1alpha1.PodIdentityProviderAzure { - return nil, fmt.Errorf("azure Monitor doesn't support pod identity %s", config.PodIdentity) + return "", "", fmt.Errorf("azure Monitor doesn't support pod identity %s", config.PodIdentity) } - return &meta, nil + return clientID, clientPassword, nil } // Returns true if the Azure Monitor metric value is greater than zero diff --git a/pkg/scalers/azure_monitor_scaler_test.go b/pkg/scalers/azure_monitor_scaler_test.go index c69c7b50591..51ec9807b77 100644 --- a/pkg/scalers/azure_monitor_scaler_test.go +++ b/pkg/scalers/azure_monitor_scaler_test.go @@ -3,7 +3,7 @@ package scalers import ( "testing" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" ) type parseAzMonitorMetadataTestData struct { diff --git a/pkg/scalers/azure_queue_scaler.go b/pkg/scalers/azure_queue_scaler.go index 7163c6427db..5bbc60f0751 100644 --- a/pkg/scalers/azure_queue_scaler.go +++ b/pkg/scalers/azure_queue_scaler.go @@ -3,9 +3,10 @@ package scalers import ( "context" "fmt" + "net/http" "strconv" - "github.com/kedacore/keda/pkg/scalers/azure" + "github.com/kedacore/keda/v2/pkg/scalers/azure" v2beta2 "k8s.io/api/autoscaling/v2beta2" "k8s.io/apimachinery/pkg/api/resource" @@ -14,8 +15,8 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - kedautil "github.com/kedacore/keda/pkg/util" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( @@ -27,6 +28,7 @@ const ( type azureQueueScaler struct { metadata *azureQueueMetadata podIdentity kedav1alpha1.PodIdentityProvider + httpClient *http.Client } type azureQueueMetadata struct { @@ -48,6 +50,7 @@ func NewAzureQueueScaler(config *ScalerConfig) (Scaler, error) { return &azureQueueScaler{ metadata: meta, podIdentity: podIdentity, + httpClient: kedautil.CreateHTTPClient(config.GlobalHTTPTimeout), }, nil } @@ -107,10 +110,11 @@ func parseAzureQueueMetadata(config *ScalerConfig) (*azureQueueMetadata, kedav1a return &meta, config.PodIdentity, nil } -// GetScaleDecision is a func +// IsActive determines whether this scaler is currently active func (s *azureQueueScaler) IsActive(ctx context.Context) (bool, error) { length, err := azure.GetAzureQueueLength( ctx, + s.httpClient, s.podIdentity, s.metadata.connection, s.metadata.queueName, @@ -148,6 +152,7 @@ func (s *azureQueueScaler) GetMetricSpecForScaling() []v2beta2.MetricSpec { func (s *azureQueueScaler) GetMetrics(ctx context.Context, metricName string, metricSelector labels.Selector) ([]external_metrics.ExternalMetricValue, error) { queuelen, err := azure.GetAzureQueueLength( ctx, + s.httpClient, s.podIdentity, s.metadata.connection, s.metadata.queueName, diff --git a/pkg/scalers/azure_queue_scaler_test.go b/pkg/scalers/azure_queue_scaler_test.go index 8ad9bc595f8..1fd37eb64d7 100644 --- a/pkg/scalers/azure_queue_scaler_test.go +++ b/pkg/scalers/azure_queue_scaler_test.go @@ -1,9 +1,10 @@ package scalers import ( + "net/http" "testing" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" ) var testAzQueueResolvedEnv = map[string]string{ @@ -74,7 +75,11 @@ func TestAzQueueGetMetricSpecForScaling(t *testing.T) { if err != nil { t.Fatal("Could not parse metadata:", err) } - mockAzQueueScaler := azureQueueScaler{meta, podIdentity} + mockAzQueueScaler := azureQueueScaler{ + metadata: meta, + podIdentity: podIdentity, + httpClient: http.DefaultClient, + } metricSpec := mockAzQueueScaler.GetMetricSpecForScaling() metricName := metricSpec[0].External.Metric.Name diff --git a/pkg/scalers/azure_servicebus_scaler.go b/pkg/scalers/azure_servicebus_scaler.go index fbd0fed6342..4e9c6fe0322 100755 --- a/pkg/scalers/azure_servicebus_scaler.go +++ b/pkg/scalers/azure_servicebus_scaler.go @@ -3,11 +3,12 @@ package scalers import ( "context" "fmt" + "net/http" "strconv" "github.com/Azure/azure-amqp-common-go/v3/auth" servicebus "github.com/Azure/azure-service-bus-go" - "github.com/kedacore/keda/pkg/scalers/azure" + "github.com/kedacore/keda/v2/pkg/scalers/azure" v2beta2 "k8s.io/api/autoscaling/v2beta2" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -15,8 +16,8 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - kedautil "github.com/kedacore/keda/pkg/util" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) type entityType int @@ -34,6 +35,7 @@ var azureServiceBusLog = logf.Log.WithName("azure_servicebus_scaler") type azureServiceBusScaler struct { metadata *azureServiceBusMetadata podIdentity kedav1alpha1.PodIdentityProvider + httpClient *http.Client } type azureServiceBusMetadata struct { @@ -56,6 +58,7 @@ func NewAzureServiceBusScaler(config *ScalerConfig) (Scaler, error) { return &azureServiceBusScaler{ metadata: meta, podIdentity: config.PodIdentity, + httpClient: kedautil.CreateHTTPClient(config.GlobalHTTPTimeout), }, nil } @@ -184,11 +187,12 @@ func (s *azureServiceBusScaler) GetMetrics(ctx context.Context, metricName strin } type azureTokenProvider struct { + httpClient *http.Client } // GetToken implements TokenProvider interface for azureTokenProvider -func (azureTokenProvider) GetToken(uri string) (*auth.Token, error) { - token, err := azure.GetAzureADPodIdentityToken("https://servicebus.azure.net") +func (a azureTokenProvider) GetToken(uri string) (*auth.Token, error) { + token, err := azure.GetAzureADPodIdentityToken(a.httpClient, "https://servicebus.azure.net") if err != nil { return nil, err } @@ -215,7 +219,9 @@ func (s *azureServiceBusScaler) GetAzureServiceBusLength(ctx context.Context) (i if err != nil { return -1, err } - namespace.TokenProvider = azureTokenProvider{} + namespace.TokenProvider = azureTokenProvider{ + httpClient: s.httpClient, + } namespace.Name = s.metadata.namespace } diff --git a/pkg/scalers/azure_servicebus_scaler_test.go b/pkg/scalers/azure_servicebus_scaler_test.go index e5ad78988f3..c40c8a0d011 100755 --- a/pkg/scalers/azure_servicebus_scaler_test.go +++ b/pkg/scalers/azure_servicebus_scaler_test.go @@ -2,10 +2,12 @@ package scalers import ( "context" + "net/http" "os" "testing" + "time" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" ) const ( @@ -68,22 +70,35 @@ var azServiceBusMetricIdentifiers = []azServiceBusMetricIdentifier{ {&parseServiceBusMetadataDataset[3], "azure-servicebus-testtopic-testsubscription"}, } +var commonHTTPClient = &http.Client{ + Timeout: 300 * time.Millisecond, +} + var getServiceBusLengthTestScalers = []azureServiceBusScaler{ - {metadata: &azureServiceBusMetadata{ - entityType: queue, - queueName: queueName, - }}, - {metadata: &azureServiceBusMetadata{ - entityType: subscription, - topicName: topicName, - subscriptionName: subscriptionName, - }}, - {metadata: &azureServiceBusMetadata{ - entityType: subscription, - topicName: topicName, - subscriptionName: subscriptionName, + { + metadata: &azureServiceBusMetadata{ + entityType: queue, + queueName: queueName, + }, + httpClient: commonHTTPClient, + }, + { + metadata: &azureServiceBusMetadata{ + entityType: subscription, + topicName: topicName, + subscriptionName: subscriptionName, + }, + httpClient: commonHTTPClient, + }, + { + metadata: &azureServiceBusMetadata{ + entityType: subscription, + topicName: topicName, + subscriptionName: subscriptionName, + }, + podIdentity: kedav1alpha1.PodIdentityProviderAzure, + httpClient: commonHTTPClient, }, - podIdentity: kedav1alpha1.PodIdentityProviderAzure}, } func TestParseServiceBusMetadata(t *testing.T) { @@ -140,7 +155,11 @@ func TestAzServiceBusGetMetricSpecForScaling(t *testing.T) { if err != nil { t.Fatal("Could not parse metadata:", err) } - mockAzServiceBusScalerScaler := azureServiceBusScaler{meta, testData.metadataTestData.podIdentity} + mockAzServiceBusScalerScaler := azureServiceBusScaler{ + metadata: meta, + podIdentity: testData.metadataTestData.podIdentity, + httpClient: http.DefaultClient, + } metricSpec := mockAzServiceBusScalerScaler.GetMetricSpecForScaling() metricName := metricSpec[0].External.Metric.Name diff --git a/pkg/scalers/cron_scaler.go b/pkg/scalers/cron_scaler.go index 1fb46c501c6..894974cdfbe 100644 --- a/pkg/scalers/cron_scaler.go +++ b/pkg/scalers/cron_scaler.go @@ -15,7 +15,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( diff --git a/pkg/scalers/external_scaler.go b/pkg/scalers/external_scaler.go index 77c9e932060..66d9d6125bf 100644 --- a/pkg/scalers/external_scaler.go +++ b/pkg/scalers/external_scaler.go @@ -9,7 +9,7 @@ import ( "github.com/mitchellh/hashstructure" - pb "github.com/kedacore/keda/pkg/scalers/externalscaler" + pb "github.com/kedacore/keda/v2/pkg/scalers/externalscaler" "google.golang.org/grpc" "google.golang.org/grpc/credentials" v2beta2 "k8s.io/api/autoscaling/v2beta2" diff --git a/pkg/scalers/external_scaler_test.go b/pkg/scalers/external_scaler_test.go index af8ae3e7e19..a780a7a2b61 100644 --- a/pkg/scalers/external_scaler_test.go +++ b/pkg/scalers/external_scaler_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - pb "github.com/kedacore/keda/pkg/scalers/externalscaler" + pb "github.com/kedacore/keda/v2/pkg/scalers/externalscaler" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/pkg/scalers/gcp_pub_sub_scaler.go b/pkg/scalers/gcp_pub_sub_scaler.go index 58b004cc0b7..feac8efc4ee 100644 --- a/pkg/scalers/gcp_pub_sub_scaler.go +++ b/pkg/scalers/gcp_pub_sub_scaler.go @@ -12,7 +12,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( @@ -20,6 +20,11 @@ const ( pubSubStackDriverMetricName = "pubsub.googleapis.com/subscription/num_undelivered_messages" ) +type gcpAuthorizationMetadata struct { + GoogleApplicationCredentials string + podIdentityOwner bool +} + type pubsubScaler struct { client *StackDriverClient metadata *pubsubMetadata @@ -28,7 +33,7 @@ type pubsubScaler struct { type pubsubMetadata struct { targetSubscriptionSize int subscriptionName string - credentials string + gcpAuthorization gcpAuthorizationMetadata } var gcpPubSubLog = logf.Log.WithName("gcp_pub_sub_scaler") @@ -68,14 +73,11 @@ func parsePubSubMetadata(config *ScalerConfig) (*pubsubMetadata, error) { return nil, fmt.Errorf("no subscription name given") } - if config.TriggerMetadata["credentialsFromEnv"] != "" { - meta.credentials = config.ResolvedEnv[config.TriggerMetadata["credentialsFromEnv"]] - } - - if len(meta.credentials) == 0 { - return nil, fmt.Errorf("no credentials given. Need GCP service account credentials in json format") + auth, err := getGcpAuthorization(config.AuthParams, config.TriggerMetadata, config.ResolvedEnv) + if err != nil { + return nil, err } - + meta.gcpAuthorization = *auth return &meta, nil } @@ -149,7 +151,7 @@ func (s *pubsubScaler) GetMetrics(ctx context.Context, metricName string, metric // Stackdriver api func (s *pubsubScaler) GetSubscriptionSize(ctx context.Context) (int64, error) { if s.client == nil { - client, err := NewStackDriverClient(ctx, s.metadata.credentials) + client, err := NewStackDriverClient(ctx, s.metadata.gcpAuthorization.GoogleApplicationCredentials) if err != nil { return -1, err } @@ -160,3 +162,22 @@ func (s *pubsubScaler) GetSubscriptionSize(ctx context.Context) (int64, error) { return s.client.GetMetrics(ctx, filter) } + +func getGcpAuthorization(authParams, metadata, resolvedEnv map[string]string) (*gcpAuthorizationMetadata, error) { + meta := gcpAuthorizationMetadata{} + if metadata["identityOwner"] == "operator" { + meta.podIdentityOwner = false + } else if metadata["identityOwner"] == "" || metadata["identityOwner"] == "pod" { + meta.podIdentityOwner = true + if authParams["GoogleApplicationCredentials"] != "" { + meta.GoogleApplicationCredentials = authParams["GoogleApplicationCredentials"] + } else { + if metadata["credentialsFromEnv"] != "" { + meta.GoogleApplicationCredentials = resolvedEnv[metadata["credentialsFromEnv"]] + } else { + return nil, fmt.Errorf("GoogleApplicationCredentials not found") + } + } + } + return &meta, nil +} diff --git a/pkg/scalers/gcp_pubsub_scaler_test.go b/pkg/scalers/gcp_pubsub_scaler_test.go index ce2d700f71c..6a7c6b38f20 100644 --- a/pkg/scalers/gcp_pubsub_scaler_test.go +++ b/pkg/scalers/gcp_pubsub_scaler_test.go @@ -9,8 +9,9 @@ var testPubSubResolvedEnv = map[string]string{ } type parsePubSubMetadataTestData struct { - metadata map[string]string - isError bool + authParams map[string]string + metadata map[string]string + isError bool } type gcpPubSubMetricIdentifier struct { @@ -19,17 +20,19 @@ type gcpPubSubMetricIdentifier struct { } var testPubSubMetadata = []parsePubSubMetadataTestData{ - {map[string]string{}, true}, + {map[string]string{}, map[string]string{}, true}, // all properly formed - {map[string]string{"subscriptionName": "mysubscription", "subscriptionSize": "7", "credentialsFromEnv": "SAMPLE_CREDS"}, false}, + {nil, map[string]string{"subscriptionName": "mysubscription", "subscriptionSize": "7", "credentialsFromEnv": "SAMPLE_CREDS"}, false}, // missing subscriptionName - {map[string]string{"subscriptionName": "", "subscriptionSize": "7", "credentialsFromEnv": "SAMPLE_CREDS"}, true}, + {nil, map[string]string{"subscriptionName": "", "subscriptionSize": "7", "credentialsFromEnv": "SAMPLE_CREDS"}, true}, // missing credentials - {map[string]string{"subscriptionName": "mysubscription", "subscriptionSize": "7", "credentialsFromEnv": ""}, true}, - // incorrect credentials - {map[string]string{"subscriptionName": "mysubscription", "subscriptionSize": "7", "credentialsFromEnv": "WRONG_CREDS"}, true}, + {nil, map[string]string{"subscriptionName": "mysubscription", "subscriptionSize": "7", "credentialsFromEnv": ""}, true}, // malformed subscriptionSize - {map[string]string{"subscriptionName": "mysubscription", "subscriptionSize": "AA", "credentialsFromEnv": "SAMPLE_CREDS"}, true}, + {nil, map[string]string{"subscriptionName": "mysubscription", "subscriptionSize": "AA", "credentialsFromEnv": "SAMPLE_CREDS"}, true}, + // Credentials from AuthParams + {map[string]string{"GoogleApplicationCredentials": "Creds", "podIdentityOwner": ""}, map[string]string{"subscriptionName": "mysubscription", "subscriptionSize": "7"}, false}, + // Credentials from AuthParams with empty creds + {map[string]string{"GoogleApplicationCredentials": "", "podIdentityOwner": ""}, map[string]string{"subscriptionName": "mysubscription", "subscriptionSize": "7"}, true}, } var gcpPubSubMetricIdentifiers = []gcpPubSubMetricIdentifier{ @@ -38,7 +41,7 @@ var gcpPubSubMetricIdentifiers = []gcpPubSubMetricIdentifier{ func TestPubSubParseMetadata(t *testing.T) { for _, testData := range testPubSubMetadata { - _, err := parsePubSubMetadata(&ScalerConfig{TriggerMetadata: testData.metadata, ResolvedEnv: testPubSubResolvedEnv}) + _, err := parsePubSubMetadata(&ScalerConfig{AuthParams: testData.authParams, TriggerMetadata: testData.metadata, ResolvedEnv: testPubSubResolvedEnv}) if err != nil && !testData.isError { t.Error("Expected success but got error", err) } diff --git a/pkg/scalers/huawei_cloudeye_scaler.go b/pkg/scalers/huawei_cloudeye_scaler.go index c258bac98eb..73788b2950b 100644 --- a/pkg/scalers/huawei_cloudeye_scaler.go +++ b/pkg/scalers/huawei_cloudeye_scaler.go @@ -17,7 +17,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( diff --git a/pkg/scalers/ibmmq_scaler.go b/pkg/scalers/ibmmq_scaler.go index 97dfeb9282e..f577e025266 100644 --- a/pkg/scalers/ibmmq_scaler.go +++ b/pkg/scalers/ibmmq_scaler.go @@ -17,7 +17,7 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/metrics/pkg/apis/external_metrics" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) // Default variables and settings diff --git a/pkg/scalers/kafka_scaler.go b/pkg/scalers/kafka_scaler.go index 81e8bc7355c..bdea752c274 100644 --- a/pkg/scalers/kafka_scaler.go +++ b/pkg/scalers/kafka_scaler.go @@ -15,7 +15,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) type kafkaScaler struct { @@ -92,22 +92,29 @@ func NewKafkaScaler(config *ScalerConfig) (Scaler, error) { func parseKafkaMetadata(config *ScalerConfig) (kafkaMetadata, error) { meta := kafkaMetadata{} - if config.TriggerMetadata["bootstrapServers"] == "" { - return meta, errors.New("no bootstrapServers given") - } - if config.TriggerMetadata["bootstrapServers"] != "" { + if config.TriggerMetadata["bootstrapServersFromEnv"] != "" { + meta.bootstrapServers = strings.Split(config.ResolvedEnv[config.TriggerMetadata["bootstrapServersFromEnv"]], ",") + } else if config.TriggerMetadata["bootstrapServers"] != "" { meta.bootstrapServers = strings.Split(config.TriggerMetadata["bootstrapServers"], ",") + } else { + return meta, errors.New("no bootstrapServers given") } - if config.TriggerMetadata["consumerGroup"] == "" { + if config.TriggerMetadata["consumerGroupFromEnv"] != "" { + meta.group = config.ResolvedEnv[config.TriggerMetadata["consumerGroupFromEnv"]] + } else if config.TriggerMetadata["consumerGroup"] != "" { + meta.group = config.TriggerMetadata["consumerGroup"] + } else { return meta, errors.New("no consumer group given") } - meta.group = config.TriggerMetadata["consumerGroup"] - if config.TriggerMetadata["topic"] == "" { + if config.TriggerMetadata["topicFromEnv"] != "" { + meta.topic = config.ResolvedEnv[config.TriggerMetadata["topicFromEnv"]] + } else if config.TriggerMetadata["topic"] != "" { + meta.topic = config.TriggerMetadata["topic"] + } else { return meta, errors.New("no topic given") } - meta.topic = config.TriggerMetadata["topic"] meta.offsetResetPolicy = defaultOffsetResetPolicy diff --git a/pkg/scalers/liiklus/mocks/mock_liiklus.go b/pkg/scalers/liiklus/mocks/mock_liiklus.go index 7f58e9f5f86..419805c668c 100644 --- a/pkg/scalers/liiklus/mocks/mock_liiklus.go +++ b/pkg/scalers/liiklus/mocks/mock_liiklus.go @@ -1,5 +1,5 @@ // Code generated by MockGen. DO NOT EDIT. -// Source: github.com/kedacore/keda/pkg/scalers/liiklus (interfaces: LiiklusServiceClient) +// Source: github.com/kedacore/keda/v2/pkg/scalers/liiklus (interfaces: LiiklusServiceClient) // Package mock_liiklus is a generated GoMock package. package mock_liiklus @@ -8,7 +8,7 @@ import ( context "context" gomock "github.com/golang/mock/gomock" empty "github.com/golang/protobuf/ptypes/empty" - liiklus "github.com/kedacore/keda/pkg/scalers/liiklus" + liiklus "github.com/kedacore/keda/v2/pkg/scalers/liiklus" grpc "google.golang.org/grpc" reflect "reflect" ) diff --git a/pkg/scalers/liiklus_scaler.go b/pkg/scalers/liiklus_scaler.go index 6449ee9b22f..ebc11b6acde 100644 --- a/pkg/scalers/liiklus_scaler.go +++ b/pkg/scalers/liiklus_scaler.go @@ -14,8 +14,8 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/metrics/pkg/apis/external_metrics" - liiklus_service "github.com/kedacore/keda/pkg/scalers/liiklus" - kedautil "github.com/kedacore/keda/pkg/util" + liiklus_service "github.com/kedacore/keda/v2/pkg/scalers/liiklus" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) type liiklusScaler struct { diff --git a/pkg/scalers/liiklus_scaler_test.go b/pkg/scalers/liiklus_scaler_test.go index d1f6b85a5c1..a8f8580d4f6 100644 --- a/pkg/scalers/liiklus_scaler_test.go +++ b/pkg/scalers/liiklus_scaler_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/kedacore/keda/pkg/scalers/liiklus" - mock_liiklus "github.com/kedacore/keda/pkg/scalers/liiklus/mocks" + "github.com/kedacore/keda/v2/pkg/scalers/liiklus" + mock_liiklus "github.com/kedacore/keda/v2/pkg/scalers/liiklus/mocks" "github.com/pkg/errors" ) diff --git a/pkg/scalers/metrics_api_scaler.go b/pkg/scalers/metrics_api_scaler.go index 9b794e0170f..4a0afb199aa 100644 --- a/pkg/scalers/metrics_api_scaler.go +++ b/pkg/scalers/metrics_api_scaler.go @@ -8,7 +8,6 @@ import ( "net/http" "strconv" "strings" - "time" neturl "net/url" @@ -20,7 +19,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) type metricsAPIScaler struct { @@ -53,14 +52,13 @@ type metricsAPIScalerMetadata struct { ca string } -const defaultTimeOut = 3 * time.Second - type authenticationType string const ( - apiKeyAuth authenticationType = "apiKey" - basicAuth authenticationType = "basic" - tlsAuth authenticationType = "tls" + apiKeyAuth authenticationType = "apiKey" + basicAuth authenticationType = "basic" + tlsAuth authenticationType = "tls" + methodValueQuery = "query" ) var httpLog = logf.Log.WithName("metrics_api_scaler") @@ -72,9 +70,7 @@ func NewMetricsAPIScaler(config *ScalerConfig) (Scaler, error) { return nil, fmt.Errorf("error parsing metric API metadata: %s", err) } - client := &http.Client{ - Timeout: defaultTimeOut, - } + httpClient := kedautil.CreateHTTPClient(config.GlobalHTTPTimeout) if meta.enableTLS { config, err := kedautil.NewTLSConfig(meta.cert, meta.key, meta.ca) @@ -82,12 +78,12 @@ func NewMetricsAPIScaler(config *ScalerConfig) (Scaler, error) { return nil, err } - client.Transport = &http.Transport{TLSClientConfig: config} + httpClient.Transport = &http.Transport{TLSClientConfig: config} } return &metricsAPIScaler{ metadata: meta, - client: client, + client: httpClient, }, nil } @@ -134,8 +130,8 @@ func parseMetricsAPIMetadata(config *ScalerConfig) (*metricsAPIScalerMetadata, e meta.method = "header" meta.enableAPIKeyAuth = true - if config.TriggerMetadata["method"] == "query" { - meta.method = "query" + if config.TriggerMetadata["method"] == methodValueQuery { + meta.method = methodValueQuery } if len(config.TriggerMetadata["keyParamName"]) > 0 { @@ -269,7 +265,7 @@ func getMetricAPIServerRequest(meta *metricsAPIScalerMetadata) (*http.Request, e var err error if meta.enableAPIKeyAuth { - if meta.method == "query" { + if meta.method == methodValueQuery { url, _ := neturl.Parse(meta.url) queryString := url.Query() if len(meta.keyParamName) == 0 { diff --git a/pkg/scalers/mysql_scaler.go b/pkg/scalers/mysql_scaler.go index 64a939dd635..9cc469ce466 100644 --- a/pkg/scalers/mysql_scaler.go +++ b/pkg/scalers/mysql_scaler.go @@ -14,7 +14,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) type mySQLScaler struct { diff --git a/pkg/scalers/postgresql_scaler.go b/pkg/scalers/postgresql_scaler.go index d4b84218ac7..b1086347deb 100644 --- a/pkg/scalers/postgresql_scaler.go +++ b/pkg/scalers/postgresql_scaler.go @@ -15,7 +15,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) type postgreSQLScaler struct { diff --git a/pkg/scalers/prometheus_scaler.go b/pkg/scalers/prometheus_scaler.go index 01d348482b3..92e31cad8be 100644 --- a/pkg/scalers/prometheus_scaler.go +++ b/pkg/scalers/prometheus_scaler.go @@ -17,7 +17,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( @@ -28,7 +28,8 @@ const ( ) type prometheusScaler struct { - metadata *prometheusMetadata + metadata *prometheusMetadata + httpClient *http.Client } type prometheusMetadata struct { @@ -60,7 +61,8 @@ func NewPrometheusScaler(config *ScalerConfig) (Scaler, error) { } return &prometheusScaler{ - metadata: meta, + metadata: meta, + httpClient: kedautil.CreateHTTPClient(config.GlobalHTTPTimeout), }, nil } @@ -132,7 +134,11 @@ func (s *prometheusScaler) ExecutePromQuery() (float64, error) { t := time.Now().UTC().Format(time.RFC3339) queryEscaped := url_pkg.QueryEscape(s.metadata.query) url := fmt.Sprintf("%s/api/v1/query?query=%s&time=%s", s.metadata.serverAddress, queryEscaped, t) - r, err := http.Get(url) + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return -1, err + } + r, err := s.httpClient.Do(req) if err != nil { return -1, err } diff --git a/pkg/scalers/prometheus_scaler_test.go b/pkg/scalers/prometheus_scaler_test.go index 0f6e520bf15..b164762119a 100644 --- a/pkg/scalers/prometheus_scaler_test.go +++ b/pkg/scalers/prometheus_scaler_test.go @@ -1,6 +1,7 @@ package scalers import ( + "net/http" "testing" ) @@ -52,7 +53,10 @@ func TestPrometheusGetMetricSpecForScaling(t *testing.T) { if err != nil { t.Fatal("Could not parse metadata:", err) } - mockPrometheusScaler := prometheusScaler{meta} + mockPrometheusScaler := prometheusScaler{ + metadata: meta, + httpClient: http.DefaultClient, + } metricSpec := mockPrometheusScaler.GetMetricSpecForScaling() metricName := metricSpec[0].External.Metric.Name diff --git a/pkg/scalers/rabbitmq_scaler.go b/pkg/scalers/rabbitmq_scaler.go index 64a030a3606..65f4bbed5c5 100644 --- a/pkg/scalers/rabbitmq_scaler.go +++ b/pkg/scalers/rabbitmq_scaler.go @@ -8,7 +8,6 @@ import ( "net/http" "net/url" "strconv" - "time" "github.com/streadway/amqp" v2beta2 "k8s.io/api/autoscaling/v2beta2" @@ -18,7 +17,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( @@ -37,6 +36,7 @@ type rabbitMQScaler struct { metadata *rabbitMQMetadata connection *amqp.Connection channel *amqp.Channel + httpClient *http.Client } type rabbitMQMetadata struct { @@ -56,13 +56,17 @@ var rabbitmqLog = logf.Log.WithName("rabbitmq_scaler") // NewRabbitMQScaler creates a new rabbitMQ scaler func NewRabbitMQScaler(config *ScalerConfig) (Scaler, error) { + httpClient := kedautil.CreateHTTPClient(config.GlobalHTTPTimeout) meta, err := parseRabbitMQMetadata(config) if err != nil { return nil, fmt.Errorf("error parsing rabbitmq metadata: %s", err) } if meta.protocol == httpProtocol { - return &rabbitMQScaler{metadata: meta}, nil + return &rabbitMQScaler{ + metadata: meta, + httpClient: httpClient, + }, nil } conn, ch, err := getConnectionAndChannel(meta.host) @@ -74,6 +78,7 @@ func NewRabbitMQScaler(config *ScalerConfig) (Scaler, error) { metadata: meta, connection: conn, channel: ch, + httpClient: httpClient, }, nil } @@ -178,9 +183,8 @@ func (s *rabbitMQScaler) getQueueMessages() (int, error) { return items.Messages, nil } -func getJSON(url string, target interface{}) error { - var client = &http.Client{Timeout: 5 * time.Second} - r, err := client.Get(url) +func getJSON(httpClient *http.Client, url string, target interface{}) error { + r, err := httpClient.Get(url) if err != nil { return err } @@ -212,7 +216,7 @@ func (s *rabbitMQScaler) getQueueInfoViaHTTP() (*queueInfo, error) { getQueueInfoManagementURI := fmt.Sprintf("%s/%s%s/%s", parsedURL.String(), "api/queues", vhost, s.metadata.queueName) info := queueInfo{} - err = getJSON(getQueueInfoManagementURI, &info) + err = getJSON(s.httpClient, getQueueInfoManagementURI, &info) if err != nil { return nil, err diff --git a/pkg/scalers/rabbitmq_scaler_test.go b/pkg/scalers/rabbitmq_scaler_test.go index bfcad8beb57..b6f0c43499c 100644 --- a/pkg/scalers/rabbitmq_scaler_test.go +++ b/pkg/scalers/rabbitmq_scaler_test.go @@ -7,6 +7,7 @@ import ( "net/http/httptest" "strings" "testing" + "time" ) const ( @@ -129,7 +130,14 @@ func TestGetQueueInfo(t *testing.T) { "protocol": "http", } - s, err := NewRabbitMQScaler(&ScalerConfig{ResolvedEnv: resolvedEnv, TriggerMetadata: metadata, AuthParams: map[string]string{}}) + s, err := NewRabbitMQScaler( + &ScalerConfig{ + ResolvedEnv: resolvedEnv, + TriggerMetadata: metadata, + AuthParams: map[string]string{}, + GlobalHTTPTimeout: 300 * time.Millisecond, + }, + ) if err != nil { t.Error("Expect success", err) @@ -165,7 +173,12 @@ func TestRabbitMQGetMetricSpecForScaling(t *testing.T) { if err != nil { t.Fatal("Could not parse metadata:", err) } - mockRabbitMQScaler := rabbitMQScaler{meta, nil, nil} + mockRabbitMQScaler := rabbitMQScaler{ + metadata: meta, + connection: nil, + channel: nil, + httpClient: http.DefaultClient, + } metricSpec := mockRabbitMQScaler.GetMetricSpecForScaling() metricName := metricSpec[0].External.Metric.Name diff --git a/pkg/scalers/redis_scaler.go b/pkg/scalers/redis_scaler.go index 258dbd2dc95..bd9da22e003 100644 --- a/pkg/scalers/redis_scaler.go +++ b/pkg/scalers/redis_scaler.go @@ -14,7 +14,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( diff --git a/pkg/scalers/redis_streams_scaler.go b/pkg/scalers/redis_streams_scaler.go index 5677c5b4620..46276a82221 100644 --- a/pkg/scalers/redis_streams_scaler.go +++ b/pkg/scalers/redis_streams_scaler.go @@ -14,7 +14,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) const ( diff --git a/pkg/scalers/scaler.go b/pkg/scalers/scaler.go index eb3c475a705..10889a70376 100644 --- a/pkg/scalers/scaler.go +++ b/pkg/scalers/scaler.go @@ -2,12 +2,13 @@ package scalers import ( "context" + "time" v2beta2 "k8s.io/api/autoscaling/v2beta2" "k8s.io/apimachinery/pkg/labels" "k8s.io/metrics/pkg/apis/external_metrics" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" ) // Scaler interface @@ -39,6 +40,9 @@ type ScalerConfig struct { // Name used for external scalers Name string + // The timeout to be used on all HTTP requests from the controller + GlobalHTTPTimeout time.Duration + // Namespace used for external scalers Namespace string diff --git a/pkg/scalers/stan_scaler.go b/pkg/scalers/stan_scaler.go index f5721051c56..e3608fda8b3 100644 --- a/pkg/scalers/stan_scaler.go +++ b/pkg/scalers/stan_scaler.go @@ -15,7 +15,7 @@ import ( "k8s.io/metrics/pkg/apis/external_metrics" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedautil "github.com/kedacore/keda/pkg/util" + kedautil "github.com/kedacore/keda/v2/pkg/util" ) type monitorChannelInfo struct { @@ -41,6 +41,7 @@ type monitorSubscriberInfo struct { type stanScaler struct { channelInfo *monitorChannelInfo metadata stanMetadata + httpClient *http.Client } type stanMetadata struct { @@ -68,6 +69,7 @@ func NewStanScaler(config *ScalerConfig) (Scaler, error) { return &stanScaler{ channelInfo: &monitorChannelInfo{}, metadata: stanMetadata, + httpClient: kedautil.CreateHTTPClient(config.GlobalHTTPTimeout), }, nil } @@ -111,14 +113,22 @@ func parseStanMetadata(config *ScalerConfig) (stanMetadata, error) { func (s *stanScaler) IsActive(ctx context.Context) (bool, error) { monitoringEndpoint := s.getMonitoringEndpoint() - resp, err := http.Get(monitoringEndpoint) + req, err := http.NewRequest("GET", monitoringEndpoint, nil) + if err != nil { + return false, err + } + resp, err := s.httpClient.Do(req) if err != nil { stanLog.Error(err, "Unable to access the nats streaming broker monitoring endpoint", "natsServerMonitoringEndpoint", s.metadata.natsServerMonitoringEndpoint) return false, err } if resp.StatusCode == 404 { - baseResp, err := http.Get(s.getSTANChannelsEndpoint()) + req, err := http.NewRequest("GET", s.getSTANChannelsEndpoint(), nil) + if err != nil { + return false, err + } + baseResp, err := s.httpClient.Do(req) if err != nil { return false, err } @@ -201,7 +211,11 @@ func (s *stanScaler) GetMetricSpecForScaling() []v2beta2.MetricSpec { //GetMetrics returns value for a supported metric and an error if there is a problem getting the metric func (s *stanScaler) GetMetrics(ctx context.Context, metricName string, metricSelector labels.Selector) ([]external_metrics.ExternalMetricValue, error) { - resp, err := http.Get(s.getMonitoringEndpoint()) + req, err := http.NewRequest("GET", s.getMonitoringEndpoint(), nil) + if err != nil { + return nil, err + } + resp, err := s.httpClient.Do(req) if err != nil { stanLog.Error(err, "Unable to access the nats streaming broker monitoring endpoint", "natsServerMonitoringEndpoint", s.metadata.natsServerMonitoringEndpoint) diff --git a/pkg/scalers/stan_scaler_test.go b/pkg/scalers/stan_scaler_test.go index 812621321bb..d1915d005d3 100644 --- a/pkg/scalers/stan_scaler_test.go +++ b/pkg/scalers/stan_scaler_test.go @@ -1,6 +1,7 @@ package scalers import ( + "net/http" "testing" ) @@ -49,7 +50,11 @@ func TestStanGetMetricSpecForScaling(t *testing.T) { if err != nil { t.Fatal("Could not parse metadata:", err) } - mockStanScaler := stanScaler{nil, meta} + mockStanScaler := stanScaler{ + channelInfo: nil, + metadata: meta, + httpClient: http.DefaultClient, + } metricSpec := mockStanScaler.GetMetricSpecForScaling() metricName := metricSpec[0].External.Metric.Name diff --git a/pkg/scaling/executor/scale_executor.go b/pkg/scaling/executor/scale_executor.go index aebf65fc3a6..4a703afe8d8 100644 --- a/pkg/scaling/executor/scale_executor.go +++ b/pkg/scaling/executor/scale_executor.go @@ -11,7 +11,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" ) const ( diff --git a/pkg/scaling/executor/scale_jobs.go b/pkg/scaling/executor/scale_jobs.go index 81eac699629..ad37ae1ef6b 100644 --- a/pkg/scaling/executor/scale_jobs.go +++ b/pkg/scaling/executor/scale_jobs.go @@ -12,8 +12,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - version "github.com/kedacore/keda/version" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + version "github.com/kedacore/keda/v2/version" ) const ( @@ -63,18 +63,23 @@ func (e *scaleExecutor) createJobs(logger logr.Logger, scaledJob *kedav1alpha1.S } logger.Info("Creating jobs", "Number of jobs", scaleTo) + labels := map[string]string{ + "app.kubernetes.io/name": scaledJob.GetName(), + "app.kubernetes.io/version": version.Version, + "app.kubernetes.io/part-of": scaledJob.GetName(), + "app.kubernetes.io/managed-by": "keda-operator", + "scaledjob": scaledJob.GetName(), + } + for key, value := range scaledJob.ObjectMeta.Labels { + labels[key] = value + } + for i := 0; i < int(scaleTo); i++ { job := &batchv1.Job{ ObjectMeta: metav1.ObjectMeta{ GenerateName: scaledJob.GetName() + "-", Namespace: scaledJob.GetNamespace(), - Labels: map[string]string{ - "app.kubernetes.io/name": scaledJob.GetName(), - "app.kubernetes.io/version": version.Version, - "app.kubernetes.io/part-of": scaledJob.GetName(), - "app.kubernetes.io/managed-by": "keda-operator", - "scaledjob": scaledJob.GetName(), - }, + Labels: labels, }, Spec: *scaledJob.Spec.JobTargetRef.DeepCopy(), } diff --git a/pkg/scaling/executor/scale_jobs_test.go b/pkg/scaling/executor/scale_jobs_test.go index 14906ba80ab..415ae556d28 100644 --- a/pkg/scaling/executor/scale_jobs_test.go +++ b/pkg/scaling/executor/scale_jobs_test.go @@ -15,8 +15,8 @@ import ( runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - "github.com/kedacore/keda/pkg/mock/mock_client" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + "github.com/kedacore/keda/v2/pkg/mock/mock_client" ) func TestCleanUpNormalCase(t *testing.T) { diff --git a/pkg/scaling/executor/scale_scaledobjects.go b/pkg/scaling/executor/scale_scaledobjects.go index 9e131243753..39ab752396a 100644 --- a/pkg/scaling/executor/scale_scaledobjects.go +++ b/pkg/scaling/executor/scale_scaledobjects.go @@ -8,7 +8,7 @@ import ( autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" ) func (e *scaleExecutor) RequestScale(ctx context.Context, scaledObject *kedav1alpha1.ScaledObject, isActive bool) { diff --git a/pkg/scaling/resolver/hashicorpvault_handler.go b/pkg/scaling/resolver/hashicorpvault_handler.go index f9b51e225bf..04095303d37 100644 --- a/pkg/scaling/resolver/hashicorpvault_handler.go +++ b/pkg/scaling/resolver/hashicorpvault_handler.go @@ -8,7 +8,7 @@ import ( "github.com/go-logr/logr" vaultApi "github.com/hashicorp/vault/api" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" ) // HashicorpVaultHandler is specification of Hashi Corp Vault diff --git a/pkg/scaling/resolver/scale_resolvers.go b/pkg/scaling/resolver/scale_resolvers.go index 6f950e490d8..e3d9614ce31 100644 --- a/pkg/scaling/resolver/scale_resolvers.go +++ b/pkg/scaling/resolver/scale_resolvers.go @@ -10,7 +10,7 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" ) const ( diff --git a/pkg/scaling/resolver/scale_resolvers_test.go b/pkg/scaling/resolver/scale_resolvers_test.go index 19ae4948aaa..72db639a5c2 100644 --- a/pkg/scaling/resolver/scale_resolvers_test.go +++ b/pkg/scaling/resolver/scale_resolvers_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/google/go-cmp/cmp" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/scaling/scale_handler.go b/pkg/scaling/scale_handler.go index 3ce57b8a274..ca02adf5b1d 100644 --- a/pkg/scaling/scale_handler.go +++ b/pkg/scaling/scale_handler.go @@ -18,10 +18,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" logf "sigs.k8s.io/controller-runtime/pkg/log" - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" - "github.com/kedacore/keda/pkg/scalers" - "github.com/kedacore/keda/pkg/scaling/executor" - "github.com/kedacore/keda/pkg/scaling/resolver" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + "github.com/kedacore/keda/v2/pkg/scalers" + "github.com/kedacore/keda/v2/pkg/scaling/executor" + "github.com/kedacore/keda/v2/pkg/scaling/resolver" ) const ( @@ -42,15 +42,17 @@ type scaleHandler struct { logger logr.Logger scaleLoopContexts *sync.Map scaleExecutor executor.ScaleExecutor + globalHTTPTimeout time.Duration } // NewScaleHandler creates a ScaleHandler object -func NewScaleHandler(client client.Client, scaleClient *scale.ScalesGetter, reconcilerScheme *runtime.Scheme) ScaleHandler { +func NewScaleHandler(client client.Client, scaleClient *scale.ScalesGetter, reconcilerScheme *runtime.Scheme, globalHTTPTimeout time.Duration) ScaleHandler { return &scaleHandler{ client: client, logger: logf.Log.WithName("scalehandler"), scaleLoopContexts: &sync.Map{}, scaleExecutor: executor.NewScaleExecutor(client, scaleClient, reconcilerScheme), + globalHTTPTimeout: globalHTTPTimeout, } } @@ -325,30 +327,31 @@ func (h *scaleHandler) buildScalers(withTriggers *kedav1alpha1.WithTriggers, pod } for i, trigger := range withTriggers.Spec.Triggers { - config := &scalers.ScalerConfig{ - Name: withTriggers.Name, - Namespace: withTriggers.Namespace, - TriggerMetadata: trigger.Metadata, - ResolvedEnv: resolvedEnv, - AuthParams: make(map[string]string), - } - if podTemplateSpec != nil { - authParams, podIdentity := resolver.ResolveAuthRef(h.client, logger, trigger.AuthenticationRef, &podTemplateSpec.Spec, withTriggers.Namespace) - - if podIdentity == kedav1alpha1.PodIdentityProviderAwsEKS { - serviceAccountName := podTemplateSpec.Spec.ServiceAccountName - serviceAccount := &corev1.ServiceAccount{} - err = h.client.Get(context.TODO(), types.NamespacedName{Name: serviceAccountName, Namespace: withTriggers.Namespace}, serviceAccount) - if err != nil { - closeScalers(scalersRes) - return []scalers.Scaler{}, fmt.Errorf("error getting service account: %s", err) - } - authParams["awsRoleArn"] = serviceAccount.Annotations[kedav1alpha1.PodIdentityAnnotationEKS] - } else if podIdentity == kedav1alpha1.PodIdentityProviderAwsKiam { - authParams["awsRoleArn"] = podTemplateSpec.ObjectMeta.Annotations[kedav1alpha1.PodIdentityAnnotationKiam] + authParams, podIdentity := resolver.ResolveAuthRef(h.client, logger, trigger.AuthenticationRef, &podTemplateSpec.Spec, withTriggers.Namespace) + + if podIdentity == kedav1alpha1.PodIdentityProviderAwsEKS { + serviceAccountName := podTemplateSpec.Spec.ServiceAccountName + serviceAccount := &corev1.ServiceAccount{} + err = h.client.Get(context.TODO(), types.NamespacedName{Name: serviceAccountName, Namespace: withTriggers.Namespace}, serviceAccount) + if err != nil { + closeScalers(scalersRes) + return []scalers.Scaler{}, fmt.Errorf("error getting service account: %s", err) } - config.AuthParams = authParams - config.PodIdentity = podIdentity + authParams["awsRoleArn"] = serviceAccount.Annotations[kedav1alpha1.PodIdentityAnnotationEKS] + } else if podIdentity == kedav1alpha1.PodIdentityProviderAwsKiam { + authParams["awsRoleArn"] = podTemplateSpec.ObjectMeta.Annotations[kedav1alpha1.PodIdentityAnnotationKiam] + } else { + authParams, _ = resolver.ResolveAuthRef(h.client, logger, trigger.AuthenticationRef, nil, withTriggers.Namespace) + } + + config := &scalers.ScalerConfig{ + Name: withTriggers.Name, + Namespace: withTriggers.Namespace, + TriggerMetadata: trigger.Metadata, + ResolvedEnv: resolvedEnv, + AuthParams: authParams, + PodIdentity: podIdentity, + GlobalHTTPTimeout: h.globalHTTPTimeout, } scaler, err := buildScaler(trigger.Type, config) @@ -400,6 +403,8 @@ func buildScaler(triggerType string, config *scalers.ScalerConfig) (scalers.Scal // TRIGGERS-START switch triggerType { case "artemis-queue": + // currently, the Artemis Scaler defines its own HTTP client, with a hard-coded 3 second + // timeout. not sure why that is? return scalers.NewArtemisQueueScaler(config) case "aws-cloudwatch": return scalers.NewAwsCloudwatchScaler(config) diff --git a/pkg/util/gvkr.go b/pkg/util/gvkr.go index 857c11b1439..bc434da0199 100644 --- a/pkg/util/gvkr.go +++ b/pkg/util/gvkr.go @@ -1,7 +1,7 @@ package util import ( - kedav1alpha1 "github.com/kedacore/keda/api/v1alpha1" + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/util/http.go b/pkg/util/http.go new file mode 100644 index 00000000000..f23088e41f2 --- /dev/null +++ b/pkg/util/http.go @@ -0,0 +1,27 @@ +package util + +import ( + "net/http" + "time" +) + +// HTTPDoer is an interface that matches the Do method on +// (net/http).Client. It should be used in function signatures +// instead of raw *http.Clients wherever possible +type HTTPDoer interface { + Do(*http.Request) (*http.Response, error) +} + +// CreateHTTPClient returns a new HTTP client with the timeout set to +// timeoutMS milliseconds, or 300 milliseconds if timeoutMS <= 0 +func CreateHTTPClient(timeout time.Duration) *http.Client { + // default the timeout to 300ms + if timeout <= 0 { + timeout = 300 * time.Millisecond + } + httpClient := &http.Client{ + Timeout: timeout, + } + + return httpClient +} diff --git a/tests/scalers/stan-helpers.ts b/tests/scalers/stan-helpers.ts new file mode 100644 index 00000000000..894015e7a86 --- /dev/null +++ b/tests/scalers/stan-helpers.ts @@ -0,0 +1,189 @@ +import * as sh from 'shelljs' +import * as tmp from 'tmp' +import * as fs from 'fs' + +export class StanHelper { + static install(t, stanNamespace: string) { + const tmpFile = tmp.fileSync() + // deploy stan + fs.writeFileSync(tmpFile.name, stanManifest) + sh.exec('kubectl create namespace stan') + t.is( + 0, + sh.exec(`kubectl -n ${stanNamespace} apply -f ${tmpFile.name}`).code, 'creating stan statefulset should work.' + ) + t.is( + 0, + sh.exec(`kubectl -n ${stanNamespace} wait --for=condition=Ready --timeout=600s po/stan-nats-ss-0`).code, 'Stan pod should be available.' + ) + + } + + static uninstall(t, stanNamespace: string){ + const tmpFile = tmp.fileSync() + fs.writeFileSync(tmpFile.name, stanManifest) + sh.exec(`kubectl -n ${stanNamespace} delete -f ${tmpFile.name}`) + + } + + static publishMessages(t, testNamespace: string) { + const tmpFile = tmp.fileSync() + fs.writeFileSync(tmpFile.name, pubYaml) + t.is( + 0, + sh.exec(`kubectl -n ${testNamespace} apply -f ${tmpFile.name}`).code, 'creating stan producer should work.' + ) + } + + static installConsumer(t, testNamespace: string) { + const tmpFile = tmp.fileSync() + fs.writeFileSync(tmpFile.name, subYaml) + t.is( + 0, + sh.exec(`kubectl -n ${testNamespace} apply -f ${tmpFile.name}`).code, 'creating stan consumer deployment should work.' + ) + } + + static uninstallWorkloads(t, testNamespace: string){ + const tmpFile = tmp.fileSync() + fs.writeFileSync(tmpFile.name, subYaml) + sh.exec(`kubectl -n ${testNamespace} delete -f ${tmpFile.name}`) + fs.writeFileSync(tmpFile.name, pubYaml) + sh.exec(`kubectl -n ${testNamespace} delete -f ${tmpFile.name}`) + } + +} + +const stanManifest = ` +# Source: nats-ss/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + name: stan-nats-ss + labels: + app: nats-ss + chart: nats-ss-0.0.1 + release: stan + heritage: Helm +spec: + type: ClusterIP + ports: + - name: client + port: 4222 + targetPort: 4222 + protocol: TCP + - name: monitor + port: 8222 + targetPort: 8222 + protocol: TCP + selector: + app: nats-ss + release: stan +--- +# Source: nats-ss/templates/statefulset.yaml +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: stan-nats-ss + labels: + app: nats-ss + chart: nats-ss-0.0.1 + release: stan + heritage: Helm +spec: + serviceName: nats-ss + replicas: 1 + selector: + matchLabels: + app: nats-ss + template: + metadata: + labels: + app: nats-ss + release: stan + spec: + containers: + - name: nats-ss + image: nats-streaming:0.16.2 + imagePullPolicy: IfNotPresent + command: + - /nats-streaming-server + args: + - -m=8222 + - -st=FILE + - --dir=/nats-datastore + - --cluster_id=local-stan + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + volumeMounts: + - mountPath: /nats-datastore + name: nats-datastore + volumes: + - name: nats-datastore + emptyDir: {} +` + +const pubYaml = ` +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pub + labels: + app.kubernetes.io/name: pub + helm.sh/chart: pub-0.0.3 + app.kubernetes.io/instance: pub + app.kubernetes.io/version: "0.0.3" + app.kubernetes.io/managed-by: Helm +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: pub + app.kubernetes.io/instance: pub + template: + metadata: + labels: + app.kubernetes.io/name: pub + app.kubernetes.io/instance: pub + spec: + containers: + - name: pub + image: "balchu/gonuts-pub:c02e4ee-dirty" + imagePullPolicy: Always + command: ["/app"] + args: ["-s", "nats://stan-nats-ss.stan:4222", "-d", "10", "-limit", "1000", "Test"] +` + +const subYaml = ` +apiVersion: apps/v1 +kind: Deployment +metadata: + name: sub + labels: + app.kubernetes.io/name: sub + helm.sh/chart: sub-0.0.3 + app.kubernetes.io/instance: sub + app.kubernetes.io/version: "0.0.3" + app.kubernetes.io/managed-by: Helm +spec: + replicas: 0 + selector: + matchLabels: + app.kubernetes.io/name: sub + app.kubernetes.io/instance: sub + template: + metadata: + labels: + app.kubernetes.io/name: sub + app.kubernetes.io/instance: sub + spec: + containers: + - name: sub + image: "balchu/gonuts-sub:c02e4ee" + imagePullPolicy: Always + command: ["/app"] + args: ["-d", "5000", "-s", "nats://stan-nats-ss.stan:4222","-d","10","--durable","ImDurable", "--qgroup", "grp1", "Test"] +` diff --git a/tests/scalers/stan.test.ts b/tests/scalers/stan.test.ts new file mode 100644 index 00000000000..2e71db68ff2 --- /dev/null +++ b/tests/scalers/stan.test.ts @@ -0,0 +1,96 @@ +import * as async from 'async' +import * as fs from 'fs' +import * as sh from 'shelljs' +import * as tmp from 'tmp' +import test from 'ava' +import { StanHelper } from './stan-helpers' + +const testNamespace = 'gonuts' +const stanNamespace = 'stan' +const queueName = 'test' + +test.before(t => { + sh.config.silent = true + sh.exec(`kubectl create namespace gonuts`) + StanHelper.install(t, stanNamespace); + StanHelper.installConsumer(t, testNamespace) + StanHelper.publishMessages(t, testNamespace) + +}); + +test.serial('Deployment should have 0 replicas on start', t => { + const replicaCount = sh.exec(`kubectl get deployment.apps/sub --namespace ${testNamespace} -o jsonpath="{.spec.replicas}"`).stdout + + t.log('replica count: %s', replicaCount); + t.is(replicaCount, '0', 'replica count should start out as 0') + +}) + +test.serial(`Deployment should scale to 5 with 1000 messages on the queue then back to 0`, t => { + // deploy scaler + const tmpFile = tmp.fileSync() + fs.writeFileSync(tmpFile.name, scaledObjectYaml) + t.is( + 0, + sh.exec(`kubectl -n ${testNamespace} apply -f ${tmpFile.name}`).code, 'creating scaledObject should work.' + ) + + + // with messages published, the consumer deployment should start receiving the messages + let replicaCount = '0' + for (let i = 0; i < 10 && replicaCount !== '5'; i++) { + replicaCount = sh.exec( + `kubectl get deployment.apps/sub --namespace ${testNamespace} -o jsonpath="{.spec.replicas}"` + ).stdout + t.log('replica count is:' + replicaCount) + if (replicaCount !== '5') { + sh.exec('sleep 5s') + } + } + + t.is('5', replicaCount, 'Replica count should be 5 after 10 seconds') + + for (let i = 0; i < 50 && replicaCount !== '0'; i++) { + replicaCount = sh.exec( + `kubectl get deployment.apps/sub --namespace ${testNamespace} -o jsonpath="{.spec.replicas}"` + ).stdout + if (replicaCount !== '0') { + sh.exec('sleep 5s') + } + } + + t.is('0', replicaCount, 'Replica count should be 0 after 3 minutes') + }) + +test.after.always.cb('clean up stan deployment', t => { + sh.exec(`kubectl -n ${testNamespace} delete scaledobject.keda.sh/stan-scaledobject`) + + StanHelper.uninstall(t, stanNamespace) + sh.exec(`kubectl delete namespace ${stanNamespace}`) + StanHelper.uninstallWorkloads(t, testNamespace) + sh.exec(`kubectl delete namespace ${testNamespace}`) + t.end() +}) + + +const scaledObjectYaml = ` +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: stan-scaledobject +spec: + pollingInterval: 3 + cooldownPeriod: 10 + minReplicaCount: 0 + maxReplicaCount: 5 + scaleTargetRef: + name: sub + triggers: + - type: stan + metadata: + natsServerMonitoringEndpoint: "stan-nats-ss.stan:8222" + queueGroup: "grp1" + durableName: "ImDurable" + subject: "Test" + lagThreshold: "10" +` diff --git a/tools/build-tools.Dockerfile b/tools/build-tools.Dockerfile index ccc484dd344..988d66f5b19 100644 --- a/tools/build-tools.Dockerfile +++ b/tools/build-tools.Dockerfile @@ -26,9 +26,9 @@ RUN curl -LO https://download.docker.com/linux/static/stable/x86_64/docker-19.03 rm -rf docker docker-19.03.2.tgz # Install golang -RUN GO_VERSION=1.15.1 && \ +RUN GO_VERSION=1.15.5 && \ curl -LO https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz && \ - go_sha256=70ac0dbf60a8ee9236f337ed0daa7a4c3b98f6186d4497826f68e97c0c0413f6 && \ + go_sha256=9a58494e8da722c3aef248c9227b0e9c528c7318309827780f16220998180a0d && \ echo "$go_sha256 go${GO_VERSION}.linux-amd64.tar.gz" | sha256sum -c - && \ tar -C /usr/local -xvzf go${GO_VERSION}.linux-amd64.tar.gz && \ rm -rf go${GO_VERSION}.linux-amd64.tar.gz diff --git a/version/version.go b/version/version.go index b34f0931ce4..410bf0a54e6 100644 --- a/version/version.go +++ b/version/version.go @@ -2,7 +2,7 @@ package version var ( // Version defines the current version of keda - Version = "v2" + Version = "main" // GitCommit stores the current commit hash GitCommit string ) From 8f59db41fc4d870cc19b4925242091cefd7f903b Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Fri, 4 Dec 2020 12:22:23 -0800 Subject: [PATCH 2/8] restoring mysql scaler test Signed-off-by: Aaron Schlesinger --- pkg/scalers/mysql_scaler_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/scalers/mysql_scaler_test.go b/pkg/scalers/mysql_scaler_test.go index 8aa3ddddd1a..57a0e0a2f0c 100644 --- a/pkg/scalers/mysql_scaler_test.go +++ b/pkg/scalers/mysql_scaler_test.go @@ -93,4 +93,4 @@ func TestMySQLGetMetricSpecForScaling(t *testing.T) { t.Error("Wrong External metric source name:", metricName) } } -} +} \ No newline at end of file From 98c6cad5b5cfca561cc99a85112e875e42a51c5f Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Fri, 4 Dec 2020 12:34:52 -0800 Subject: [PATCH 3/8] tidy deps Signed-off-by: Aaron Schlesinger --- go.sum | 1 - 1 file changed, 1 deletion(-) diff --git a/go.sum b/go.sum index 9969993c55c..5ba2b969536 100644 --- a/go.sum +++ b/go.sum @@ -866,7 +866,6 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/kedacore/keda v1.5.0 h1:c8xA1Vo3H7rPwFiWUX3CBXnjBSrbYDmUs9iEfDlf4bQ= github.com/kelseyhightower/envconfig v1.3.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= From 662a06594088ef46372636bf4d9feb5e3b2c9ba6 Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Fri, 4 Dec 2020 12:36:13 -0800 Subject: [PATCH 4/8] newline at EOF Signed-off-by: Aaron Schlesinger --- pkg/scalers/mysql_scaler_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/scalers/mysql_scaler_test.go b/pkg/scalers/mysql_scaler_test.go index 57a0e0a2f0c..8aa3ddddd1a 100644 --- a/pkg/scalers/mysql_scaler_test.go +++ b/pkg/scalers/mysql_scaler_test.go @@ -93,4 +93,4 @@ func TestMySQLGetMetricSpecForScaling(t *testing.T) { t.Error("Wrong External metric source name:", metricName) } } -} \ No newline at end of file +} From 366d9d802f11bee17d2d4c918a8346af1667fb0b Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Fri, 4 Dec 2020 13:43:18 -0800 Subject: [PATCH 5/8] fixing syntax error Signed-off-by: Aaron Schlesinger --- pkg/scalers/kafka_scaler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/scalers/kafka_scaler.go b/pkg/scalers/kafka_scaler.go index 1b3f9ba347f..972d4f90885 100644 --- a/pkg/scalers/kafka_scaler.go +++ b/pkg/scalers/kafka_scaler.go @@ -114,7 +114,7 @@ func parseKafkaMetadata(config *ScalerConfig) (kafkaMetadata, error) { meta.topic = config.ResolvedEnv[config.TriggerMetadata["topicFromEnv"]] case config.TriggerMetadata["topic"] != "": meta.topic = config.TriggerMetadata["topic"] - default:- + default: return meta, errors.New("no topic given") } From 1cf4ef6aa12a5a56f8e617ce7107fb2f9c799f04 Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Fri, 4 Dec 2020 13:47:01 -0800 Subject: [PATCH 6/8] simplify code, bring closer to main Signed-off-by: Aaron Schlesinger --- pkg/scaling/scale_handler.go | 41 +++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/pkg/scaling/scale_handler.go b/pkg/scaling/scale_handler.go index 219cf8c2a80..4d22a6cc8df 100644 --- a/pkg/scaling/scale_handler.go +++ b/pkg/scaling/scale_handler.go @@ -327,32 +327,35 @@ func (h *scaleHandler) buildScalers(withTriggers *kedav1alpha1.WithTriggers, pod } for i, trigger := range withTriggers.Spec.Triggers { - authParams, podIdentity := resolver.ResolveAuthRef(h.client, logger, trigger.AuthenticationRef, &podTemplateSpec.Spec, withTriggers.Namespace) - - if podIdentity == kedav1alpha1.PodIdentityProviderAwsEKS { - serviceAccountName := podTemplateSpec.Spec.ServiceAccountName - serviceAccount := &corev1.ServiceAccount{} - err = h.client.Get(context.TODO(), types.NamespacedName{Name: serviceAccountName, Namespace: withTriggers.Namespace}, serviceAccount) - if err != nil { - closeScalers(scalersRes) - return []scalers.Scaler{}, fmt.Errorf("error getting service account: %s", err) - } - authParams["awsRoleArn"] = serviceAccount.Annotations[kedav1alpha1.PodIdentityAnnotationEKS] - } else if podIdentity == kedav1alpha1.PodIdentityProviderAwsKiam { - authParams["awsRoleArn"] = podTemplateSpec.ObjectMeta.Annotations[kedav1alpha1.PodIdentityAnnotationKiam] - } else { - authParams, _ = resolver.ResolveAuthRef(h.client, logger, trigger.AuthenticationRef, nil, withTriggers.Namespace) - } - config := &scalers.ScalerConfig{ Name: withTriggers.Name, Namespace: withTriggers.Namespace, TriggerMetadata: trigger.Metadata, ResolvedEnv: resolvedEnv, - AuthParams: authParams, - PodIdentity: podIdentity, + AuthParams: make(map[string]string), GlobalHTTPTimeout: h.globalHTTPTimeout, } + if podTemplateSpec != nil { + authParams, podIdentity := resolver.ResolveAuthRef(h.client, logger, trigger.AuthenticationRef, &podTemplateSpec.Spec, withTriggers.Namespace) + + if podIdentity == kedav1alpha1.PodIdentityProviderAwsEKS { + serviceAccountName := podTemplateSpec.Spec.ServiceAccountName + serviceAccount := &corev1.ServiceAccount{} + err = h.client.Get(context.TODO(), types.NamespacedName{Name: serviceAccountName, Namespace: withTriggers.Namespace}, serviceAccount) + if err != nil { + closeScalers(scalersRes) + return []scalers.Scaler{}, fmt.Errorf("error getting service account: %s", err) + } + authParams["awsRoleArn"] = serviceAccount.Annotations[kedav1alpha1.PodIdentityAnnotationEKS] + } else if podIdentity == kedav1alpha1.PodIdentityProviderAwsKiam { + authParams["awsRoleArn"] = podTemplateSpec.ObjectMeta.Annotations[kedav1alpha1.PodIdentityAnnotationKiam] + } + config.AuthParams = authParams + config.PodIdentity = podIdentity + } else { + authParams, _ := resolver.ResolveAuthRef(h.client, logger, trigger.AuthenticationRef, nil, withTriggers.Namespace) + config.AuthParams = authParams + } scaler, err := buildScaler(trigger.Type, config) if err != nil { From 3909d33618c1b68aa4916d22d443163cf8cfec3b Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Fri, 4 Dec 2020 13:47:41 -0800 Subject: [PATCH 7/8] removing obsolete todo Signed-off-by: Aaron Schlesinger --- pkg/scaling/scale_handler.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/scaling/scale_handler.go b/pkg/scaling/scale_handler.go index 4d22a6cc8df..e88f7b2ba30 100644 --- a/pkg/scaling/scale_handler.go +++ b/pkg/scaling/scale_handler.go @@ -406,8 +406,6 @@ func buildScaler(triggerType string, config *scalers.ScalerConfig) (scalers.Scal // TRIGGERS-START switch triggerType { case "artemis-queue": - // currently, the Artemis Scaler defines its own HTTP client, with a hard-coded 3 second - // timeout. not sure why that is? return scalers.NewArtemisQueueScaler(config) case "aws-cloudwatch": return scalers.NewAwsCloudwatchScaler(config) From f969a84f27dee4e95bafa9574b45d2fcfa260e09 Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Wed, 9 Dec 2020 11:47:15 -0800 Subject: [PATCH 8/8] Fixing static check error Cannot call os.Exit(1) because it prevents the klog.Flush defer Signed-off-by: Aaron Schlesinger --- adapter/main.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/adapter/main.go b/adapter/main.go index 9fcfad4c781..1a44e307345 100644 --- a/adapter/main.go +++ b/adapter/main.go @@ -41,22 +41,22 @@ var ( prometheusMetricsPath string ) -func (a *Adapter) makeProviderOrDie(globalHTTPTimeout time.Duration) provider.MetricsProvider { +func (a *Adapter) makeProvider(globalHTTPTimeout time.Duration) (provider.MetricsProvider, error) { // Get a config to talk to the apiserver cfg, err := config.GetConfig() if err != nil { logger.Error(err, "failed to get the config") - os.Exit(1) + return nil, fmt.Errorf("failed to get the config (%s)", err) } scheme := scheme.Scheme if err := appsv1.SchemeBuilder.AddToScheme(scheme); err != nil { logger.Error(err, "failed to add apps/v1 scheme to runtime scheme") - os.Exit(1) + return nil, fmt.Errorf("failed to add apps/v1 scheme to runtime scheme (%s)", err) } if err := kedav1alpha1.SchemeBuilder.AddToScheme(scheme); err != nil { logger.Error(err, "failed to add keda scheme to runtime scheme") - os.Exit(1) + return nil, fmt.Errorf("failed to add keda scheme to runtime scheme (%s)", err) } kubeclient, err := client.New(cfg, client.Options{ @@ -64,7 +64,7 @@ func (a *Adapter) makeProviderOrDie(globalHTTPTimeout time.Duration) provider.Me }) if err != nil { logger.Error(err, "unable to construct new client") - os.Exit(1) + return nil, fmt.Errorf("unable to construct new client (%s)", err) } handler := scaling.NewScaleHandler(kubeclient, nil, scheme, globalHTTPTimeout) @@ -72,13 +72,13 @@ func (a *Adapter) makeProviderOrDie(globalHTTPTimeout time.Duration) provider.Me namespace, err := getWatchNamespace() if err != nil { logger.Error(err, "failed to get watch namespace") - os.Exit(1) + return nil, fmt.Errorf("failed to get watch namespace (%s)", err) } prometheusServer := &prommetrics.PrometheusMetricServer{} go func() { prometheusServer.NewServer(fmt.Sprintf(":%v", prometheusMetricsPort), prometheusMetricsPath) }() - return kedaprovider.NewProvider(logger, handler, kubeclient, namespace) + return kedaprovider.NewProvider(logger, handler, kubeclient, namespace), nil } func printVersion() { @@ -128,10 +128,14 @@ func main() { globalHTTPTimeoutMS, err := strconv.Atoi(globalHTTPTimeoutStr) if err != nil { logger.Error(err, "Invalid KEDA_HTTP_DEFAULT_TIMEOUT") - os.Exit(1) + return } - kedaProvider := cmd.makeProviderOrDie(time.Duration(globalHTTPTimeoutMS) * time.Millisecond) + kedaProvider, err := cmd.makeProvider(time.Duration(globalHTTPTimeoutMS) * time.Millisecond) + if err != nil { + logger.Error(err, "making provider") + return + } cmd.WithExternalMetrics(kedaProvider) logger.Info(cmd.Message)