Skip to content

Commit

Permalink
ipam: use ip provided by nad annotation when providing IPAM for other…
Browse files Browse the repository at this point in the history
… CNI plugins (#4883)

Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian committed Dec 30, 2024
1 parent 7981d08 commit 5d787e2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -1560,13 +1560,9 @@ func (c *Controller) getPodAttachmentNet(pod *v1.Pod) ([]*kubeovnNet, error) {
Subnet: subnet,
IsDefault: isDefault,
AllowLiveMigration: allowLiveMigration,
MacRequest: attach.MacRequest,
IPRequest: strings.Join(attach.IPRequest, ","),
}

if len(attach.IPRequest) != 0 {
ret.IPRequest = strings.Join(attach.IPRequest, ",")
}

ret.MacRequest = attach.MacRequest
result = append(result, ret)
} else {
providerName = fmt.Sprintf("%s.%s", attach.Name, attach.Namespace)
Expand All @@ -1576,6 +1572,8 @@ func (c *Controller) getPodAttachmentNet(pod *v1.Pod) ([]*kubeovnNet, error) {
Type: providerTypeIPAM,
ProviderName: providerName,
Subnet: subnet,
MacRequest: attach.MacRequest,
IPRequest: strings.Join(attach.IPRequest, ","),
})
break
}
Expand Down

0 comments on commit 5d787e2

Please sign in to comment.