Skip to content

Commit

Permalink
fix: promote failed (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyelei authored Feb 21, 2025
1 parent 98f0be6 commit 66455c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/cmd/cluster/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,8 @@ func (o *OperationsOptions) validatePromote(clusterObj *appsv1.Cluster) error {

getTargetRole := func(roles []appsv1.ReplicaRole) (string, error) {
pods, err := o.Client.CoreV1().Pods(clusterObj.Namespace).List(context.Background(), metav1.ListOptions{
LabelSelector: fmt.Sprintf("%s=%s", constant.KBAppComponentLabelKey, podObj.Labels[constant.KBAppComponentLabelKey]),
LabelSelector: fmt.Sprintf("%s=%s,%s=%s", constant.KBAppComponentLabelKey,
podObj.Labels[constant.KBAppComponentLabelKey], constant.AppInstanceLabelKey, clusterObj.Name),
})
if err != nil {
return "", err
Expand Down

0 comments on commit 66455c0

Please sign in to comment.