Skip to content

Commit 6df8e35

Browse files
committed
updated scaffolding project/api to keep it in sync with controller-tools
1 parent d56edf8 commit 6df8e35

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

cmd/kubebuilder/initproject/project.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,21 @@ func (o *projectOptions) RunInit() {
6363
log.Fatal(err)
6464
}
6565

66+
// default controller manager image name
67+
imgName := "controller:latest"
68+
6669
s = &scaffold.Scaffold{}
6770
err = s.Execute(input.Options{ProjectPath: p.Path, BoilerplatePath: b.Path},
6871
o.gopkg,
6972
o.mgr,
70-
&project.Makefile{},
73+
&project.Makefile{Image: imgName},
7174
o.dkr,
7275
&manager.APIs{},
7376
&manager.Controller{},
74-
&manager.Config{},
75-
&project.GitIgnore{})
77+
&manager.Config{Image: imgName},
78+
&project.GitIgnore{},
79+
&project.Kustomize{},
80+
&project.KustomizeImagePatch{})
7681
if err != nil {
7782
log.Fatal(err)
7883
}
@@ -119,6 +124,8 @@ Writes the following files:
119124
- a PROJECT file with the domain and repo
120125
- a Makefile to build the project
121126
- a Gopkg.toml with project dependencies
127+
- a Kustomization.yaml for customizating manifests
128+
- a Patch file for customizing image for manager manifests
122129
- a cmd/manager/main.go to run
123130
124131
project will prompt the user to run 'dep ensure' after writing the project files.

cmd/kubebuilder/v1/api.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ func (o *apiOptions) RunAddAPI() {
7272
&resource.Doc{Resource: r},
7373
&resource.Group{Resource: r},
7474
&resource.AddToScheme{Resource: r},
75-
&resource.CRD{Resource: r},
76-
&resource.Role{Resource: r},
77-
&resource.RoleBinding{Resource: r},
75+
&resource.CRDSample{Resource: r},
7876
)
7977
if err != nil {
8078
log.Fatal(err)

0 commit comments

Comments
 (0)