Skip to content

Commit 5145fd6

Browse files
sblundysteven-blundy
authored andcommitted
Copy NotationType in Nil Values
parseNilValueType() was not including NotationType in its output.
1 parent c9b921a commit 5145fd6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

pkg/document/values.go

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ func parseNilValueType(key string, description helm.ChartValueDescription, autoD
9696
return valueRow{
9797
Key: key,
9898
Type: t,
99+
NotationType: autoDescription.NotationType,
99100
AutoDefault: autoDescription.Default,
100101
Default: description.Default,
101102
AutoDescription: autoDescription.Description,

pkg/document/values_test.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -1490,12 +1490,16 @@ animals:
14901490
# @notationType -- yaml
14911491
fish:
14921492
name: nomoby
1493+
1494+
# -- (list) Declaring object as yaml with null value
1495+
# @notationType -- yaml
1496+
lizards:
14931497
`)
14941498

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

14971501
assert.Nil(t, err)
1498-
assert.Len(t, valuesRows, 4)
1502+
assert.Len(t, valuesRows, 5)
14991503

15001504
assert.Equal(t, "animals.cats", valuesRows[0].Key)
15011505
assert.Equal(t, listType, valuesRows[0].Type)
@@ -1520,6 +1524,10 @@ animals:
15201524
assert.Equal(t, yamlType, valuesRows[3].NotationType)
15211525
assert.Equal(t, "name: nomoby\n", valuesRows[3].Default)
15221526
assert.Equal(t, "My animals lists", valuesRows[0].AutoDescription)
1527+
1528+
assert.Equal(t, "animals.lizards", valuesRows[4].Key)
1529+
assert.Equal(t, listType, valuesRows[4].Type)
1530+
assert.Equal(t, yamlType, valuesRows[4].NotationType)
15231531
}
15241532

15251533
func TestExtractCustomDeclaredType(t *testing.T) {

0 commit comments

Comments
 (0)