mirror of
https://github.com/siderolabs/talos.git
synced 2025-10-17 18:41:16 +02:00
fix: properly filter resources in maintenance server
The issue was introduced in PR #6042 Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
This commit is contained in:
parent
fa5aad01a0
commit
6eefa9d9cb
@ -11,6 +11,7 @@ import (
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/cosi-project/runtime/pkg/state"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/peer"
|
||||
@ -54,9 +55,13 @@ func New(r runtime.Runtime, logger *log.Logger, cfgCh chan []byte) *Server {
|
||||
func (s *Server) Register(obj *grpc.Server) {
|
||||
s.server = obj
|
||||
|
||||
// wrap resources with access filter
|
||||
resourceState := s.runtime.State().V1Alpha2().Resources()
|
||||
resourceState = state.WrapCore(state.Filter(resourceState, resources.AccessPolicy(resourceState)))
|
||||
|
||||
storage.RegisterStorageServiceServer(obj, &storaged.Server{})
|
||||
machine.RegisterMachineServiceServer(obj, s)
|
||||
resource.RegisterResourceServiceServer(obj, &resources.Server{Resources: s.runtime.State().V1Alpha2().Resources()})
|
||||
resource.RegisterResourceServiceServer(obj, &resources.Server{Resources: resourceState})
|
||||
}
|
||||
|
||||
// ApplyConfiguration implements machine.MachineService.
|
||||
|
Loading…
x
Reference in New Issue
Block a user