Skip to content

Commit

Permalink
Register the GroupControllerServer
Browse files Browse the repository at this point in the history
  • Loading branch information
nixpanic committed Aug 7, 2023
1 parent 7e9bc5b commit 04a8ae0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/hostpath/hostpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions pkg/hostpath/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
Expand All @@ -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())

Expand Down

0 comments on commit 04a8ae0

Please sign in to comment.