@@ -196,7 +196,7 @@ func TestInstanceIfExists(t *testing.T) {
196196 s := NewService (scope )
197197 s .EC2Client = ec2Mock
198198
199- instance , err := s .InstanceIfExists (& tc .instanceID )
199+ instance , err := s .InstanceIfExists (aws . String ( tc .instanceID ) )
200200 tc .check (instance , err )
201201 })
202202 }
@@ -298,15 +298,15 @@ func TestCreateInstance(t *testing.T) {
298298
299299 testcases := []struct {
300300 name string
301- machine clusterv1.Machine
301+ machine * clusterv1.Machine
302302 machineConfig * infrav1.AWSMachineSpec
303303 awsCluster * infrav1.AWSCluster
304304 expect func (m * mocks.MockEC2APIMockRecorder )
305305 check func (instance * infrav1.Instance , err error )
306306 }{
307307 {
308308 name : "simple" ,
309- machine : clusterv1.Machine {
309+ machine : & clusterv1.Machine {
310310 ObjectMeta : metav1.ObjectMeta {
311311 Labels : map [string ]string {"set" : "node" },
312312 },
@@ -419,7 +419,7 @@ func TestCreateInstance(t *testing.T) {
419419 },
420420 {
421421 name : "with availability zone" ,
422- machine : clusterv1.Machine {
422+ machine : & clusterv1.Machine {
423423 ObjectMeta : metav1.ObjectMeta {
424424 Labels : map [string ]string {"set" : "node" },
425425 },
@@ -550,7 +550,7 @@ func TestCreateInstance(t *testing.T) {
550550 },
551551 {
552552 name : "with ImageLookupOrg specified at the machine level" ,
553- machine : clusterv1.Machine {
553+ machine : & clusterv1.Machine {
554554 ObjectMeta : metav1.ObjectMeta {
555555 Labels : map [string ]string {"set" : "node" },
556556 },
@@ -700,7 +700,7 @@ func TestCreateInstance(t *testing.T) {
700700 },
701701 {
702702 name : "with ImageLookupOrg specified at the cluster-level" ,
703- machine : clusterv1.Machine {
703+ machine : & clusterv1.Machine {
704704 ObjectMeta : metav1.ObjectMeta {
705705 Labels : map [string ]string {"set" : "node" },
706706 },
@@ -850,7 +850,7 @@ func TestCreateInstance(t *testing.T) {
850850 },
851851 {
852852 name : "AWSMachine ImageLookupOrg overrides AWSCluster ImageLookupOrg" ,
853- machine : clusterv1.Machine {
853+ machine : & clusterv1.Machine {
854854 ObjectMeta : metav1.ObjectMeta {
855855 Labels : map [string ]string {"set" : "node" },
856856 },
@@ -1001,7 +1001,7 @@ func TestCreateInstance(t *testing.T) {
10011001 },
10021002 {
10031003 name : "subnet filter and failureDomain defined" ,
1004- machine : clusterv1.Machine {
1004+ machine : & clusterv1.Machine {
10051005 ObjectMeta : metav1.ObjectMeta {
10061006 Labels : map [string ]string {"set" : "node" },
10071007 },
@@ -1129,7 +1129,7 @@ func TestCreateInstance(t *testing.T) {
11291129 },
11301130 {
11311131 name : "with subnet ID that belongs to Cluster" ,
1132- machine : clusterv1.Machine {
1132+ machine : & clusterv1.Machine {
11331133 ObjectMeta : metav1.ObjectMeta {
11341134 Labels : map [string ]string {"set" : "node" },
11351135 },
@@ -1256,7 +1256,7 @@ func TestCreateInstance(t *testing.T) {
12561256 },
12571257 {
12581258 name : "with subnet ID that does not exist" ,
1259- machine : clusterv1.Machine {
1259+ machine : & clusterv1.Machine {
12601260 ObjectMeta : metav1.ObjectMeta {
12611261 Labels : map [string ]string {"set" : "node" },
12621262 },
@@ -1349,7 +1349,7 @@ func TestCreateInstance(t *testing.T) {
13491349 },
13501350 {
13511351 name : "with subnet ID that does not belong to Cluster" ,
1352- machine : clusterv1.Machine {
1352+ machine : & clusterv1.Machine {
13531353 ObjectMeta : metav1.ObjectMeta {
13541354 Labels : map [string ]string {"set" : "node" },
13551355 },
@@ -1475,7 +1475,7 @@ func TestCreateInstance(t *testing.T) {
14751475 },
14761476 {
14771477 name : "subnet id and failureDomain don't match" ,
1478- machine : clusterv1.Machine {
1478+ machine : & clusterv1.Machine {
14791479 ObjectMeta : metav1.ObjectMeta {
14801480 Labels : map [string ]string {"set" : "node" },
14811481 },
@@ -1573,7 +1573,7 @@ func TestCreateInstance(t *testing.T) {
15731573 },
15741574 {
15751575 name : "public IP true and failureDomain doesn't have public subnet" ,
1576- machine : clusterv1.Machine {
1576+ machine : & clusterv1.Machine {
15771577 ObjectMeta : metav1.ObjectMeta {
15781578 Labels : map [string ]string {"set" : "node" },
15791579 },
@@ -1656,7 +1656,7 @@ func TestCreateInstance(t *testing.T) {
16561656 },
16571657 {
16581658 name : "public IP true and public subnet ID given" ,
1659- machine : clusterv1.Machine {
1659+ machine : & clusterv1.Machine {
16601660 ObjectMeta : metav1.ObjectMeta {
16611661 Labels : map [string ]string {"set" : "node" },
16621662 },
@@ -1786,7 +1786,7 @@ func TestCreateInstance(t *testing.T) {
17861786 },
17871787 {
17881788 name : "public IP true and private subnet ID given" ,
1789- machine : clusterv1.Machine {
1789+ machine : & clusterv1.Machine {
17901790 ObjectMeta : metav1.ObjectMeta {
17911791 Labels : map [string ]string {"set" : "node" },
17921792 },
@@ -1885,7 +1885,7 @@ func TestCreateInstance(t *testing.T) {
18851885 },
18861886 {
18871887 name : "both public IP and subnet filter defined" ,
1888- machine : clusterv1.Machine {
1888+ machine : & clusterv1.Machine {
18891889 ObjectMeta : metav1.ObjectMeta {
18901890 Labels : map [string ]string {"set" : "node" },
18911891 },
@@ -2023,7 +2023,7 @@ func TestCreateInstance(t *testing.T) {
20232023 },
20242024 {
20252025 name : "public IP true and public subnet exists" ,
2026- machine : clusterv1.Machine {
2026+ machine : & clusterv1.Machine {
20272027 ObjectMeta : metav1.ObjectMeta {
20282028 Labels : map [string ]string {"set" : "node" },
20292029 },
@@ -2141,7 +2141,7 @@ func TestCreateInstance(t *testing.T) {
21412141 },
21422142 {
21432143 name : "public IP true and no public subnet exists" ,
2144- machine : clusterv1.Machine {
2144+ machine : & clusterv1.Machine {
21452145 ObjectMeta : metav1.ObjectMeta {
21462146 Labels : map [string ]string {"set" : "node" },
21472147 },
@@ -2224,7 +2224,7 @@ func TestCreateInstance(t *testing.T) {
22242224 },
22252225 {
22262226 name : "with multiple block device mappings" ,
2227- machine : clusterv1.Machine {
2227+ machine : & clusterv1.Machine {
22282228 ObjectMeta : metav1.ObjectMeta {
22292229 Labels : map [string ]string {"set" : "node" },
22302230 },
@@ -2347,7 +2347,7 @@ func TestCreateInstance(t *testing.T) {
23472347 },
23482348 {
23492349 name : "with dedicated tenancy cloud-config" ,
2350- machine : clusterv1.Machine {
2350+ machine : & clusterv1.Machine {
23512351 ObjectMeta : metav1.ObjectMeta {
23522352 Labels : map [string ]string {"set" : "node" },
23532353 Namespace : "default" ,
@@ -2503,7 +2503,7 @@ func TestCreateInstance(t *testing.T) {
25032503 },
25042504 {
25052505 name : "with custom placement group cloud-config" ,
2506- machine : clusterv1.Machine {
2506+ machine : & clusterv1.Machine {
25072507 ObjectMeta : metav1.ObjectMeta {
25082508 Labels : map [string ]string {"set" : "node" },
25092509 Namespace : "default" ,
@@ -2659,7 +2659,7 @@ func TestCreateInstance(t *testing.T) {
26592659 },
26602660 {
26612661 name : "with dedicated tenancy and placement group ignition" ,
2662- machine : clusterv1.Machine {
2662+ machine : & clusterv1.Machine {
26632663 ObjectMeta : metav1.ObjectMeta {
26642664 Labels : map [string ]string {"set" : "node" },
26652665 Namespace : "default" ,
@@ -2819,7 +2819,7 @@ func TestCreateInstance(t *testing.T) {
28192819 },
28202820 {
28212821 name : "expect the default SSH key when none is provided" ,
2822- machine : clusterv1.Machine {
2822+ machine : & clusterv1.Machine {
28232823 ObjectMeta : metav1.ObjectMeta {
28242824 Labels : map [string ]string {"set" : "node" },
28252825 },
@@ -2948,7 +2948,7 @@ func TestCreateInstance(t *testing.T) {
29482948 },
29492949 {
29502950 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 {
29522952 ObjectMeta : metav1.ObjectMeta {
29532953 Labels : map [string ]string {"set" : "node" },
29542954 },
@@ -3078,7 +3078,7 @@ func TestCreateInstance(t *testing.T) {
30783078 },
30793079 {
30803080 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 {
30823082 ObjectMeta : metav1.ObjectMeta {
30833083 Labels : map [string ]string {"set" : "node" },
30843084 },
@@ -3209,7 +3209,7 @@ func TestCreateInstance(t *testing.T) {
32093209 },
32103210 {
32113211 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 {
32133213 ObjectMeta : metav1.ObjectMeta {
32143214 Labels : map [string ]string {"set" : "node" },
32153215 },
@@ -3337,7 +3337,7 @@ func TestCreateInstance(t *testing.T) {
33373337 },
33383338 {
33393339 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 {
33413341 ObjectMeta : metav1.ObjectMeta {
33423342 Labels : map [string ]string {"set" : "node" },
33433343 },
@@ -3465,7 +3465,7 @@ func TestCreateInstance(t *testing.T) {
34653465 },
34663466 {
34673467 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 {
34693469 ObjectMeta : metav1.ObjectMeta {
34703470 Labels : map [string ]string {"set" : "node" },
34713471 },
@@ -3620,7 +3620,7 @@ func TestCreateInstance(t *testing.T) {
36203620 },
36213621 }
36223622
3623- machine := & tc .machine
3623+ machine := tc .machine
36243624
36253625 awsMachine := & infrav1.AWSMachine {
36263626 ObjectMeta : metav1.ObjectMeta {
0 commit comments