Check HTTP Response status when trying to download minikube.iso

Check the response so that we don't actually download an error page or
something other than the ISO we're looking for.
pull/472/head
Matt Rickard 2016-08-10 20:13:58 -07:00
parent 24a20d643e
commit 39a6b586da
1 changed files with 2 additions and 0 deletions

View File

@ -308,6 +308,8 @@ func (m *MachineConfig) CacheMinikubeISOFromURL() error {
response, err := http.Get(m.MinikubeISO)
if err != nil {
return err
} else if response.StatusCode != http.StatusOK {
return fmt.Errorf("Received %d response from %s while trying to download minikube.iso", response.StatusCode, m.MinikubeISO)
} else {
out, err := os.Create(m.GetISOCacheFilepath())
if err != nil {