@@ -196,7 +196,7 @@ func TestInstanceIfExists(t *testing.T) {
196
196
s := NewService (scope )
197
197
s .EC2Client = ec2Mock
198
198
199
- instance , err := s .InstanceIfExists (& tc .instanceID )
199
+ instance , err := s .InstanceIfExists (aws . String ( tc .instanceID ) )
200
200
tc .check (instance , err )
201
201
})
202
202
}
@@ -298,15 +298,15 @@ func TestCreateInstance(t *testing.T) {
298
298
299
299
testcases := []struct {
300
300
name string
301
- machine clusterv1.Machine
301
+ machine * clusterv1.Machine
302
302
machineConfig * infrav1.AWSMachineSpec
303
303
awsCluster * infrav1.AWSCluster
304
304
expect func (m * mocks.MockEC2APIMockRecorder )
305
305
check func (instance * infrav1.Instance , err error )
306
306
}{
307
307
{
308
308
name : "simple" ,
309
- machine : clusterv1.Machine {
309
+ machine : & clusterv1.Machine {
310
310
ObjectMeta : metav1.ObjectMeta {
311
311
Labels : map [string ]string {"set" : "node" },
312
312
},
@@ -419,7 +419,7 @@ func TestCreateInstance(t *testing.T) {
419
419
},
420
420
{
421
421
name : "with availability zone" ,
422
- machine : clusterv1.Machine {
422
+ machine : & clusterv1.Machine {
423
423
ObjectMeta : metav1.ObjectMeta {
424
424
Labels : map [string ]string {"set" : "node" },
425
425
},
@@ -550,7 +550,7 @@ func TestCreateInstance(t *testing.T) {
550
550
},
551
551
{
552
552
name : "with ImageLookupOrg specified at the machine level" ,
553
- machine : clusterv1.Machine {
553
+ machine : & clusterv1.Machine {
554
554
ObjectMeta : metav1.ObjectMeta {
555
555
Labels : map [string ]string {"set" : "node" },
556
556
},
@@ -700,7 +700,7 @@ func TestCreateInstance(t *testing.T) {
700
700
},
701
701
{
702
702
name : "with ImageLookupOrg specified at the cluster-level" ,
703
- machine : clusterv1.Machine {
703
+ machine : & clusterv1.Machine {
704
704
ObjectMeta : metav1.ObjectMeta {
705
705
Labels : map [string ]string {"set" : "node" },
706
706
},
@@ -850,7 +850,7 @@ func TestCreateInstance(t *testing.T) {
850
850
},
851
851
{
852
852
name : "AWSMachine ImageLookupOrg overrides AWSCluster ImageLookupOrg" ,
853
- machine : clusterv1.Machine {
853
+ machine : & clusterv1.Machine {
854
854
ObjectMeta : metav1.ObjectMeta {
855
855
Labels : map [string ]string {"set" : "node" },
856
856
},
@@ -1001,7 +1001,7 @@ func TestCreateInstance(t *testing.T) {
1001
1001
},
1002
1002
{
1003
1003
name : "subnet filter and failureDomain defined" ,
1004
- machine : clusterv1.Machine {
1004
+ machine : & clusterv1.Machine {
1005
1005
ObjectMeta : metav1.ObjectMeta {
1006
1006
Labels : map [string ]string {"set" : "node" },
1007
1007
},
@@ -1129,7 +1129,7 @@ func TestCreateInstance(t *testing.T) {
1129
1129
},
1130
1130
{
1131
1131
name : "with subnet ID that belongs to Cluster" ,
1132
- machine : clusterv1.Machine {
1132
+ machine : & clusterv1.Machine {
1133
1133
ObjectMeta : metav1.ObjectMeta {
1134
1134
Labels : map [string ]string {"set" : "node" },
1135
1135
},
@@ -1256,7 +1256,7 @@ func TestCreateInstance(t *testing.T) {
1256
1256
},
1257
1257
{
1258
1258
name : "with subnet ID that does not exist" ,
1259
- machine : clusterv1.Machine {
1259
+ machine : & clusterv1.Machine {
1260
1260
ObjectMeta : metav1.ObjectMeta {
1261
1261
Labels : map [string ]string {"set" : "node" },
1262
1262
},
@@ -1349,7 +1349,7 @@ func TestCreateInstance(t *testing.T) {
1349
1349
},
1350
1350
{
1351
1351
name : "with subnet ID that does not belong to Cluster" ,
1352
- machine : clusterv1.Machine {
1352
+ machine : & clusterv1.Machine {
1353
1353
ObjectMeta : metav1.ObjectMeta {
1354
1354
Labels : map [string ]string {"set" : "node" },
1355
1355
},
@@ -1475,7 +1475,7 @@ func TestCreateInstance(t *testing.T) {
1475
1475
},
1476
1476
{
1477
1477
name : "subnet id and failureDomain don't match" ,
1478
- machine : clusterv1.Machine {
1478
+ machine : & clusterv1.Machine {
1479
1479
ObjectMeta : metav1.ObjectMeta {
1480
1480
Labels : map [string ]string {"set" : "node" },
1481
1481
},
@@ -1573,7 +1573,7 @@ func TestCreateInstance(t *testing.T) {
1573
1573
},
1574
1574
{
1575
1575
name : "public IP true and failureDomain doesn't have public subnet" ,
1576
- machine : clusterv1.Machine {
1576
+ machine : & clusterv1.Machine {
1577
1577
ObjectMeta : metav1.ObjectMeta {
1578
1578
Labels : map [string ]string {"set" : "node" },
1579
1579
},
@@ -1656,7 +1656,7 @@ func TestCreateInstance(t *testing.T) {
1656
1656
},
1657
1657
{
1658
1658
name : "public IP true and public subnet ID given" ,
1659
- machine : clusterv1.Machine {
1659
+ machine : & clusterv1.Machine {
1660
1660
ObjectMeta : metav1.ObjectMeta {
1661
1661
Labels : map [string ]string {"set" : "node" },
1662
1662
},
@@ -1786,7 +1786,7 @@ func TestCreateInstance(t *testing.T) {
1786
1786
},
1787
1787
{
1788
1788
name : "public IP true and private subnet ID given" ,
1789
- machine : clusterv1.Machine {
1789
+ machine : & clusterv1.Machine {
1790
1790
ObjectMeta : metav1.ObjectMeta {
1791
1791
Labels : map [string ]string {"set" : "node" },
1792
1792
},
@@ -1885,7 +1885,7 @@ func TestCreateInstance(t *testing.T) {
1885
1885
},
1886
1886
{
1887
1887
name : "both public IP and subnet filter defined" ,
1888
- machine : clusterv1.Machine {
1888
+ machine : & clusterv1.Machine {
1889
1889
ObjectMeta : metav1.ObjectMeta {
1890
1890
Labels : map [string ]string {"set" : "node" },
1891
1891
},
@@ -2023,7 +2023,7 @@ func TestCreateInstance(t *testing.T) {
2023
2023
},
2024
2024
{
2025
2025
name : "public IP true and public subnet exists" ,
2026
- machine : clusterv1.Machine {
2026
+ machine : & clusterv1.Machine {
2027
2027
ObjectMeta : metav1.ObjectMeta {
2028
2028
Labels : map [string ]string {"set" : "node" },
2029
2029
},
@@ -2141,7 +2141,7 @@ func TestCreateInstance(t *testing.T) {
2141
2141
},
2142
2142
{
2143
2143
name : "public IP true and no public subnet exists" ,
2144
- machine : clusterv1.Machine {
2144
+ machine : & clusterv1.Machine {
2145
2145
ObjectMeta : metav1.ObjectMeta {
2146
2146
Labels : map [string ]string {"set" : "node" },
2147
2147
},
@@ -2224,7 +2224,7 @@ func TestCreateInstance(t *testing.T) {
2224
2224
},
2225
2225
{
2226
2226
name : "with multiple block device mappings" ,
2227
- machine : clusterv1.Machine {
2227
+ machine : & clusterv1.Machine {
2228
2228
ObjectMeta : metav1.ObjectMeta {
2229
2229
Labels : map [string ]string {"set" : "node" },
2230
2230
},
@@ -2347,7 +2347,7 @@ func TestCreateInstance(t *testing.T) {
2347
2347
},
2348
2348
{
2349
2349
name : "with dedicated tenancy cloud-config" ,
2350
- machine : clusterv1.Machine {
2350
+ machine : & clusterv1.Machine {
2351
2351
ObjectMeta : metav1.ObjectMeta {
2352
2352
Labels : map [string ]string {"set" : "node" },
2353
2353
Namespace : "default" ,
@@ -2503,7 +2503,7 @@ func TestCreateInstance(t *testing.T) {
2503
2503
},
2504
2504
{
2505
2505
name : "with custom placement group cloud-config" ,
2506
- machine : clusterv1.Machine {
2506
+ machine : & clusterv1.Machine {
2507
2507
ObjectMeta : metav1.ObjectMeta {
2508
2508
Labels : map [string ]string {"set" : "node" },
2509
2509
Namespace : "default" ,
@@ -2659,7 +2659,7 @@ func TestCreateInstance(t *testing.T) {
2659
2659
},
2660
2660
{
2661
2661
name : "with dedicated tenancy and placement group ignition" ,
2662
- machine : clusterv1.Machine {
2662
+ machine : & clusterv1.Machine {
2663
2663
ObjectMeta : metav1.ObjectMeta {
2664
2664
Labels : map [string ]string {"set" : "node" },
2665
2665
Namespace : "default" ,
@@ -2819,7 +2819,7 @@ func TestCreateInstance(t *testing.T) {
2819
2819
},
2820
2820
{
2821
2821
name : "expect the default SSH key when none is provided" ,
2822
- machine : clusterv1.Machine {
2822
+ machine : & clusterv1.Machine {
2823
2823
ObjectMeta : metav1.ObjectMeta {
2824
2824
Labels : map [string ]string {"set" : "node" },
2825
2825
},
@@ -2948,7 +2948,7 @@ func TestCreateInstance(t *testing.T) {
2948
2948
},
2949
2949
{
2950
2950
name : "expect to use the cluster level ssh key name when no machine key name is provided" ,
2951
- machine : clusterv1.Machine {
2951
+ machine : & clusterv1.Machine {
2952
2952
ObjectMeta : metav1.ObjectMeta {
2953
2953
Labels : map [string ]string {"set" : "node" },
2954
2954
},
@@ -3078,7 +3078,7 @@ func TestCreateInstance(t *testing.T) {
3078
3078
},
3079
3079
{
3080
3080
name : "expect to use the machine level ssh key name when both cluster and machine key names are provided" ,
3081
- machine : clusterv1.Machine {
3081
+ machine : & clusterv1.Machine {
3082
3082
ObjectMeta : metav1.ObjectMeta {
3083
3083
Labels : map [string ]string {"set" : "node" },
3084
3084
},
@@ -3209,7 +3209,7 @@ func TestCreateInstance(t *testing.T) {
3209
3209
},
3210
3210
{
3211
3211
name : "expect ssh key to be unset when cluster key name is empty string and machine key name is nil" ,
3212
- machine : clusterv1.Machine {
3212
+ machine : & clusterv1.Machine {
3213
3213
ObjectMeta : metav1.ObjectMeta {
3214
3214
Labels : map [string ]string {"set" : "node" },
3215
3215
},
@@ -3337,7 +3337,7 @@ func TestCreateInstance(t *testing.T) {
3337
3337
},
3338
3338
{
3339
3339
name : "expect ssh key to be unset when cluster key name is empty string and machine key name is empty string" ,
3340
- machine : clusterv1.Machine {
3340
+ machine : & clusterv1.Machine {
3341
3341
ObjectMeta : metav1.ObjectMeta {
3342
3342
Labels : map [string ]string {"set" : "node" },
3343
3343
},
@@ -3465,7 +3465,7 @@ func TestCreateInstance(t *testing.T) {
3465
3465
},
3466
3466
{
3467
3467
name : "expect ssh key to be unset when cluster key name is nil and machine key name is empty string" ,
3468
- machine : clusterv1.Machine {
3468
+ machine : & clusterv1.Machine {
3469
3469
ObjectMeta : metav1.ObjectMeta {
3470
3470
Labels : map [string ]string {"set" : "node" },
3471
3471
},
@@ -3620,7 +3620,7 @@ func TestCreateInstance(t *testing.T) {
3620
3620
},
3621
3621
}
3622
3622
3623
- machine := & tc .machine
3623
+ machine := tc .machine
3624
3624
3625
3625
awsMachine := & infrav1.AWSMachine {
3626
3626
ObjectMeta : metav1.ObjectMeta {
0 commit comments