feat: add restart command for managed deployments and enhance logging functionality

This commit is contained in:
2026-08-09 14:43:33 +07:00 Unverified
parent 58c26b735a
commit a0abaf05b9
8 changed files with 337 additions and 93 deletions
+20
View File
@@ -68,6 +68,26 @@ export async function scaleDeployment(name: string, replicas: number) {
});
}
export async function restartDeployment(name: string) {
return objectApi.patch({
apiVersion: "apps/v1",
kind: "Deployment",
metadata: {
name,
namespace: getProject(),
},
spec: {
template: {
metadata: {
annotations: {
"kubectl.kubernetes.io/restartedAt": new Date().toISOString(),
},
},
},
},
});
}
export function throwWhen<T, Narrowed extends T>(
condition: (arg: T) => arg is Narrowed,
): (arg: T) => Exclude<T, Narrowed>;