helm/pkg
Damien Nozay 9fa373e8be Make validation errors easier to fix
Problem: the warnings don't give enough details about which
values are problematic, only the name of the leaf key. This is
all the more annoying when you have a chart depending on other charts.

```
mainchart
 |
 +- subchart1
 +- subchart2
 +- subchart3
```

Here are some warnings I get before the change:
```
coalesce.go:199: warning: destination for credentials is a table. Ignoring non-table value
coalesce.go:160: warning: skipped value for resources: Not a table.
coalesce.go:160: warning: skipped value for googleSheetsServiceAccount: Not a table.
coalesce.go:199: warning: destination for googleSheetsServiceAccount is a table. Ignoring non-table value
coalesce.go:199: warning: destination for resources is a table. Ignoring non-table value []
coalesce.go:199: warning: destination for credentials is a table. Ignoring non-table value
coalesce.go:199: warning: destination for credentials is a table. Ignoring non-table value
coalesce.go:160: warning: skipped value for resources: Not a table.
coalesce.go:160: warning: skipped value for googleSheetsServiceAccount: Not a table.
```

with fix:
```
coalesce.go:162: warning: skipped value for subchart1.resources: Not a table.
coalesce.go:162: warning: skipped value for subchart2.googleSheetsServiceAccount: Not a table.
coalesce.go:211: warning: destination for subchart3.aws.credentials is a table. Ignoring non-table value ()
coalesce.go:211: warning: destination for mainchart.subchart3.aws.credentials is a table. Ignoring non-table value ()
coalesce.go:211: warning: destination for mainchart.subchart2.googleSheetsServiceAccount is a table. Ignoring non-table value ()
coalesce.go:211: warning: destination for mainchart.subchart1.resources is a table. Ignoring non-table value ([])
coalesce.go:162: warning: skipped value for subchart1.resources: Not a table.
coalesce.go:162: warning: skipped value for subchart2.googleSheetsServiceAccount: Not a table.
coalesce.go:211: warning: destination for subchart3.aws.credentials is a table. Ignoring non-table value ()
```

Signed-off-by: Damien Nozay <damiennozay+github@gmail.com>

add tests

Signed-off-by: Damien Nozay <damiennozay+github@gmail.com>
2021-09-09 11:47:00 -07:00
..
action Merge pull request #9180 from Moser-ss/feature-handle-SIGINT 2021-08-30 18:18:13 -04:00
chart fix(*): Validate metadata semver and printable characters 2021-02-04 12:52:24 -08:00
chartutil Make validation errors easier to fix 2021-09-09 11:47:00 -07:00
cli feat(comp): Add descriptions for output format 2021-02-24 11:43:45 -05:00
downloader fix tarFromLocalDir saving file dependencies in dest path 2021-09-09 08:52:02 -07:00
engine Fixing issue with non-existant .Template when using tpl function 2021-08-31 10:19:54 -04:00
gates pkg/gates: add unit test for String 2020-02-17 13:48:12 +08:00
getter remove hardcoded oci strings, add constant/util 2021-06-28 12:43:33 -04:00
helmpath Fixing argument to be lower case 2020-05-05 10:27:47 -04:00
kube Merge pull request #9180 from Moser-ss/feature-handle-SIGINT 2021-08-30 18:18:13 -04:00
lint feat(linter): check for nested resource-policy annotations 2021-07-06 11:18:15 -07:00
plugin add unittest 2021-08-07 09:48:37 +08:00
postrender chore: Spelling (#9410) 2021-03-15 21:11:57 -04:00
provenance improved the error message for failed package signing (#6948) 2019-12-06 09:14:39 -07:00
release chore: Spelling (#9410) 2021-03-15 21:11:57 -04:00
releaseutil add kind_sorter support for SecretList 2020-05-21 18:23:00 +08:00
repo Merge branch 'main' of github.com:helm/helm into hip-6 2021-08-26 16:51:02 -04:00
storage fix(typo): fix typo of storage doc 2021-07-22 23:32:06 +08:00
strvals fix conflict 2020-07-01 21:38:44 +08:00
time remove redudant time func 2020-09-23 23:32:56 +02:00