diff --git a/internal/dinosaur/pkg/routes/route_loader.go b/internal/dinosaur/pkg/routes/route_loader.go index 54c6671ab..54f32c628 100644 --- a/internal/dinosaur/pkg/routes/route_loader.go +++ b/internal/dinosaur/pkg/routes/route_loader.go @@ -269,12 +269,6 @@ func (s *options) buildAPIBaseRouter(mainRouter *mux.Router, basePath string, op Methods(http.MethodPost) } - if features.ClusterMigration.Enabled() { - adminCentralsRouter.HandleFunc("/{id}/assign-cluster", adminCentralHandler.AssignCluster). - Name(logger.NewLogEvent("admin-central-assign-cluster", "[admin] change central cluster assignment").ToString()). - Methods(http.MethodPost) - } - adminCentralsRouter.HandleFunc("/{id}/traits", adminCentralHandler.ListTraits). Name(logger.NewLogEvent("admin-list-traits", "[admin] list central traits").ToString()). Methods(http.MethodGet) diff --git a/internal/dinosaur/pkg/services/cluster_placement_strategy.go b/internal/dinosaur/pkg/services/cluster_placement_strategy.go index 53e0ff279..895514484 100644 --- a/internal/dinosaur/pkg/services/cluster_placement_strategy.go +++ b/internal/dinosaur/pkg/services/cluster_placement_strategy.go @@ -13,8 +13,6 @@ import ( type ClusterPlacementStrategy interface { // FindCluster finds and returns a Cluster depends on the specific impl. FindCluster(central *dbapi.CentralRequest) (*api.Cluster, error) - // AllMatchingClustersForCentral returns all cluster that fit the criteria to run a central - AllMatchingClustersForCentral(central *dbapi.CentralRequest) ([]*api.Cluster, error) } // NewClusterPlacementStrategy return a concrete strategy impl. depends on the diff --git a/internal/dinosaur/pkg/services/cluster_placement_strategy_moq.go b/internal/dinosaur/pkg/services/cluster_placement_strategy_moq.go index 5a9c15567..ef22e1c90 100644 --- a/internal/dinosaur/pkg/services/cluster_placement_strategy_moq.go +++ b/internal/dinosaur/pkg/services/cluster_placement_strategy_moq.go @@ -19,9 +19,6 @@ var _ ClusterPlacementStrategy = &ClusterPlacementStrategyMock{} // // // make and configure a mocked ClusterPlacementStrategy // mockedClusterPlacementStrategy := &ClusterPlacementStrategyMock{ -// AllMatchingClustersForCentralFunc: func(central *dbapi.CentralRequest) ([]*api.Cluster, error) { -// panic("mock out the AllMatchingClustersForCentral method") -// }, // FindClusterFunc: func(central *dbapi.CentralRequest) (*api.Cluster, error) { // panic("mock out the FindCluster method") // }, @@ -32,59 +29,18 @@ var _ ClusterPlacementStrategy = &ClusterPlacementStrategyMock{} // // } type ClusterPlacementStrategyMock struct { - // AllMatchingClustersForCentralFunc mocks the AllMatchingClustersForCentral method. - AllMatchingClustersForCentralFunc func(central *dbapi.CentralRequest) ([]*api.Cluster, error) - // FindClusterFunc mocks the FindCluster method. FindClusterFunc func(central *dbapi.CentralRequest) (*api.Cluster, error) // calls tracks calls to the methods. calls struct { - // AllMatchingClustersForCentral holds details about calls to the AllMatchingClustersForCentral method. - AllMatchingClustersForCentral []struct { - // Central is the central argument value. - Central *dbapi.CentralRequest - } // FindCluster holds details about calls to the FindCluster method. FindCluster []struct { // Central is the central argument value. Central *dbapi.CentralRequest } } - lockAllMatchingClustersForCentral sync.RWMutex - lockFindCluster sync.RWMutex -} - -// AllMatchingClustersForCentral calls AllMatchingClustersForCentralFunc. -func (mock *ClusterPlacementStrategyMock) AllMatchingClustersForCentral(central *dbapi.CentralRequest) ([]*api.Cluster, error) { - if mock.AllMatchingClustersForCentralFunc == nil { - panic("ClusterPlacementStrategyMock.AllMatchingClustersForCentralFunc: method is nil but ClusterPlacementStrategy.AllMatchingClustersForCentral was just called") - } - callInfo := struct { - Central *dbapi.CentralRequest - }{ - Central: central, - } - mock.lockAllMatchingClustersForCentral.Lock() - mock.calls.AllMatchingClustersForCentral = append(mock.calls.AllMatchingClustersForCentral, callInfo) - mock.lockAllMatchingClustersForCentral.Unlock() - return mock.AllMatchingClustersForCentralFunc(central) -} - -// AllMatchingClustersForCentralCalls gets all the calls that were made to AllMatchingClustersForCentral. -// Check the length with: -// -// len(mockedClusterPlacementStrategy.AllMatchingClustersForCentralCalls()) -func (mock *ClusterPlacementStrategyMock) AllMatchingClustersForCentralCalls() []struct { - Central *dbapi.CentralRequest -} { - var calls []struct { - Central *dbapi.CentralRequest - } - mock.lockAllMatchingClustersForCentral.RLock() - calls = mock.calls.AllMatchingClustersForCentral - mock.lockAllMatchingClustersForCentral.RUnlock() - return calls + lockFindCluster sync.RWMutex } // FindCluster calls FindClusterFunc.