Files
provider-kairos/internal/role/p2p/common.go
mudler 0517b1e766 Add kubeVIP support with p2p hybrid mode
In this way, the p2p API will just run the co-ordination to setup KubeVIP automatically
to the new cluster.

Signed-off-by: Ettore Di Giacinto <mudler@mocaccino.org>
2022-12-05 11:53:33 +01:00

26 lines
460 B
Go

package role
import (
"fmt"
"net"
providerConfig "github.com/kairos-io/provider-kairos/internal/provider/config"
)
func guessInterface(pconfig *providerConfig.Config) string {
if pconfig.KubeVIP.Interface != "" {
return pconfig.KubeVIP.Interface
}
ifaces, err := net.Interfaces()
if err != nil {
fmt.Println("failed getting system interfaces")
return ""
}
for _, i := range ifaces {
if i.Name != "lo" {
return i.Name
}
}
return ""
}