@@ -545,7 +545,7 @@ func TestAddIPToDNS(t *testing.T) {
545
545
expectedError : fmt .Errorf ("failed to create domain record of type A" ),
546
546
},
547
547
{
548
- name : "Success - If the machine is a control plane node and record already exists, update it" ,
548
+ name : "Success - If the machine is a control plane node and record already exists, leave it alone " ,
549
549
machineScope : & scope.MachineScope {
550
550
Machine : & clusterv1.Machine {
551
551
ObjectMeta : metav1.ObjectMeta {
@@ -612,13 +612,6 @@ func TestAddIPToDNS(t *testing.T) {
612
612
TTLSec : 30 ,
613
613
},
614
614
}, nil ).AnyTimes ()
615
- mockClient .EXPECT ().CreateDomainRecord (gomock .Any (), gomock .Any (), gomock .Any ()).Return (nil , nil ).AnyTimes ()
616
- mockClient .EXPECT ().UpdateDomainRecord (gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any ()).Return (& linodego.DomainRecord {
617
- ID : 1234 ,
618
- Type : "A" ,
619
- Name : "test-cluster" ,
620
- TTLSec : 30 ,
621
- }, nil ).AnyTimes ()
622
615
},
623
616
expectedError : nil ,
624
617
},
@@ -686,79 +679,6 @@ func TestAddIPToDNS(t *testing.T) {
686
679
},
687
680
expectedError : fmt .Errorf ("api error" ),
688
681
},
689
- {
690
- name : "Error - UpdateDomainRecord fails" ,
691
- machineScope : & scope.MachineScope {
692
- Machine : & clusterv1.Machine {
693
- ObjectMeta : metav1.ObjectMeta {
694
- Name : "test-machine" ,
695
- UID : "test-uid" ,
696
- Labels : map [string ]string {
697
- clusterv1 .MachineControlPlaneLabel : "true" ,
698
- },
699
- },
700
- },
701
- Cluster : & clusterv1.Cluster {
702
- ObjectMeta : metav1.ObjectMeta {
703
- Name : "test-cluster" ,
704
- UID : "test-uid" ,
705
- },
706
- },
707
- LinodeCluster : & infrav1alpha2.LinodeCluster {
708
- ObjectMeta : metav1.ObjectMeta {
709
- Name : "test-cluster" ,
710
- UID : "test-uid" ,
711
- },
712
- Spec : infrav1alpha2.LinodeClusterSpec {
713
- Network : infrav1alpha2.NetworkSpec {
714
- LoadBalancerType : "dns" ,
715
- DNSRootDomain : "lkedevs.net" ,
716
- DNSUniqueIdentifier : "test-hash" ,
717
- },
718
- },
719
- },
720
- LinodeMachine : & infrav1alpha2.LinodeMachine {
721
- ObjectMeta : metav1.ObjectMeta {
722
- Name : "test-machine" ,
723
- UID : "test-uid" ,
724
- },
725
- Spec : infrav1alpha2.LinodeMachineSpec {
726
- InstanceID : ptr .To (123 ),
727
- },
728
- Status : infrav1alpha2.LinodeMachineStatus {
729
- Addresses : []clusterv1.MachineAddress {
730
- {
731
- Type : "ExternalIP" ,
732
- Address : "10.10.10.10" ,
733
- },
734
- {
735
- Type : "ExternalIP" ,
736
- Address : "fd00::" ,
737
- },
738
- },
739
- },
740
- },
741
- },
742
- expects : func (mockClient * mock.MockLinodeClient ) {
743
- mockClient .EXPECT ().ListDomains (gomock .Any (), gomock .Any ()).Return ([]linodego.Domain {
744
- {
745
- ID : 1 ,
746
- Domain : "lkedevs.net" ,
747
- },
748
- }, nil ).AnyTimes ()
749
- mockClient .EXPECT ().ListDomainRecords (gomock .Any (), gomock .Any (), gomock .Any ()).Return ([]linodego.DomainRecord {
750
- {
751
- ID : 1234 ,
752
- Type : "A" ,
753
- Name : "test-cluster" ,
754
- TTLSec : 30 ,
755
- },
756
- }, nil ).AnyTimes ()
757
- mockClient .EXPECT ().CreateDomainRecord (gomock .Any (), gomock .Any (), gomock .Any ()).Return (nil , nil ).AnyTimes ()
758
- mockClient .EXPECT ().UpdateDomainRecord (gomock .Any (), gomock .Any (), gomock .Any (), gomock .Any ()).Return (nil , fmt .Errorf ("failed to update domain record of type A" )).AnyTimes ()
759
- },
760
- expectedError : fmt .Errorf ("failed to update domain record of type A" ),
761
- },
762
682
{
763
683
name : "Error - no public ip set" ,
764
684
machineScope : & scope.MachineScope {
0 commit comments