🌳
pt0/deployF/k8sF/resourcesActionF.mts
5import { getKlusterCtx, type KubeResource } from './ctxF/klusterCtxF.mts'
8type ResourcesActionInnerProps = {
9 resources: KubeResource[]
10 noDelPvcs?: boolean
11 skipCustomActions?: boolean
12 [key: string]: any
15const resourcesActionInner = async ({
16 resources,
17 noDelPvcs=true,
18 skipCustomActions=false,
19 ...props
20}: ResourcesActionInnerProps) => {
21 const {cluster_name} = getKlusterCtx(props)
22 const action = getAction()
23 if (!skipCustomActions && !isActionSupported(action) && await runAction({action})) {
24 // for skipping actions that shld run once per-app not per-resource like dbconsole
25 return
26 }
28 return await resourcesActionCore({resources, action, cluster_name, noDelPvcs})
31export const resourcesAction = async (props?: ResourcesActionInnerProps) => {
32 return await wrapKubeCoalesce(resourcesActionInner, props)