diff --git a/internal/csi-addons/rbd/identity.go b/internal/csi-addons/rbd/identity.go index 6ba39b571..a5c29625b 100644 --- a/internal/csi-addons/rbd/identity.go +++ b/internal/csi-addons/rbd/identity.go @@ -75,6 +75,13 @@ func (is *IdentityServer) GetCapabilities( Type: identity.Capability_Service_CONTROLLER_SERVICE, }, }, + }, + &identity.Capability{ + Type: &identity.Capability_ReclaimSpace_{ + ReclaimSpace: &identity.Capability_ReclaimSpace{ + Type: identity.Capability_ReclaimSpace_OFFLINE, + }, + }, }) } @@ -87,6 +94,13 @@ func (is *IdentityServer) GetCapabilities( Type: identity.Capability_Service_NODE_SERVICE, }, }, + }, + &identity.Capability{ + Type: &identity.Capability_ReclaimSpace_{ + ReclaimSpace: &identity.Capability_ReclaimSpace{ + Type: identity.Capability_ReclaimSpace_ONLINE, + }, + }, }) } diff --git a/internal/rbd/driver/driver.go b/internal/rbd/driver/driver.go index b4840da7a..edc1d4b83 100644 --- a/internal/rbd/driver/driver.go +++ b/internal/rbd/driver/driver.go @@ -213,6 +213,16 @@ func (r *Driver) setupCSIAddonsServer(conf *util.Config) error { is := casrbd.NewIdentityServer(conf) r.cas.RegisterService(is) + if conf.IsControllerServer { + rs := casrbd.NewReclaimSpaceControllerServer() + r.cas.RegisterService(rs) + } + + if conf.IsNodeServer { + rs := casrbd.NewReclaimSpaceNodeServer() + r.cas.RegisterService(rs) + } + // start the server, this does not block, it runs a new go-routine err = r.cas.Start() if err != nil {