Skip to content

Commit

Permalink
fix: Solves issue where helm-docs would segfault due in charts with c…
Browse files Browse the repository at this point in the history
…ertain comment format

    The issue was that if a user had a comment which started with the
    old comment format "# field.name -- description", but then underneath had a
    comment of the new format "# -- description", the tool would mark
    the field as having an old style comment, with the key pulled from
    the latter comment "". This meant that we'd try to document the
    root-level mapping node, however the key is `nil` at this point.
  • Loading branch information
norwoodj committed Feb 24, 2024
1 parent e91f4af commit d57d6db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/helm/chart_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ func parseChartValuesFileComments(chartDirectory string, values *yaml.Node, lint
// If we haven't continued by this point, we didn't match any of the comment formats we want, so we need to add
// the in progress value to the map, and reset to looking for a new key
key, description := ParseComment(commentLines)
keyToDescriptions[key] = description
if key != "" {
keyToDescriptions[key] = description
}

commentLines = make([]string, 0)
foundValuesComment = false
}
Expand Down

0 comments on commit d57d6db

Please sign in to comment.