MCPcopy
hub / github.com/1Panel-dev/KubePi / forceDeleteWorkLoad

Function forceDeleteWorkLoad

web/dashboard/src/api/workloads.js:97–122  ·  view source on GitHub ↗
(cluster_name, type, namespace, name)

Source from the content-addressed store, hash-verified

95}
96
97export function forceDeleteWorkLoad (cluster_name, type, namespace, name) {
98 switch (type) {
99 case "deployments":
100 case "statefulsets":
101 case "daemonsets":
102 return delWithData(
103 `${appsV1UrlWithNsUrl(cluster_name, type, namespace)}/${name}`,{
104 gracePeriodSeconds: 0
105 }
106 )
107 case "cronjobs":
108 return delWithData(
109 `${batchV1WithNsUrl(cluster_name, type, namespace)}/${name}`,{
110 gracePeriodSeconds: 0
111 }
112 )
113 case "pods":
114 return delWithData(`${apiV1UrlWithNsUrl(cluster_name, type, namespace)}/${name}`,{
115 gracePeriodSeconds: 0
116 })
117 case "jobs":
118 return delWithData(`${batchV1WithNsUrl(cluster_name, type, namespace)}/${name}`,{
119 gracePeriodSeconds: 0
120 })
121 }
122}
123
124export function createWorkLoad (cluster_name, type, namespace, data) {
125 switch (type) {

Callers

nothing calls this directly

Calls 4

delWithDataFunction · 0.90
appsV1UrlWithNsUrlFunction · 0.85
batchV1WithNsUrlFunction · 0.85
apiV1UrlWithNsUrlFunction · 0.85

Tested by

no test coverage detected