Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit db45f21

Browse files
committed
set preserveUnknownFields to false to make updating to crd v1 easier
- also update controller tools to v0.2.5
1 parent f65dbc7 commit db45f21

File tree

5 files changed

+304
-4
lines changed

5 files changed

+304
-4
lines changed

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,23 @@ generate: $(CONTROLLER_GEN) ## Generate code
116116

117117
.PHONY: generate-deepcopy
118118
generate-deepcopy: $(CONTROLLER_GEN) ## Generate deepcopy files
119-
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate/boilerplate.generatego.txt paths=./api/...
119+
$(CONTROLLER_GEN) \
120+
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt \
121+
paths=./api/... \
122+
crd:preserveUnknownFields=false \
123+
output:crd:dir=./config/crd/bases
120124

121125
.PHONY: generate-manifests
122126
generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc
123-
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:dir=$(CRD_ROOT) output:webhook:dir=$(WEBHOOK_ROOT) output:rbac:dir=$(RBAC_ROOT)
127+
$(CONTROLLER_GEN) \
128+
$(CRD_OPTIONS) \
129+
rbac:roleName=manager-role \
130+
webhook \
131+
paths="./..." \
132+
crd:preserveUnknownFields=false \
133+
output:crd:dir=$(CRD_ROOT) \
134+
output:webhook:dir=$(WEBHOOK_ROOT) \
135+
output:rbac:dir=$(RBAC_ROOT)
124136

125137
.PHONY: modules
126138
modules: ## Runs go mod to ensure modules are up to date.

config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
apiVersion: apiextensions.k8s.io/v1beta1
44
kind: CustomResourceDefinition
55
metadata:
6+
annotations:
7+
controller-gen.kubebuilder.io/version: v0.2.5
68
creationTimestamp: null
79
name: kubeadmconfigs.bootstrap.cluster.x-k8s.io
810
spec:
@@ -14,6 +16,7 @@ spec:
1416
listKind: KubeadmConfigList
1517
plural: kubeadmconfigs
1618
singular: kubeadmconfig
19+
preserveUnknownFields: false
1720
scope: Namespaced
1821
subresources:
1922
status: {}

config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
apiVersion: apiextensions.k8s.io/v1beta1
44
kind: CustomResourceDefinition
55
metadata:
6+
annotations:
7+
controller-gen.kubebuilder.io/version: v0.2.5
68
creationTimestamp: null
79
name: kubeadmconfigtemplates.bootstrap.cluster.x-k8s.io
810
spec:
@@ -14,6 +16,7 @@ spec:
1416
listKind: KubeadmConfigTemplateList
1517
plural: kubeadmconfigtemplates
1618
singular: kubeadmconfigtemplate
19+
preserveUnknownFields: false
1720
scope: Namespaced
1821
validation:
1922
openAPIV3Schema:

hack/tools/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ go 1.12
55
require (
66
github.com/golangci/golangci-lint v1.18.0
77
sigs.k8s.io/cluster-api/hack/tools v0.0.0-20190926205936-6fc621a1c6af
8-
sigs.k8s.io/controller-tools v0.2.1
8+
sigs.k8s.io/controller-tools v0.2.5
99
)

0 commit comments

Comments
 (0)