Skip to content

Commit

Permalink
Metrics Server: use vendored OpenAPI definitions
Browse files Browse the repository at this point in the history
custom-metrics-apiserver serves OpenAPI spec by default since
version [v1.25.0] (cf [PR 110]).

[v1.25.0]: https://github.com/kubernetes-sigs/custom-metrics-apiserver/releases/tag/v1.25.0
[PR 110]: kubernetes-sigs/custom-metrics-apiserver#110

In Keda Metrics Server, remove generation of
`adapter/generated/openapi/zz_generated.openapi.go` and use
OpenAPI definitions from custom-metrics-apiserver instead.

Signed-off-by: Olivier Lemasle <[email protected]>
  • Loading branch information
olivierlemasle committed Nov 29, 2022
1 parent 50f4640 commit 66e0497
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 14,953 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio
- **General**: Bump Golang to 1.18.6 ([#3205](https://github.com/kedacore/keda/issues/3205))
- **General**: Bump `github.com/Azure/azure-event-hubs-go/v3` ([#2986](https://github.com/kedacore/keda/issues/2986))
- **General**: Migrate from `azure-service-bus-go` to `azservicebus` ([#3394](https://github.com/kedacore/keda/issues/3394))
- **General**: Metrics Server: use OpenAPI definitions served by custom-metrics-apiserver
- **Azure EventHub**: Add e2e tests ([#2792](https://github.com/kedacore/keda/issues/2792))

## v2.8.1
Expand Down
12 changes: 1 addition & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,6 @@ manifests: controller-gen ## Generate ClusterRole and CustomResourceDefinition o
generate: controller-gen mockgen-gen proto-gen ## Generate code containing DeepCopy, DeepCopyInto, DeepCopyObject method implementations (API), mocks and proto.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

adapter/generated/openapi/zz_generated.openapi.go: go.mod go.sum ## Generate OpenAPI for KEDA Metrics Adapter.
go run vendor/k8s.io/kube-openapi/cmd/openapi-gen/openapi-gen.go --logtostderr \
-i k8s.io/metrics/pkg/apis/custom_metrics,k8s.io/metrics/pkg/apis/custom_metrics/v1beta1,k8s.io/metrics/pkg/apis/custom_metrics/v1beta2,k8s.io/metrics/pkg/apis/external_metrics,k8s.io/metrics/pkg/apis/external_metrics/v1beta1,k8s.io/metrics/pkg/apis/metrics,k8s.io/metrics/pkg/apis/metrics/v1beta1,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/version,k8s.io/api/core/v1 \
--build-tag autogenerated \
-h ./hack/boilerplate.go.txt \
-p ./adapter/generated/openapi \
-O zz_generated.openapi \
-o ./ \
-r /dev/null

fmt: ## Run go fmt against code.
go fmt ./...

Expand Down Expand Up @@ -177,7 +167,7 @@ build: generate fmt vet manager adapter ## Build Operator (manager) and Metrics
manager: generate
${GO_BUILD_VARS} go build -ldflags $(GO_LDFLAGS) -mod=vendor -o bin/keda main.go

adapter: generate adapter/generated/openapi/zz_generated.openapi.go
adapter: generate
${GO_BUILD_VARS} go build -ldflags $(GO_LDFLAGS) -mod=vendor -o bin/keda-adapter adapter/main.go

run: manifests generate ## Run a controller from your host.
Expand Down
Loading

0 comments on commit 66e0497

Please sign in to comment.