3 Commits

Author SHA1 Message Date
Pragalva Sapkota
0906013bff fix: report the real file and index in kyaml input errors
WrapErrorWithFile reads the path and index annotations into local
variables, then passes those values back through meta.Annotations as if
they were keys. The second lookup almost always misses, so every error
returned by inpututil.MapInputs and MapInputsE is prefixed with " []: "
instead of naming the file and document that failed.

The legacy fallback for the index also read LegacyPathAnnotation rather
than LegacyIndexAnnotation, so resources carrying only the legacy
annotations resolved the index to the file path.

Use the values that were already resolved, and read the index from
LegacyIndexAnnotation. This matches kioutil.GetFileAnnotations, which
resolves the same pair of annotations correctly.

Adds a test for the internal and legacy annotation forms; the package
previously had none.

Signed-off-by: Pragalva Sapkota <sapkotapragalva@gmail.com>
2026-09-09 10:26:14 +05:45
Natasha Sarkar
67a5f6d68f support krm spec v1 and legacy path, index, and id annotations 2021-09-17 17:10:10 -07:00
Phillip Wittrock
b473faccca Improve error handling in kyaml libraries 2019-11-12 08:53:55 -08:00