Skip to content

Commit

Permalink
fix(kom): 修复查询 ReplicaSet 时未指定命名空间的问题
Browse files Browse the repository at this point in the history
- 在查询与 Deployment 关联的 ReplicaSet 列表时,添加了命名空间参数
-确保查询操作在正确的命名
  • Loading branch information
weibaohui committed Jan 21, 2025
1 parent faf5893 commit 5460b47
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kom/ctl_rollout.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,9 @@ func (d *rollout) History() ([]RolloutHistory, error) {
// 查询与 Deployment 关联的所有 ReplicaSet
var rsList []*v1.ReplicaSet

err = d.kubectl.newInstance().Resource(&v1.ReplicaSet{}).WithLabelSelector(labelSelector).List(&rsList).Error
err = d.kubectl.newInstance().Resource(&v1.ReplicaSet{}).
Namespace(ns).
WithLabelSelector(labelSelector).List(&rsList).Error
if err != nil {
return nil, fmt.Errorf("failed to list ReplicaSets for Deployment %s/%s: %v", ns, name, err)
}
Expand Down

0 comments on commit 5460b47

Please sign in to comment.