manirajv06 commented on code in PR #428:
URL: https://github.com/apache/yunikorn-k8shim/pull/428#discussion_r896810997
##########
pkg/cache/context.go:
##########
@@ -692,22 +692,34 @@ func (ctx *Context) AddTask(request
*interfaces.AddTaskRequest) interfaces.Manag
if app, valid := managedApp.(*Application); valid {
existingTask, err :=
app.GetTask(request.Metadata.TaskID)
if err != nil {
- task :=
NewFromTaskMeta(request.Metadata.TaskID, app, ctx, request.Metadata)
+ var originator bool
+
+ // Is this task the originator of the
application?
+ // If yes, then make it as "first
pod/owner/driver" of the application and set the task as originator
+ if app.GetOriginatingTask() == nil {
+ for _, ownerReference := range
app.getPlaceholderOwnerReferences() {
+ referenceID :=
string(ownerReference.UID)
+ if request.Metadata.TaskID ==
referenceID {
+ originator = true
+ break
Review Comment:
Test cases has been already added in general_test.go. I think it is good
enough.
--
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]