Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion controllers/solrcloud_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion controllers/util/solr_scale_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines 37 to 39
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
} else {
requestId := "balance-replicas-" + balanceCmdUniqueId
Expand Down
Loading