pbacsko commented on code in PR #428:
URL: https://github.com/apache/yunikorn-k8shim/pull/428#discussion_r896802362
##########
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:
This is new code, but `context_test.go` has not been updated, so codecov
complains. Is this legit? I don't think L715-717 is important, but this one +
L719-222 are.
--
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]