goharbor / harbor

An open source trusted cloud native registry project that stores, signs, and scans content.

Home Page:https://goharbor.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot delete webhook that has executions

slamdev opened this issue · comments

When deleting a webhook via api, it can fail with the following error:

failed to delete executions for webhook of policy 8352: contains executions that aren't in final status, stop the execution first

But there is no api to delete webhook executions. Exposing such api will help with the subject issue.

Because there is a task stay in the non-final status, application API can't solve this issue.
You should login to the database and delete the task of webhook first

delete from task t
where exists (select count(1) from execution e where e.id = t.execution_id and e.vendor_type = 'WEBHOOK');

could this query be wrapped into api call? I see harbor has DELETE endpoints for different execution kinds, but not for webhooks.