From 5f0fd80d272c4bd20c1454dadb3c86610b6ad6d0 Mon Sep 17 00:00:00 2001 From: backguynn Date: Tue, 9 Jul 2024 16:45:30 +0900 Subject: [PATCH] remove default tags (use setDefault) --- cmd/loxilb-agent/config.go | 4 ++-- cmd/loxilb-agent/main.go | 1 - cmd/loxilb-agent/options.go | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/loxilb-agent/config.go b/cmd/loxilb-agent/config.go index d8f8b46..dd51371 100644 --- a/cmd/loxilb-agent/config.go +++ b/cmd/loxilb-agent/config.go @@ -53,9 +53,9 @@ type AgentConfig struct { // external BGP Peers. This is a comma separated list e.g. IP1:ASID1,IP2:ASID2 ExtBGPPeers []string `yaml:"extBGPPeers,omitempty"` // support BGP protocol - SetBGP uint16 `yaml:"setBGP,omitempty,default=0"` + SetBGP uint16 `yaml:"setBGP,omitempty"` // Custom BGP Port - ListenBGPPort uint16 `yaml:"listenBGPPort,omitempty,default=179"` + ListenBGPPort uint16 `yaml:"listenBGPPort,omitempty"` // Set eBGP multi-hop EBGPMultiHop bool `yaml:"eBGPMultiHop"` // loxilb loadbalancer mode diff --git a/cmd/loxilb-agent/main.go b/cmd/loxilb-agent/main.go index 2a37457..3bde80d 100644 --- a/cmd/loxilb-agent/main.go +++ b/cmd/loxilb-agent/main.go @@ -81,7 +81,6 @@ func newAgentCommand() *cobra.Command { if err := opts.validate(args); err != nil { klog.Errorf("Failed to options validate. err: %v", err) os.Exit(255) - } if err := run(opts); err != nil { klog.Errorf("Error running agent. err: %v", err) diff --git a/cmd/loxilb-agent/options.go b/cmd/loxilb-agent/options.go index 5c33326..a06da25 100644 --- a/cmd/loxilb-agent/options.go +++ b/cmd/loxilb-agent/options.go @@ -291,4 +291,7 @@ func (o *Options) setDefaults() { if o.config.ExtBGPPeers == nil { o.config.ExtBGPPeers = []string{} } + if o.config.ListenBGPPort == 0 { + o.config.ListenBGPPort = 179 + } }