Skip to content

Commit

Permalink
add local helm chart linting
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-schndr committed Dec 23, 2024
1 parent 8c6eacd commit f17fab4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,20 @@ fmt: $(GOIMPORTS)
$(GOIMPORTS) -w -local github.com/Azure/ARO-HCP $(shell go list -f '{{.Dir}}' -m | xargs)
.PHONY: fmt

ct-lint:
# Find all parent directories of directories containing 'Chart.yaml', output via csv without the leading './'
CHART_DIRS=$(shell find . -type f -name 'Chart.yaml' -printf '%h\n' |sed 's|^\./||' | xargs -I {} dirname {} | sort -u | tr '\n' ',' | sed 's/,$$//') && \
docker run --rm \
-v $(PWD)/:/src/:z \
-w /src/ \
quay.io/helmpack/chart-testing:v3.11.0 ct lint \
--chart-dirs="$${CHART_DIRS}" \
--all \
--validate-maintainers=false \
--debug; \
find . -type f -name 'Chart.lock' | xargs -I {} rm {}; \ # remove any Chart.lock files created with helm dependency build
find . -type f -name '*.tgz' | xargs -I {} rm {} # remove output artifacts from helm dependency build

#
# Infra
#
Expand Down

0 comments on commit f17fab4

Please sign in to comment.