Skip to content

Commit

Permalink
add checks for all funcs
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Zappa <[email protected]>
  • Loading branch information
MikeZappa87 committed Apr 6, 2024
1 parent 5d2d968 commit b78ecc0
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit b78ecc0

Please sign in to comment.