Skip to content

Commit

Permalink
Copy NotationType in Nil Values
Browse files Browse the repository at this point in the history
parseNilValueType() was not including NotationType in its output.
  • Loading branch information
sblundy authored and steven-blundy committed Jul 12, 2023
1 parent c9b921a commit 5145fd6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/document/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func parseNilValueType(key string, description helm.ChartValueDescription, autoD
return valueRow{
Key: key,
Type: t,
NotationType: autoDescription.NotationType,
AutoDefault: autoDescription.Default,
Default: description.Default,
AutoDescription: autoDescription.Description,
Expand Down
10 changes: 9 additions & 1 deletion pkg/document/values_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1490,12 +1490,16 @@ animals:
# @notationType -- yaml
fish:
name: nomoby
# -- (list) Declaring object as yaml with null value
# @notationType -- yaml
lizards:
`)

valuesRows, err := getSortedValuesTableRows(helmValues, make(map[string]helm.ChartValueDescription))

assert.Nil(t, err)
assert.Len(t, valuesRows, 4)
assert.Len(t, valuesRows, 5)

assert.Equal(t, "animals.cats", valuesRows[0].Key)
assert.Equal(t, listType, valuesRows[0].Type)
Expand All @@ -1520,6 +1524,10 @@ animals:
assert.Equal(t, yamlType, valuesRows[3].NotationType)
assert.Equal(t, "name: nomoby\n", valuesRows[3].Default)
assert.Equal(t, "My animals lists", valuesRows[0].AutoDescription)

assert.Equal(t, "animals.lizards", valuesRows[4].Key)
assert.Equal(t, listType, valuesRows[4].Type)
assert.Equal(t, yamlType, valuesRows[4].NotationType)
}

func TestExtractCustomDeclaredType(t *testing.T) {
Expand Down

0 comments on commit 5145fd6

Please sign in to comment.