Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update controller-gen and remove our code generation workarounds #4015

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
30 changes: 4 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ get-external-snapshotter:
clean: ## Clean resources
clean: clean-deprecated
rm -f bin/postgres-operator
rm -f config/rbac/role.yaml
rm -rf licenses/*/
[ ! -d testing/kuttl/e2e-generated ] || rm -r testing/kuttl/e2e-generated
[ ! -d testing/kuttl/e2e-generated-other ] || rm -r testing/kuttl/e2e-generated-other
Expand Down Expand Up @@ -279,27 +278,7 @@ generate-crd: tools/controller-gen
$(CONTROLLER) \
crd:crdVersions='v1' \
paths='./pkg/apis/...' \
output:dir='build/crd/postgresclusters/generated' # build/crd/{plural}/generated/{group}_{plural}.yaml
@
$(CONTROLLER) \
crd:crdVersions='v1' \
paths='./pkg/apis/...' \
output:dir='build/crd/pgupgrades/generated' # build/crd/{plural}/generated/{group}_{plural}.yaml
@
$(CONTROLLER) \
crd:crdVersions='v1' \
paths='./pkg/apis/...' \
output:dir='build/crd/pgadmins/generated' # build/crd/{plural}/generated/{group}_{plural}.yaml
@
$(CONTROLLER) \
crd:crdVersions='v1' \
paths='./pkg/apis/...' \
output:dir='build/crd/crunchybridgeclusters/generated' # build/crd/{plural}/generated/{group}_{plural}.yaml
@
kubectl kustomize ./build/crd/postgresclusters > ./config/crd/bases/postgres-operator.crunchydata.com_postgresclusters.yaml
kubectl kustomize ./build/crd/pgupgrades > ./config/crd/bases/postgres-operator.crunchydata.com_pgupgrades.yaml
kubectl kustomize ./build/crd/pgadmins > ./config/crd/bases/postgres-operator.crunchydata.com_pgadmins.yaml
kubectl kustomize ./build/crd/crunchybridgeclusters > ./config/crd/bases/postgres-operator.crunchydata.com_crunchybridgeclusters.yaml
output:dir='config/crd/bases' # {directory}/{group}_{plural}.yaml

.PHONY: generate-deepcopy
generate-deepcopy: ## Generate DeepCopy functions
Expand All @@ -312,10 +291,9 @@ generate-deepcopy: tools/controller-gen
generate-rbac: ## Generate RBAC
generate-rbac: tools/controller-gen
$(CONTROLLER) \
rbac:roleName='generated' \
rbac:roleName='postgres-operator' \
paths='./cmd/...' paths='./internal/...' \
output:dir='config/rbac' # ${directory}/role.yaml
./hack/generate-rbac.sh 'config/rbac'
output:dir='config/rbac' # {directory}/role.yaml

##@ Tools

Expand All @@ -330,7 +308,7 @@ endef
CONTROLLER ?= hack/tools/controller-gen
tools: tools/controller-gen
tools/controller-gen:
$(call go-get-tool,$(CONTROLLER),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0)
$(call go-get-tool,$(CONTROLLER),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.4)

ENVTEST ?= hack/tools/setup-envtest
tools: tools/setup-envtest
Expand Down
4 changes: 0 additions & 4 deletions build/crd/.gitignore

This file was deleted.

19 changes: 0 additions & 19 deletions build/crd/crunchybridgeclusters/kustomization.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions build/crd/pgadmins/kustomization.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions build/crd/pgadmins/todos.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions build/crd/pgupgrades/kustomization.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions build/crd/pgupgrades/todos.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions build/crd/postgresclusters/condition.yaml

This file was deleted.

36 changes: 0 additions & 36 deletions build/crd/postgresclusters/kustomization.yaml

This file was deleted.

89 changes: 0 additions & 89 deletions build/crd/postgresclusters/todos.yaml

This file was deleted.

76 changes: 0 additions & 76 deletions build/crd/postgresclusters/validation.yaml

This file was deleted.

Loading