mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-10-09 00:41:05 +02:00
by host name or FQDN. kubelet can be started with --hostname-override with configurable value. In AWS envirinment typcally its set FQDN obtained from the metda data. This fix ensures we can deploy kube-router in case nodes are registered with FQDN Fixes #17
17 lines
226 B
Go
17 lines
226 B
Go
package utils
|
|
|
|
import (
|
|
"bytes"
|
|
"os/exec"
|
|
)
|
|
|
|
func GetFqdn() string {
|
|
cmd := exec.Command("hostname", "-f")
|
|
var out bytes.Buffer
|
|
cmd.Stdout = &out
|
|
cmd.Run()
|
|
fqdn := out.String()
|
|
fqdn = fqdn[:len(fqdn)-1]
|
|
return fqdn
|
|
}
|