Skip to content

Commit 6db9610

Browse files
authored
feat: add schema validation for env keys (#4084)
1 parent 5a33001 commit 6db9610

File tree

5 files changed

+1138
-516
lines changed

5 files changed

+1138
-516
lines changed

Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,23 @@ helm.schema-update:
166166
excluded_versions="camunda-platform-(8\.(2|3|4|5|6|7)|alpha)$$"; \
167167
if echo "$${chart_dir}" | grep -qE "$${excluded_versions}"; then \
168168
echo "\n[$@] Chart dir: $${chart_dir}";\
169-
echo "[$@] This chart version doesn't have schema";\
169+
echo "[$@] This chart version doesn't have schema"; \
170170
continue; \
171171
fi; \
172172
echo "\n[$@] Chart dir: $${chart_dir}"; \
173173
readme-generator \
174174
--values "$${chart_dir}/values.yaml" \
175-
--schema "$${chart_dir}/values.schema.json";\
175+
--schema "$${chart_dir}/values.schema.json"; \
176+
# Merge with extra schema if exists. \
177+
if [ ! -f "$${chart_dir}/values.schema.extra.json" ]; then \
178+
echo "[$@] No extra schema to merge"; \
179+
continue; \
180+
fi; \
181+
echo "[$@] Merging with extra schema"; \
182+
jq --indent 4 -s 'reduce .[] as $$obj ({}; . * $$obj)' \
183+
"$${chart_dir}/values.schema.json" \
184+
"$${chart_dir}/values.schema.extra.json" > "$${chart_dir}/values.schema.tmp.json" \
185+
&& mv "$${chart_dir}/values.schema.tmp.json" "$${chart_dir}/values.schema.json"; \
176186
done
177187

178188
# helm.get-images: list all images in the chart.

0 commit comments

Comments
 (0)