From 9bd3195d18e760b359acd95cacad0c2d17f6bebe Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Mon, 19 Feb 2024 16:28:57 +0100 Subject: [PATCH] fixup Signed-off-by: Anatolii Bazko --- src/tasks/pod-tasks.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tasks/pod-tasks.ts b/src/tasks/pod-tasks.ts index 97b3bd76c..4f93e0bf0 100644 --- a/src/tasks/pod-tasks.ts +++ b/src/tasks/pod-tasks.ts @@ -59,12 +59,13 @@ export namespace PodTasks { return { title: `Scale ${name} ${replicas > 0 ? 'Up' : 'Down'}`, task: async (_ctx: any, task: any) => { - if (await kubeHelper.isDeploymentExist(deploymentName, namespace)) { - await kubeHelper.scaleDeployment(deploymentName, namespace, replicas) - task.title = `${task.title}...[OK]` - } else { + if (replicas === 0 && !await kubeHelper.isDeploymentExist(deploymentName, namespace)) { task.title = `${task.title}...[Not found]` + return } + + await kubeHelper.scaleDeployment(deploymentName, namespace, replicas) + task.title = `${task.title}...[OK]` }, } }