diff --git a/pkg/controller/pod.go b/pkg/controller/pod.go index 156d314bfe1..f51ab73280b 100644 --- a/pkg/controller/pod.go +++ b/pkg/controller/pod.go @@ -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) @@ -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 }