Skip to content

Commit 5421068

Browse files
steigrmurali-reddy
authored andcommitted
Print output of ip route command as string. (#439)
`Cmd.CombinedOutput()` returns `[]byte` for the command output which, at least for `ip` commands should be a printable string. The output is now printed as string. Furthermore the constant `KUBE_DUMMY_IF` is used for the interface name to reduce multiple definitions of the interface name. Signed-off-by: Mathias Kaufmann <[email protected]>
1 parent 0538a2a commit 5421068

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/controllers/proxy/network_services_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ func (ln *linuxNetworking) ipAddrAdd(iface netlink.Link, ip string) error {
115115

116116
// TODO: netlink.RouteReplace which is replacement for below command is not working as expected. Call succeeds but
117117
// route is not replaced. For now do it with command.
118-
out, err := exec.Command("ip", "route", "replace", "local", ip, "dev", "kube-dummy-if", "table", "local", "proto", "kernel", "scope", "host", "src",
118+
out, err := exec.Command("ip", "route", "replace", "local", ip, "dev", KUBE_DUMMY_IF, "table", "local", "proto", "kernel", "scope", "host", "src",
119119
NodeIP.String(), "table", "local").CombinedOutput()
120120
if err != nil {
121-
glog.Errorf("Failed to replace route to service VIP %s configured on kube-dummy-if. Error: %v, Output: %v", ip, err, out)
121+
glog.Errorf("Failed to replace route to service VIP %s configured on %s. Error: %v, Output: %s", ip, KUBE_DUMMY_IF, err, out)
122122
}
123123
return nil
124124
}

0 commit comments

Comments
 (0)