Skip to content

Commit

Permalink
fix tempalte delApplaunchpad
Browse files Browse the repository at this point in the history
  • Loading branch information
zjy365 committed Nov 21, 2024
1 parent 5b61e03 commit d481824
Showing 1 changed file with 53 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,59 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
undefined,
`${appDeployKey}=${instanceName}`
), // delete Ingress
k8sCustomObjects.deleteNamespacedCustomObject(
// delete Issuer
'cert-manager.io',
'v1',
namespace,
'issuers',
instanceName
),
k8sCustomObjects.deleteNamespacedCustomObject(
// delete Certificate
'cert-manager.io',
'v1',
namespace,
'certificates',
instanceName
),
k8sCustomObjects
.listNamespacedCustomObject(
'cert-manager.io',
'v1',
namespace,
'issuers',
undefined,
undefined,
undefined,
undefined,
`${appDeployKey}=${instanceName}`
)
.then(async (res: any) => {
const items = res.body.items || [];
console.log(items.map((item: any) => item.metadata.name));
return Promise.all(
items.map((item: any) =>
k8sCustomObjects.deleteNamespacedCustomObject(
'cert-manager.io',
'v1',
namespace,
'issuers',
item.metadata.name
)
)
);
}),
k8sCustomObjects
.listNamespacedCustomObject(
'cert-manager.io',
'v1',
namespace,
'certificates',
undefined,
undefined,
undefined,
undefined,
`${appDeployKey}=${instanceName}`
)
.then(async (res: any) => {
const items = res.body.items || [];
return Promise.all(
items.map((item: any) =>
k8sCustomObjects.deleteNamespacedCustomObject(
'cert-manager.io',
'v1',
namespace,
'certificates',
item.metadata.name
)
)
);
}),
k8sCore.deleteCollectionNamespacedPersistentVolumeClaim(
// delete pvc
namespace,
Expand Down

0 comments on commit d481824

Please sign in to comment.