Skip to content

Commit

Permalink
Reverse Global Tenant check logic in cancel task endpoint
Browse files Browse the repository at this point in the history
Attempting to cancel a task by DELETEing at the tenant specific task API
endpoint would result in No Such Task being returned. It appears that
this is because of a reversed logic check, which prevents this endpoint
from being a workaround to delete global tasks. Instead, it ONLY allows
the cancellation of global tasks.
  • Loading branch information
thomasmitchell committed Nov 25, 2019
1 parent 15d1f5f commit 7a30447
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/api_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ func (c *Core) v2API() *route.Router {
r.Fail(route.Oops(err, "Unable to retrieve task information"))
return
}
if task == nil || task.TenantUUID != db.GlobalTenantUUID {
if task == nil || task.TenantUUID == db.GlobalTenantUUID {
r.Fail(route.NotFound(err, "No such task"))
return
}
Expand Down

0 comments on commit 7a30447

Please sign in to comment.