azure: support nics with multiple ipconfigs
This commit is contained in:
		@@ -151,9 +151,12 @@ func getPrimaryIPConfig(nic network.Interface) (*network.InterfaceIPConfiguratio
 | 
				
			|||||||
		return &((*nic.Properties.IPConfigurations)[0]), nil
 | 
							return &((*nic.Properties.IPConfigurations)[0]), nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// we're here because we either have multiple ipconfigs and can't determine the primary:
 | 
						for _, ref := range *nic.Properties.IPConfigurations {
 | 
				
			||||||
	//   https://github.com/Azure/azure-rest-api-specs/issues/305
 | 
							if *ref.Properties.Primary {
 | 
				
			||||||
	// or somehow we had zero ipconfigs
 | 
								return &ref, nil
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return nil, fmt.Errorf("failed to determine the determine primary ipconfig. nicname=%q", *nic.Name)
 | 
						return nil, fmt.Errorf("failed to determine the determine primary ipconfig. nicname=%q", *nic.Name)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user