Skip to content

Commit 42b1564

Browse files
authored
feat: add support for delete propagation policy (#9113)
* add support for propagation policy to delete resource, update UI and regenerate API schema * fix gql schema * update schema * update schema * make fix * fix prettier
1 parent 881c6da commit 42b1564

File tree

20 files changed

+503
-331
lines changed

20 files changed

+503
-331
lines changed

modules/api/pkg/handler/apihandler.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,7 @@ func CreateHTTPAPIHandler(iManager integration.Manager) (*restful.Container, err
885885
Param(apiV1Ws.PathParameter("namespace", "namespace of the resource")).
886886
Param(apiV1Ws.PathParameter("name", "name of the resource")).
887887
Param(apiV1Ws.QueryParameter("deleteNow", "override graceful delete options and enforce immediate deletion")).
888+
Param(apiV1Ws.QueryParameter("propagation", "override default delete propagation policy")).
888889
Returns(http.StatusNoContent, "", nil))
889890
apiV1Ws.Route(
890891
apiV1Ws.GET("/_raw/{kind}/namespace/{namespace}/name/{name}").To(apiHandler.handleGetResource).
@@ -912,6 +913,8 @@ func CreateHTTPAPIHandler(iManager integration.Manager) (*restful.Container, err
912913
Doc("deletes a non-namespaced resource").
913914
Param(apiV1Ws.PathParameter("kind", "kind of the resource")).
914915
Param(apiV1Ws.PathParameter("name", "name of the resource")).
916+
Param(apiV1Ws.QueryParameter("deleteNow", "override graceful delete options and enforce immediate deletion")).
917+
Param(apiV1Ws.QueryParameter("propagation", "override default delete propagation policy")).
915918
Returns(http.StatusNoContent, "", nil))
916919
apiV1Ws.Route(
917920
apiV1Ws.GET("/_raw/{kind}/name/{name}").To(apiHandler.handleGetResource).
@@ -2355,9 +2358,10 @@ func (apiHandler *APIHandler) handleDeleteResource(
23552358
kind := request.PathParameter("kind")
23562359
namespace := request.PathParameters()["namespace"]
23572360
name := request.PathParameter("name")
2361+
propagation := request.QueryParameter("propagation")
23582362
deleteNow := request.QueryParameter("deleteNow") == "true"
23592363

2360-
if err := verber.Delete(kind, namespace, name, deleteNow); err != nil {
2364+
if err := verber.Delete(kind, namespace, name, propagation, deleteNow); err != nil {
23612365
errors.HandleInternalError(response, err)
23622366
return
23632367
}

0 commit comments

Comments
 (0)