- add missing 'warning:' prefix and terminal period to globals key message
- simplify overly verbose 'skipped value' message (remove YAML-specific wording)
- shorten test assertions to stable key-path fragments
Signed-off-by: Marcus H <jfjrh2014@users.noreply.github.com>
// It's not clear if this condition can actually ever trigger.
// It's not clear if this condition can actually ever trigger.
printf("key %s is a mapping. Skipping",key)
printf("warning: key %s is a mapping. Skipping.",key)
}else{
}else{
// TODO: Do we need to do any additional checking on the value?
// TODO: Do we need to do any additional checking on the value?
dg[key]=val
dg[key]=val
@ -245,7 +245,7 @@ func coalesceValues(printf printFn, c chart.Charter, v map[string]any, prefix st
// If the original value is nil, there is nothing to coalesce, so we don't print
// If the original value is nil, there is nothing to coalesce, so we don't print
// the warning
// the warning
ifval!=nil{
ifval!=nil{
printf("warning: skipped value for %s.%s: destination is a mapping, but the provided value is not. Use a YAML map (key:value pairs) for this key.",subPrefix,key)
printf("warning: skipped value for %s.%s: destination is a mapping, but the provided value is not.",subPrefix,key)
}
}
}else{
}else{
// If the key is a child chart, coalesce tables with Merge set to true
// If the key is a child chart, coalesce tables with Merge set to true
assert.Contains(t,warnings,"warning: skipped value for level1.level2.level3.boat: destination is a mapping, but the provided value is not. Use a YAML map (key:value pairs) for this key.")
assert.Contains(t,warnings,"skipped value for level1.level2.level3.boat")
assert.Contains(t,warnings,"warning: destination for level1.level2.level3.spear.tip is a mapping. Ignoring non-mapping value (true)")
assert.Contains(t,warnings,"destination for level1.level2.level3.spear.tip is a mapping")
assert.Contains(t,warnings,"warning: cannot overwrite mapping with non-mapping value for level1.level2.level3.spear.sail (map[cotton:true])")
assert.Contains(t,warnings,"cannot overwrite mapping with non-mapping value for level1.level2.level3.spear.sail")