Update definition.go (#4767)

fix bug, use labels to replace annotation

(cherry picked from commit 8f395d843c)

Co-authored-by: Hair1ossTeenager <45008570+Hair1ossTeenager@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2022-09-21 10:29:37 +08:00
committed by GitHub
co-authored by Hair1ossTeenager
parent 56c2827669
commit 9ded3c9d3e
+1 -1
View File
@@ -235,7 +235,7 @@ func (def *Definition) FromCUE(val *cue.Value, templateString string) error {
labels := map[string]string{}
for k, v := range def.GetLabels() {
if !strings.HasPrefix(k, UserPrefix) {
annotations[k] = v
labels[k] = v
}
}
spec, ok := def.Object["spec"].(map[string]interface{})