From 04a8ae010bf14e8a1ba5f7939ad887a5b2b66ea5 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 25 Apr 2023 14:32:39 +0200 Subject: [PATCH] Register the GroupControllerServer --- pkg/hostpath/hostpath.go | 2 +- pkg/hostpath/server.go | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/hostpath/hostpath.go b/pkg/hostpath/hostpath.go index 2a107e4b7..1488094ff 100644 --- a/pkg/hostpath/hostpath.go +++ b/pkg/hostpath/hostpath.go @@ -123,7 +123,7 @@ func NewHostPathDriver(cfg Config) (*hostPath, error) { func (hp *hostPath) Run() error { s := NewNonBlockingGRPCServer() // hp itself implements ControllerServer, NodeServer, and IdentityServer. - s.Start(hp.config.Endpoint, hp, hp, hp) + s.Start(hp.config.Endpoint, hp, hp, hp, hp) s.Wait() return nil diff --git a/pkg/hostpath/server.go b/pkg/hostpath/server.go index 8687fe191..01b5f911d 100644 --- a/pkg/hostpath/server.go +++ b/pkg/hostpath/server.go @@ -40,11 +40,11 @@ type nonBlockingGRPCServer struct { cleanup func() } -func (s *nonBlockingGRPCServer) Start(endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer) { +func (s *nonBlockingGRPCServer) Start(endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer, gcs csi.GroupControllerServer) { s.wg.Add(1) - go s.serve(endpoint, ids, cs, ns) + go s.serve(endpoint, ids, cs, ns, gcs) return } @@ -63,7 +63,7 @@ func (s *nonBlockingGRPCServer) ForceStop() { s.cleanup() } -func (s *nonBlockingGRPCServer) serve(ep string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer) { +func (s *nonBlockingGRPCServer) serve(ep string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer, gcs csi.GroupControllerServer) { listener, cleanup, err := endpoint.Listen(ep) if err != nil { glog.Fatalf("Failed to listen: %v", err) @@ -85,6 +85,9 @@ func (s *nonBlockingGRPCServer) serve(ep string, ids csi.IdentityServer, cs csi. if ns != nil { csi.RegisterNodeServer(server, ns) } + if gcs != nil { + csi.RegisterGroupControllerServer(server, gcs) + } glog.Infof("Listening for connections on address: %#v", listener.Addr())