From 098cc198b7ffaf2e76cbad3753197feda16041e2 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Tue, 16 Jan 2024 21:35:58 +0000 Subject: [PATCH] Add macvlan to linux multicall binary Signed-off-by: Brad Davidson --- main_linux.go | 2 ++ plugins/main/macvlan/macvlan.go | 4 ++-- plugins/main/macvlan/macvlan_suite_test.go | 2 +- plugins/main/macvlan/macvlan_test.go | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/main_linux.go b/main_linux.go index 33dc2834..c6421b5b 100644 --- a/main_linux.go +++ b/main_linux.go @@ -16,6 +16,7 @@ import ( hostlocal "github.com/containernetworking/plugins/plugins/ipam/host-local" "github.com/containernetworking/plugins/plugins/main/bridge" "github.com/containernetworking/plugins/plugins/main/loopback" + "github.com/containernetworking/plugins/plugins/main/macvlan" "github.com/containernetworking/plugins/plugins/meta/bandwidth" "github.com/containernetworking/plugins/plugins/meta/firewall" "github.com/containernetworking/plugins/plugins/meta/flannel" @@ -30,6 +31,7 @@ func main() { reexec.Register("flannel", flannel.Main) reexec.Register("host-local", hostlocal.Main) reexec.Register("loopback", loopback.Main) + reexec.Register("macvlan", macvlan.Main) reexec.Register("portmap", portmap.Main) if !reexec.Init() { _, _ = fmt.Fprintln(os.Stderr, bv.BuildString("plugins")) diff --git a/plugins/main/macvlan/macvlan.go b/plugins/main/macvlan/macvlan.go index 7f6380fd..a9795941 100644 --- a/plugins/main/macvlan/macvlan.go +++ b/plugins/main/macvlan/macvlan.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package main +package macvlan import ( "encoding/json" @@ -426,7 +426,7 @@ func cmdDel(args *skel.CmdArgs) error { return err } -func main() { +func Main() { skel.PluginMain(cmdAdd, cmdCheck, cmdDel, version.All, bv.BuildString("macvlan")) } diff --git a/plugins/main/macvlan/macvlan_suite_test.go b/plugins/main/macvlan/macvlan_suite_test.go index 0a24b796..2164c660 100644 --- a/plugins/main/macvlan/macvlan_suite_test.go +++ b/plugins/main/macvlan/macvlan_suite_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package main +package macvlan_test import ( "testing" diff --git a/plugins/main/macvlan/macvlan_test.go b/plugins/main/macvlan/macvlan_test.go index ae73f99f..2e54c0fb 100644 --- a/plugins/main/macvlan/macvlan_test.go +++ b/plugins/main/macvlan/macvlan_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package main +package macvlan import ( "encoding/json"