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

Commit 38af74d

Browse files
authored
Merge pull request #293 from nader-ziada/preserveUnknownFields
🐛set preserveUnknownFields to false to make updating to crd v1 easier
2 parents 5f230e3 + 91f096b commit 38af74d

File tree

5 files changed

+302
-5
lines changed

5 files changed

+302
-5
lines changed

Makefile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ARCH ?= amd64
4444
ALL_ARCH = amd64 arm arm64 ppc64le s390x
4545

4646
# Produce CRDs that work back to Kubernetes 1.11 (no version conversion)
47-
CRD_OPTIONS ?= "crd:trivialVersions=true"
47+
CRD_OPTIONS ?= "crd:trivialVersions=true, preserveUnknownFields=false"
4848

4949
TOOLS_DIR := hack/tools
5050
CONTROLLER_GEN_BIN := bin/controller-gen
@@ -116,11 +116,20 @@ 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/...
120122

121123
.PHONY: generate-manifests
122124
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)
125+
$(CONTROLLER_GEN) \
126+
$(CRD_OPTIONS) \
127+
rbac:roleName=manager-role \
128+
webhook \
129+
paths="./..." \
130+
output:crd:dir=$(CRD_ROOT) \
131+
output:webhook:dir=$(WEBHOOK_ROOT) \
132+
output:rbac:dir=$(RBAC_ROOT)
124133

125134
.PHONY: modules
126135
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)