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]` }, } }