diff --git a/controllers/solrcloud_controller.go b/controllers/solrcloud_controller.go index b18dbd14..355d378a 100644 --- a/controllers/solrcloud_controller.go +++ b/controllers/solrcloud_controller.go @@ -680,7 +680,7 @@ func (r *SolrCloudReconciler) cleanupUnconfiguredServices(ctx context.Context, s return } for _, pod := range podList { - if pod.Annotations == nil && pod.Annotations[util.ServiceTypeAnnotation] != "" { + if pod.Annotations != nil && pod.Annotations[util.ServiceTypeAnnotation] != "" { if onlyServiceTypeInUse != pod.Annotations[util.ServiceTypeAnnotation] { // Only remove services if all pods are using the same, and configured, type of service. // Otherwise, we are in transition between service types and need to wait to delete anything. diff --git a/controllers/util/solr_scale_util.go b/controllers/util/solr_scale_util.go index 3f556af6..e10c6da4 100644 --- a/controllers/util/solr_scale_util.go +++ b/controllers/util/solr_scale_util.go @@ -35,7 +35,7 @@ import ( func BalanceReplicasForCluster(ctx context.Context, solrCloud *solr.SolrCloud, statefulSet *appsv1.StatefulSet, balanceReason string, balanceCmdUniqueId string, logger logr.Logger) (balanceComplete bool, requestInProgress bool, retryLaterDuration time.Duration, err error) { logger = logger.WithValues("balanceReason", balanceReason) // If the Cloud has 1 or zero pods, there is no reason to balance replicas. - if statefulSet.Spec.Replicas == nil || *statefulSet.Spec.Replicas < 1 { + if statefulSet.Spec.Replicas == nil || *statefulSet.Spec.Replicas <= 1 { balanceComplete = true } else { requestId := "balance-replicas-" + balanceCmdUniqueId