mirror of https://github.com/kubernetes/kops.git
Fix error message when not specify --cloud or --zones
This commit is contained in:
parent
709f902c11
commit
1d402ec962
|
@ -442,9 +442,13 @@ func RunCreateCluster(f *util.Factory, out io.Writer, c *CreateClusterOptions) e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if cluster.Spec.CloudProvider == "" {
|
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?)")
|
return fmt.Errorf("unable to infer CloudProvider from Zones (is there a typo in --zones?)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
zoneToSubnetMap := make(map[string]*api.ClusterSubnetSpec)
|
zoneToSubnetMap := make(map[string]*api.ClusterSubnetSpec)
|
||||||
if len(c.Zones) == 0 {
|
if len(c.Zones) == 0 {
|
||||||
|
|
Loading…
Reference in New Issue