Skip to content

Commit ea8def1

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/propertychecker/azure/checker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func validateCapacity(value string, operator placementv1beta1.PropertySelectorOp
155155

156156
// Adjust capacity based on operator semantics for VMSizeRecommender API.
157157
// If operator is GreaterThanOrEqualTo, decrement capacity by 1 as the API checks for strictly greater than.
158-
if operator == placementv1beta1.PropertySelectorGreaterThanOrEqualTo && capacity >= minVMInstanceCapacity {
158+
if operator == placementv1beta1.PropertySelectorGreaterThanOrEqualTo && capacity > minVMInstanceCapacity {
159159
capacity -= 1
160160
}
161161

@@ -167,7 +167,7 @@ func validateCapacity(value string, operator placementv1beta1.PropertySelectorOp
167167
// Ensure capacity meets minimum requirements (minVMInstanceCapacity) after operator adjustment.
168168
// The VMSizeRecommender API requires capacity > 0.
169169
if capacity < minVMInstanceCapacity {
170-
return 0, fmt.Errorf("capacity value cannot be below minimum %d after adjustment", minVMInstanceCapacity)
170+
capacity = minVMInstanceCapacity
171171
}
172172

173173
return capacity, nil

0 commit comments

Comments
 (0)