mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/kube-vip/kube-vip.git
synced 2026-09-20 08:03:47 +08:00
fixed vars formatting & log statement
Signed-off-by: mushrushu <mushrushu@outlook.com>
This commit is contained in:
@@ -94,7 +94,7 @@ func init() {
|
||||
kubeVipCmd.PersistentFlags().StringVar(&initConfig.Annotations, "annotations", "", "Set Node annotations prefix for parsing")
|
||||
|
||||
kubeVipCmd.PersistentFlags().BoolVar(&initConfig.BGPConfig.Zebra.Enabled, "zebra", false, "This will enable Zebra support within kube-vip")
|
||||
kubeVipCmd.PersistentFlags().StringVar(&initConfig.BGPConfig.Zebra.Url, "zebraUrl", "unix:/var/run/frr/zserv.api", "Path to the unix domain socket for connecting to Zebra daemon")
|
||||
kubeVipCmd.PersistentFlags().StringVar(&initConfig.BGPConfig.Zebra.URL, "zebraUrl", "unix:/var/run/frr/zserv.api", "Path to the unix domain socket for connecting to Zebra daemon")
|
||||
kubeVipCmd.PersistentFlags().Uint32Var(&initConfig.BGPConfig.Zebra.Version, "zebraVersion", 6, "Zebra API Version")
|
||||
kubeVipCmd.PersistentFlags().StringVar(&initConfig.BGPConfig.Zebra.SoftwareName, "zebraSoftwareName", "frr8.3", "Software Name for Zebra")
|
||||
|
||||
|
||||
@@ -60,11 +60,11 @@ func NewBGPServer(c *Config, peerStateChangeCallback func(*api.WatchEventRespons
|
||||
|
||||
if c.Zebra.Enabled {
|
||||
if err = b.s.EnableZebra(context.Background(), &api.EnableZebraRequest{
|
||||
Url: c.Zebra.Url,
|
||||
Url: c.Zebra.URL,
|
||||
Version: c.Zebra.Version,
|
||||
SoftwareName: c.Zebra.SoftwareName,
|
||||
}); err != nil {
|
||||
log.Error("failed to enable zebra:", err)
|
||||
log.Error(err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ type Config struct {
|
||||
// Defines Zebra connection configuration. More on the topic - https://github.com/osrg/gobgp/blob/master/docs/sources/zebra.md#configuration
|
||||
type ZebraConfig struct {
|
||||
Enabled bool
|
||||
Url string
|
||||
URL string
|
||||
Version uint32
|
||||
SoftwareName string
|
||||
}
|
||||
|
||||
@@ -509,9 +509,9 @@ func ParseEnvironment(c *Config) error {
|
||||
c.BGPConfig.Zebra.Enabled = result
|
||||
}
|
||||
|
||||
env = os.Getenv(zebraUrl)
|
||||
env = os.Getenv(zebraURL)
|
||||
if env != "" {
|
||||
c.BGPConfig.Zebra.Url = env
|
||||
c.BGPConfig.Zebra.URL = env
|
||||
}
|
||||
|
||||
env = os.Getenv(zebraVersion)
|
||||
|
||||
@@ -113,7 +113,7 @@ const (
|
||||
// zebraEnable defines if Zebra integraton should be enabled
|
||||
zebraEnable = "zebra_enable"
|
||||
// zebraUrl specifies path to the unix domain socket for connecting to Zebra daemon
|
||||
zebraUrl = "zebra_url"
|
||||
zebraURL = "zebra_url"
|
||||
// zebraVersion specifies Zebra API Version
|
||||
zebraVersion = "zebra_version"
|
||||
// zebraSoftwareName specifies Software Name for Zebra
|
||||
|
||||
Reference in New Issue
Block a user