Skip to content

Commit

Permalink
fix ip type setting for addresses on machine controller
Browse files Browse the repository at this point in the history
  • Loading branch information
AshleyDumaine committed Mar 1, 2024
1 parent dc5ffcf commit 848ff2b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions controller/linodemachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,14 @@ func (r *LinodeMachineReconciler) reconcileCreate(
machineScope.LinodeMachine.Spec.ProviderID = util.Pointer(fmt.Sprintf("linode://%d", linodeInstance.ID))

machineScope.LinodeMachine.Status.Addresses = []clusterv1.MachineAddress{}
for _, add := range linodeInstance.IPv4 {
for _, addr := range linodeInstance.IPv4 {
addrType := clusterv1.MachineExternalIP
if addr.IsPrivate() {
addrType = clusterv1.MachineInternalIP
}
machineScope.LinodeMachine.Status.Addresses = append(machineScope.LinodeMachine.Status.Addresses, clusterv1.MachineAddress{
Type: clusterv1.MachineExternalIP,
Address: add.String(),
Type: addrType,
Address: addr.String(),
})
}

Expand Down

0 comments on commit 848ff2b

Please sign in to comment.