Skip to content

Commit

Permalink
Expose PublicIp for Node
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Dufour <[email protected]>
  • Loading branch information
outscale-mdr committed Mar 15, 2024
1 parent 877ba6d commit 173c0cf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions controllers/oscmachine_vm_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,13 @@ func reconcileVm(ctx context.Context, clusterScope *scope.ClusterScope, machineS
Address: *privateIp,
},
)
// Expose Public IP if one is set
if publicIp, ok := vm.GetPublicIpOk(); ok {
addresses = append(addresses, corev1.NodeAddress{
Type: corev1.NodeExternalIP,
Address: *publicIp,
})
}
machineScope.SetAddresses(addresses)
err = vmSvc.AddCcmTag(clusterName, *privateDnsName, vmId)
if err != nil {
Expand Down

0 comments on commit 173c0cf

Please sign in to comment.