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

🐛set preserveUnknownFields to false to make updating to crd v1 easier #293

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ARCH ?= amd64
ALL_ARCH = amd64 arm arm64 ppc64le s390x

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

TOOLS_DIR := hack/tools
CONTROLLER_GEN_BIN := bin/controller-gen
Expand Down Expand Up @@ -116,11 +116,20 @@ generate: $(CONTROLLER_GEN) ## Generate code

.PHONY: generate-deepcopy
generate-deepcopy: $(CONTROLLER_GEN) ## Generate deepcopy files
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate/boilerplate.generatego.txt paths=./api/...
$(CONTROLLER_GEN) \
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt \
paths=./api/...

.PHONY: generate-manifests
generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc
$(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)
$(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)

.PHONY: modules
modules: ## Runs go mod to ensure modules are up to date.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: kubeadmconfigs.bootstrap.cluster.x-k8s.io
spec:
Expand All @@ -14,6 +16,7 @@ spec:
listKind: KubeadmConfigList
plural: kubeadmconfigs
singular: kubeadmconfig
preserveUnknownFields: false
scope: Namespaced
subresources:
status: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: kubeadmconfigtemplates.bootstrap.cluster.x-k8s.io
spec:
Expand All @@ -14,6 +16,7 @@ spec:
listKind: KubeadmConfigTemplateList
plural: kubeadmconfigtemplates
singular: kubeadmconfigtemplate
preserveUnknownFields: false
scope: Namespaced
validation:
openAPIV3Schema:
Expand Down
2 changes: 1 addition & 1 deletion hack/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ go 1.12
require (
github.com/golangci/golangci-lint v1.18.0
sigs.k8s.io/cluster-api/hack/tools v0.0.0-20190926205936-6fc621a1c6af
sigs.k8s.io/controller-tools v0.2.1
sigs.k8s.io/controller-tools v0.2.5
)
Loading