diff --git a/cluster-autoscaler/main.go b/cluster-autoscaler/main.go index 121837596b60..cab701af0af7 100644 --- a/cluster-autoscaler/main.go +++ b/cluster-autoscaler/main.go @@ -37,6 +37,7 @@ import ( "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/besteffortatomic" "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/checkcapacity" "k8s.io/autoscaler/cluster-autoscaler/provisioningrequest/provreqclient" + "k8s.io/autoscaler/cluster-autoscaler/simulator/clustersnapshot" "k8s.io/autoscaler/cluster-autoscaler/simulator/clustersnapshot/predicate" "k8s.io/autoscaler/cluster-autoscaler/simulator/clustersnapshot/store" "k8s.io/autoscaler/cluster-autoscaler/simulator/framework" @@ -503,10 +504,16 @@ func buildAutoscaler(context ctx.Context, debuggingSnapshotter debuggingsnapshot deleteOptions := options.NewNodeDeleteOptions(autoscalingOptions) drainabilityRules := rules.Default(deleteOptions) + var snapshotStore clustersnapshot.ClusterSnapshotStore = store.NewDeltaSnapshotStore() + if autoscalingOptions.DynamicResourceAllocationEnabled { + // TODO(DRA): Remove this once DeltaSnapshotStore is integrated with DRA. + snapshotStore = store.NewBasicSnapshotStore() + } + opts := core.AutoscalerOptions{ AutoscalingOptions: autoscalingOptions, FrameworkHandle: fwHandle, - ClusterSnapshot: predicate.NewPredicateSnapshot(store.NewDeltaSnapshotStore(), fwHandle, autoscalingOptions.DynamicResourceAllocationEnabled), + ClusterSnapshot: predicate.NewPredicateSnapshot(snapshotStore, fwHandle, autoscalingOptions.DynamicResourceAllocationEnabled), KubeClient: kubeClient, InformerFactory: informerFactory, DebuggingSnapshotter: debuggingSnapshotter,