Replace scale down forbidden window

Replacement is scale down stabilization window. HPA will scale down only
    to max of recommendations it made during that window. More details in

    https://docs.google.com/document/d/1IdG3sqgCEaRV3urPLA29IDudCufD89RYCohfBPNeWIM
This commit is contained in:
Krzysztof Jastrzebski
2018-08-31 09:32:01 +02:00
parent 2548fb08cd
commit 958cba1c82
12 changed files with 200 additions and 92 deletions

View File

@@ -488,7 +488,7 @@ func (tc *legacyTestCase) runTest(t *testing.T) {
replicaCalc := NewReplicaCalculator(metricsClient, testClient.Core(), defaultTestingTolerance, defaultTestingCpuInitializationPeriod, defaultTestingDelayOfInitialReadinessStatus)
informerFactory := informers.NewSharedInformerFactory(testClient, controller.NoResyncPeriodFunc())
defaultDownscaleForbiddenWindow := 5 * time.Minute
defaultDownscaleStabilisationWindow := 5 * time.Minute
hpaController := NewHorizontalController(
eventClient.Core(),
@@ -498,7 +498,7 @@ func (tc *legacyTestCase) runTest(t *testing.T) {
replicaCalc,
informerFactory.Autoscaling().V1().HorizontalPodAutoscalers(),
controller.NoResyncPeriodFunc(),
defaultDownscaleForbiddenWindow,
defaultDownscaleStabilisationWindow,
)
hpaController.hpaListerSynced = alwaysReady