Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
return an error when the server list does not contain the address
This is to avoid the error: 2023-09-25 14:43:23 Allocating openstack:cirros-64... panic: runtime error: index out of range [0] with length 0 goroutine 30 [running]: github.com/snapcore/spread/spread.(*openstackProvider).waitServerCompleteSetup(0xc0000ae240, 0xc000100e60, 0xf0, 0x0, 0x0) /home/test/src/github.com/snapcore/spread/spread/openstack.go:379 +0x5bc github.com/snapcore/spread/spread.(*openstackProvider).createMachine(0xc0000ae240, 0x9183c0, 0xc000069240, 0xc0000a8b40, 0x0, 0xc0000e39d8, 0xc0000a90e0) /home/test/src/github.com/snapcore/spread/spread/openstack.go:511 +0xbbb github.com/snapcore/spread/spread.(*openstackProvider).Allocate(0xc0000ae240, 0x9183c0, 0xc000069240, 0xc0000a8b40, 0xc0000a9168, 0xc0000489c8, 0x41a4e3, 0x8) /home/test/src/github.com/snapcore/spread/spread/openstack.go:143 +0x6e github.com/snapcore/spread/spread.(*Runner).allocateServer(0xc0000ac900, 0xc00006f080, 0xc0000a8b40, 0x0) /home/test/src/github.com/snapcore/spread/spread/runner.go:887 +0x25a github.com/snapcore/spread/spread.(*Runner).client(0xc0000ac900, 0xc00006f080, 0xc0000a8b40, 0x0) /home/test/src/github.com/snapcore/spread/spread/runner.go:769 +0x767 github.com/snapcore/spread/spread.(*Runner).worker(0xc0000ac900, 0xc00006f080, 0xc0000a8b40, 0xc00014c248, 0x1, 0x1) /home/test/src/github.com/snapcore/spread/spread/runner.go:536 +0xa0 created by github.com/snapcore/spread/spread.(*Runner).loop /home/test/src/github.com/snapcore/spread/spread/runner.go:234 +0x702
- Loading branch information