You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by "zhuqi-lucas (via GitHub)" <gi...@apache.org> on 2023/05/15 06:54:41 UTC

[GitHub] [yunikorn-k8shim] zhuqi-lucas commented on a diff in pull request #584: [YUNIKORN-1708] Filtered owner references for placeholder pods.

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: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org