Skip to content

Commit da8f7fc

Browse files
committed
address comments
Signed-off-by: Britania Rodriguez Reyes <[email protected]>
1 parent eaf9aa5 commit da8f7fc

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

pkg/propertychecker/azure/checker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (s *PropertyChecker) CheckIfMeetSKUCapacityRequirement(
8080
}
8181

8282
// Request VM size recommendations to validate SKU availability and capacity.
83-
// The capacity is checked by ensuring the current allocatable capacity is greater than or equals to the requested capacity.
83+
// The capacity is checked by ensuring the current allocatable capacity is greater than or equal to the requested capacity.
8484
klog.V(2).Infof("Checking SKU %s with capacity %d in cluster %s", sku, capacity, cluster.Name)
8585
request := &computev1.GenerateAttributeBasedRecommendationsRequest{
8686
SubscriptionId: subID,

pkg/propertychecker/azure/checker_test.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,6 @@ func TestValidateCapacity(t *testing.T) {
8585
wantError: true,
8686
errorSubstring: "exceeds maximum allowed value",
8787
},
88-
{
89-
name: "capacity at minimum limit with GreaterThanOrEqualTo operator",
90-
value: "1",
91-
operator: placementv1beta1.PropertySelectorGreaterThanOrEqualTo,
92-
wantValue: 1,
93-
},
9488
{
9589
name: "capacity equal to max limit with supported operator",
9690
value: "200",
@@ -107,9 +101,9 @@ func TestValidateCapacity(t *testing.T) {
107101
},
108102
{
109103
name: "capacity at minimum limit (Gt)",
110-
value: "1",
104+
value: "0",
111105
operator: placementv1beta1.PropertySelectorGreaterThan,
112-
wantValue: 2,
106+
wantValue: 1,
113107
wantError: false,
114108
},
115109
{
@@ -179,7 +173,7 @@ func TestExtractCapacityRequirements(t *testing.T) {
179173
errorSubstring: "exceeds maximum allowed value of 200",
180174
},
181175
{
182-
name: "invalid Azure SKU capacity property below min limit",
176+
name: "invalid Azure SKU capacity property below min limit (Ge)",
183177
req: placementv1beta1.PropertySelectorRequirement{
184178
Name: fmt.Sprintf(azure.CapacityPerSKUPropertyTmpl, "Standard_B2ms"),
185179
Operator: placementv1beta1.PropertySelectorGreaterThanOrEqualTo,
@@ -422,7 +416,7 @@ func TestCheckIfMeetSKUCapacityRequirement(t *testing.T) {
422416
name: "too low value in requirement",
423417
cluster: cluster,
424418
sku: validSKU,
425-
targetCapacity: 1,
419+
targetCapacity: 0,
426420
req: placementv1beta1.PropertySelectorRequirement{
427421
Name: fmt.Sprintf(azure.CapacityPerSKUPropertyTmpl, validSKU),
428422
Operator: placementv1beta1.PropertySelectorGreaterThanOrEqualTo,

pkg/scheduler/framework/plugins/clusteraffinity/types_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,13 +1350,13 @@ func TestClusterRequirementMatches_WithPropertyChecker(t *testing.T) {
13501350
Name: validPropertyName,
13511351
Operator: placementv1beta1.PropertySelectorGreaterThan,
13521352
Values: []string{
1353-
"1",
1353+
"0",
13541354
},
13551355
},
13561356
},
13571357
cluster: cluster,
13581358
sku: "Standard_D2s_v3",
1359-
targetCapacity: 2,
1359+
targetCapacity: 1,
13601360
want: true,
13611361
},
13621362
{

0 commit comments

Comments
 (0)