-
Notifications
You must be signed in to change notification settings - Fork 80
add labels for workload to record component info #189
add labels for workload to record component info #189
Conversation
add e2e test & unit test Signed-off-by: roy wang <seiwy2010@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM , ping @ryanzhang-oss @zzxwill
oam.LabelAppComponent: acc.ComponentName, | ||
oam.LabelAppComponentRevision: componentRevisionName, | ||
} | ||
w.SetLabels(labels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make sure we won't override the existing labels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, I will use merge instead of override here.
add unit test Signed-off-by: roy wang <seiwy2010@gmail.com>
@@ -469,6 +477,17 @@ func fillValue(obj *unstructured.Unstructured, fs []string, val interface{}) err | |||
return nil | |||
} | |||
|
|||
func addWorkloadLabels(w *unstructured.Unstructured, labels map[string]string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move this to util and change the name from "addWorkloadLabels" to "addLabels" as this is very generic. Also, I am not sure if this already exists somewhere in the library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will check and move it.
Signed-off-by: roy wang <seiwy2010@gmail.com>
Good job |
Signed-off-by: roy wang seiwy2010@gmail.com