From b78ecc079bddc3c08e7c65916bb66fcd90d592c9 Mon Sep 17 00:00:00 2001 From: Michael Zappa Date: Fri, 5 Apr 2024 20:53:52 -0600 Subject: [PATCH] add checks for all funcs Signed-off-by: Michael Zappa --- opts.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/opts.go b/opts.go index 923af88..825d2d2 100644 --- a/opts.go +++ b/opts.go @@ -127,6 +127,13 @@ func WithConfIndex(bytes []byte, index int) Opt { if err != nil { return err } + + err = checkPluginExists(c, confList) + + if err != nil { + return err + } + c.networks = append(c.networks, &Network{ cni: c.cniConfig, config: confList, @@ -150,6 +157,13 @@ func WithConfFile(fileName string) Opt { if err != nil { return err } + + err = checkPluginExists(c, confList) + + if err != nil { + return err + } + c.networks = append(c.networks, &Network{ cni: c.cniConfig, config: confList, @@ -167,6 +181,13 @@ func WithConfListBytes(bytes []byte) Opt { if err != nil { return err } + + err = checkPluginExists(c, confList) + + if err != nil { + return err + } + i := len(c.networks) c.networks = append(c.networks, &Network{ cni: c.cniConfig, @@ -186,6 +207,13 @@ func WithConfListFile(fileName string) Opt { if err != nil { return err } + + err = checkPluginExists(c, confList) + + if err != nil { + return err + } + i := len(c.networks) c.networks = append(c.networks, &Network{ cni: c.cniConfig,