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:
parent
997425beba
commit
de06486124
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue