@@ -135,7 +135,7 @@ func TestReconcileMachinePhases(t *testing.T) {
135
135
return false
136
136
}
137
137
g .Expect (bootstrapConfig .GetOwnerReferences ()).To (HaveLen (1 ))
138
- g .Expect (bootstrapConfig .GetLabels ()[clusterv1 .ClusterNameLabel ]).To (BeEquivalentTo ("test-cluster" ))
138
+ g .Expect (bootstrapConfig .GetLabels ()[clusterv1 .ClusterNameLabel ]).To (Equal ("test-cluster" ))
139
139
return true
140
140
}, 10 * time .Second ).Should (BeTrue ())
141
141
@@ -145,7 +145,7 @@ func TestReconcileMachinePhases(t *testing.T) {
145
145
return false
146
146
}
147
147
g .Expect (infraMachine .GetOwnerReferences ()).To (HaveLen (1 ))
148
- g .Expect (infraMachine .GetLabels ()[clusterv1 .ClusterNameLabel ]).To (BeEquivalentTo ("test-cluster" ))
148
+ g .Expect (infraMachine .GetLabels ()[clusterv1 .ClusterNameLabel ]).To (Equal ("test-cluster" ))
149
149
return true
150
150
}, 10 * time .Second ).Should (BeTrue ())
151
151
})
@@ -726,11 +726,11 @@ func TestReconcileBootstrap(t *testing.T) {
726
726
expected : func (g * WithT , m * clusterv1.Machine ) {
727
727
g .Expect (m .Status .BootstrapReady ).To (BeTrue ())
728
728
g .Expect (m .Spec .Bootstrap .DataSecretName ).NotTo (BeNil ())
729
- g .Expect (* m .Spec .Bootstrap .DataSecretName ).To (ContainSubstring ("secret-data" ))
729
+ g .Expect (* m .Spec .Bootstrap .DataSecretName ).To (Equal ("secret-data" ))
730
730
},
731
731
},
732
732
{
733
- name : "bootstrap config ready but paused, it should reconcile and data should surface on the machine" ,
733
+ name : "bootstrap config ready and paused, it should reconcile and data should surface on the machine" ,
734
734
machine : defaultMachine .DeepCopy (),
735
735
bootstrapConfig : map [string ]interface {}{
736
736
"kind" : "GenericBootstrapConfig" ,
@@ -754,7 +754,7 @@ func TestReconcileBootstrap(t *testing.T) {
754
754
expected : func (g * WithT , m * clusterv1.Machine ) {
755
755
g .Expect (m .Status .BootstrapReady ).To (BeTrue ())
756
756
g .Expect (m .Spec .Bootstrap .DataSecretName ).NotTo (BeNil ())
757
- g .Expect (* m .Spec .Bootstrap .DataSecretName ).To (ContainSubstring ("secret-data" ))
757
+ g .Expect (* m .Spec .Bootstrap .DataSecretName ).To (Equal ("secret-data" ))
758
758
},
759
759
},
760
760
{
@@ -819,7 +819,7 @@ func TestReconcileBootstrap(t *testing.T) {
819
819
expectError : false ,
820
820
expected : func (g * WithT , m * clusterv1.Machine ) {
821
821
g .Expect (m .Status .BootstrapReady ).To (BeTrue ())
822
- g .Expect (* m .Spec .Bootstrap .DataSecretName ).To (BeEquivalentTo ("secret-data" ))
822
+ g .Expect (* m .Spec .Bootstrap .DataSecretName ).To (Equal ("secret-data" ))
823
823
},
824
824
},
825
825
}
@@ -896,7 +896,7 @@ func TestReconcileInfrastructure(t *testing.T) {
896
896
name string
897
897
machine * clusterv1.Machine
898
898
infraMachine map [string ]interface {}
899
- InfraMachineGetError error
899
+ infraMachineGetError error
900
900
expectResult ctrl.Result
901
901
expectError bool
902
902
expected func (g * WithT , m * clusterv1.Machine )
@@ -905,15 +905,15 @@ func TestReconcileInfrastructure(t *testing.T) {
905
905
name : "err reading infra machine (something different than not found), it should return error" ,
906
906
machine : defaultMachine .DeepCopy (),
907
907
infraMachine : nil ,
908
- InfraMachineGetError : errors .New ("some error" ),
908
+ infraMachineGetError : errors .New ("some error" ),
909
909
expectResult : ctrl.Result {},
910
910
expectError : true ,
911
911
},
912
912
{
913
913
name : "infra machine not found and infrastructure not yet ready, it should requeue" ,
914
914
machine : defaultMachine .DeepCopy (),
915
915
infraMachine : nil ,
916
- InfraMachineGetError : nil ,
916
+ infraMachineGetError : nil ,
917
917
expectResult : ctrl.Result {RequeueAfter : externalReadyWait },
918
918
expectError : false ,
919
919
expected : func (g * WithT , m * clusterv1.Machine ) {
@@ -949,7 +949,7 @@ func TestReconcileInfrastructure(t *testing.T) {
949
949
},
950
950
},
951
951
},
952
- InfraMachineGetError : nil ,
952
+ infraMachineGetError : nil ,
953
953
expectResult : ctrl.Result {},
954
954
expectError : false ,
955
955
expected : func (g * WithT , m * clusterv1.Machine ) {
@@ -976,7 +976,7 @@ func TestReconcileInfrastructure(t *testing.T) {
976
976
"ready" : true ,
977
977
},
978
978
},
979
- InfraMachineGetError : nil ,
979
+ infraMachineGetError : nil ,
980
980
expectResult : ctrl.Result {},
981
981
expectError : false ,
982
982
expected : func (g * WithT , m * clusterv1.Machine ) {
@@ -1004,7 +1004,7 @@ func TestReconcileInfrastructure(t *testing.T) {
1004
1004
"ready" : true ,
1005
1005
},
1006
1006
},
1007
- InfraMachineGetError : nil ,
1007
+ infraMachineGetError : nil ,
1008
1008
expectResult : ctrl.Result {},
1009
1009
expectError : false ,
1010
1010
expected : func (g * WithT , m * clusterv1.Machine ) {
@@ -1041,14 +1041,14 @@ func TestReconcileInfrastructure(t *testing.T) {
1041
1041
},
1042
1042
},
1043
1043
},
1044
- InfraMachineGetError : nil ,
1044
+ infraMachineGetError : nil ,
1045
1045
expectResult : ctrl.Result {},
1046
1046
expectError : false ,
1047
1047
expected : func (g * WithT , m * clusterv1.Machine ) {
1048
1048
g .Expect (m .Status .InfrastructureReady ).To (BeTrue ())
1049
1049
g .Expect (ptr .Deref (m .Spec .ProviderID , "" )).To (Equal ("test://id-1" ))
1050
1050
g .Expect (m .Spec .FailureDomain ).To (BeNil ())
1051
- g .Expect (m .Status .Addresses ).ToNot ( BeNil ( ))
1051
+ g .Expect (m .Status .Addresses ).To ( HaveLen ( 2 ))
1052
1052
},
1053
1053
},
1054
1054
{
@@ -1079,18 +1079,18 @@ func TestReconcileInfrastructure(t *testing.T) {
1079
1079
},
1080
1080
},
1081
1081
},
1082
- InfraMachineGetError : nil ,
1082
+ infraMachineGetError : nil ,
1083
1083
expectResult : ctrl.Result {},
1084
1084
expectError : false ,
1085
1085
expected : func (g * WithT , m * clusterv1.Machine ) {
1086
1086
g .Expect (m .Status .InfrastructureReady ).To (BeTrue ())
1087
1087
g .Expect (ptr .Deref (m .Spec .ProviderID , "" )).To (Equal ("test://id-1" ))
1088
1088
g .Expect (ptr .Deref (m .Spec .FailureDomain , "" )).To (Equal ("foo" ))
1089
- g .Expect (m .Status .Addresses ).ToNot ( BeNil ( ))
1089
+ g .Expect (m .Status .Addresses ).To ( HaveLen ( 2 ))
1090
1090
},
1091
1091
},
1092
1092
{
1093
- name : "infra machine ready but paused, it should reconcile but no data should surface on the machine" ,
1093
+ name : "infra machine ready and paused, it should reconcile and no data should surface on the machine" ,
1094
1094
machine : defaultMachine .DeepCopy (),
1095
1095
infraMachine : map [string ]interface {}{
1096
1096
"kind" : "GenericInfrastructureMachine" ,
@@ -1120,14 +1120,14 @@ func TestReconcileInfrastructure(t *testing.T) {
1120
1120
},
1121
1121
},
1122
1122
},
1123
- InfraMachineGetError : nil ,
1123
+ infraMachineGetError : nil ,
1124
1124
expectResult : ctrl.Result {},
1125
1125
expectError : false ,
1126
1126
expected : func (g * WithT , m * clusterv1.Machine ) {
1127
1127
g .Expect (m .Status .InfrastructureReady ).To (BeTrue ())
1128
1128
g .Expect (ptr .Deref (m .Spec .ProviderID , "" )).To (Equal ("test://id-1" ))
1129
1129
g .Expect (ptr .Deref (m .Spec .FailureDomain , "" )).To (Equal ("foo" ))
1130
- g .Expect (m .Status .Addresses ).ToNot ( BeNil ( ))
1130
+ g .Expect (m .Status .Addresses ).To ( HaveLen ( 2 ))
1131
1131
},
1132
1132
},
1133
1133
{
@@ -1145,7 +1145,7 @@ func TestReconcileInfrastructure(t *testing.T) {
1145
1145
"ready" : true ,
1146
1146
},
1147
1147
},
1148
- InfraMachineGetError : nil ,
1148
+ infraMachineGetError : nil ,
1149
1149
expectResult : ctrl.Result {},
1150
1150
expectError : true ,
1151
1151
},
@@ -1200,7 +1200,7 @@ func TestReconcileInfrastructure(t *testing.T) {
1200
1200
},
1201
1201
},
1202
1202
},
1203
- InfraMachineGetError : nil ,
1203
+ infraMachineGetError : nil ,
1204
1204
expectResult : ctrl.Result {},
1205
1205
expectError : false ,
1206
1206
expected : func (g * WithT , m * clusterv1.Machine ) {
@@ -1261,7 +1261,7 @@ func TestReconcileInfrastructure(t *testing.T) {
1261
1261
},
1262
1262
},
1263
1263
},
1264
- InfraMachineGetError : nil ,
1264
+ infraMachineGetError : nil ,
1265
1265
expectResult : ctrl.Result {},
1266
1266
expectError : false ,
1267
1267
expected : func (g * WithT , m * clusterv1.Machine ) {
@@ -1290,7 +1290,7 @@ func TestReconcileInfrastructure(t *testing.T) {
1290
1290
},
1291
1291
},
1292
1292
infraMachine : nil ,
1293
- InfraMachineGetError : errors .New ("some error" ),
1293
+ infraMachineGetError : errors .New ("some error" ),
1294
1294
expectResult : ctrl.Result {},
1295
1295
expectError : true ,
1296
1296
expected : func (g * WithT , m * clusterv1.Machine ) {
@@ -1318,7 +1318,7 @@ func TestReconcileInfrastructure(t *testing.T) {
1318
1318
},
1319
1319
},
1320
1320
infraMachine : nil ,
1321
- InfraMachineGetError : nil ,
1321
+ infraMachineGetError : nil ,
1322
1322
expectResult : ctrl.Result {},
1323
1323
expectError : true ,
1324
1324
expected : func (g * WithT , m * clusterv1.Machine ) {
@@ -1340,7 +1340,7 @@ func TestReconcileInfrastructure(t *testing.T) {
1340
1340
c := fake .NewClientBuilder ().
1341
1341
WithObjects (tc .machine ).Build ()
1342
1342
1343
- if tc .InfraMachineGetError == nil {
1343
+ if tc .infraMachineGetError == nil {
1344
1344
g .Expect (c .Create (ctx , builder .GenericInfrastructureMachineCRD .DeepCopy ())).To (Succeed ())
1345
1345
}
1346
1346
0 commit comments