Skip to content
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

feat: add values.schema.json #220

Merged
merged 15 commits into from
Jan 14, 2025
Merged
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Chart.lock
charts/
.vscode
.vscode
.bin/
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
LOCALBIN ?= $(shell pwd)/.bin

$(LOCALBIN):
mkdir -p .bin

.PHONY: chart-local
chart-local:
helm dependency update ./chart
Expand All @@ -16,3 +21,16 @@ agent-chart:
.PHONY: crd-chart
crd-chart:
helm package ./crd-chart

# We have to update schema for chart dependencies to freely modify its properties
.PHONY: values.schema.json
values.schema.json: .bin/helm-schema
cd chart && ../.bin/helm-schema -r -f values.yaml -o temp-schema.json && cd -
jq --argjson JSON_CONTENT '{"additionalProperties": true,"required": [],"type": "object"}' \
'reduce ["apm-hub", "canary-checker", "config-db","flanksource-ui", "kratos"][] as $$key (.; .properties[$$key] = $$JSON_CONTENT) | .additionalProperties = true' \
chart/temp-schema.json > chart/values.schema.json
rm chart/temp-schema.json

.bin/helm-schema:
test -s $(LOCALBIN)/helm-schema || \
GOBIN=$(LOCALBIN) go install github.com/dadav/helm-schema/cmd/helm-schema@latest
Loading
Loading