PPragalva Sapkotafix: report the real file and index in kyaml input errors
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
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> | 1 个月前 | |
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> | 1 个月前 |