Skip to content

Commit 5ac4c82

Browse files
authored
Move CRDs to config directory (#1798)
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.
1 parent 15396c8 commit 5ac4c82

File tree

6 files changed

+4
-146
lines changed

6 files changed

+4
-146
lines changed

Diff for: .yamllint.yaml

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ yaml-files:
55

66
ignore:
77
- deploy/helm-chart/templates/
8-
- deploy/helm-chart/crds/
8+
- config/crd/bases/
99
- .github/workflows/
1010

1111
rules:
@@ -30,7 +30,6 @@ rules:
3030
check-multi-line-strings: true
3131
ignore: |
3232
deploy/manifests/nginx-gateway.yaml
33-
deploy/manifests/crds
3433
key-duplicates: enable
3534
key-ordering: disable
3635
line-length:
@@ -40,7 +39,6 @@ rules:
4039
ignore: |
4140
.github/
4241
deploy/manifests/nginx-gateway.yaml
43-
deploy/manifests/crds
4442
tests/suite/manifests/longevity/cronjob.yaml
4543
.goreleaser.yml
4644
new-line-at-end-of-file: enable

Diff for: Makefile

+1-3
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,10 @@ generate: ## Run go generate
100100

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

106105
.PHONY: generate-manifests
107106
generate-manifests: ## Generate manifests using Helm.
108-
cp $(CHART_DIR)/crds/* $(MANIFEST_DIR)/crds/
109107
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
110108
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
111109
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

Diff for: deploy/helm-chart/crds

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../config/crd/bases

Diff for: deploy/manifests/crds

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../config/crd/bases

Diff for: deploy/manifests/crds/gateway.nginx.org_nginxgateways.yaml

-140
This file was deleted.

0 commit comments

Comments
 (0)