@@ -317,19 +317,14 @@ func (webhook *MachineDeployment) validate(oldMD, newMD *clusterv1.MachineDeploy
317
317
//
318
318
// We are supporting the following use cases:
319
319
// * A new MD is created and replicas should be managed by the autoscaler
320
- // - Either via the default annotation or via the min size and max size annotations the replicas field
321
- // is defaulted to a value which is within the (min size, max size) range so the autoscaler can take control.
320
+ // - If the min size and max size annotations are set, the replicas field is defaulted to the value of the min size
321
+ // annotation so the autoscaler can take control.
322
322
//
323
323
// * An existing MD which initially wasn't controlled by the autoscaler should be later controlled by the autoscaler
324
- // - To adopt an existing MD users can use the default, min size and max size annotations to enable the autoscaler
325
- // and to ensure the replicas field is within the (min size, max size) range. Without the annotations handing over
326
- // control to the autoscaler by unsetting the replicas field would lead to the field being set to 1. This is very
327
- // disruptive for existing Machines and if 1 is outside the (min size, max size) range the autoscaler won't take
328
- // control.
329
- //
330
- // Notes:
331
- // - While the min size and max size annotations of the autoscaler provide the best UX, other autoscalers can use the
332
- // DefaultReplicasAnnotation if they have similar use cases.
324
+ // - To adopt an existing MD users can use the min size and max size annotations to enable the autoscaler
325
+ // and to ensure the replicas field is within the (min size, max size) range. Without defaulting based on the annotations, handing over
326
+ // control to the autoscaler by unsetting the replicas field would lead to the field being set to 1. This could be
327
+ // very disruptive if the previous value of the replica field is greater than 1.
333
328
func calculateMachineDeploymentReplicas (ctx context.Context , oldMD * clusterv1.MachineDeployment , newMD * clusterv1.MachineDeployment , dryRun bool ) (int32 , error ) {
334
329
// If replicas is already set => Keep the current value.
335
330
if newMD .Spec .Replicas != nil {
0 commit comments