-
Notifications
You must be signed in to change notification settings - Fork 113
Expose Pod, Image, and Gateway over HTTP using GRPC-Gateway #1391
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 issues found across 17 files
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
@cubic-dev-ai re-run |
@cooper-grc I've started the AI code review. It'll take a few minutes to complete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 issues found across 17 files
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
@@ -503,6 +529,11 @@ func (g *Gateway) Start() error { | |||
log.Fatal().Err(err).Msg("failed to initialize http server") | |||
} | |||
|
|||
err = g.initGrpcGateway(fmt.Sprintf(":%d", g.Config.GatewayService.GRPC.Port)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Endpoint passed to initGrpcGateway lacks a host; use "localhost:%d" (or configured host) instead of just ":%d" to avoid dial errors.
Prompt for AI agents
Address the following comment on pkg/gateway/gateway.go at line 532:
<comment>Endpoint passed to initGrpcGateway lacks a host; use "localhost:%d" (or configured host) instead of just ":%d" to avoid dial errors.</comment>
<file context>
@@ -503,6 +529,11 @@ func (g *Gateway) Start() error {
log.Fatal().Err(err).Msg("failed to initialize http server")
}
+ err = g.initGrpcGateway(fmt.Sprintf(":%d", g.Config.GatewayService.GRPC.Port))
+ if err != nil {
+ log.Fatal().Err(err).Msg("failed to initialize grpc gateway")
</file context>
err = g.initGrpcGateway(fmt.Sprintf(":%d", g.Config.GatewayService.GRPC.Port)) | |
err = g.initGrpcGateway(fmt.Sprintf("localhost:%d", g.Config.GatewayService.GRPC.Port)) |
pkg/gateway/gateway.go
Outdated
// No need to add auth middleware: grpc-gateway maps the 'Authorization' header | ||
// to gRPC metadata, and the destination gRPC server's interceptor will handle | ||
// authorization for every request. | ||
g.baseRouteGroup.Any("/grpc-gateway/*", echo.WrapHandler(http.StripPrefix(apiv1.HttpServerBaseRoute+"/grpc-gateway", mux))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if I like the naming. This is more like an /api/v2 path instead of calling it /api/v1/grpc-gateway. People using this endpoint shouldn't need to associated it with an http gateway in front of GRPC. @luke-beamcloud
Also is this some form of behavior that will allow us to add additional endpoints to the grpc->http generated route groups?
If so, then we can actually call this /api/v2 and either build out all functionality to grpc
Summary by cubic
Expose Pod, Image, and Gateway gRPC services over HTTP using grpc-gateway, mounted at /api/v1/grpc-gateway. This lets clients call JSON endpoints without a gRPC client.
New Features
Dependencies