mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: panic when there is no secondary IP on the host. (#22728)
Co-authored-by: glzjin <glzjin2015@gmail.com>
This commit is contained in:
@@ -222,6 +222,9 @@ func (s *Service) metaData(ctx context.Context, w http.ResponseWriter, r *http.R
|
||||
ips := make([]string, 0)
|
||||
guestNics := guestDesc.Nics
|
||||
for _, nic := range guestNics {
|
||||
if nic.Networkaddresses == nil {
|
||||
continue
|
||||
}
|
||||
nas, _ := nic.Networkaddresses.GetArray()
|
||||
for _, na := range nas {
|
||||
if typ, _ := na.GetString("type"); typ == "sub_ip" {
|
||||
|
||||
Reference in New Issue
Block a user