Skip to content

Commit

Permalink
Make VmSize validation logic clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
Tof1973 committed Jan 31, 2025
1 parent a94fa96 commit 434650e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions pkg/api/validate/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,12 @@ func VMSizeIsValid(vmSize api.VMSize, requiredD2sV3Workers, isMaster bool) bool
return supportedAsMaster
}

if requiredD2sV3Workers && vmSize != api.VMSizeStandardD2sV3 {
return false
if requiredD2sV3Workers {
return vmSize == api.VMSizeStandardD2sV3
}

_, supportedAsWorker := SupportedVMSizesByRole(VMRoleWorker)[vmSize]
if supportedAsWorker || (requiredD2sV3Workers && vmSize == api.VMSizeStandardD2sV3) {
return true
}

return false
return supportedAsWorker
}

func VMSizeFromName(vmSize api.VMSize) (api.VMSizeStruct, bool) {
Expand Down

0 comments on commit 434650e

Please sign in to comment.