Skip to content

Commit

Permalink
Validate create api flags
Browse files Browse the repository at this point in the history
Fixes #321
  • Loading branch information
fraenkel committed Aug 15, 2018
1 parent 581c0cb commit aacef4a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/kubebuilder/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,22 @@ func (o *apiOptions) RunAddAPI() {
fmt.Println("Create Resource under pkg/apis [y/n]?")
o.doResource = util.Yesno(reader)
}

if !o.controllerFlag.Changed {
fmt.Println("Create Controller under pkg/controller [y/n]?")
o.doController = util.Yesno(reader)
}

if o.r.Group == "" {
log.Fatalf("Must specify --group")
}
if o.r.Version == "" {
log.Fatalf("Must specify --version")
}
if o.r.Kind == "" {
log.Fatalf("Must specify --kind")
}

fmt.Println("Writing scaffold for you to edit...")

r := o.r
Expand Down

0 comments on commit aacef4a

Please sign in to comment.