fix bug with migrating annotations

This commit is contained in:
natasha41575
2021-10-12 10:59:41 -07:00
parent 67c58ad4f4
commit 55ac9ca88d
6 changed files with 182 additions and 18 deletions

View File

@@ -316,6 +316,10 @@ func (r *ByteReader) decode(originalYAML string, index int, decoder *yaml.Decode
r.SetAnnotations = map[string]string{}
}
if !r.OmitReaderAnnotations {
err := kioutil.CopyLegacyAnnotations(n)
if err != nil {
return nil, err
}
r.SetAnnotations[kioutil.IndexAnnotation] = fmt.Sprintf("%d", index)
r.SetAnnotations[kioutil.LegacyIndexAnnotation] = fmt.Sprintf("%d", index)