Skip to content

Commit 3220d74

Browse files
authored
Use chart-testing to lint the Helm Chart (#2027)
Use chart-testing to lint the Helm Chart Problem: We want to validate all the files related to the helm chart and not just run helm lint Solution: Use helm/chart-testing
1 parent 16f0835 commit 3220d74

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

.ct.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
remote: origin
2+
target-branch: main
3+
4+
check-version-increment: false

.github/workflows/lint.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,20 @@ jobs:
9999
steps:
100100
- name: Checkout Repository
101101
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
102-
- name: Lint chart
103-
run: make lint-helm
102+
with:
103+
fetch-depth: 0
104+
105+
- name: Set up Python
106+
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
107+
with:
108+
python-version: "3.x"
109+
check-latest: true
110+
111+
- name: Set up chart-testing
112+
uses: helm/chart-testing-action@e6669bcd63d7cb57cb4380c33043eebe5d111992 # v2.6.1
113+
114+
- name: Run chart-testing
115+
run: ct lint --print-config --config .ct.yaml
104116

105117
yaml-lint:
106118
name: Yaml Lint

.yamllint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ yaml-files:
44
- "*.yml"
55

66
ignore:
7-
- charts/nginx-gateway-fabric/templates
7+
- charts/nginx-gateway-fabric/
88
- config/crd/bases/
99
- deploy/crds.yaml
1010

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ njs-unit-test: ## Run unit tests for the njs httpmatches module
191191

192192
.PHONY: lint-helm
193193
lint-helm: ## Run the helm chart linter
194-
helm lint $(CHART_DIR)
194+
docker run --pull always --rm -v $(CURDIR):/nginx-gateway-fabric -w /nginx-gateway-fabric quay.io/helmpack/chart-testing:latest ct lint --config .ct.yaml
195195

196196
.PHONY: load-images
197197
load-images: ## Load NGF and NGINX images on configured kind cluster.

charts/nginx-gateway-fabric/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ keywords:
1414
- gateway
1515
- nginx
1616
maintainers:
17-
- name: nginxinc
17+
- name: nginxinc/nginx-gateway-fabric
1818
email: kubernetes@nginx.com

0 commit comments

Comments
 (0)