Use error message of failed to find a healthy node for karmada-etcd for can not found note to scheduled etcd

Signed-off-by: Lan Liang <gcslyp@gmail.com>
This commit is contained in:
Lan Liang 2022-10-04 11:01:00 +08:00
parent 997425beba
commit de06486124
1 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package kubernetes
import (
"context"
"encoding/json"
"errors"
"fmt"
"strings"
@ -108,6 +109,10 @@ func (i *CommandInitOption) AddNodeSelectorLabels() error {
}
}
if etcdSelectorLabels == nil {
return errors.New("failed to find a healthy node for karmada-etcd")
}
etcdSelectorLabels["karmada.io/etcd"] = ""
patchData := map[string]interface{}{"metadata": map[string]map[string]string{"labels": etcdSelectorLabels}}
playLoadBytes, _ := json.Marshal(patchData)