From ba3bb6ef786d1f84cc118da0f11959a32c8f9263 Mon Sep 17 00:00:00 2001 From: Abhisek Dwivedi Date: Thu, 30 Nov 2023 21:35:27 +0530 Subject: [PATCH] Added/modified test-cases --- controllers/pod.go | 2 +- controllers/rack.go | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/controllers/pod.go b/controllers/pod.go index 188b7e8c1..3fb2f840e 100644 --- a/controllers/pod.go +++ b/controllers/pod.go @@ -650,7 +650,7 @@ func (r *SingleClusterReconciler) cleanupDanglingPodsRack(sts *appsv1.StatefulSe // getIgnorablePods returns pods: // 1. From racksToDelete that are currently not running and can be ignored in stability checks. -// 2. User given pods in ignorePodList that are currently not running and can be ignored from stability checks. +// 2. Failed/pending pods identified using maxIgnorablePods field and can be ignored from stability checks. func (r *SingleClusterReconciler) getIgnorablePods(racksToDelete []asdbv1.Rack, configureRacks []RackState) ( sets.Set[string], error, ) { diff --git a/controllers/rack.go b/controllers/rack.go index 451d1dbea..e03029ec0 100644 --- a/controllers/rack.go +++ b/controllers/rack.go @@ -419,12 +419,11 @@ func (r *SingleClusterReconciler) upgradeOrRollingRestartRack(found *appsv1.Stat } } - podList, err := r.getOrderedRackPodList(rackState.Rack.ID) - if err != nil { - return found, reconcileError(fmt.Errorf("failed to list pods: %v", err)) - } - if r.aeroCluster.Spec.RackConfig.MaxIgnorablePods != nil { + podList, err := r.getOrderedRackPodList(rackState.Rack.ID) + if err != nil { + return found, reconcileError(fmt.Errorf("failed to list pods: %v", err)) + } // Filter ignoredPods to update their dirtyVolumes in the status. // IgnoredPods are skipped from upgrade/rolling restart, and as a result in case of device removal, dirtyVolumes // are not updated in their pod status. This makes devices un-reusable as they cannot be cleaned up during init phase.