Merge pull request #1508 from zhouqiu0103/add-vip

fix get interface bug
This commit is contained in:
KubeSphere CI Bot 2022-09-15 14:16:47 +08:00 committed by GitHub
commit 23d9e39816
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,7 +163,7 @@ func (g *GetInterfaceName) Execute(runtime connector.Runtime) error {
return nil
}
cmd := fmt.Sprintf("ip route "+
"| grep %s "+
"| grep ' %s ' "+
"| sed -e \"s/^.*dev.//\" -e \"s/.proto.*//\"", host.GetAddress())
interfaceName, err := runtime.GetRunner().SudoCmd(cmd, false)
if err != nil {