Skip to content

Commit

Permalink
fix(evpn): adding Initialize fun
Browse files Browse the repository at this point in the history
Signed-off-by: atulpatel261194 <[email protected]>
  • Loading branch information
atulpatel261194 committed May 23, 2024
1 parent cf48f29 commit 1ed4abd
Show file tree
Hide file tree
Showing 7 changed files with 425 additions and 444 deletions.
29 changes: 15 additions & 14 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ var rootCmd = &cobra.Command{

switch config.GlobalConfig.Buildenv {
case intelStr:
gen_linux.Init()
intel_e2000_linux.Init()
frr.Init()
ipu_vendor.Init()
gen_linux.Initialize()
intel_e2000_linux.Initialize()
frr.Initialize()
ipu_vendor.Initialize()
case "ci":
gen_linux.Init()
ci_linux.Init()
frr.Init()
gen_linux.Initialize()
ci_linux.Initialize()
frr.Initialize()
default:
log.Panic(" ERROR: Could not find Build env ")
}
Expand All @@ -85,7 +85,7 @@ var rootCmd = &cobra.Command{
}
switch config.GlobalConfig.Buildenv {
case intelStr:
netlink.Init()
netlink.Initialize()
default:
}

Expand Down Expand Up @@ -138,13 +138,14 @@ func cleanUp() {

switch config.GlobalConfig.Buildenv {
case intelStr:
gen_linux.DeInit()
intel_e2000_linux.DeInit()
frr.DeInit()
gen_linux.DeInitialize()
intel_e2000_linux.DeInitialize()
frr.DeInitialize()
ipu_vendor.DeInitialize()
case "ci":
gen_linux.DeInit()
ci_linux.DeInit()
frr.DeInit()
gen_linux.DeInitialize()
ci_linux.DeInitialize()
frr.DeInitialize()
default:
log.Panic(" ERROR: Could not find Build env ")
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/LinuxCIModule/lci.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ func tearDownBp(bp *infradb.BridgePort) bool {
var ctx context.Context
var nlink utils.Netlink

// Init initializes the config and subscribers
func Init() {
// Initialize initializes the config and subscribers
func Initialize() {
eb := eventbus.EBus
for _, subscriberConfig := range config.GlobalConfig.Subscribers {
if subscriberConfig.Name == "lci" {
Expand All @@ -216,8 +216,8 @@ func Init() {
nlink = utils.NewNetlinkWrapper()
}

// DeInit function handles stops functionality
func DeInit() {
// DeInitialize function handles stops functionality
func DeInitialize() {
// Unsubscribe to InfraDB notifications
eb := eventbus.EBus
eb.UnsubscribeModule("lci")
Expand Down
8 changes: 4 additions & 4 deletions pkg/LinuxGeneralModule/lgm.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ var ctx context.Context
// nlink variable wrapper
var nlink utils.Netlink

// Init initializes the config, logger and subscribers
func Init() {
// Initialize initializes the config, logger and subscribers
func Initialize() {
eb := eventbus.EBus
for _, subscriberConfig := range config.GlobalConfig.Subscribers {
if subscriberConfig.Name == lgmComp {
Expand All @@ -332,8 +332,8 @@ func Init() {
}
}

// DeInit function handles stops functionality
func DeInit() {
// DeInitialize function handles stops functionality
func DeInitialize() {
eb := eventbus.EBus
err := TearDownTenantBridge()
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions pkg/LinuxVendorModule/intele2000/intelE2000.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ var brTenant string
var ctx context.Context
var nlink utils.Netlink

// Init function initialize config
func Init() {
// Initialize function initialize config
func Initialize() {
eb := eventbus.EBus
for _, subscriberConfig := range config.GlobalConfig.Subscribers {
if subscriberConfig.Name == lvmComp {
Expand All @@ -398,8 +398,8 @@ func Init() {
nlink = utils.NewNetlinkWrapper()
}

// DeInit function handles stops functionality
func DeInit() {
// DeInitialize function handles stops functionality
func DeInitialize() {
eb := eventbus.EBus
eb.UnsubscribeModule(lvmComp)
}
8 changes: 4 additions & 4 deletions pkg/frr/frr.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ var ctx context.Context
// Frr variable of type utils wrapper
var Frr utils.Frr

// Init function handles init functionality
func Init() {
// Initialize function handles init functionality
func Initialize() {
frrEnabled := config.GlobalConfig.LinuxFrr.Enabled
if !frrEnabled {
log.Println("FRR Module disabled")
Expand All @@ -265,8 +265,8 @@ func Init() {
}
}

// DeInit function handles stops functionality
func DeInit() {
// DeInitialize function handles stops functionality
func DeInitialize() {
frrEnabled := config.GlobalConfig.LinuxFrr.Enabled
if !frrEnabled {
log.Println("FRR Module disabled")
Expand Down
Loading

0 comments on commit 1ed4abd

Please sign in to comment.