This commit is contained in:
Nikola Jokic
2025-04-16 14:25:04 +02:00
parent 928f63d88a
commit 1c2ae5d20a
3 changed files with 12 additions and 17 deletions

View File

@@ -1606,9 +1606,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001713", "version": "1.0.30001714",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001713.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001714.tgz",
"integrity": "sha512-wCIWIg+A4Xr7NfhTuHdX+/FKh3+Op3LBbSp2N5Pfx6T/LhdQy3GTyoTg48BReaW/MyMNZAkTadsBtai3ldWK0Q==", "integrity": "sha512-mtgapdwDLSSBnCI3JokHM7oEQBLxiJKVRtg10AxM1AyeiKcM96f0Mkbqeq+1AbiCtvMcHRulAAEMu693JrSWqg==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {

View File

@@ -8,7 +8,8 @@
"build": "tsc && npx ncc build", "build": "tsc && npx ncc build",
"format": "prettier --write '**/*.ts'", "format": "prettier --write '**/*.ts'",
"format-check": "prettier --check '**/*.ts'", "format-check": "prettier --check '**/*.ts'",
"lint": "eslint src/**/*.ts" "lint": "eslint src/**/*.ts",
"lint:fix": "eslint src/**/*.ts --fix"
}, },
"author": "", "author": "",
"license": "MIT", "license": "MIT",

View File

@@ -200,6 +200,7 @@ export async function getContainerJobPodName(jobName: string): Promise<string> {
labelSelector: selector, labelSelector: selector,
limit: 1 limit: 1
}) })
if (!podList.items?.length) { if (!podList.items?.length) {
await backOffManager.backOff() await backOffManager.backOff()
continue continue
@@ -362,7 +363,7 @@ export async function pruneSecrets(): Promise<void> {
await Promise.all( await Promise.all(
secretList.items.map( secretList.items.map(
async secret => async secret =>
secret.metadata?.name && (await deleteSecret(secret.metadata.name)) secret.metadata?.name && deleteSecret(secret.metadata.name)
) )
) )
} }
@@ -465,8 +466,7 @@ export async function getPodLogs(
pretty: false, pretty: false,
timestamps: false timestamps: false
}) })
await new Promise(resolve => logStream.on('close', () => resolve(null)))
await new Promise(resolve => logStream.on('close', resolve))
} }
export async function prunePods(): Promise<void> { export async function prunePods(): Promise<void> {
@@ -480,7 +480,7 @@ export async function prunePods(): Promise<void> {
await Promise.all( await Promise.all(
podList.items.map( podList.items.map(
async pod => pod.metadata?.name && (await deletePod(pod.metadata.name)) async pod => pod.metadata?.name && deletePod(pod.metadata.name)
) )
) )
} }
@@ -488,11 +488,8 @@ export async function prunePods(): Promise<void> {
export async function getPodStatus( export async function getPodStatus(
name: string name: string
): Promise<k8s.V1PodStatus | undefined> { ): Promise<k8s.V1PodStatus | undefined> {
const { status } = await k8sApi.readNamespacedPod({ const pod = await k8sApi.readNamespacedPod({ name, namespace: namespace() })
name, return pod.status
namespace: namespace()
})
return status
} }
export async function isAuthPermissionsOK(): Promise<boolean> { export async function isAuthPermissionsOK(): Promise<boolean> {
@@ -654,8 +651,5 @@ export function containerPorts(
} }
export async function getPodByName(name): Promise<k8s.V1Pod> { export async function getPodByName(name): Promise<k8s.V1Pod> {
return await k8sApi.readNamespacedPod({ return await k8sApi.readNamespacedPod({ name, namespace: namespace() })
name,
namespace: namespace()
})
} }