Skip to content

Move CRDs to config directory #1798

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 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Move CRDs to config directory
Problem: The CRDs are generated inside the helm chart directory instead
of the standard config directory.

Solution: Modify the output parameter of the CRDs generation to save
them in the config directory. Also add symlinks to the other locations
where we expect to find CRDs.
  • Loading branch information
lucacome committed Apr 2, 2024
commit 1efa41b69a2892293dc90cba6f5e6b45c5cbd5e8
4 changes: 1 addition & 3 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ yaml-files:

ignore:
- deploy/helm-chart/templates/
- deploy/helm-chart/crds/
- config/crd/bases/
- .github/workflows/

rules:
Expand All @@ -30,7 +30,6 @@ rules:
check-multi-line-strings: true
ignore: |
deploy/manifests/nginx-gateway.yaml
deploy/manifests/crds
key-duplicates: enable
key-ordering: disable
line-length:
Expand All @@ -40,7 +39,6 @@ rules:
ignore: |
.github/
deploy/manifests/nginx-gateway.yaml
deploy/manifests/crds
tests/suite/manifests/longevity/cronjob.yaml
.goreleaser.yml
new-line-at-end-of-file: enable
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,10 @@ generate: ## Run go generate

.PHONY: generate-crds
generate-crds: ## Generate CRDs and Go types using kubebuilder
go run sigs.k8s.io/controller-tools/cmd/controller-gen crd paths=./apis/... output:crd:dir=deploy/helm-chart/crds
go run sigs.k8s.io/controller-tools/cmd/controller-gen object paths=./apis/...
go run sigs.k8s.io/controller-tools/cmd/controller-gen crd object paths=./apis/... output:crd:artifacts:config=config/crd/bases

.PHONY: generate-manifests
generate-manifests: ## Generate manifests using Helm.
cp $(CHART_DIR)/crds/* $(MANIFEST_DIR)/crds/
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) $(HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE) -n nginx-gateway | cat $(strip $(MANIFEST_DIR))/namespace.yaml - > $(strip $(MANIFEST_DIR))/nginx-gateway.yaml
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) $(HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE) --set nginx.plus=true --set nginx.image.repository=$(NGINX_PLUS_PREFIX) -n nginx-gateway | cat $(strip $(MANIFEST_DIR))/namespace.yaml - > $(strip $(MANIFEST_DIR))/nginx-plus-gateway.yaml
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) $(HELM_TEMPLATE_EXTRA_ARGS_FOR_ALL_MANIFESTS_FILE) --set nginxGateway.gwAPIExperimentalFeatures.enable=true -n nginx-gateway | cat $(strip $(MANIFEST_DIR))/namespace.yaml - > $(strip $(MANIFEST_DIR))/nginx-gateway-experimental.yaml
Expand Down
1 change: 1 addition & 0 deletions deploy/helm-chart/crds
1 change: 1 addition & 0 deletions deploy/manifests/crds
140 changes: 0 additions & 140 deletions deploy/manifests/crds/gateway.nginx.org_nginxgateways.yaml

This file was deleted.