Skip to content

Commit

Permalink
ocp: fix network lookup
Browse files Browse the repository at this point in the history
name and namespace were in an incorrect order

Signed-off-by: Benny Zlotnik <[email protected]>
  • Loading branch information
bennyz committed Sep 27, 2023
1 parent 00db291 commit 0660ad6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/controller/plan/adapter/ocp/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,19 +158,21 @@ func (r *Validator) NetworksMapped(vmRef ref.Ref) (ok bool, err error) {
"vm",
vmRef.String(),
)
r.log.Error(err, "Pod network not found.")

return false, err
}
} else if net.Multus != nil {
namespace, name := getNetworkNameAndNamespace(net.Multus.NetworkName, &vmRef)

name, namespace := getNetworkNameAndNamespace(net.Multus.NetworkName, &vmRef)
_, found := r.plan.Referenced.Map.Network.FindNetworkByNameAndNamespace(namespace, name)
if !found {
err = liberr.Wrap(
err,
"Multus network not found.",
"vm",
"network",
fmt.Sprintf("%s/%s", namespace, name),
)
r.log.Error(err, "Multus network not found.")
return false, err
}
}
Expand Down

0 comments on commit 0660ad6

Please sign in to comment.