Skip to content

Commit c91bfa9

Browse files
committed
(feat) add makefile and set generation to enabled by default
1 parent 473f3ca commit c91bfa9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/plugins/golang/v4/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (p *createAPISubcommand) BindFlags(fs *pflag.FlagSet) {
104104
"if set, generate the resource without prompting the user")
105105
p.resourceFlag = fs.Lookup("resource")
106106
fs.BoolVar(&p.options.Namespaced, "namespaced", true, "resource is namespaced")
107-
fs.BoolVar(&p.options.GenerateApplyConfiguration, "generate-apply-configuration", false, "if set, generate applyconfiguration code for the resource")
107+
fs.BoolVar(&p.options.GenerateApplyConfiguration, "generate-apply-configuration", true, "if set, generate applyconfiguration code for the resource")
108108

109109
fs.BoolVar(&p.options.DoController, "controller", true,
110110
"if set, generate the controller without prompting the user")

pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
123123
.PHONY: generate
124124
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
125125
{{ if .BoilerplatePath -}}
126-
"$(CONTROLLER_GEN)" object:headerFile={{printf "%q" .BoilerplatePath}} paths="./..."
126+
"$(CONTROLLER_GEN)" applyconfiguration:headerFile="hack/boilerplate.go.txt" object:headerFile={{printf "%q" .BoilerplatePath}} paths="./..."
127127
{{- else -}}
128-
"$(CONTROLLER_GEN)" object paths="./..."
128+
"$(CONTROLLER_GEN)" applyconfiguration object paths="./..."
129129
{{- end }}
130130
131131
.PHONY: fmt

0 commit comments

Comments
 (0)