Skip to content

Commit e93068a

Browse files
authored
Support ci/default-values.yaml (#133)
* Support ci/default-values.yaml * Address comment --------- Co-authored-by: James Kwon <[email protected]>
1 parent 59fd861 commit e93068a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

hooks/helmlint.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,26 @@ for file in "${files[@]}"; do
146146
linter_values_arg=""
147147
fi
148148

149+
# Add any additional values files compatible with the chart-testing tool ([docs](https://github.com/helm/chart-testing))
150+
ci_values_args=()
151+
for file in "$file_chart_path"/ci/*-values.yaml; do
152+
if [ ! -f "$file" ]; then
153+
continue
154+
fi
155+
156+
ci_values_args+=("-f" "$file")
157+
done
158+
149159
if [[ ! -z "$file_chart_path" ]]; then
150160
if contains_element "$file_chart_path" "${seen_chart_paths[@]}"; then
151161
debug "Already linted $file_chart_path"
152-
elif [[ -z "$linter_values_arg" ]]; then
162+
elif [[ -z "$linter_values_arg" ]] && [ ${#ci_values_args[@]} -eq 0 ]; then
153163
helm lint $helm_lint_opts "$file_chart_path"
154164
seen_chart_paths+=( "$file_chart_path" )
155165
else
156166
# Combine both linter_values.yaml and values.yaml
157-
helm lint $helm_lint_opts -f "$file_chart_path/values.yaml" -f "$linter_values_arg" "$file_chart_path"
158167
seen_chart_paths+=( "$file_chart_path" )
168+
helm lint $helm_lint_opts -f "$file_chart_path/values.yaml" -f "$linter_values_arg" "${ci_values_args[@]}" "$file_chart_path"
159169
fi
160170
fi
161171
done

0 commit comments

Comments
 (0)