Skip to content

Commit 120c9de

Browse files
committed
update: code review and go fmt
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
1 parent a8ebf33 commit 120c9de

6 files changed

Lines changed: 10 additions & 14 deletions

File tree

internal/config/loader_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import (
77
"time"
88

99
flag "github.com/spf13/pflag"
10-
11-
1210
)
1311

1412
// writeTestConfigFile writes a YAML config file to a temp directory and returns its path.

internal/config/saturation_scaling.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ type AnalyzerScoreConfig struct {
6767
Name string `yaml:"name"`
6868
Enabled *bool `yaml:"enabled,omitempty"` // default true
6969
Score float64 `yaml:"score,omitempty"` // default 1.0
70-
ScaleUpThreshold *float64 `yaml:"scaleUpThreshold,omitempty"` // overrides global
70+
ScaleUpThreshold *float64 `yaml:"scaleUpThreshold,omitempty"` // overrides global
7171
ScaleDownBoundary *float64 `yaml:"scaleDownBoundary,omitempty"` // overrides global
7272
}
7373

internal/controller/configmap_bootstrap.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ func (r *ConfigMapReconciler) BootstrapInitialConfigMaps(ctx context.Context) er
6464
continue // Skip excluded namespaces. Only for all-namespaces mode.
6565
}
6666
}
67-
6867
}
6968
if ns.Labels != nil {
7069
if value, ok := ns.Labels[constants.NamespaceConfigEnabledLabelKey]; ok {

internal/engines/pipeline/enforcer.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,3 @@ func updateDecisionAction(d *interfaces.VariantDecision, optimizerName string) {
185185
}
186186
d.Reason = fmt.Sprintf("V2 %s (optimizer: %s, enforced)", d.Action, optimizerName)
187187
}
188-

internal/engines/pipeline/greedy_score_optimizer_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -967,10 +967,10 @@ var _ = Describe("GreedyByScoreOptimizer", func() {
967967
ModelID: "model-1",
968968
Namespace: "default",
969969
Result: &interfaces.AnalyzerResult{
970-
ModelID: "model-1",
971-
Namespace: "default",
972-
AnalyzedAt: time.Now(),
973-
SpareCapacity: 50000,
970+
ModelID: "model-1",
971+
Namespace: "default",
972+
AnalyzedAt: time.Now(),
973+
SpareCapacity: 50000,
974974
VariantCapacities: []interfaces.VariantCapacity{
975975
{VariantName: "expensive", AcceleratorName: "A100", Cost: 15.0, ReplicaCount: 3, PerReplicaCapacity: 20000},
976976
{VariantName: "cheap", AcceleratorName: "A100", Cost: 5.0, ReplicaCount: 3, PerReplicaCapacity: 10000},
@@ -998,10 +998,10 @@ var _ = Describe("GreedyByScoreOptimizer", func() {
998998
ModelID: "model-1",
999999
Namespace: "default",
10001000
Result: &interfaces.AnalyzerResult{
1001-
ModelID: "model-1",
1002-
Namespace: "default",
1003-
AnalyzedAt: time.Now(),
1004-
SpareCapacity: 80000, // enough to remove all
1001+
ModelID: "model-1",
1002+
Namespace: "default",
1003+
AnalyzedAt: time.Now(),
1004+
SpareCapacity: 80000, // enough to remove all
10051005
VariantCapacities: []interfaces.VariantCapacity{
10061006
{VariantName: "keep-alive", AcceleratorName: "A100", Cost: 15.0, ReplicaCount: 2, PerReplicaCapacity: 20000},
10071007
{VariantName: "expendable", AcceleratorName: "A100", Cost: 5.0, ReplicaCount: 3, PerReplicaCapacity: 10000},

internal/engines/saturation/engine_v2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (e *Engine) runAnalyzersAndScore(
114114
switch aw.Name {
115115
case "saturation":
116116
totalWeighted += baseResult.RequiredCapacity * aw.Score
117-
// future: case "throughput", "slo"
117+
// future: case "throughput", "slo"
118118
}
119119
}
120120

0 commit comments

Comments
 (0)