Closed zyy17 closed 2 months ago
[!WARNING]
Rate limit exceeded
@zyy17 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 7 seconds before requesting another review.
⌛ How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.🚦 How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.📥 Commits
Files that changed from the base of the PR and between 6086c776cd7959c84ebccc62e7d5b9473bb5285d and 4f712814c412af920c0207bd4f9e303955bea7d0.
The pull request introduces a new API server functionality to the operator application. It modifies the command initialization to conditionally start an API server based on configuration flags. Additionally, it updates the options structure to include parameters for enabling the API server and specifying its port. A new package, apiserver
, is created, implementing the HTTP server with endpoints for managing GreptimeDBCluster
resources. Unit tests are also added to validate the API server's behavior using a mock Kubernetes client.
Files | Change Summary |
---|---|
cmd/operator/app/command.go |
Introduced API server support in NewOperatorCommand , including server initialization and error handling. |
cmd/operator/app/options/options.go |
Added EnableAPIServer and APIServerPort fields to Options struct; updated NewDefaultOptions and AddFlags methods to initialize and configure these fields. |
pkg/apiserver/apiserver.go |
Implemented a new HTTP API server with endpoints for managing GreptimeDBCluster resources, including methods for retrieving cluster details and handling pod information. |
pkg/apiserver/apiserver_test.go |
Added unit tests for the API server, including a mock client to simulate Kubernetes interactions and validate the API responses. |
go.mod |
Updated dependencies to include new packages and modify existing ones, reflecting changes related to the API server functionality. |
cmd/operator/app/command.go
file, updating the controller manager initialization, related to command structure.GreptimeDBCluster
, which may relate to the overall functionality of the operator, including the new API server features in the main PR.🐰 In the code, a new server hops,
With clusters to manage, it never stops.
Flags set to guide, ports to define,
API magic, oh how it shines!
Testing with care, all bugs we’ll chase,
In this rabbit’s realm, we find our place! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
What's changed
Introduce a apiserver for greptimedb-operator. The trust 3rd application can use http service to access the metadata of
GreptimeDBCluster
without using K8s API.For example:
GET /api/v1alpha1/namespaces/all/clusters
: Get all clusters;GET /api/v1alpha1/namespaces/foo/clusters/bar
: Getbar
cluster offoo
namespace;Summary by CodeRabbit
New Features
Bug Fixes
Tests