Merge pull request #3841 from justinsb/must_specify_zones_or_cloud

Automatic merge from submit-queue.

Fix error message when not specify --cloud or --zones
This commit is contained in:
Kubernetes Submit Queue 2017-11-13 17:25:18 -08:00 committed by GitHub
commit 0da56ded74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -442,9 +442,13 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
}
}
if cluster.Spec.CloudProvider == "" {
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?)")
}
}
}
zoneToSubnetMap := make(map[string]*api.ClusterSubnetSpec)
if len(c.Zones) == 0 {