Backend delete functionality with queues#81
Backend delete functionality with queues#81Shrutim1505 wants to merge 4 commits intovolcano-sh:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
184c33b to
2c4ed56
Compare
|
/assign @kevin-wangzefeng |
|
Hi, what's the difference between this and #74 ? |
|
closed that one @Monokaix , this is the correct implementation of backend |
|
this could be merged after #80 |
|
Need to solve merge conflicts and add more details in the description, besides, add more screenshot of the effect will be better |
|
This will be resolved after #80 |
|
Also need to solve this PR's conflict and give more details for the description |
@JesseStutler this PR is behind #80 so it would be resolved after merge of 80 |
|
Please solve the code conflicts. |
f26c978 to
611afc9
Compare
|
Does this pr include delete all resources or just pod and queue? |
|
@Monokaix it is just for queues, but same logic will be implemented with pods and jobs too |
|
while restructuring the code i will implement that in jobs and pods too till then we can merge this one |
|
I will test it today |
|
There is no permission for dashboard to delete the queues, you should also add a dashboard/deployment/volcano-dashboard.yaml Lines 124 to 129 in bad5ca3 |
|
Also the error message in the pic is not correct, should be like: |
i will check |
962a789 to
ca1123d
Compare
|
hi @JesseStutler I guess u can check it now |
@Shrutim1505 You should also add a delete permission for queue in clusterrole |
|
@Shrutim1505 Error msg can be improved here though. |
abf0056 to
c277111
Compare
|
@JesseStutler added |
| namespace: volcano-system | ||
| --- | ||
|
|
||
| # volcano dashboard cluster role |
There was a problem hiding this comment.
This comment should not added
deployment/volcano-dashboard.yaml
Outdated
| - get | ||
| - list | ||
| - watch | ||
| - delete |
There was a problem hiding this comment.
I think dashboard should not have permission to delete namespace
deployment/volcano-dashboard.yaml
Outdated
| - get | ||
| - list | ||
| - watch | ||
| - delete |
There was a problem hiding this comment.
Maybe we can add delete for jobs/pods later? Because your PR only support to delete queues currently
| size="sm" | ||
| className="rounded-pill px-4 py-2 d-flex align-items-center justify-content-center shadow-sm fw-medium border-2" | ||
| onClick={handleRefresh} | ||
| onClick={handleRefresh} // This is correct |
There was a problem hiding this comment.
What is this comment used for?
There was a problem hiding this comment.
removed, i guess too its not necessary
| }); | ||
| } | ||
| }); | ||
| // Delete a Pod |
There was a problem hiding this comment.
This PR also support delete pods? But seems that pod doesn't have much error cases such as 4XX? Do we need to support pod deletion in this PR?
There was a problem hiding this comment.
POD and job deletion would be completed in next PR @JesseStutler
backend/src/server.js
Outdated
| const queueName = name.toLowerCase(); | ||
|
|
||
| /* ---------- 1. Protect the default queue ---------- */ | ||
| if (queueName === "default") { |
There was a problem hiding this comment.
Also should protect root queue
There was a problem hiding this comment.
ok i will add this too
backend/src/server.js
Outdated
| } catch (error) { | ||
| console.error("Error deleting queue:", error?.body || error); | ||
|
|
||
| if (error.statusCode === 403) { |
There was a problem hiding this comment.
I have a question: Why not directly return the error code and error message to the user? Why do we need to judge based on the different types of codes?
There was a problem hiding this comment.
this is just printing type of error in the terminal
There was a problem hiding this comment.
We can directly return the error code and error message from kube-apiserver to the user, I think user who are using volcano and k8s will understand the error message, there is no need to judge here and wrap the message
backend/src/server.js
Outdated
| }); | ||
| } | ||
|
|
||
| if (error.body?.includes("admission webhook")) { |
There was a problem hiding this comment.
It's very strange to judge based on the return value of the body
There was a problem hiding this comment.
@JesseStutler When you try to delete a queue, Kubernetes may have a safety‑check (an admission webhook) that says “No, this queue is protected.”
The API’s error message usually contains the words “admission webhook.”
5f4756f to
5c73330
Compare
backend/src/server.js
Outdated
|
|
||
| // Disallow deleting protected system queues | ||
| if (["root", "default"].includes(queueName)) { | ||
| return res.status(400).json({ |
There was a problem hiding this comment.
I think the return code should be 403
39d4729 to
68dd27f
Compare
|
@JesseStutler @Monokaix please review |
|
|
7643b48 to
7468516
Compare
Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> undo formatting of contributing.md Signed-off-by: Sayan Banerjee <sayanbanerjee2002@gmail.com> update sidebar ui/ux Signed-off-by: Karan Yadav <xpresskaran98@gmail.com> fix deprecated package volcano-sh#46 Signed-off-by: Karan Yadav <xpresskaran98@gmail.com> final rebased commited changes to code-modularity Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> format checker Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> backend working Signed-off-by: Sayan Banerjee <sayanbanerjee2002@gmail.com> refractored code for better UI design Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> refracted ui queues Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> maintain code reusability and improve UI Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> removed package-lock.json from individual workspaces Signed-off-by: Sayan Banerjee <sayanbanerjee2002@gmail.com> undo formatting of contributing.md Signed-off-by: Sayan Banerjee <sayanbanerjee2002@gmail.com> update sidebar ui/ux Signed-off-by: Karan Yadav <xpresskaran98@gmail.com> fix deprecated package volcano-sh#46 Signed-off-by: Karan Yadav <xpresskaran98@gmail.com> format checker Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> configure vitest Signed-off-by: Karan Yadav <xpresskaran98@gmail.com> feat/trpc: Add support for trpc and improve the api response time Signed-off-by: Kuldeep <de6p97@gmail.com> Revert "feat/trpc: Add support for trpc and improve the api response time 5x-10x faster" Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> docker error solve Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> implemented delete and update functionality with all conflicts resolved Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> Add security context configuration Signed-off-by: jessestutler <chenzicong4@huawei.com> Frontend changes of Jobs and Pods UI Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> Frontend updation of the Queues UI Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> Frontend updation of the Queues UI Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> modified jobs-pods for the UI Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> prettier check added Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> edit dialogue box changed Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> pods handle search improved Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> npm run format Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> backend delete queue UI Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> Frontend updation of the Queues UI Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> Frontend updation of the Queues UI Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> modified jobs-pods for the UI Signed-off-by: Shruti78 <shrutimurthy2103@gmail.com> backend on updating queue/job status Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> delete functionality working Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> updated missing functionalities Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> format checker Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> handling error cases Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> delete permission in cluster role Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> refractoring of backend Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> refractoring of backend Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> backend error functionality handling Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com> Delete dialogue on showing error Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com>
7468516 to
ac03d47
Compare
Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com>
Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com>
Signed-off-by: Shrutim1505 <shrutimurthy2103@gmail.com>





Description:
This PR introduces the backend implementation for the delete functionality. It includes the necessary route, controller logic, and service integration to handle delete operations securely and efficiently.
Changes Made:
Added DELETE API endpoint in the backend
Implemented controller and service logic for delete operation
Integrated appropriate validations and error handling
Updated documentation (if applicable)
Testing:
Verified delete functionality with valid and invalid inputs
Ensured proper status codes and messages are returned
Confirmed no unintended side effects on other endpoints