Fix error message when not specify --cloud or --zones

This commit is contained in:
Justin Santa Barbara 2017-11-12 22:36:41 -05:00
parent 709f902c11
commit 1d402ec962
1 changed files with 5 additions and 1 deletions

View File

@ -442,7 +442,11 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
}
}
if cluster.Spec.CloudProvider == "" {
return fmt.Errorf("unable to infer CloudProvider from Zones (is there a typo in --zones?)")
if allZones.Len() == 0 {
return fmt.Errorf("must specify --zones or --cloud")
} else {
return fmt.Errorf("unable to infer CloudProvider from Zones (is there a typo in --zones?)")
}
}
}