move remainingNodes outof drain loop

This commit is contained in:
yuzhiquan 2021-10-12 09:26:22 +08:00
parent f54d2a0dd1
commit 0c66b43d7a

View File

@ -319,12 +319,12 @@ func (o *DrainCmdOptions) RunDrain() error {
continue
}
}
if len(remainingNodes) > 0 {
fmt.Fprintf(o.ErrOut, "There are pending nodes to be drained:\n")
for _, nodeName := range remainingNodes {
fmt.Fprintf(o.ErrOut, " %s\n", nodeName)
}
if len(remainingNodes) > 0 {
fmt.Fprintf(o.ErrOut, "There are pending nodes to be drained:\n")
for _, nodeName := range remainingNodes {
fmt.Fprintf(o.ErrOut, " %s\n", nodeName)
}
}