Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 1d33229

Browse files
Cecile Robert-Michonjackfrancis
authored andcommitted
Scale windows VM bug: catch error for len(vms) < 1 (#2059)
* add win config to tests * catch 0 vms error * Revert "add win config to tests" This reverts commit 3ffca42. * rm comment
1 parent 5e39da1 commit 1d33229

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmd/scale.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ func (sc *scaleCmd) run(cmd *cobra.Command, args []string) error {
188188
vms, err := sc.client.ListVirtualMachines(sc.resourceGroupName)
189189
if err != nil {
190190
log.Fatalln("failed to get vms in the resource group. Error: %s", err.Error())
191+
} else if len(*vms.Value) < 1 {
192+
log.Fatalln("The provided resource group does not contain any vms.")
191193
}
192194
for _, vm := range *vms.Value {
193195

0 commit comments

Comments
 (0)