feat: add support for replica ranges and HorizontalPodAutoscaler integration

This commit is contained in:
2026-09-03 12:02:22 +07:00 Unverified
parent 4ce8ed3e40
commit 8e9d207915
10 changed files with 700 additions and 39 deletions
+13
View File
@@ -474,6 +474,19 @@ export function createManagementService(dependencies: ManagementDependencies) {
async stop(workspace: Workspace, names?: string[]): Promise<string[]> {
const selected = await targets(workspace, names);
const selectedSet = new Set(selected);
const hpas = (await dependencies.listProjectResources(workspace.project))
.filter(
(resource) =>
resource.apiVersion === "autoscaling/v2" &&
resource.kind === "HorizontalPodAutoscaler" &&
resource.metadata?.name !== undefined &&
selectedSet.has(resource.metadata.name),
)
.map((resource) => identity(workspace, resource));
if (hpas.length > 0) {
await deleteResources(workspace, hpas);
}
for (const name of selected) {
await dependencies.scaleDeployment(workspace.project, name, 0);
}