Skip to content

Commit

Permalink
Generate V1 CRDs
Browse files Browse the repository at this point in the history
Update tools to newer versions.

Note that despite preserveUnknownFields, this is not included in the
generated CRDs due to [1]. Importing our local kustomize hack to
include it here does not seem worthwhile since it is mostly an upgrade
issue.

[1] - kubernetes-sigs/controller-tools#476
  • Loading branch information
bryanv committed Jan 29, 2021
1 parent 739fd43 commit 1f1399b
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 56 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export PATH := $(abspath $(BIN_DIR)):$(abspath $(TOOLS_BIN_DIR)):$(PATH)

# Tooling binaries
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen
CLIENT_GEN := $(TOOLS_BIN_DIR)/client-gen
CLIENT_GEN := $(TOOLS_BIN_DIR)/client-gen
INFORMER_GEN := $(TOOLS_BIN_DIR)/informer-gen
LISTER_GEN := $(TOOLS_BIN_DIR)/lister-gen
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
Expand Down Expand Up @@ -80,7 +80,10 @@ generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
$(CONTROLLER_GEN) \
paths=./api/... \
crd:trivialVersions=true \
output:crd:dir=$(CRD_ROOT)
crd:crdVersions=v1 \
crd:preserveUnknownFields=false \
output:crd:dir=$(CRD_ROOT) \
output:none

.PHONY: generate-client
generate-client: tools ## Generate api client
Expand Down
4 changes: 2 additions & 2 deletions hack/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/vmware-tanzu/vm-operator-api/hack/tools
go 1.13

require (
k8s.io/code-generator v0.17.4
sigs.k8s.io/controller-tools v0.2.8
k8s.io/code-generator v0.18.2
sigs.k8s.io/controller-tools v0.4.1
)
Loading

0 comments on commit 1f1399b

Please sign in to comment.