Skip to content

Commit

Permalink
Merge pull request #354 from fraenkel/api_version
Browse files Browse the repository at this point in the history
Validate create api flags
  • Loading branch information
k8s-ci-robot committed Aug 15, 2018
2 parents 27a4c65 + aacef4a commit 6ece4e7
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 6ece4e7

Please sign in to comment.