From 89f920791a705c3d259ced9a9bab4b9c06913be7 Mon Sep 17 00:00:00 2001 From: Artsiom Koltun Date: Mon, 29 Jan 2024 13:09:21 +0100 Subject: [PATCH 1/3] refactor(network): move evpn cmd files in network dir Signed-off-by: Artsiom Koltun --- cmd/{ => network}/evpn-bridge-port.go | 4 ++-- cmd/{ => network}/evpn-logical-brige.go | 4 ++-- cmd/{ => network}/evpn-svi.go | 4 ++-- cmd/{ => network}/evpn-test.go | 4 ++-- cmd/{ => network}/evpn-vrf.go | 4 ++-- main.go | 3 ++- 6 files changed, 12 insertions(+), 11 deletions(-) rename cmd/{ => network}/evpn-bridge-port.go (99%) rename cmd/{ => network}/evpn-logical-brige.go (98%) rename cmd/{ => network}/evpn-svi.go (99%) rename cmd/{ => network}/evpn-test.go (94%) rename cmd/{ => network}/evpn-vrf.go (98%) diff --git a/cmd/evpn-bridge-port.go b/cmd/network/evpn-bridge-port.go similarity index 99% rename from cmd/evpn-bridge-port.go rename to cmd/network/evpn-bridge-port.go index ce53224..c4b3a51 100644 --- a/cmd/evpn-bridge-port.go +++ b/cmd/network/evpn-bridge-port.go @@ -2,8 +2,8 @@ // Copyright (c) 2022-2023 Intel Corporation, or its subsidiaries. // Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. -// Package cmd implements the CLI commands -package cmd +// Package network implements the network related CLI commands +package network import ( "context" diff --git a/cmd/evpn-logical-brige.go b/cmd/network/evpn-logical-brige.go similarity index 98% rename from cmd/evpn-logical-brige.go rename to cmd/network/evpn-logical-brige.go index e8c78fa..a8dd145 100644 --- a/cmd/evpn-logical-brige.go +++ b/cmd/network/evpn-logical-brige.go @@ -2,8 +2,8 @@ // Copyright (c) 2022-2023 Intel Corporation, or its subsidiaries. // Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. -// Package cmd implements the CLI commands -package cmd +// Package network implements the network related CLI commands +package network import ( "context" diff --git a/cmd/evpn-svi.go b/cmd/network/evpn-svi.go similarity index 99% rename from cmd/evpn-svi.go rename to cmd/network/evpn-svi.go index c12e381..72ba608 100644 --- a/cmd/evpn-svi.go +++ b/cmd/network/evpn-svi.go @@ -2,8 +2,8 @@ // Copyright (c) 2022-2023 Intel Corporation, or its subsidiaries. // Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. -// Package cmd implements the CLI commands -package cmd +// Package network implements the network related CLI commands +package network import ( "context" diff --git a/cmd/evpn-test.go b/cmd/network/evpn-test.go similarity index 94% rename from cmd/evpn-test.go rename to cmd/network/evpn-test.go index 9446c92..93c99dd 100644 --- a/cmd/evpn-test.go +++ b/cmd/network/evpn-test.go @@ -2,8 +2,8 @@ // Copyright (c) 2022-2023 Intel Corporation, or its subsidiaries. // Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. -// Package cmd implements the CLI commands -package cmd +// Package network implements the network related CLI commands +package network import ( "log" diff --git a/cmd/evpn-vrf.go b/cmd/network/evpn-vrf.go similarity index 98% rename from cmd/evpn-vrf.go rename to cmd/network/evpn-vrf.go index 6a04603..ca6cc5a 100644 --- a/cmd/evpn-vrf.go +++ b/cmd/network/evpn-vrf.go @@ -2,8 +2,8 @@ // Copyright (c) 2022-2023 Intel Corporation, or its subsidiaries. // Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. -// Package cmd implements the CLI commands -package cmd +// Package network implements the network related CLI commands +package network import ( "context" diff --git a/main.go b/main.go index 847717e..dc608e5 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,7 @@ import ( "os" "github.com/opiproject/godpu/cmd" + "github.com/opiproject/godpu/cmd/network" "github.com/opiproject/godpu/cmd/storage" "github.com/spf13/cobra" ) @@ -39,6 +40,6 @@ func newCommand() *cobra.Command { c.AddCommand(cmd.NewInventoryCommand()) c.AddCommand(cmd.NewIPSecCommand()) c.AddCommand(storage.NewStorageCommand()) - c.AddCommand(cmd.NewEvpnCommand()) + c.AddCommand(network.NewEvpnCommand()) return c } From 57f83e8674314d9ee7f79237670581374de9af85 Mon Sep 17 00:00:00 2001 From: Artsiom Koltun Date: Mon, 29 Jan 2024 13:15:08 +0100 Subject: [PATCH 2/3] refactor(ipsec): move ipsec cmd files in ipsec dir Signed-off-by: Artsiom Koltun --- cmd/{ => ipsec}/ipsec-stats.go | 4 ++-- cmd/{ => ipsec}/ipsec-test.go | 4 ++-- main.go | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) rename cmd/{ => ipsec}/ipsec-stats.go (93%) rename cmd/{ => ipsec}/ipsec-test.go (91%) diff --git a/cmd/ipsec-stats.go b/cmd/ipsec/ipsec-stats.go similarity index 93% rename from cmd/ipsec-stats.go rename to cmd/ipsec/ipsec-stats.go index faf1df5..5dd4ea1 100644 --- a/cmd/ipsec-stats.go +++ b/cmd/ipsec/ipsec-stats.go @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. -// Package cmd implements the CLI commands -package cmd +// Package ipsec implements the ipsec related CLI commands +package ipsec import ( "fmt" diff --git a/cmd/ipsec-test.go b/cmd/ipsec/ipsec-test.go similarity index 91% rename from cmd/ipsec-test.go rename to cmd/ipsec/ipsec-test.go index aaeab88..fea8cb9 100644 --- a/cmd/ipsec-test.go +++ b/cmd/ipsec/ipsec-test.go @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. -// Package cmd implements the CLI commands -package cmd +// Package ipsec implements the ipsec related CLI commands +package ipsec import ( "fmt" diff --git a/main.go b/main.go index dc608e5..69dfd56 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,7 @@ import ( "os" "github.com/opiproject/godpu/cmd" + "github.com/opiproject/godpu/cmd/ipsec" "github.com/opiproject/godpu/cmd/network" "github.com/opiproject/godpu/cmd/storage" "github.com/spf13/cobra" @@ -38,7 +39,7 @@ func newCommand() *cobra.Command { }, } c.AddCommand(cmd.NewInventoryCommand()) - c.AddCommand(cmd.NewIPSecCommand()) + c.AddCommand(ipsec.NewIPSecCommand()) c.AddCommand(storage.NewStorageCommand()) c.AddCommand(network.NewEvpnCommand()) return c From a98d081ab096f7385ce549fe7fc57b33dec58bef Mon Sep 17 00:00:00 2001 From: Artsiom Koltun Date: Mon, 29 Jan 2024 13:16:59 +0100 Subject: [PATCH 3/3] refactor(inventory): move inventory cmd files in inventory dir Signed-off-by: Artsiom Koltun --- cmd/{ => inventory}/inventory-get.go | 4 ++-- main.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename cmd/{ => inventory}/inventory-get.go (94%) diff --git a/cmd/inventory-get.go b/cmd/inventory/inventory-get.go similarity index 94% rename from cmd/inventory-get.go rename to cmd/inventory/inventory-get.go index 5628157..52e43de 100644 --- a/cmd/inventory-get.go +++ b/cmd/inventory/inventory-get.go @@ -1,8 +1,8 @@ // SPDX-License-Identifier: Apache-2.0 // Copyright (c) 2022-2023 Dell Inc, or its subsidiaries. -// Package cmd implements the CLI commands -package cmd +// Package inventory implements inventory related CLI commands +package inventory import ( "context" diff --git a/main.go b/main.go index 69dfd56..d060cb3 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,7 @@ import ( "log" "os" - "github.com/opiproject/godpu/cmd" + "github.com/opiproject/godpu/cmd/inventory" "github.com/opiproject/godpu/cmd/ipsec" "github.com/opiproject/godpu/cmd/network" "github.com/opiproject/godpu/cmd/storage" @@ -38,7 +38,7 @@ func newCommand() *cobra.Command { os.Exit(1) }, } - c.AddCommand(cmd.NewInventoryCommand()) + c.AddCommand(inventory.NewInventoryCommand()) c.AddCommand(ipsec.NewIPSecCommand()) c.AddCommand(storage.NewStorageCommand()) c.AddCommand(network.NewEvpnCommand())