Skip to content

Commit

Permalink
fix comficts
Browse files Browse the repository at this point in the history
  • Loading branch information
ryankert01 committed Aug 8, 2024
1 parent 5721af1 commit 0468d36
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions pkg/cache/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func (ctx *Context) ensureAppAndTaskCreated(pod *v1.Pod, app *Application) {
zap.String("name", pod.Name))
return

Check warning on line 331 in pkg/cache/context.go

View check run for this annotation

Codecov / codecov/patch

pkg/cache/context.go#L328-L331

Added lines #L328 - L331 were not covered by tests
}
app = ctx.addApplication(&AddApplicationRequest{
app = ctx.AddApplication(&AddApplicationRequest{
Metadata: appMeta,
})
}
Expand Down Expand Up @@ -436,7 +436,7 @@ func (ctx *Context) DeletePod(obj interface{}) {
func (ctx *Context) deleteYuniKornPod(pod *v1.Pod) {
if taskMeta, ok := getTaskMetadata(pod); ok {
if app := ctx.GetApplication(taskMeta.ApplicationID); app != nil {
ctx.notifyTaskComplete(taskMeta.ApplicationID, taskMeta.TaskID)
ctx.notifyTaskComplete(app, taskMeta.TaskID)
}
}

Expand Down Expand Up @@ -880,22 +880,16 @@ func (ctx *Context) NotifyTaskComplete(app *Application, taskID string) {
}

func (ctx *Context) notifyTaskComplete(app *Application, taskID string) {
log.Log(log.ShimContext).Debug("NotifyTaskComplete and release allocation",
log.Log(log.ShimContext).Debug("NotifyTaskComplete",
zap.String("appID", app.applicationID),
zap.String("taskID", taskID))
log.Log(log.ShimContext).Debug("release allocation",
zap.String("appID", app.applicationID),
zap.String("taskID", taskID))
ev := NewSimpleTaskEvent(app.applicationID, taskID, CompleteTask)
dispatcher.Dispatch(ev)
if app.GetApplicationState() == ApplicationStates().Resuming {
dispatcher.Dispatch(NewSimpleApplicationEvent(app.applicationID, AppTaskCompleted))

Check warning on line 892 in pkg/cache/context.go

View check run for this annotation

Codecov / codecov/patch

pkg/cache/context.go#L892

Added line #L892 was not covered by tests
if app := ctx.GetApplication(appID); app != nil {
log.Log(log.ShimContext).Debug("release allocation",
zap.String("appID", appID),
zap.String("taskID", taskID))
ev := NewSimpleTaskEvent(appID, taskID, CompleteTask)
dispatcher.Dispatch(ev)
if app.GetApplicationState() == ApplicationStates().Resuming {
dispatcher.Dispatch(NewSimpleApplicationEvent(appID, AppTaskCompleted))
}
}
}

Expand Down

0 comments on commit 0468d36

Please sign in to comment.