Skip to content

Commit

Permalink
rbd: Add capability and register service
Browse files Browse the repository at this point in the history
Signed-off-by: Yug Gupta <[email protected]>
  • Loading branch information
Yuggupta27 committed Dec 22, 2021
1 parent 592c9a5 commit f7da55e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/csi-addons/rbd/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ func (is *IdentityServer) GetCapabilities(
Type: identity.Capability_Service_CONTROLLER_SERVICE,
},
},
}, &identity.Capability{
Type: &identity.Capability_NetworkFence_{
NetworkFence: &identity.Capability_NetworkFence{
Type: identity.Capability_NetworkFence_NETWORK_FENCE,
},
},
})
}

Expand Down
5 changes: 5 additions & 0 deletions internal/rbd/driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ func (r *Driver) setupCSIAddonsServer(conf *util.Config) error {
is := casrbd.NewIdentityServer(conf)
r.cas.RegisterService(is)

if conf.IsControllerServer {
fcs := casrbd.NewFenceControllerServer()
r.cas.RegisterService(fcs)
}

// start the server, this does not block, it runs a new go-routine
err = r.cas.Start()
if err != nil {
Expand Down

0 comments on commit f7da55e

Please sign in to comment.