mirror of
https://github.com/hanzoai/tasks.git
synced 2026-10-04 02:04:03 +00:00
## What changed? Reject `RemoveRemoteCluster` (both the Operator and Admin gRPC paths) when any global namespace still lists the target cluster in its replication cluster set. ## Why? Removing a cluster that is still referenced by a global namespace leaves that namespace pointing at a cluster the registry no longer knows about, which breaks replication and namespace lookups until manually repaired. ## How did you test it? - [x] built - [x] run locally and tested manually - [ ] covered by existing tests - [x] added new unit test(s) - [ ] added new functional test(s)
253 lines
9.1 KiB
Go
253 lines
9.1 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: registry.go
|
|
//
|
|
// Generated by this command:
|
|
//
|
|
// mockgen -package namespace -source registry.go -destination registry_mock.go
|
|
//
|
|
|
|
// Package namespace is a generated GoMock package.
|
|
package namespace
|
|
|
|
import (
|
|
reflect "reflect"
|
|
|
|
pingable "go.temporal.io/server/common/pingable"
|
|
gomock "go.uber.org/mock/gomock"
|
|
)
|
|
|
|
// MockRegistry is a mock of Registry interface.
|
|
type MockRegistry struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockRegistryMockRecorder
|
|
isgomock struct{}
|
|
}
|
|
|
|
// MockRegistryMockRecorder is the mock recorder for MockRegistry.
|
|
type MockRegistryMockRecorder struct {
|
|
mock *MockRegistry
|
|
}
|
|
|
|
// NewMockRegistry creates a new mock instance.
|
|
func NewMockRegistry(ctrl *gomock.Controller) *MockRegistry {
|
|
mock := &MockRegistry{ctrl: ctrl}
|
|
mock.recorder = &MockRegistryMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockRegistry) EXPECT() *MockRegistryMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// GetAllNamespaces mocks base method.
|
|
func (m *MockRegistry) GetAllNamespaces() []*Namespace {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetAllNamespaces")
|
|
ret0, _ := ret[0].([]*Namespace)
|
|
return ret0
|
|
}
|
|
|
|
// GetAllNamespaces indicates an expected call of GetAllNamespaces.
|
|
func (mr *MockRegistryMockRecorder) GetAllNamespaces() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllNamespaces", reflect.TypeOf((*MockRegistry)(nil).GetAllNamespaces))
|
|
}
|
|
|
|
// GetCustomSearchAttributesMapper mocks base method.
|
|
func (m *MockRegistry) GetCustomSearchAttributesMapper(name Name) (CustomSearchAttributesMapper, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetCustomSearchAttributesMapper", name)
|
|
ret0, _ := ret[0].(CustomSearchAttributesMapper)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// GetCustomSearchAttributesMapper indicates an expected call of GetCustomSearchAttributesMapper.
|
|
func (mr *MockRegistryMockRecorder) GetCustomSearchAttributesMapper(name any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCustomSearchAttributesMapper", reflect.TypeOf((*MockRegistry)(nil).GetCustomSearchAttributesMapper), name)
|
|
}
|
|
|
|
// GetNamespace mocks base method.
|
|
func (m *MockRegistry) GetNamespace(name Name) (*Namespace, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetNamespace", name)
|
|
ret0, _ := ret[0].(*Namespace)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// GetNamespace indicates an expected call of GetNamespace.
|
|
func (mr *MockRegistryMockRecorder) GetNamespace(name any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNamespace", reflect.TypeOf((*MockRegistry)(nil).GetNamespace), name)
|
|
}
|
|
|
|
// GetNamespaceByID mocks base method.
|
|
func (m *MockRegistry) GetNamespaceByID(id ID) (*Namespace, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetNamespaceByID", id)
|
|
ret0, _ := ret[0].(*Namespace)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// GetNamespaceByID indicates an expected call of GetNamespaceByID.
|
|
func (mr *MockRegistryMockRecorder) GetNamespaceByID(id any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNamespaceByID", reflect.TypeOf((*MockRegistry)(nil).GetNamespaceByID), id)
|
|
}
|
|
|
|
// GetNamespaceByIDWithOptions mocks base method.
|
|
func (m *MockRegistry) GetNamespaceByIDWithOptions(id ID, opts GetNamespaceOptions) (*Namespace, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetNamespaceByIDWithOptions", id, opts)
|
|
ret0, _ := ret[0].(*Namespace)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// GetNamespaceByIDWithOptions indicates an expected call of GetNamespaceByIDWithOptions.
|
|
func (mr *MockRegistryMockRecorder) GetNamespaceByIDWithOptions(id, opts any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNamespaceByIDWithOptions", reflect.TypeOf((*MockRegistry)(nil).GetNamespaceByIDWithOptions), id, opts)
|
|
}
|
|
|
|
// GetNamespaceID mocks base method.
|
|
func (m *MockRegistry) GetNamespaceID(name Name) (ID, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetNamespaceID", name)
|
|
ret0, _ := ret[0].(ID)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// GetNamespaceID indicates an expected call of GetNamespaceID.
|
|
func (mr *MockRegistryMockRecorder) GetNamespaceID(name any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNamespaceID", reflect.TypeOf((*MockRegistry)(nil).GetNamespaceID), name)
|
|
}
|
|
|
|
// GetNamespaceName mocks base method.
|
|
func (m *MockRegistry) GetNamespaceName(id ID) (Name, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetNamespaceName", id)
|
|
ret0, _ := ret[0].(Name)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// GetNamespaceName indicates an expected call of GetNamespaceName.
|
|
func (mr *MockRegistryMockRecorder) GetNamespaceName(id any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNamespaceName", reflect.TypeOf((*MockRegistry)(nil).GetNamespaceName), id)
|
|
}
|
|
|
|
// GetNamespaceWithOptions mocks base method.
|
|
func (m *MockRegistry) GetNamespaceWithOptions(name Name, opts GetNamespaceOptions) (*Namespace, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetNamespaceWithOptions", name, opts)
|
|
ret0, _ := ret[0].(*Namespace)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// GetNamespaceWithOptions indicates an expected call of GetNamespaceWithOptions.
|
|
func (mr *MockRegistryMockRecorder) GetNamespaceWithOptions(name, opts any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNamespaceWithOptions", reflect.TypeOf((*MockRegistry)(nil).GetNamespaceWithOptions), name, opts)
|
|
}
|
|
|
|
// GetPingChecks mocks base method.
|
|
func (m *MockRegistry) GetPingChecks() []pingable.Check {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetPingChecks")
|
|
ret0, _ := ret[0].([]pingable.Check)
|
|
return ret0
|
|
}
|
|
|
|
// GetPingChecks indicates an expected call of GetPingChecks.
|
|
func (mr *MockRegistryMockRecorder) GetPingChecks() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPingChecks", reflect.TypeOf((*MockRegistry)(nil).GetPingChecks))
|
|
}
|
|
|
|
// GetRegistrySize mocks base method.
|
|
func (m *MockRegistry) GetRegistrySize() (int64, int64) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetRegistrySize")
|
|
ret0, _ := ret[0].(int64)
|
|
ret1, _ := ret[1].(int64)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// GetRegistrySize indicates an expected call of GetRegistrySize.
|
|
func (mr *MockRegistryMockRecorder) GetRegistrySize() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRegistrySize", reflect.TypeOf((*MockRegistry)(nil).GetRegistrySize))
|
|
}
|
|
|
|
// RefreshNamespaceById mocks base method.
|
|
func (m *MockRegistry) RefreshNamespaceById(namespaceId ID) (*Namespace, error) {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "RefreshNamespaceById", namespaceId)
|
|
ret0, _ := ret[0].(*Namespace)
|
|
ret1, _ := ret[1].(error)
|
|
return ret0, ret1
|
|
}
|
|
|
|
// RefreshNamespaceById indicates an expected call of RefreshNamespaceById.
|
|
func (mr *MockRegistryMockRecorder) RefreshNamespaceById(namespaceId any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RefreshNamespaceById", reflect.TypeOf((*MockRegistry)(nil).RefreshNamespaceById), namespaceId)
|
|
}
|
|
|
|
// RegisterStateChangeCallback mocks base method.
|
|
func (m *MockRegistry) RegisterStateChangeCallback(key any, cb StateChangeCallbackFn) {
|
|
m.ctrl.T.Helper()
|
|
m.ctrl.Call(m, "RegisterStateChangeCallback", key, cb)
|
|
}
|
|
|
|
// RegisterStateChangeCallback indicates an expected call of RegisterStateChangeCallback.
|
|
func (mr *MockRegistryMockRecorder) RegisterStateChangeCallback(key, cb any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterStateChangeCallback", reflect.TypeOf((*MockRegistry)(nil).RegisterStateChangeCallback), key, cb)
|
|
}
|
|
|
|
// Start mocks base method.
|
|
func (m *MockRegistry) Start() {
|
|
m.ctrl.T.Helper()
|
|
m.ctrl.Call(m, "Start")
|
|
}
|
|
|
|
// Start indicates an expected call of Start.
|
|
func (mr *MockRegistryMockRecorder) Start() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Start", reflect.TypeOf((*MockRegistry)(nil).Start))
|
|
}
|
|
|
|
// Stop mocks base method.
|
|
func (m *MockRegistry) Stop() {
|
|
m.ctrl.T.Helper()
|
|
m.ctrl.Call(m, "Stop")
|
|
}
|
|
|
|
// Stop indicates an expected call of Stop.
|
|
func (mr *MockRegistryMockRecorder) Stop() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Stop", reflect.TypeOf((*MockRegistry)(nil).Stop))
|
|
}
|
|
|
|
// UnregisterStateChangeCallback mocks base method.
|
|
func (m *MockRegistry) UnregisterStateChangeCallback(key any) {
|
|
m.ctrl.T.Helper()
|
|
m.ctrl.Call(m, "UnregisterStateChangeCallback", key)
|
|
}
|
|
|
|
// UnregisterStateChangeCallback indicates an expected call of UnregisterStateChangeCallback.
|
|
func (mr *MockRegistryMockRecorder) UnregisterStateChangeCallback(key any) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnregisterStateChangeCallback", reflect.TypeOf((*MockRegistry)(nil).UnregisterStateChangeCallback), key)
|
|
}
|