-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serve OpenAPI spec by default #110
Conversation
7b064ed
to
258bf97
Compare
I very like this approach, it is a great improvement that will remove a lot of tedious work for maintainers as I don't expect many projects to have a custom OpenAPI |
These definitions now defaults to those of custom-metrics-apiserver.
258bf97
to
eeef1a3
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dgrisonnet, olivierlemasle The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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]>
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]>
* Metrics Server: use vendored OpenAPI definitions 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]> * Update CHANGELOG.md Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Olivier Lemasle <[email protected]> Signed-off-by: Olivier Lemasle <[email protected]> Signed-off-by: Olivier Lemasle <[email protected]> Co-authored-by: Zbynek Roubalik <[email protected]>
* Metrics Server: use vendored OpenAPI definitions 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]> * Update CHANGELOG.md Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Olivier Lemasle <[email protected]> Signed-off-by: Olivier Lemasle <[email protected]> Signed-off-by: Olivier Lemasle <[email protected]> Co-authored-by: Zbynek Roubalik <[email protected]>
* Metrics Server: use vendored OpenAPI definitions 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]> * Update CHANGELOG.md Co-authored-by: Zbynek Roubalik <[email protected]> Signed-off-by: Olivier Lemasle <[email protected]> Signed-off-by: Olivier Lemasle <[email protected]> Signed-off-by: Olivier Lemasle <[email protected]> Co-authored-by: Zbynek Roubalik <[email protected]>
Resolves #109
This PR adds default OpenAPI definitions and settings, while keeping it customizable.
If the project using
custom-metrics-apiserver
continues to usethen nothing changes.
However, if an
OpenAPIConfig
is not provided,custom-metrics-apiserver
will provide a default value, with its own generated definitions, which means that the OpenAPI spec will be served.Note 1: I have split the definitions between custom_metrics, external_metrics and "core", but it is possible to use a single generated file.
Note 2: I could have let
test-adapter
use its custom OpenAPI settings to show how to use it. But I don't think it's really necessary (documentation could be added, though).