rbd: expose CSI-Addons ReclaimSpace operations

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-12-08 17:40:04 +01:00 committed by mergify[bot]
parent c274649b80
commit e574c807f0
2 changed files with 24 additions and 0 deletions

View File

@ -75,6 +75,13 @@ func (is *IdentityServer) GetCapabilities(
Type: identity.Capability_Service_CONTROLLER_SERVICE, 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, Type: identity.Capability_Service_NODE_SERVICE,
}, },
}, },
},
&identity.Capability{
Type: &identity.Capability_ReclaimSpace_{
ReclaimSpace: &identity.Capability_ReclaimSpace{
Type: identity.Capability_ReclaimSpace_ONLINE,
},
},
}) })
} }

View File

@ -213,6 +213,16 @@ func (r *Driver) setupCSIAddonsServer(conf *util.Config) error {
is := casrbd.NewIdentityServer(conf) is := casrbd.NewIdentityServer(conf)
r.cas.RegisterService(is) 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 // start the server, this does not block, it runs a new go-routine
err = r.cas.Start() err = r.cas.Start()
if err != nil { if err != nil {