Copilot commented on code in PR #825:
URL: https://github.com/apache/solr-operator/pull/825#discussion_r3010583008
##########
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
Review Comment:
Consider adding a focused unit/integration test that covers the new <= 1
replicas early-exit path (e.g., Spec.Replicas=1 returns balanceComplete=true
and does not attempt any async request). This is a behavior change that could
regress silently since this util file currently has no direct test coverage.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]