mirror of
https://github.com/kairos-io/provider-kairos.git
synced 2025-09-15 06:43:32 +00:00
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>
26 lines
460 B
Go
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 ""
|
|
}
|