mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
Merge pull request #8947 from yousong/bugfix/yousong-vm-changeip-eip
fix(region): change_ipaddr: retain eip_id on detach and attach
This commit is contained in:
@@ -2093,6 +2093,12 @@ func (self *SGuest) PerformChangeIpaddr(ctx context.Context, userCred mcclient.T
|
||||
}
|
||||
return nil, httperrors.NewBadRequestError("%v", err)
|
||||
}
|
||||
if _, err := db.Update(&ngn[0], func() error {
|
||||
ngn[0].EipId = gn.EipId
|
||||
return nil
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return ngn, nil
|
||||
}()
|
||||
|
||||
Reference in New Issue
Block a user