mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
api: deprecate /grpc and /session endpoints
The /grpc and /session endpoints are now deprecated as the Engine has been upgraded to properly support HTTP/2 and h2c requests, making these specialized endpoints unnecessary. These endpoints will be removed in the next major API version to complete the cleanup. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
@@ -44,7 +44,7 @@ import (
|
||||
"github.com/moby/moby/v2/daemon/server/router/container"
|
||||
debugrouter "github.com/moby/moby/v2/daemon/server/router/debug"
|
||||
distributionrouter "github.com/moby/moby/v2/daemon/server/router/distribution"
|
||||
grpcrouter "github.com/moby/moby/v2/daemon/server/router/grpc"
|
||||
grpcrouter "github.com/moby/moby/v2/daemon/server/router/grpc" //nolint:staticcheck // Deprecated endpoint kept for backward compatibility
|
||||
"github.com/moby/moby/v2/daemon/server/router/image"
|
||||
"github.com/moby/moby/v2/daemon/server/router/network"
|
||||
pluginrouter "github.com/moby/moby/v2/daemon/server/router/plugin"
|
||||
@@ -730,7 +730,7 @@ func buildRouters(opts routerOptions) []router.Router {
|
||||
systemrouter.NewRouter(opts.daemon, opts.cluster, opts.builder.buildkit, opts.daemon.Features),
|
||||
volume.NewRouter(opts.daemon.VolumesService(), opts.cluster),
|
||||
build.NewRouter(opts.builder.backend, opts.daemon),
|
||||
sessionrouter.NewRouter(opts.builder.sessionManager),
|
||||
sessionrouter.NewRouter(opts.builder.sessionManager), //nolint:staticcheck // Deprecated endpoint kept for backward compatibility
|
||||
swarmrouter.NewRouter(opts.cluster),
|
||||
pluginrouter.NewRouter(opts.daemon.PluginManager()),
|
||||
distributionrouter.NewRouter(opts.daemon.ImageBackend()),
|
||||
@@ -739,7 +739,7 @@ func buildRouters(opts routerOptions) []router.Router {
|
||||
}
|
||||
|
||||
if opts.builder.backend != nil {
|
||||
routers = append(routers, grpcrouter.NewRouter(opts.builder.backend))
|
||||
routers = append(routers, grpcrouter.NewRouter(opts.builder.backend)) //nolint:staticcheck // Deprecated endpoint kept for backward compatibility
|
||||
}
|
||||
|
||||
if opts.daemon.HasExperimental() {
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
// Package grpc provides the router for the /grpc endpoint.
|
||||
//
|
||||
// Deprecated: The /grpc endpoint is deprecated and will be removed in the next
|
||||
// major version. The Engine now properly supports HTTP/2 and h2c requests and can
|
||||
// serve gRPC without this endpoint. Clients should establish gRPC connections
|
||||
// directly over HTTP/2.
|
||||
package grpc
|
||||
|
||||
import (
|
||||
@@ -25,6 +31,9 @@ type grpcRouter struct {
|
||||
}
|
||||
|
||||
// NewRouter initializes a new grpc http router
|
||||
//
|
||||
// Deprecated: The /grpc endpoint is deprecated and will be removed in the next
|
||||
// major version. The Engine now properly supports HTTP/2 and h2c requests.
|
||||
func NewRouter(backends ...Backend) router.Router {
|
||||
tp, _ := otelutil.NewTracerProvider(context.Background(), false)
|
||||
opts := []grpc.ServerOption{
|
||||
|
||||
@@ -9,6 +9,9 @@ type sessionRouter struct {
|
||||
}
|
||||
|
||||
// NewRouter initializes a new session router
|
||||
//
|
||||
// Deprecated: The /session endpoint is deprecated and will be removed in the next
|
||||
// major version. The Engine now properly supports HTTP/2 and h2c requests.
|
||||
func NewRouter(b Backend) router.Router {
|
||||
r := &sessionRouter{
|
||||
backend: b,
|
||||
|
||||
Reference in New Issue
Block a user