Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/apis/openstackproviderconfig/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ type SecurityGroupFilter struct {
type NetworkParam struct {
// The UUID of the network. Required if you omit the port attribute.
UUID string `json:"uuid,omitempty"`
// A fixed IPv4 address for the NIC.
// A fixed IP address for the NIC.
FixedIp string `json:"fixedIp,omitempty"`
// Filters for optional network query
Filter Filter `json:"filter,omitempty"`
Expand Down
9 changes: 6 additions & 3 deletions pkg/cloud/openstack/machine/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,11 @@ func getIPsFromInstance(instance *clients.Instance) (map[string]string, error) {
"": instance.AccessIPv4,
}, nil
}
if instance.AccessIPv6 != "" && net.ParseIP(instance.AccessIPv6) != nil {
return map[string]string{
"": instance.AccessIPv6,
}, nil
}
type networkInterface struct {
Address string `json:"addr"`
Version float64 `json:"version"`
Expand All @@ -442,9 +447,7 @@ func getIPsFromInstance(instance *clients.Instance) (map[string]string, error) {
var netInterface networkInterface
b, _ := json.Marshal(network)
json.Unmarshal(b, &netInterface)
if netInterface.Version == 4.0 {
addrMap[networkName] = netInterface.Address
}
addrMap[networkName] = netInterface.Address
}
}
if len(addrMap) == 0 {
Expand Down