This repository was archived by the owner on Jul 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -664,7 +664,10 @@ func (d *Driver) innerCreate() error {
664664
665665 spotInstanceRequest , err := d .getClient ().RequestSpotInstances (& req )
666666 if err != nil {
667- return fmt .Errorf ("Error request spot instance: %s" , err )
667+ return fmt .Errorf ("Error request spot instance: %v" , err )
668+ }
669+ if spotInstanceRequest == nil || len ((* spotInstanceRequest ).SpotInstanceRequests ) < 1 {
670+ return fmt .Errorf ("Error requesting spot instance: %v" , errors .New ("Unexpected AWS API response" ))
668671 }
669672 d .spotInstanceRequestId = * spotInstanceRequest .SpotInstanceRequests [0 ].SpotInstanceRequestId
670673
@@ -740,7 +743,10 @@ func (d *Driver) innerCreate() error {
740743 })
741744
742745 if err != nil {
743- return fmt .Errorf ("Error launching instance: %s" , err )
746+ return fmt .Errorf ("Error launching instance: %v" , err )
747+ }
748+ if inst == nil || len (inst .Instances ) < 1 {
749+ return fmt .Errorf ("Error launching instance: %v" , errors .New ("Unexpected AWS API response" ))
744750 }
745751 instance = inst .Instances [0 ]
746752 }
You can’t perform that action at this time.
0 commit comments