From 24e88ce1ee8f298a62c41cead5aee13d7ae27cfb Mon Sep 17 00:00:00 2001 From: sanjain-px <116874823+sanjain-px@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:16:22 +0530 Subject: [PATCH] PWX-37595: honour force flag over node status (#2479) * PWX-37959: honour force flag over node status Signed-off-by: sanjain * minor changes Signed-off-by: sanjain * minor changes Signed-off-by: sanjain * added cluster listner mock Signed-off-by: sanjain --------- Signed-off-by: sanjain --- Makefile | 1 + cluster/cluster.go | 1 + cluster/manager/manager.go | 3 +- cluster/manager/manager_test.go | 41 +++ cluster/mock/cluster_listener.mock.go | 443 ++++++++++++++++++++++++++ 5 files changed, 488 insertions(+), 1 deletion(-) create mode 100644 cluster/mock/cluster_listener.mock.go diff --git a/Makefile b/Makefile index 1e759054b..9162f7614 100644 --- a/Makefile +++ b/Makefile @@ -435,6 +435,7 @@ mockgen: mockgen -destination=api/mock/mock_watch.go -package=mock github.com/libopenstorage/openstorage/api OpenStorageWatchServer,OpenStorageWatchClient,OpenStorageWatch_WatchClient,OpenStorageWatch_WatchServer mockgen -destination=api/mock/mock_bucket.go -package=mock github.com/libopenstorage/openstorage/api OpenStorageBucketServer,OpenStorageBucketClient mockgen -destination=cluster/mock/cluster.mock.go -package=mock github.com/libopenstorage/openstorage/cluster Cluster + mockgen -destination=cluster/mock/cluster_listener.mock.go -package=mock github.com/libopenstorage/openstorage/cluster ClusterListener mockgen -destination=api/mock/mock_fstrim.go -package=mock github.com/libopenstorage/openstorage/api OpenStorageFilesystemTrimServer,OpenStorageFilesystemTrimClient mockgen -destination=api/mock/mock_fscheck.go -package=mock github.com/libopenstorage/openstorage/api OpenStorageFilesystemCheckServer,OpenStorageFilesystemCheckClient mockgen -destination=api/mock/mock_defrag.go -package=mock github.com/libopenstorage/openstorage/api OpenStorageFilesystemDefragServer,OpenStorageFilesystemDefragClient diff --git a/cluster/cluster.go b/cluster/cluster.go index d1ecd89ad..5a19e6f67 100644 --- a/cluster/cluster.go +++ b/cluster/cluster.go @@ -1,4 +1,5 @@ //go:generate mockgen -package=mock -destination=mock/cluster.mock.go github.com/libopenstorage/openstorage/cluster Cluster +//go:generate mockgen -destination=cluster/mock/cluster_listener.mock.go -package=mock github.com/libopenstorage/openstorage/cluster ClusterListener package cluster import ( diff --git a/cluster/manager/manager.go b/cluster/manager/manager.go index 1e9e69d67..39df00483 100644 --- a/cluster/manager/manager.go +++ b/cluster/manager/manager.go @@ -1830,7 +1830,8 @@ func (c *ClusterManager) Remove(nodes []api.Node, forceRemove bool) error { // If node is not down, do not remove it if nodeCacheStatus != api.Status_STATUS_OFFLINE && nodeCacheStatus != api.Status_STATUS_MAINTENANCE && - nodeCacheStatus != api.Status_STATUS_DECOMMISSION { + nodeCacheStatus != api.Status_STATUS_DECOMMISSION && + !forceRemove { msg := fmt.Sprintf(decommissionErrMsg, nodes[i].Id) logrus.Errorf(msg+", node status: %s", nodeCacheStatus) diff --git a/cluster/manager/manager_test.go b/cluster/manager/manager_test.go index 14f898512..67b77a525 100644 --- a/cluster/manager/manager_test.go +++ b/cluster/manager/manager_test.go @@ -16,11 +16,16 @@ limitations under the License. package manager import ( + "container/list" + "errors" "fmt" "testing" "time" + "github.com/golang/mock/gomock" + "github.com/libopenstorage/openstorage/api" "github.com/libopenstorage/openstorage/cluster" + "github.com/libopenstorage/openstorage/cluster/mock" "github.com/libopenstorage/openstorage/config" "github.com/libopenstorage/openstorage/pkg/auth" "github.com/libopenstorage/openstorage/pkg/auth/systemtoken" @@ -114,3 +119,39 @@ func TestUpdateSchedulerNodeName(t *testing.T) { cleanup() } + +func TestRemoveOnlineNode(t *testing.T) { + const testNodeID = "test id" + mockErr := errors.New("mock err") + ctrl := gomock.NewController(t) + mockListener := mock.NewMockClusterListener(ctrl) + nodeToRemove := api.Node{ + Id: testNodeID, + Status: api.Status_STATUS_OK, + } + clusterListener := list.New() + clusterListener.PushBack(mockListener) + testManager := ClusterManager{ + nodeCache: map[string]api.Node{ + testNodeID: nodeToRemove, + }, + listeners: clusterListener, + } + + kv, err := kvdb.New(mem.Name, "test", []string{}, nil, kvdb.LogFatalErrorCB) + assert.NoError(t, err) + err = kvdb.SetInstance(kv) + assert.NoError(t, err) + + // when force flag is false, node status check should take precedence + err = testManager.Remove([]api.Node{nodeToRemove}, false) + assert.Error(t, err) + assert.EqualError(t, err, fmt.Sprintf(decommissionErrMsg, testNodeID)) + + // when force flag is true, we shouldn't abort due to node status + mockListener.EXPECT().String().Return(testNodeID) + mockListener.EXPECT().MarkNodeDown(gomock.Any()).Return(mockErr) + + err = testManager.Remove([]api.Node{nodeToRemove}, true) + assert.EqualError(t, err, mockErr.Error()) +} diff --git a/cluster/mock/cluster_listener.mock.go b/cluster/mock/cluster_listener.mock.go new file mode 100644 index 000000000..61b16be33 --- /dev/null +++ b/cluster/mock/cluster_listener.mock.go @@ -0,0 +1,443 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: github.com/libopenstorage/openstorage/cluster (interfaces: ClusterListener) + +// Package mock is a generated GoMock package. +package mock + +import ( + gomock "github.com/golang/mock/gomock" + api "github.com/libopenstorage/openstorage/api" + cluster "github.com/libopenstorage/openstorage/cluster" + reflect "reflect" + time "time" +) + +// MockClusterListener is a mock of ClusterListener interface +type MockClusterListener struct { + ctrl *gomock.Controller + recorder *MockClusterListenerMockRecorder +} + +// MockClusterListenerMockRecorder is the mock recorder for MockClusterListener +type MockClusterListenerMockRecorder struct { + mock *MockClusterListener +} + +// NewMockClusterListener creates a new mock instance +func NewMockClusterListener(ctrl *gomock.Controller) *MockClusterListener { + mock := &MockClusterListener{ctrl: ctrl} + mock.recorder = &MockClusterListenerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use +func (m *MockClusterListener) EXPECT() *MockClusterListenerMockRecorder { + return m.recorder +} + +// Add mocks base method +func (m *MockClusterListener) Add(arg0 *api.Node) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Add", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// Add indicates an expected call of Add +func (mr *MockClusterListenerMockRecorder) Add(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Add", reflect.TypeOf((*MockClusterListener)(nil).Add), arg0) +} + +// CanNodeJoin mocks base method +func (m *MockClusterListener) CanNodeJoin(arg0 *api.Node, arg1 *cluster.ClusterInfo, arg2 bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CanNodeJoin", arg0, arg1, arg2) + ret0, _ := ret[0].(error) + return ret0 +} + +// CanNodeJoin indicates an expected call of CanNodeJoin +func (mr *MockClusterListenerMockRecorder) CanNodeJoin(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CanNodeJoin", reflect.TypeOf((*MockClusterListener)(nil).CanNodeJoin), arg0, arg1, arg2) +} + +// CanNodeRemove mocks base method +func (m *MockClusterListener) CanNodeRemove(arg0 *api.Node) (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CanNodeRemove", arg0) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CanNodeRemove indicates an expected call of CanNodeRemove +func (mr *MockClusterListenerMockRecorder) CanNodeRemove(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CanNodeRemove", reflect.TypeOf((*MockClusterListener)(nil).CanNodeRemove), arg0) +} + +// CleanupInit mocks base method +func (m *MockClusterListener) CleanupInit(arg0 *api.Node, arg1 *cluster.ClusterInfo) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CleanupInit", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// CleanupInit indicates an expected call of CleanupInit +func (mr *MockClusterListenerMockRecorder) CleanupInit(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CleanupInit", reflect.TypeOf((*MockClusterListener)(nil).CleanupInit), arg0, arg1) +} + +// ClusterInit mocks base method +func (m *MockClusterListener) ClusterInit(arg0 *api.Node) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ClusterInit", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// ClusterInit indicates an expected call of ClusterInit +func (mr *MockClusterListenerMockRecorder) ClusterInit(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClusterInit", reflect.TypeOf((*MockClusterListener)(nil).ClusterInit), arg0) +} + +// CreatePair mocks base method +func (m *MockClusterListener) CreatePair(arg0 *api.ClusterPairCreateRequest, arg1 *api.ClusterPairProcessResponse) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreatePair", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreatePair indicates an expected call of CreatePair +func (mr *MockClusterListenerMockRecorder) CreatePair(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePair", reflect.TypeOf((*MockClusterListener)(nil).CreatePair), arg0, arg1) +} + +// Enumerate mocks base method +func (m *MockClusterListener) Enumerate(arg0 *api.Cluster) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Enumerate", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// Enumerate indicates an expected call of Enumerate +func (mr *MockClusterListenerMockRecorder) Enumerate(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Enumerate", reflect.TypeOf((*MockClusterListener)(nil).Enumerate), arg0) +} + +// EnumerateAlerts mocks base method +func (m *MockClusterListener) EnumerateAlerts(arg0, arg1 time.Time, arg2 api.ResourceType) (*api.Alerts, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EnumerateAlerts", arg0, arg1, arg2) + ret0, _ := ret[0].(*api.Alerts) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// EnumerateAlerts indicates an expected call of EnumerateAlerts +func (mr *MockClusterListenerMockRecorder) EnumerateAlerts(arg0, arg1, arg2 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnumerateAlerts", reflect.TypeOf((*MockClusterListener)(nil).EnumerateAlerts), arg0, arg1, arg2) +} + +// EraseAlert mocks base method +func (m *MockClusterListener) EraseAlert(arg0 api.ResourceType, arg1 int64) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EraseAlert", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// EraseAlert indicates an expected call of EraseAlert +func (mr *MockClusterListenerMockRecorder) EraseAlert(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EraseAlert", reflect.TypeOf((*MockClusterListener)(nil).EraseAlert), arg0, arg1) +} + +// GetPairMode mocks base method +func (m *MockClusterListener) GetPairMode() api.ClusterPairMode_Mode { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetPairMode") + ret0, _ := ret[0].(api.ClusterPairMode_Mode) + return ret0 +} + +// GetPairMode indicates an expected call of GetPairMode +func (mr *MockClusterListenerMockRecorder) GetPairMode() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPairMode", reflect.TypeOf((*MockClusterListener)(nil).GetPairMode)) +} + +// Halt mocks base method +func (m *MockClusterListener) Halt(arg0 *api.Node, arg1 *cluster.ClusterInfo) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Halt", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// Halt indicates an expected call of Halt +func (mr *MockClusterListenerMockRecorder) Halt(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Halt", reflect.TypeOf((*MockClusterListener)(nil).Halt), arg0, arg1) +} + +// Init mocks base method +func (m *MockClusterListener) Init(arg0 *api.Node, arg1 *cluster.ClusterInfo) (cluster.FinalizeInitCb, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Init", arg0, arg1) + ret0, _ := ret[0].(cluster.FinalizeInitCb) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Init indicates an expected call of Init +func (mr *MockClusterListenerMockRecorder) Init(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Init", reflect.TypeOf((*MockClusterListener)(nil).Init), arg0, arg1) +} + +// Join mocks base method +func (m *MockClusterListener) Join(arg0 *api.Node, arg1 *cluster.ClusterInitState) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Join", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// Join indicates an expected call of Join +func (mr *MockClusterListenerMockRecorder) Join(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Join", reflect.TypeOf((*MockClusterListener)(nil).Join), arg0, arg1) +} + +// JoinComplete mocks base method +func (m *MockClusterListener) JoinComplete(arg0 *api.Node) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "JoinComplete", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// JoinComplete indicates an expected call of JoinComplete +func (mr *MockClusterListenerMockRecorder) JoinComplete(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "JoinComplete", reflect.TypeOf((*MockClusterListener)(nil).JoinComplete), arg0) +} + +// Leave mocks base method +func (m *MockClusterListener) Leave(arg0 *api.Node) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Leave", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// Leave indicates an expected call of Leave +func (mr *MockClusterListenerMockRecorder) Leave(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Leave", reflect.TypeOf((*MockClusterListener)(nil).Leave), arg0) +} + +// ListenerData mocks base method +func (m *MockClusterListener) ListenerData() map[string]interface{} { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListenerData") + ret0, _ := ret[0].(map[string]interface{}) + return ret0 +} + +// ListenerData indicates an expected call of ListenerData +func (mr *MockClusterListenerMockRecorder) ListenerData() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListenerData", reflect.TypeOf((*MockClusterListener)(nil).ListenerData)) +} + +// ListenerPeerStatus mocks base method +func (m *MockClusterListener) ListenerPeerStatus() map[string]api.Status { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListenerPeerStatus") + ret0, _ := ret[0].(map[string]api.Status) + return ret0 +} + +// ListenerPeerStatus indicates an expected call of ListenerPeerStatus +func (mr *MockClusterListenerMockRecorder) ListenerPeerStatus() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListenerPeerStatus", reflect.TypeOf((*MockClusterListener)(nil).ListenerPeerStatus)) +} + +// ListenerStatus mocks base method +func (m *MockClusterListener) ListenerStatus() api.Status { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListenerStatus") + ret0, _ := ret[0].(api.Status) + return ret0 +} + +// ListenerStatus indicates an expected call of ListenerStatus +func (mr *MockClusterListenerMockRecorder) ListenerStatus() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListenerStatus", reflect.TypeOf((*MockClusterListener)(nil).ListenerStatus)) +} + +// MarkNodeDown mocks base method +func (m *MockClusterListener) MarkNodeDown(arg0 *api.Node) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MarkNodeDown", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// MarkNodeDown indicates an expected call of MarkNodeDown +func (mr *MockClusterListenerMockRecorder) MarkNodeDown(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkNodeDown", reflect.TypeOf((*MockClusterListener)(nil).MarkNodeDown), arg0) +} + +// MarkNodeForRemoval mocks base method +func (m *MockClusterListener) MarkNodeForRemoval(arg0 *api.Node) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "MarkNodeForRemoval", arg0) +} + +// MarkNodeForRemoval indicates an expected call of MarkNodeForRemoval +func (mr *MockClusterListenerMockRecorder) MarkNodeForRemoval(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkNodeForRemoval", reflect.TypeOf((*MockClusterListener)(nil).MarkNodeForRemoval), arg0) +} + +// NodeInspect mocks base method +func (m *MockClusterListener) NodeInspect(arg0 *api.Node) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "NodeInspect", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// NodeInspect indicates an expected call of NodeInspect +func (mr *MockClusterListenerMockRecorder) NodeInspect(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeInspect", reflect.TypeOf((*MockClusterListener)(nil).NodeInspect), arg0) +} + +// PreJoin mocks base method +func (m *MockClusterListener) PreJoin(arg0 *api.Node) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "PreJoin", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// PreJoin indicates an expected call of PreJoin +func (mr *MockClusterListenerMockRecorder) PreJoin(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PreJoin", reflect.TypeOf((*MockClusterListener)(nil).PreJoin), arg0) +} + +// ProcessPairRequest mocks base method +func (m *MockClusterListener) ProcessPairRequest(arg0 *api.ClusterPairProcessRequest, arg1 *api.ClusterPairProcessResponse) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ProcessPairRequest", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// ProcessPairRequest indicates an expected call of ProcessPairRequest +func (mr *MockClusterListenerMockRecorder) ProcessPairRequest(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessPairRequest", reflect.TypeOf((*MockClusterListener)(nil).ProcessPairRequest), arg0, arg1) +} + +// QuorumMember mocks base method +func (m *MockClusterListener) QuorumMember(arg0 *api.Node) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "QuorumMember", arg0) + ret0, _ := ret[0].(bool) + return ret0 +} + +// QuorumMember indicates an expected call of QuorumMember +func (mr *MockClusterListenerMockRecorder) QuorumMember(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QuorumMember", reflect.TypeOf((*MockClusterListener)(nil).QuorumMember), arg0) +} + +// Remove mocks base method +func (m *MockClusterListener) Remove(arg0 *api.Node, arg1 bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Remove", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// Remove indicates an expected call of Remove +func (mr *MockClusterListenerMockRecorder) Remove(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Remove", reflect.TypeOf((*MockClusterListener)(nil).Remove), arg0, arg1) +} + +// String mocks base method +func (m *MockClusterListener) String() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "String") + ret0, _ := ret[0].(string) + return ret0 +} + +// String indicates an expected call of String +func (mr *MockClusterListenerMockRecorder) String() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "String", reflect.TypeOf((*MockClusterListener)(nil).String)) +} + +// Update mocks base method +func (m *MockClusterListener) Update(arg0 *api.Node) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Update", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// Update indicates an expected call of Update +func (mr *MockClusterListenerMockRecorder) Update(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockClusterListener)(nil).Update), arg0) +} + +// UpdateCluster mocks base method +func (m *MockClusterListener) UpdateCluster(arg0 *api.Node, arg1 *cluster.ClusterInfo) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateCluster", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// UpdateCluster indicates an expected call of UpdateCluster +func (mr *MockClusterListenerMockRecorder) UpdateCluster(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateCluster", reflect.TypeOf((*MockClusterListener)(nil).UpdateCluster), arg0, arg1) +} + +// ValidatePair mocks base method +func (m *MockClusterListener) ValidatePair(arg0 *api.ClusterPairInfo) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidatePair", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// ValidatePair indicates an expected call of ValidatePair +func (mr *MockClusterListenerMockRecorder) ValidatePair(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatePair", reflect.TypeOf((*MockClusterListener)(nil).ValidatePair), arg0) +}