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 14, 2024
1 parent 877ba6d commit 55af943
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions controllers/oscmachine_vm_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,14 @@ func reconcileVm(ctx context.Context, clusterScope *scope.ClusterScope, machineS
Address: *privateIp,
},
)
// Expose Public IP if one is set
publicIp, ok := vm.GetPublicIpOk()
if 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 55af943

Please sign in to comment.