fixed vars formatting & log statement

Signed-off-by: mushrushu <mushrushu@outlook.com>
This commit is contained in:
mushrushu
2025-06-26 19:24:30 +03:00
committed by Marcel Fest
parent 42478905d0
commit f7821c7fb3
5 changed files with 7 additions and 7 deletions

View File

@@ -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")

View File

@@ -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
}
}

View File

@@ -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
}

View File

@@ -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)

View File

@@ -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