mirror of
https://github.com/siderolabs/talos.git
synced 2025-12-16 06:51:27 +01:00
New service `routerd` performs exactly single task: based on incoming API call service name, it routes the requests to the appropriate Talos service (`networkd`, `osd`, etc.) Service `routerd` listens of file socket and routes requests to file sockets. Service `apid` now does single task as well: * it either fans out request to other `apid` services running on other nodes and aggregates responses * or it forwards requests to local `routerd` (when request destination is local node) Cons: * one more proxying layer on request path Pros: * more clear service roles * `routerd` is part of core Talos, services should register with it to expose their API; no auth in the service (not exposed to the world) * `apid` might be replaced with other implementation, it depends on TLS infra, auth, etc. * `apid` is better segregated from other Talos services (can only access `routerd`, can't talk to other Talos services directly, so less exposure in case of a bug) This change is no-op to the end users. Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
32 lines
705 B
Go
32 lines
705 B
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
package director_test
|
|
|
|
import (
|
|
"context"
|
|
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
type mockBackend struct {
|
|
target string
|
|
}
|
|
|
|
func (m *mockBackend) String() string {
|
|
return m.target
|
|
}
|
|
|
|
func (m *mockBackend) GetConnection(ctx context.Context) (context.Context, *grpc.ClientConn, error) {
|
|
return ctx, nil, nil
|
|
}
|
|
|
|
func (m *mockBackend) AppendInfo(streaming bool, resp []byte) ([]byte, error) {
|
|
return resp, nil
|
|
}
|
|
|
|
func (m *mockBackend) BuildError(streaming bool, err error) ([]byte, error) {
|
|
return nil, nil
|
|
}
|