Skip to content

Commit de86ddc

Browse files
committed
chore(codegen): use controller-gen for deepcopy
Use controller-gen instead of k8s.io/code-generator to generate deepcopy. Note: Deepcopy generation should be left to the operator-framework/api repo at once we start strictly importing API type defs from there.
1 parent 26aa314 commit de86ddc

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,11 @@ manifests: vendor
160160

161161
$(YQ_INTERNAL) w --inplace deploy/chart/crds/0000_50_olm_03-clusterserviceversion.crd.yaml spec.validation.openAPIV3Schema.properties.spec.properties.install.properties.spec.properties.deployments.items.properties.spec.properties.template.properties.metadata.x-kubernetes-preserve-unknown-fields true
162162

163-
# Generate clients, listers, and informers
163+
# Generate deepcopy, conversion, clients, listers, and informers
164164
codegen:
165+
# Deepcopy
166+
$(CONTROLLER_GEN) object:headerFile=./boilerplate.go.txt paths=./pkg/api/apis/operators/...i
167+
# Conversion, clients, listers, and informers
165168
$(CODEGEN)
166169

167170
# Generate mock types.

scripts/update_codegen.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ MODULE="github.com/operator-framework/operator-lifecycle-manager"
3131
# --output-base because this script should also be able to run inside the vendor dir of
3232
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
3333
# instead of the $GOPATH directly. For normal projects this can be dropped.
34-
bash "${CODEGEN_PKG}/generate-internal-groups.sh" "deepcopy,conversion,informer,lister" \
34+
bash "${CODEGEN_PKG}/generate-internal-groups.sh" "conversion,informer,lister" \
3535
"${MODULE}/pkg/api/client" \
3636
"${MODULE}/pkg/api/apis" \
3737
"${MODULE}/pkg/api/apis" \
@@ -57,4 +57,5 @@ bash "${CODEGEN_PKG}/generate-internal-groups.sh" all \
5757
--go-header-file "${SCRIPT_ROOT}/boilerplate.go.txt"
5858

5959
# copy the generated resources
60-
cp -R "${OUTPUT_BASE}/${MODULE}/." "${SCRIPT_ROOT}"
60+
cp -R "${OUTPUT_BASE}/${MODULE}/." "${SCRIPT_ROOT}"
61+

0 commit comments

Comments
 (0)