From 1fc96783429623177e739281cbefd3f22406d833 Mon Sep 17 00:00:00 2001 From: Riya Singhal Date: Thu, 5 Oct 2023 21:01:58 +0530 Subject: [PATCH] cephfs: expose FenceControllerServer in driver.go to handle the requests Signed-off-by: Riya Singhal --- internal/cephfs/driver.go | 5 +++++ internal/csi-addons/cephfs/network_fence_test.go | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/cephfs/driver.go b/internal/cephfs/driver.go index 7c6f1b18741..d134fc04825 100644 --- a/internal/cephfs/driver.go +++ b/internal/cephfs/driver.go @@ -197,6 +197,11 @@ func (fs *Driver) setupCSIAddonsServer(conf *util.Config) error { is := casceph.NewIdentityServer(conf) fs.cas.RegisterService(is) + if conf.IsControllerServer { + fcs := casceph.NewFenceControllerServer() + fs.cas.RegisterService(fcs) + } + // start the server, this does not block, it runs a new go-routine err = fs.cas.Start() if err != nil { diff --git a/internal/csi-addons/cephfs/network_fence_test.go b/internal/csi-addons/cephfs/network_fence_test.go index 0d5cb96119c..e2e97891aab 100644 --- a/internal/csi-addons/cephfs/network_fence_test.go +++ b/internal/csi-addons/cephfs/network_fence_test.go @@ -20,9 +20,8 @@ import ( "context" "testing" - "github.com/stretchr/testify/assert" - "github.com/csi-addons/spec/lib/go/fence" + "github.com/stretchr/testify/assert" ) // TestFenceClusterNetwork is a minimal test for the FenceClusterNetwork()