Merge pull request #3987 from justinsb/default_subnets_on_create_ig

Automatic merge from submit-queue.

Use default subnet when creating IG
This commit is contained in:
Kubernetes Submit Queue 2017-12-15 09:23:14 -08:00 committed by GitHub
commit fb7c42cb4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -150,19 +150,15 @@ func RunCreateInstanceGroup(f *util.Factory, cmd *cobra.Command, args []string,
} }
ig.Spec.Role = role ig.Spec.Role = role
if len(options.Subnets) == 0 {
return fmt.Errorf("cannot create instance group without subnets; specify --subnet flag(s)")
}
ig.Spec.Subnets = options.Subnets ig.Spec.Subnets = options.Subnets
ig, err = cloudup.PopulateInstanceGroupSpec(cluster, ig, channel) ig, err = cloudup.PopulateInstanceGroupSpec(cluster, ig, channel)
ig.AddInstanceGroupNodeLabel()
if err != nil { if err != nil {
return err return err
} }
ig.AddInstanceGroupNodeLabel()
if options.DryRun { if options.DryRun {
if options.Output == "" { if options.Output == "" {