zhuqi-lucas commented on code in PR #584:
URL: https://github.com/apache/yunikorn-k8shim/pull/584#discussion_r1193398156


##########
pkg/appmgmt/general/general.go:
##########
@@ -104,9 +104,15 @@ func isStateAwareDisabled(pod *v1.Pod) bool {
        return result
 }
 
-func getOwnerReferences(pod *v1.Pod) []metav1.OwnerReference {
+func getOwnerReference(pod *v1.Pod) []metav1.OwnerReference {
        if len(pod.OwnerReferences) > 0 {
-               return pod.OwnerReferences
+               // Filter the pod kind owner reference
+               // keep this because we need to find the original pod
+               for _, ref := range pod.OwnerReferences {
+                       if ref.Kind == reflect.TypeOf(v1.Pod{}).Name() {
+                               return []metav1.OwnerReference{ref}
+                       }
+               }

Review Comment:
   Thank you @wilfred-s for review, addesseed in latest PR!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to