Skip to content

Commit

Permalink
fix: cni response missing sandbox field (#2089)
Browse files Browse the repository at this point in the history
(cherry picked from commit a659f2e)
  • Loading branch information
oilbeater committed Dec 4, 2022
1 parent 2013069 commit 9ef032b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/cni/cni.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,20 @@ func cmdAdd(args *skel.CmdArgs) error {
return err
}

result := generateCNIResult(response)
result := generateCNIResult(response, args.Netns)
return types.PrintResult(&result, cniVersion)
}

func generateCNIResult(cniResponse *request.CniResponse) current.Result {
func generateCNIResult(cniResponse *request.CniResponse, netns string) current.Result {
result := current.Result{
CNIVersion: current.ImplementedSpecVersion,
DNS: cniResponse.DNS,
}
_, mask, _ := net.ParseCIDR(cniResponse.CIDR)
podIface := current.Interface{
Name: cniResponse.PodNicName,
Mac: cniResponse.MacAddress,
Name: cniResponse.PodNicName,
Mac: cniResponse.MacAddress,
Sandbox: netns,
}
switch cniResponse.Protocol {
case kubeovnv1.ProtocolIPv4:
Expand Down

0 comments on commit 9ef032b

Please sign in to comment.