Skip to content

🌱 manifest generation: ensure we always fully regenerate files #1748

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

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
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,12 @@ tidy: #HELP Update dependencies.


.PHONY: manifests
KUSTOMIZE_CRDS_DIR := config/base/crd/bases
KUSTOMIZE_RBAC_DIR := config/base/rbac
manifests: $(CONTROLLER_GEN) #EXHELP Generate WebhookConfiguration, ClusterRole, and CustomResourceDefinition objects.
# To generate the manifests used and do not use catalogd directory
$(CONTROLLER_GEN) rbac:roleName=manager-role paths=./internal/... output:rbac:artifacts:config=config/base/rbac
$(CONTROLLER_GEN) crd paths=./api/... output:crd:artifacts:config=config/base/crd/bases
rm -rf $(KUSTOMIZE_CRDS_DIR) && $(CONTROLLER_GEN) crd paths=./api/... output:crd:artifacts:config=$(KUSTOMIZE_CRDS_DIR)
rm -f $(KUSTOMIZE_RBAC_DIR)/role.yaml && $(CONTROLLER_GEN) rbac:roleName=manager-role paths=./internal/operator-controller/... output:rbac:artifacts:config=$(KUSTOMIZE_RBAC_DIR)
# To generate the manifests for catalogd
$(MAKE) -C catalogd generate

Expand Down
7 changes: 6 additions & 1 deletion catalogd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,14 @@ clean: ## Remove binaries and test artifacts
rm -rf bin

.PHONY: generate
KUSTOMIZE_CRDS_DIR := config/base/crd/bases
KUSTOMIZE_RBAC_DIR := config/base/rbac
KUSTOMIZE_WEBHOOKS_DIR := config/base/manager/webhook
generate: $(CONTROLLER_GEN) ## Generate code and manifests.
$(CONTROLLER_GEN) object:headerFile="../hack/boilerplate.go.txt" paths="./..."
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/base/crd/bases output:rbac:artifacts:config=config/base/rbac output:webhook:artifacts:config=config/base/manager/webhook/
rm -rf $(KUSTOMIZE_CRDS_DIR) && $(CONTROLLER_GEN) crd paths="./api/..." output:crd:artifacts:config=$(KUSTOMIZE_CRDS_DIR)
rm -f $(KUSTOMIZE_RBAC_DIR)/role.yaml && $(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/..." output:rbac:artifacts:config=$(KUSTOMIZE_RBAC_DIR)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see now, I got it #1746 (review)

/lgtm

rm -f $(KUSTOMIZE_WEBHOOKS_DIR)/manifests.yaml && $(CONTROLLER_GEN) webhook paths="./internal/..." output:webhook:artifacts:config=$(KUSTOMIZE_WEBHOOKS_DIR)

##@ Build

Expand Down
Loading