Skip to content

Commit fe90097

Browse files
tchinmai7eljohnson92
authored andcommitted
chore: fix nil pointer deref in tests
1 parent c701b95 commit fe90097

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

cloud/services/domains_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ func TestAddIPToDNS(t *testing.T) {
462462
// This machine's CAPI owner is NOT ready, and should NOT have DNS entries
463463
ObjectMeta: metav1.ObjectMeta{
464464
Name: "test-not-ready-machine",
465-
UID: "test-uid-2",
465+
UID: "test-uid-3",
466466
OwnerReferences: []metav1.OwnerReference{
467467
{
468468
APIVersion: "cluster.x-k8s.io/v1beta1",
@@ -556,10 +556,12 @@ func TestAddIPToDNS(t *testing.T) {
556556
machine.Namespace = "default"
557557
machine.UID = "test-uid-2"
558558
machine.DeletionTimestamp = nil
559-
machine.Status.V1Beta2.Conditions = []metav1.Condition{
560-
{
561-
Type: clusterv1.ReadyV1Beta2Condition,
562-
Status: metav1.ConditionTrue,
559+
machine.Status.V1Beta2 = &clusterv1.MachineV1Beta2Status{
560+
Conditions: []metav1.Condition{
561+
{
562+
Type: clusterv1.ReadyV1Beta2Condition,
563+
Status: metav1.ConditionTrue,
564+
},
563565
},
564566
}
565567
case "test-not-ready-machine":

0 commit comments

Comments
 (0)