fix remove node check

This commit is contained in:
zhangzhiqiangcs 2022-12-17 20:32:41 +08:00 committed by zhangzhiqiangcs
parent f34bf693b4
commit 2d7bb0c8d4

View File

@ -491,7 +491,7 @@ type FindNode struct {
func (f *FindNode) Execute(runtime connector.Runtime) error {
var resArr []string
res, err := runtime.GetRunner().Cmd(
"sudo -E /usr/local/bin/kubectl get nodes | grep -v NAME | grep -v 'master\\|control-plane' | awk '{print $1}'",
"sudo -E /usr/local/bin/kubectl get nodes | awk '$3 !~ /master|control-plane|ROLES/ {print $1}'",
true)
if err != nil {
return errors.Wrap(errors.WithStack(err), "kubectl get nodes failed")