fix the bug for setting annotations when triggering transformers

This commit is contained in:
Jingfang Liu
2019-05-07 16:54:20 -07:00
parent 34e8de3fc8
commit 9390860288
2 changed files with 25 additions and 4 deletions

View File

@@ -208,12 +208,10 @@ func (p *ExecPlugin) getResMapWithIdAnnotation(rm resmap.ResMap) (resmap.ResMap,
}
annotations := r.GetAnnotations()
if annotations == nil {
annotations = map[string]string{
idAnnotation: string(idString),
}
r.SetAnnotations(annotations)
annotations = make(map[string]string)
}
annotations[idAnnotation] = string(idString)
r.SetAnnotations(annotations)
}
return inputRM, nil
}