@@ -239,9 +239,10 @@ func (c *ControlPlaneContract) IsUpgrading(obj *unstructured.Unstructured) (bool
239
239
// A control plane is considered scaling if:
240
240
// - status.replicas is not yet set.
241
241
// - spec.replicas != status.replicas.
242
- // - spec.replicas != status.updatedReplicas .
242
+ // - spec.replicas != status.upToDateReplicas .
243
243
// - spec.replicas != status.readyReplicas.
244
244
// - status.unavailableReplicas > 0.
245
+ // NOTE: this function is used only in E2E tests.
245
246
func (c * ControlPlaneContract ) IsScaling (obj * unstructured.Unstructured , contractVersion string ) (bool , error ) {
246
247
desiredReplicas , err := c .Replicas ().Get (obj )
247
248
if err != nil {
@@ -259,7 +260,7 @@ func (c *ControlPlaneContract) IsScaling(obj *unstructured.Unstructured, contrac
259
260
return false , errors .Wrapf (err , "failed to get control plane %s" , c .StatusReplicas ().Path ().String ())
260
261
}
261
262
262
- upToDatedReplicas , err := c .UpToDateReplicas (contractVersion ).Get (obj )
263
+ upToDateReplicas , err := c .UpToDateReplicas (contractVersion ).Get (obj )
263
264
if err != nil {
264
265
if errors .Is (err , ErrFieldNotFound ) {
265
266
// If updatedReplicas is not set on the control plane
@@ -302,7 +303,7 @@ func (c *ControlPlaneContract) IsScaling(obj *unstructured.Unstructured, contrac
302
303
availableReplicas , err = c .AvailableReplicas ().Get (obj )
303
304
if err != nil {
304
305
if errors .Is (err , ErrFieldNotFound ) {
305
- // If readyReplicas is not set on the control plane
306
+ // If availableReplicas is not set on the control plane
306
307
// we should consider the control plane to be scaling so that
307
308
// we block any operation that expect the control plane to be stable.
308
309
return true , nil
@@ -315,7 +316,7 @@ func (c *ControlPlaneContract) IsScaling(obj *unstructured.Unstructured, contrac
315
316
// * .spec.replicas, .status.replicas, .status.upToDateReplicas,
316
317
// .status.readyReplicas, .status.availableReplicas are not equal.
317
318
if * statusReplicas != * desiredReplicas ||
318
- * upToDatedReplicas != * desiredReplicas ||
319
+ * upToDateReplicas != * desiredReplicas ||
319
320
* readyReplicas != * desiredReplicas ||
320
321
* availableReplicas != * desiredReplicas {
321
322
return true , nil
0 commit comments