Skip to content
Merged
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
8 changes: 8 additions & 0 deletions controllers/openstackmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,14 @@ func (r *OpenStackMachineReconciler) reconcileNormal(ctx context.Context, scope
}

addresses := instanceNS.Addresses()

// For OpenShift and likely other systems, a node joins the cluster if the CSR generated by kubelet with the node name is approved.
// The approval happens if the Machine InternalDNS matches the node name. The in-tree provider used the server name for the node name.
// Let's add the server name as the InternalDNS to keep getting CSRs of nodes upgraded from in-tree provider approved.
addresses = append(addresses, corev1.NodeAddress{
Type: corev1.NodeInternalDNS,
Address: instanceStatus.Name(),
})
openStackMachine.Status.Addresses = addresses

switch instanceStatus.State() {
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/suites/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,12 @@ var _ = Describe("e2e tests [PR-Blocking]", func() {

// All IP addresses on all ports should be reported in Addresses
Expect(machine.Status.Addresses).To(ContainElements(seenAddresses))

// Expect an InternalDNS entry matching the name of the OpenStack server
Expect(machine.Status.Addresses).To(ContainElement(clusterv1.MachineAddress{
Type: clusterv1.MachineInternalDNS,
Address: machine.Spec.InfrastructureRef.Name,
}))
}
})
})
Expand Down