Skip to content

Commit fe4ae55

Browse files
committed
fix(recommendations): update callers missed by ServiceSavingsPlans->All rename
Rebase onto feat/multicloud-web-frontend brought in three files that still referenced the old common.ServiceSavingsPlans sentinel (renamed to ServiceSavingsPlansAll in the prior commit). Update the two production call sites and one test file so go vet and go build pass on the merged PR view.
1 parent caa7984 commit fe4ae55

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎providers/aws/recommendations/client.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ func (c *Client) GetAllRecommendations(ctx context.Context) ([]common.Recommenda
346346
return nil
347347
})
348348
g.Go(func() error {
349-
spRecs, spErr = c.GetRecommendationsForService(gctx, common.ServiceSavingsPlans)
349+
spRecs, spErr = c.GetRecommendationsForService(gctx, common.ServiceSavingsPlansAll)
350350
return nil
351351
})
352352

‎providers/azure/recommendations.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func (r *RecommendationsClientAdapter) GetRecommendations(ctx context.Context, p
134134
// The call returns an empty slice so the service appears in the fan-out
135135
// and will start returning data once the API stabilises without requiring
136136
// a scheduler change.
137-
if shouldIncludeService(params, common.ServiceSavingsPlans) {
137+
if shouldIncludeService(params, common.ServiceSavingsPlansAll) {
138138
goService(&spErr, func() {
139139
spClient := savingsplans.NewClient(r.cred, r.subscriptionID, "")
140140
spRecs, spErr = spClient.GetRecommendations(gctx, params)

‎providers/azure/recommendations_test.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ func TestRecommendationsClientAdapter_GetAllRecommendations(t *testing.T) {
218218
}
219219

220220
// TestGetRecommendations_SavingsPlansServiceIncluded pins that shouldIncludeService
221-
// allows ServiceSavingsPlans through both when params.Service is empty (all-services
222-
// sweep) and when explicitly set to ServiceSavingsPlans, and does not include it
221+
// allows ServiceSavingsPlansAll through both when params.Service is empty (all-services
222+
// sweep) and when explicitly set to ServiceSavingsPlansAll, and does not include it
223223
// when a different service is requested. This ensures the SP goroutine added to the
224224
// fan-out in GetRecommendations is exercised on every scheduler collection run.
225225
func TestGetRecommendations_SavingsPlansServiceIncluded(t *testing.T) {
@@ -235,7 +235,7 @@ func TestGetRecommendations_SavingsPlansServiceIncluded(t *testing.T) {
235235
},
236236
{
237237
name: "explicit savingsplans service is included",
238-
params: common.RecommendationParams{Service: common.ServiceSavingsPlans},
238+
params: common.RecommendationParams{Service: common.ServiceSavingsPlansAll},
239239
expected: true,
240240
},
241241
{
@@ -246,7 +246,7 @@ func TestGetRecommendations_SavingsPlansServiceIncluded(t *testing.T) {
246246
}
247247
for _, tt := range tests {
248248
t.Run(tt.name, func(t *testing.T) {
249-
got := shouldIncludeService(tt.params, common.ServiceSavingsPlans)
249+
got := shouldIncludeService(tt.params, common.ServiceSavingsPlansAll)
250250
assert.Equal(t, tt.expected, got)
251251
})
252252
}
@@ -431,7 +431,7 @@ func TestMergeServiceResults_OrderIsStable(t *testing.T) {
431431
dbRec := mkRec(common.ServiceRelationalDB, "database")
432432
cacheRec := mkRec(common.ServiceCache, "cache")
433433
cosmosRec := mkRec(common.ServiceNoSQL, "cosmosdb")
434-
spRec := mkRec(common.ServiceSavingsPlans, "savingsplans")
434+
spRec := mkRec(common.ServiceSavingsPlansAll, "savingsplans")
435435
advisorRec := mkRec(common.ServiceCompute, "advisor") // Advisor produces Compute recs
436436

437437
// Replicate the exact call order from GetRecommendations.

0 commit comments

Comments
 (0)