feat(k8s): M5 Deployment 暂停更新 + CI/CD 集成
- 后端: PauseDeployment/ResumeDeployment 客户端方法 (PATCH spec.paused) - 后端: ID路由 + Kuboard code路由 pause/resume handlers - 后端: Deployment 列表 summary 增加 paused 字段 - 前端: 操作菜单增加「暂停更新/恢复更新」动态切换 + 暂停 Badge - 前端: CI/CD 发布按钮跳转流水线页面 (namespace+deployment 上下文) - 前端: api.ts 增加 pauseDeployment/resumeDeployment 方法 - 验证: 5项端到端测试全部通过 (Python urllib)
This commit is contained in:
1 parent
23f237288d
commit
2e66908e20
8 files changed
+194
-8
No files matched your search
@@ -291,6 +291,7 @@ type DeploymentItem struct {
|
||||
type DeploymentSpec struct {
|
||||
Replicas int `json:"replicas"`
|
||||
Template DeploymentTemplate `json:"template"`
|
||||
Paused bool `json:"paused"`
|
||||
}
|
||||
|
||||
type DeploymentTemplate struct {
|
||||
@@ -586,6 +587,26 @@ func (c *Client) RestartDeployment(namespace, name string) error {
|
||||
return c.patch(path, body, nil)
|
||||
}
|
||||
|
||||
// PauseDeployment pauses rollout of a Deployment by setting spec.paused=true.
|
||||
// A paused Deployment will not process new rollouts — useful for debugging or
|
||||
// staged updates. Resume with ResumeDeployment.
|
||||
func (c *Client) PauseDeployment(namespace, name string) error {
|
||||
body := map[string]interface{}{
|
||||
"spec": map[string]interface{}{"paused": true},
|
||||
}
|
||||
path := fmt.Sprintf("/apis/apps/v1/namespaces/%s/deployments/%s", namespace, name)
|
||||
return c.patch(path, body, nil)
|
||||
}
|
||||
|
||||
// ResumeDeployment resumes rollout of a paused Deployment by setting spec.paused=false.
|
||||
func (c *Client) ResumeDeployment(namespace, name string) error {
|
||||
body := map[string]interface{}{
|
||||
"spec": map[string]interface{}{"paused": false},
|
||||
}
|
||||
path := fmt.Sprintf("/apis/apps/v1/namespaces/%s/deployments/%s", namespace, name)
|
||||
return c.patch(path, body, nil)
|
||||
}
|
||||
|
||||
// --- Exec (K8s WebSocket channel protocol) ---
|
||||
|
||||
// ExecResult holds the output of a pod exec command
|
||||
|
||||
Reference in new issue
Block a user