Skip to content

Commit 6ca0be6

Browse files
authored
Merge pull request #1715 from shiftstack/add-internal-dns
✨ Add server name for the Machine InternalDNS
2 parents 7be83b8 + de8aaa4 commit 6ca0be6

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

controllers/openstackmachine_controller.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,14 @@ func (r *OpenStackMachineReconciler) reconcileNormal(ctx context.Context, scope
348348
}
349349

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

353361
switch instanceStatus.State() {

test/e2e/suites/e2e/e2e_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,12 @@ var _ = Describe("e2e tests [PR-Blocking]", func() {
415415

416416
// All IP addresses on all ports should be reported in Addresses
417417
Expect(machine.Status.Addresses).To(ContainElements(seenAddresses))
418+
419+
// Expect an InternalDNS entry matching the name of the OpenStack server
420+
Expect(machine.Status.Addresses).To(ContainElement(clusterv1.MachineAddress{
421+
Type: clusterv1.MachineInternalDNS,
422+
Address: machine.Spec.InfrastructureRef.Name,
423+
}))
418424
}
419425
})
420426
})

0 commit comments

Comments
 (0)