@@ -458,6 +458,13 @@ func TestRegistrationMsgGet(t *testing.T) {
458458 wantRawResponse : false ,
459459 wantMessageType : register .MsgError ,
460460 },
461+ {
462+ name : "returns MsgError if mregistration status has no URL" ,
463+ machineName : "machine-3" ,
464+ protoVersion : register .MsgError ,
465+ wantRawResponse : false ,
466+ wantMessageType : register .MsgError ,
467+ },
461468 }
462469
463470 server := NewInventoryServer (& FakeAuthServer {})
@@ -473,6 +480,7 @@ func TestRegistrationMsgGet(t *testing.T) {
473480 ServiceAccountRef : & v1.ObjectReference {
474481 Name : "test-account" ,
475482 },
483+ RegistrationURL : "https://example.machine-1.org" ,
476484 RegistrationToken : "machine-1" ,
477485 Conditions : []metav1.Condition {
478486 {
@@ -494,6 +502,7 @@ func TestRegistrationMsgGet(t *testing.T) {
494502 ServiceAccountRef : & v1.ObjectReference {
495503 Name : "test-account" ,
496504 },
505+ RegistrationURL : "https://example.machine-2.org" ,
497506 RegistrationToken : "machine-2" ,
498507 Conditions : []metav1.Condition {
499508 {
@@ -504,6 +513,27 @@ func TestRegistrationMsgGet(t *testing.T) {
504513 },
505514 })
506515
516+ server .Client .Create (context .Background (), & elementalv1.MachineRegistration {
517+ ObjectMeta : metav1.ObjectMeta {
518+ Name : "machine-3" ,
519+ },
520+ Spec : elementalv1.MachineRegistrationSpec {
521+ MachineName : "machine-3" ,
522+ },
523+ Status : elementalv1.MachineRegistrationStatus {
524+ ServiceAccountRef : & v1.ObjectReference {
525+ Name : "test-account" ,
526+ },
527+ RegistrationToken : "machine-3" ,
528+ Conditions : []metav1.Condition {
529+ {
530+ Type : "Ready" ,
531+ Status : "True" ,
532+ },
533+ },
534+ },
535+ })
536+
507537 createDefaultResources (t , server )
508538
509539 wsServer := httptest .NewServer (server )
0 commit comments