yangwwei commented on a change in pull request #232:
URL: 
https://github.com/apache/incubator-yunikorn-k8shim/pull/232#discussion_r595331685



##########
File path: pkg/appmgmt/general/general.go
##########
@@ -123,20 +126,40 @@ func (os *Manager) getAppMetadata(pod *v1.Pod) 
(interfaces.ApplicationMetadata,
        if err != nil {
                log.Logger().Error("unable to get taskGroups by given pod", 
zap.Error(err))
        }
+       ownerReferences := getOwnerReferences(pod)
+
        placeholderTimeout, err := utils.GetPlaceholderTimeoutParam(pod)
        if err != nil {
                log.Logger().Warn("unable to get placeholder timeout by given 
pod.", zap.Error(err))
        }
        return interfaces.ApplicationMetadata{
-               ApplicationID: appId,
-               QueueName:     utils.GetQueueNameFromPod(pod),
-               User:          user,
-               Tags:          tags,
-               TaskGroups:    taskGroups,
+               ApplicationID:           appId,
+               QueueName:               utils.GetQueueNameFromPod(pod),
+               User:                    user,
+               Tags:                    tags,
+               TaskGroups:              taskGroups,
                PlaceholderTimeoutInSec: placeholderTimeout,
+               OwnerReferences:         ownerReferences,
        }, true
 }
 
+func getOwnerReferences(pod *v1.Pod) []metav1.OwnerReference {

Review comment:
       pls add comments to this function, to explain how we decide what 
owner-reference will be set for the placeholders.




----------------------------------------------------------------
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.

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


Reply via email to