Skip to content

Commit 7529833

Browse files
committed
fix(lint): remove unused error return from applySaturationDecisions
applySaturationDecisions logs and handles all errors inline, never returning a non-nil error. Remove the error return and simplify the caller in optimize(). Fixes the unparam lint failure. Signed-off-by: Jiazhou Gao <gjz140103@gmail.com>
1 parent ce268e5 commit 7529833

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

internal/engines/saturation/engine.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,7 @@ func (e *Engine) optimize(ctx context.Context) (retErr error) {
315315
} else {
316316
logger.Info("No scaling decisions to apply, updating VA status with metrics")
317317
}
318-
if err := e.applySaturationDecisions(ctx, allDecisions, vaMap, currentAllocations); err != nil {
319-
logger.Error(err, "Failed to apply saturation decisions")
320-
return err
321-
}
318+
e.applySaturationDecisions(ctx, allDecisions, vaMap, currentAllocations)
322319

323320
logger.Info("Optimization completed successfully",
324321
"mode", "saturation-only",
@@ -889,7 +886,7 @@ func (e *Engine) applySaturationDecisions(
889886
decisions []interfaces.VariantDecision,
890887
vaMap map[string]*llmdVariantAutoscalingV1alpha1.VariantAutoscaling,
891888
currentAllocations map[string]*interfaces.Allocation,
892-
) error {
889+
) {
893890
logger := ctrl.LoggerFrom(ctx)
894891
// Create a map of decisions for O(1) lookup
895892
// Use namespace/variantName as key to match vaMap and avoid collisions
@@ -1119,8 +1116,6 @@ func (e *Engine) applySaturationDecisions(
11191116
"reason", reason)
11201117
}
11211118
}
1122-
1123-
return nil
11241119
}
11251120

11261121
// emitSafetyNetMetrics emits fallback metrics when saturation analysis fails.

0 commit comments

Comments
 (0)