diff --git a/cluster-autoscaler/core/scaledown/actuation/actuator_test.go b/cluster-autoscaler/core/scaledown/actuation/actuator_test.go index ab4b200866aa..b48a3eb9ed12 100644 --- a/cluster-autoscaler/core/scaledown/actuation/actuator_test.go +++ b/cluster-autoscaler/core/scaledown/actuation/actuator_test.go @@ -1189,7 +1189,7 @@ func TestStartDeletion(t *testing.T) { } scaleStateNotifier := nodegroupchange.NewNodeGroupChangeObserversList() - scaleStateNotifier.Register(csr) + scaleStateNotifier.RegisterForNotifications(csr) // Create Actuator, run StartDeletion, and verify the error. ndt := deletiontracker.NewNodeDeletionTracker(0) @@ -1429,7 +1429,7 @@ func TestStartDeletionInBatchBasic(t *testing.T) { } csr := clusterstate.NewClusterStateRegistry(provider, clusterstate.ClusterStateRegistryConfig{}, ctx.LogRecorder, NewBackoff(), nodegroupconfig.NewDefaultNodeGroupConfigProcessor(config.NodeGroupAutoscalingOptions{MaxNodeProvisionTime: 15 * time.Minute})) scaleStateNotifier := nodegroupchange.NewNodeGroupChangeObserversList() - scaleStateNotifier.Register(csr) + scaleStateNotifier.RegisterForNotifications(csr) ndt := deletiontracker.NewNodeDeletionTracker(0) ndb := NewNodeDeletionBatcher(&ctx, scaleStateNotifier, ndt, deleteInterval) evictor := Evictor{EvictionRetryTime: 0, DsEvictionRetryTime: 0, DsEvictionEmptyNodeTimeout: 0, PodEvictionHeadroom: DefaultPodEvictionHeadroom} diff --git a/cluster-autoscaler/core/scaledown/actuation/delete_in_batch_test.go b/cluster-autoscaler/core/scaledown/actuation/delete_in_batch_test.go index 714024538d21..486c482c3157 100644 --- a/cluster-autoscaler/core/scaledown/actuation/delete_in_batch_test.go +++ b/cluster-autoscaler/core/scaledown/actuation/delete_in_batch_test.go @@ -170,7 +170,7 @@ func TestRemove(t *testing.T) { } scaleStateNotifier := nodegroupchange.NewNodeGroupChangeObserversList() - scaleStateNotifier.Register(clusterStateRegistry) + scaleStateNotifier.RegisterForNotifications(clusterStateRegistry) ng := "ng" provider.AddNodeGroup(ng, 1, 10, test.numNodes) diff --git a/cluster-autoscaler/core/scaleup/orchestrator/orchestrator_test.go b/cluster-autoscaler/core/scaleup/orchestrator/orchestrator_test.go index 886c4e8dd01b..9f11e2acded3 100644 --- a/cluster-autoscaler/core/scaleup/orchestrator/orchestrator_test.go +++ b/cluster-autoscaler/core/scaleup/orchestrator/orchestrator_test.go @@ -973,7 +973,7 @@ func runSimpleScaleUpTest(t *testing.T, config *ScaleUpTestConfig) *ScaleUpTestR clusterState := clusterstate.NewClusterStateRegistry(provider, clusterstate.ClusterStateRegistryConfig{}, context.LogRecorder, NewBackoff(), nodegroupconfig.NewDefaultNodeGroupConfigProcessor(options.NodeGroupDefaults)) clusterState.UpdateNodes(nodes, nodeInfos, time.Now()) processors := NewTestProcessors(&context) - processors.ScaleStateNotifier.Register(clusterState) + processors.ScaleStateNotifier.RegisterForNotifications(clusterState) orchestrator := New() orchestrator.Initialize(&context, processors, clusterState, taints.TaintConfig{}) expander := NewMockRepotingStrategy(t, config.ExpansionOptionToChoose) diff --git a/cluster-autoscaler/core/static_autoscaler_test.go b/cluster-autoscaler/core/static_autoscaler_test.go index acbda730297b..af7b48fb54df 100644 --- a/cluster-autoscaler/core/static_autoscaler_test.go +++ b/cluster-autoscaler/core/static_autoscaler_test.go @@ -421,14 +421,14 @@ func TestStaticAutoscalerRunOnceWithScaleDownDelayPerNG(t *testing.T) { } processors := NewTestProcessors(&context) sddProcessor := scaledowncandidates.NewScaleDownCandidatesDelayProcessor() - processors.ScaleStateNotifier.Register(sddProcessor) + processors.ScaleStateNotifier.RegisterForNotifications(sddProcessor) scaleDownCandidatesComparers := []scaledowncandidates.CandidatesComparer{} processors.ScaleDownNodeProcessor = scaledowncandidates.NewCombinedScaleDownCandidatesProcessor([]nodes.ScaleDownNodeProcessor{ scaledowncandidates.NewScaleDownCandidatesSortingProcessor(scaleDownCandidatesComparers), sddProcessor, }) clusterState := clusterstate.NewClusterStateRegistry(provider, clusterStateConfig, context.LogRecorder, NewBackoff(), nodegroupconfig.NewDefaultNodeGroupConfigProcessor(options.NodeGroupDefaults)) - processors.ScaleStateNotifier.Register(clusterState) + processors.ScaleStateNotifier.RegisterForNotifications(clusterState) sdPlanner, sdActuator := newScaleDownPlannerAndActuator(t, &context, processors, clusterState) suOrchestrator := orchestrator.New()