Skip to content

Commit

Permalink
updated scaffolding project/api to keep it in sync with controller-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
droot committed Jul 16, 2018
1 parent d56edf8 commit 6df8e35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 10 additions & 3 deletions cmd/kubebuilder/initproject/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,21 @@ func (o *projectOptions) RunInit() {
log.Fatal(err)
}

// default controller manager image name
imgName := "controller:latest"

s = &scaffold.Scaffold{}
err = s.Execute(input.Options{ProjectPath: p.Path, BoilerplatePath: b.Path},
o.gopkg,
o.mgr,
&project.Makefile{},
&project.Makefile{Image: imgName},
o.dkr,
&manager.APIs{},
&manager.Controller{},
&manager.Config{},
&project.GitIgnore{})
&manager.Config{Image: imgName},
&project.GitIgnore{},
&project.Kustomize{},
&project.KustomizeImagePatch{})
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -119,6 +124,8 @@ Writes the following files:
- a PROJECT file with the domain and repo
- a Makefile to build the project
- a Gopkg.toml with project dependencies
- a Kustomization.yaml for customizating manifests
- a Patch file for customizing image for manager manifests
- a cmd/manager/main.go to run
project will prompt the user to run 'dep ensure' after writing the project files.
Expand Down
4 changes: 1 addition & 3 deletions cmd/kubebuilder/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ func (o *apiOptions) RunAddAPI() {
&resource.Doc{Resource: r},
&resource.Group{Resource: r},
&resource.AddToScheme{Resource: r},
&resource.CRD{Resource: r},
&resource.Role{Resource: r},
&resource.RoleBinding{Resource: r},
&resource.CRDSample{Resource: r},
)
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit 6df8e35

Please sign in to comment.