Repository: kubernetes-sigs/cluster-api-provider-aws
Pull request #3841 (2022-11-10 17:07:56)

[E2E] Add check that the pod list is not empty.
<!-- Thanks for this PR! If this is your first PR please read the [contributing guide](../CONTRIBUTING.md) -->
<!-- If this PR is still work-in-progress and is being open for visibility please prefix the title with `WIP:` -->

**What type of PR is this?**

/kind bug

**What this PR does / why we need it**:

Adding a check that ensures that the pod list isn't empty. The for loop after it wouldn't error if there would be no pods.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Checklist**:
<!-- Put an "X" character inside the brackets of each completed task. Some may be optional depending on the PR in which case these can be deleted -->

- [ ] squashed commits
- [ ] includes documentation
- [ ] adds unit tests
- [ ] adds or updates e2e tests


k8s-ci-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by:
**Once this PR has been reviewed and has the lgtm label**, please ask for approval from skarlso by writing `/assign @skarlso` in a comment. For more information see [the Kubernetes Code Review Process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process).

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fcluster-api-provider-aws).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/main/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["skarlso"]} -->
Skarlso: /test ?
k8s-ci-robot: @Skarlso: The following commands are available to trigger required jobs:
* `/test pull-cluster-api-provider-aws-build`
* `/test pull-cluster-api-provider-aws-test`
* `/test pull-cluster-api-provider-aws-verify`

The following commands are available to trigger optional jobs:
* `/test pull-cluster-api-provider-aws-apidiff-main`
* `/test pull-cluster-api-provider-aws-e2e`
* `/test pull-cluster-api-provider-aws-e2e-blocking`
* `/test pull-cluster-api-provider-aws-e2e-clusterclass`
* `/test pull-cluster-api-provider-aws-e2e-conformance`
* `/test pull-cluster-api-provider-aws-e2e-conformance-with-ci-artifacts`
* `/test pull-cluster-api-provider-aws-e2e-eks`

Use `/test all` to run the following jobs that were automatically triggered:
* `pull-cluster-api-provider-aws-apidiff-main`
* `pull-cluster-api-provider-aws-build`
* `pull-cluster-api-provider-aws-test`
* `pull-cluster-api-provider-aws-verify`



<details>

In response to [this](https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/3841#issuecomment-1310614505):

>/test ?


Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
</details>
Skarlso: /test pull-cluster-api-provider-aws-e2e-eks
k8s-ci-robot: @Skarlso: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-cluster-api-provider-aws-e2e-eks | fab44d66efe3ab389d053aacc3920ba6af2be7c5 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api-provider-aws/3841/pull-cluster-api-provider-aws-e2e-eks/1590753464474931200) | false | `/test pull-cluster-api-provider-aws-e2e-eks`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=cluster-api-provider-aws&pr=3841). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3ASkarlso). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/cluster-api-provider-aws/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
Ankitasw: @Skarlso tests are failing, could you PTAL?
Skarlso: Yeah I'll work on this today. 
Skarlso: /test pull-cluster-api-provider-aws-e2e-eks
Skarlso: /test pull-cluster-api-provider-aws-e2e-eks
k8s-ci-robot: @Skarlso: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-cluster-api-provider-aws-e2e-eks | b442e5a283926d75098df0063b694cdfb2c983c3 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api-provider-aws/3841/pull-cluster-api-provider-aws-e2e-eks/1591078040329261056) | false | `/test pull-cluster-api-provider-aws-e2e-eks`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=cluster-api-provider-aws&pr=3841). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3ASkarlso). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/cluster-api-provider-aws/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
k8s-ci-robot: @Skarlso: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-cluster-api-provider-aws-e2e-eks | eaf3f5ca5377ad0f901933f0971c63ae02160d3d | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api-provider-aws/3841/pull-cluster-api-provider-aws-e2e-eks/1591144429492637696) | false | `/test pull-cluster-api-provider-aws-e2e-eks`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=cluster-api-provider-aws&pr=3841). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3ASkarlso). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/cluster-api-provider-aws/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
Skarlso: Interestingly enough for whatever reason, the coredns pod doesn't get an ip address.

```
 STEP: checking if pod ip address is ipv6 based: aws-node-x5594:2600:1f14:a9f:8a04:195f:dd40:db95:653a
STEP: checking if pod ip address is ipv6 based: coredns-657694c6f4-k78sp: 
```

Luckily, the aws-node does, so... it's enough to check that one.
Skarlso: Oh of course, because I'm not waiting for them to have an IP address at all. 🤦 
Skarlso: /test pull-cluster-api-provider-aws-e2e-eks
Skarlso: /test pull-cluster-api-provider-aws-e2e-eks
Skarlso: /test pull-cluster-api-provider-aws-e2e-eks
Skarlso: ```
STEP: checking if pods list is empty: 0
```

What in tarnation? OH!!! 🤦  The label selector is incorrect.
k8s-ci-robot: @Skarlso: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-cluster-api-provider-aws-e2e-eks | 8896ec035d2717547956d4ed30f40af522f9ceb3 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api-provider-aws/3841/pull-cluster-api-provider-aws-e2e-eks/1592122693371564032) | false | `/test pull-cluster-api-provider-aws-e2e-eks`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=cluster-api-provider-aws&pr=3841). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3ASkarlso). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/cluster-api-provider-aws/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
Skarlso: The label is now `k8s-app=aws-node` instead of `app=aws-node`. :D lovely. :D 
Skarlso: /test pull-cluster-api-provider-aws-e2e-eks
Skarlso: Finally!!!!!!!!!!!!!!! :D

```
STEP: checking if pods list is empty: 1
STEP: checking if pod ip address is ipv6 based: aws-node-dngtq/2600:1f13:9b5:e004:981c:66d2:21f9:ef92
STEP: Deleting cluster eks-nodes-1c16wy
STEP: Waiting for cluster eks-nodes-1c16wy to be deleted
• [SLOW TEST:1496.124 seconds] 
```
Skarlso: @richardcase If you so please. :D
Ankitasw: /lgtm
richardcase: Nicely done @Skarlso , bravo 🎉 

Let's wait for the e2e to pass, but it would be good to squash the changes....especially as they are for 1 file :)
Skarlso: Yep will do that once the tests pass :)))

Patch:
diff --git a/api/v1beta1/awsmachine_conversion.go b/api/v1beta1/awsmachine_conversion.go
index 2e36f5067..7e952f069 100644
--- a/api/v1beta1/awsmachine_conversion.go
+++ b/api/v1beta1/awsmachine_conversion.go
@@ -65,7 +65,7 @@ func (dst *AWSMachineList) ConvertFrom(srcRaw conversion.Hub) error {
 	return Convert_v1beta2_AWSMachineList_To_v1beta1_AWSMachineList(src, dst, nil)
 }
 
-// ConvertTo converts the v1beta1 AWSMachineTemplate receiver to a v1beta2 AWSMachineTemplate.
+// ConvertTo converts the v1beta1 AWSCluster receiver to a v1beta2 AWSCluster.
 func (r *AWSMachineTemplate) ConvertTo(dstRaw conversion.Hub) error {
 	dst := dstRaw.(*infrav1.AWSMachineTemplate)
 
@@ -113,3 +113,4 @@ func (dst *AWSMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error {
 
 	return Convert_v1beta2_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(src, dst, nil)
 }
+
diff --git a/api/v1beta1/conversion.go b/api/v1beta1/conversion.go
index de448264e..84b8d3a89 100644
--- a/api/v1beta1/conversion.go
+++ b/api/v1beta1/conversion.go
@@ -24,7 +24,3 @@ import (
 func Convert_v1beta2_AWSClusterSpec_To_v1beta1_AWSClusterSpec(in *v1beta2.AWSClusterSpec, out *AWSClusterSpec, s conversion.Scope) error {
 	return autoConvert_v1beta2_AWSClusterSpec_To_v1beta1_AWSClusterSpec(in, out, s)
 }
-
-func Convert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(in *AWSResourceReference, out *v1beta2.AWSResourceReference, s conversion.Scope) error {
-	return autoConvert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(in, out, s)
-}
diff --git a/api/v1beta1/zz_generated.conversion.go b/api/v1beta1/zz_generated.conversion.go
index c85bdb32e..f732173cb 100644
--- a/api/v1beta1/zz_generated.conversion.go
+++ b/api/v1beta1/zz_generated.conversion.go
@@ -335,6 +335,11 @@ func RegisterConversions(s *runtime.Scheme) error {
 	}); err != nil {
 		return err
 	}
+	if err := s.AddGeneratedConversionFunc((*AWSResourceReference)(nil), (*v1beta2.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
+		return Convert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(a.(*AWSResourceReference), b.(*v1beta2.AWSResourceReference), scope)
+	}); err != nil {
+		return err
+	}
 	if err := s.AddGeneratedConversionFunc((*v1beta2.AWSResourceReference)(nil), (*AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
 		return Convert_v1beta2_AWSResourceReference_To_v1beta1_AWSResourceReference(a.(*v1beta2.AWSResourceReference), b.(*AWSResourceReference), scope)
 	}); err != nil {
@@ -590,11 +595,6 @@ func RegisterConversions(s *runtime.Scheme) error {
 	}); err != nil {
 		return err
 	}
-	if err := s.AddConversionFunc((*AWSResourceReference)(nil), (*v1beta2.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
-		return Convert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(a.(*AWSResourceReference), b.(*v1beta2.AWSResourceReference), scope)
-	}); err != nil {
-		return err
-	}
 	if err := s.AddConversionFunc((*v1beta2.AWSClusterSpec)(nil), (*AWSClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error {
 		return Convert_v1beta2_AWSClusterSpec_To_v1beta1_AWSClusterSpec(a.(*v1beta2.AWSClusterSpec), b.(*AWSClusterSpec), scope)
 	}); err != nil {
@@ -1228,17 +1228,7 @@ func Convert_v1beta2_AWSMachine_To_v1beta1_AWSMachine(in *v1beta2.AWSMachine, ou
 
 func autoConvert_v1beta1_AWSMachineList_To_v1beta2_AWSMachineList(in *AWSMachineList, out *v1beta2.AWSMachineList, s conversion.Scope) error {
 	out.ListMeta = in.ListMeta
-	if in.Items != nil {
-		in, out := &in.Items, &out.Items
-		*out = make([]v1beta2.AWSMachine, len(*in))
-		for i := range *in {
-			if err := Convert_v1beta1_AWSMachine_To_v1beta2_AWSMachine(&(*in)[i], &(*out)[i], s); err != nil {
-				return err
-			}
-		}
-	} else {
-		out.Items = nil
-	}
+	out.Items = *(*[]v1beta2.AWSMachine)(unsafe.Pointer(&in.Items))
 	return nil
 }
 
@@ -1249,17 +1239,7 @@ func Convert_v1beta1_AWSMachineList_To_v1beta2_AWSMachineList(in *AWSMachineList
 
 func autoConvert_v1beta2_AWSMachineList_To_v1beta1_AWSMachineList(in *v1beta2.AWSMachineList, out *AWSMachineList, s conversion.Scope) error {
 	out.ListMeta = in.ListMeta
-	if in.Items != nil {
-		in, out := &in.Items, &out.Items
-		*out = make([]AWSMachine, len(*in))
-		for i := range *in {
-			if err := Convert_v1beta2_AWSMachine_To_v1beta1_AWSMachine(&(*in)[i], &(*out)[i], s); err != nil {
-				return err
-			}
-		}
-	} else {
-		out.Items = nil
-	}
+	out.Items = *(*[]AWSMachine)(unsafe.Pointer(&in.Items))
 	return nil
 }
 
@@ -1281,27 +1261,9 @@ func autoConvert_v1beta1_AWSMachineSpec_To_v1beta2_AWSMachineSpec(in *AWSMachine
 	out.AdditionalTags = *(*v1beta2.Tags)(unsafe.Pointer(&in.AdditionalTags))
 	out.IAMInstanceProfile = in.IAMInstanceProfile
 	out.PublicIP = (*bool)(unsafe.Pointer(in.PublicIP))
-	if in.AdditionalSecurityGroups != nil {
-		in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups
-		*out = make([]v1beta2.AWSResourceReference, len(*in))
-		for i := range *in {
-			if err := Convert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil {
-				return err
-			}
-		}
-	} else {
-		out.AdditionalSecurityGroups = nil
-	}
+	out.AdditionalSecurityGroups = *(*[]v1beta2.AWSResourceReference)(unsafe.Pointer(&in.AdditionalSecurityGroups))
 	out.FailureDomain = (*string)(unsafe.Pointer(in.FailureDomain))
-	if in.Subnet != nil {
-		in, out := &in.Subnet, &out.Subnet
-		*out = new(v1beta2.AWSResourceReference)
-		if err := Convert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(*in, *out, s); err != nil {
-			return err
-		}
-	} else {
-		out.Subnet = nil
-	}
+	out.Subnet = (*v1beta2.AWSResourceReference)(unsafe.Pointer(in.Subnet))
 	out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName))
 	out.RootVolume = (*v1beta2.Volume)(unsafe.Pointer(in.RootVolume))
 	out.NonRootVolumes = *(*[]v1beta2.Volume)(unsafe.Pointer(&in.NonRootVolumes))
@@ -1334,27 +1296,9 @@ func autoConvert_v1beta2_AWSMachineSpec_To_v1beta1_AWSMachineSpec(in *v1beta2.AW
 	out.AdditionalTags = *(*Tags)(unsafe.Pointer(&in.AdditionalTags))
 	out.IAMInstanceProfile = in.IAMInstanceProfile
 	out.PublicIP = (*bool)(unsafe.Pointer(in.PublicIP))
-	if in.AdditionalSecurityGroups != nil {
-		in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups
-		*out = make([]AWSResourceReference, len(*in))
-		for i := range *in {
-			if err := Convert_v1beta2_AWSResourceReference_To_v1beta1_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil {
-				return err
-			}
-		}
-	} else {
-		out.AdditionalSecurityGroups = nil
-	}
+	out.AdditionalSecurityGroups = *(*[]AWSResourceReference)(unsafe.Pointer(&in.AdditionalSecurityGroups))
 	out.FailureDomain = (*string)(unsafe.Pointer(in.FailureDomain))
-	if in.Subnet != nil {
-		in, out := &in.Subnet, &out.Subnet
-		*out = new(AWSResourceReference)
-		if err := Convert_v1beta2_AWSResourceReference_To_v1beta1_AWSResourceReference(*in, *out, s); err != nil {
-			return err
-		}
-	} else {
-		out.Subnet = nil
-	}
+	out.Subnet = (*AWSResourceReference)(unsafe.Pointer(in.Subnet))
 	out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName))
 	out.RootVolume = (*Volume)(unsafe.Pointer(in.RootVolume))
 	out.NonRootVolumes = *(*[]Volume)(unsafe.Pointer(&in.NonRootVolumes))
@@ -1440,17 +1384,7 @@ func Convert_v1beta2_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(in *v1beta
 
 func autoConvert_v1beta1_AWSMachineTemplateList_To_v1beta2_AWSMachineTemplateList(in *AWSMachineTemplateList, out *v1beta2.AWSMachineTemplateList, s conversion.Scope) error {
 	out.ListMeta = in.ListMeta
-	if in.Items != nil {
-		in, out := &in.Items, &out.Items
-		*out = make([]v1beta2.AWSMachineTemplate, len(*in))
-		for i := range *in {
-			if err := Convert_v1beta1_AWSMachineTemplate_To_v1beta2_AWSMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil {
-				return err
-			}
-		}
-	} else {
-		out.Items = nil
-	}
+	out.Items = *(*[]v1beta2.AWSMachineTemplate)(unsafe.Pointer(&in.Items))
 	return nil
 }
 
@@ -1461,17 +1395,7 @@ func Convert_v1beta1_AWSMachineTemplateList_To_v1beta2_AWSMachineTemplateList(in
 
 func autoConvert_v1beta2_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(in *v1beta2.AWSMachineTemplateList, out *AWSMachineTemplateList, s conversion.Scope) error {
 	out.ListMeta = in.ListMeta
-	if in.Items != nil {
-		in, out := &in.Items, &out.Items
-		*out = make([]AWSMachineTemplate, len(*in))
-		for i := range *in {
-			if err := Convert_v1beta2_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil {
-				return err
-			}
-		}
-	} else {
-		out.Items = nil
-	}
+	out.Items = *(*[]AWSMachineTemplate)(unsafe.Pointer(&in.Items))
 	return nil
 }
 
@@ -1552,13 +1476,19 @@ func Convert_v1beta2_AWSMachineTemplateStatus_To_v1beta1_AWSMachineTemplateStatu
 
 func autoConvert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(in *AWSResourceReference, out *v1beta2.AWSResourceReference, s conversion.Scope) error {
 	out.ID = (*string)(unsafe.Pointer(in.ID))
-	// WARNING: in.ARN requires manual conversion: does not exist in peer-type
+	out.ARN = (*string)(unsafe.Pointer(in.ARN))
 	out.Filters = *(*[]v1beta2.Filter)(unsafe.Pointer(&in.Filters))
 	return nil
 }
 
+// Convert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference is an autogenerated conversion function.
+func Convert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(in *AWSResourceReference, out *v1beta2.AWSResourceReference, s conversion.Scope) error {
+	return autoConvert_v1beta1_AWSResourceReference_To_v1beta2_AWSResourceReference(in, out, s)
+}
+
 func autoConvert_v1beta2_AWSResourceReference_To_v1beta1_AWSResourceReference(in *v1beta2.AWSResourceReference, out *AWSResourceReference, s conversion.Scope) error {
 	out.ID = (*string)(unsafe.Pointer(in.ID))
+	out.ARN = (*string)(unsafe.Pointer(in.ARN))
 	out.Filters = *(*[]Filter)(unsafe.Pointer(&in.Filters))
 	return nil
 }
diff --git a/api/v1beta2/awsmachine_webhook.go b/api/v1beta2/awsmachine_webhook.go
index dd66d12bb..5d22ecac9 100644
--- a/api/v1beta2/awsmachine_webhook.go
+++ b/api/v1beta2/awsmachine_webhook.go
@@ -252,6 +252,9 @@ func (r *AWSMachine) validateAdditionalSecurityGroups() field.ErrorList {
 		if len(additionalSecurityGroup.Filters) > 0 && additionalSecurityGroup.ID != nil {
 			allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.additionalSecurityGroups"), "only one of ID or Filters may be specified, specifying both is forbidden"))
 		}
+		if additionalSecurityGroup.ARN != nil {
+			log.Info("ARN field is deprecated and is no operation function.")
+		}
 	}
 	return allErrs
 }
diff --git a/api/v1beta2/types.go b/api/v1beta2/types.go
index a9e3d357a..7e496ecc8 100644
--- a/api/v1beta2/types.go
+++ b/api/v1beta2/types.go
@@ -30,6 +30,11 @@ type AWSResourceReference struct {
 	// +optional
 	ID *string `json:"id,omitempty"`
 
+	// ARN of resource.
+	// +optional
+	// Deprecated: This field has no function and is going to be removed in the next release.
+	ARN *string `json:"arn,omitempty"`
+
 	// Filters is a set of key/value pairs used to identify a resource
 	// They are applied according to the rules defined by the AWS API:
 	// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html
diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go
index a6a223fbb..b4edb00b3 100644
--- a/api/v1beta2/zz_generated.deepcopy.go
+++ b/api/v1beta2/zz_generated.deepcopy.go
@@ -902,6 +902,11 @@ func (in *AWSResourceReference) DeepCopyInto(out *AWSResourceReference) {
 		*out = new(string)
 		**out = **in
 	}
+	if in.ARN != nil {
+		in, out := &in.ARN, &out.ARN
+		*out = new(string)
+		**out = **in
+	}
 	if in.Filters != nil {
 		in, out := &in.Filters, &out.Filters
 		*out = make([]Filter, len(*in))
diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinepools.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinepools.yaml
index 0f3132fc6..5452203f8 100644
--- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinepools.yaml
+++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinepools.yaml
@@ -87,6 +87,10 @@ spec:
                         be specified. Specifying more than one will result in a validation
                         error.
                       properties:
+                        arn:
+                          description: 'ARN of resource. Deprecated: This field has
+                            no function and is going to be removed in the next release.'
+                          type: string
                         filters:
                           description: 'Filters is a set of key/value pairs used to
                             identify a resource They are applied according to the
@@ -337,6 +341,10 @@ spec:
                     resource by ID or filters. Only one of ID or Filters may be specified.
                     Specifying more than one will result in a validation error.
                   properties:
+                    arn:
+                      description: 'ARN of resource. Deprecated: This field has no
+                        function and is going to be removed in the next release.'
+                      type: string
                     filters:
                       description: 'Filters is a set of key/value pairs used to identify
                         a resource They are applied according to the rules defined
@@ -554,6 +562,10 @@ spec:
                         be specified. Specifying more than one will result in a validation
                         error.
                       properties:
+                        arn:
+                          description: 'ARN of resource. Deprecated: This field has
+                            no function and is going to be removed in the next release.'
+                          type: string
                         filters:
                           description: 'Filters is a set of key/value pairs used to
                             identify a resource They are applied according to the
@@ -809,6 +821,10 @@ spec:
                     resource by ID or filters. Only one of ID or Filters may be specified.
                     Specifying more than one will result in a validation error.
                   properties:
+                    arn:
+                      description: 'ARN of resource. Deprecated: This field has no
+                        function and is going to be removed in the next release.'
+                      type: string
                     filters:
                       description: 'Filters is a set of key/value pairs used to identify
                         a resource They are applied according to the rules defined
diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachines.yaml
index cae9f03e9..04226e6d4 100644
--- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachines.yaml
+++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachines.yaml
@@ -545,6 +545,10 @@ spec:
                     resource by ID or filters. Only one of ID or Filters may be specified.
                     Specifying more than one will result in a validation error.
                   properties:
+                    arn:
+                      description: 'ARN of resource. Deprecated: This field has no
+                        function and is going to be removed in the next release.'
+                      type: string
                     filters:
                       description: 'Filters is a set of key/value pairs used to identify
                         a resource They are applied according to the rules defined
@@ -795,6 +799,10 @@ spec:
                 description: Subnet is a reference to the subnet to use for this instance.
                   If not specified, the cluster subnet will be used.
                 properties:
+                  arn:
+                    description: 'ARN of resource. Deprecated: This field has no function
+                      and is going to be removed in the next release.'
+                    type: string
                   filters:
                     description: 'Filters is a set of key/value pairs used to identify
                       a resource They are applied according to the rules defined by
diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml
index 8e80317e0..3386d205d 100644
--- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml
+++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml
@@ -487,6 +487,11 @@ spec:
                             may be specified. Specifying more than one will result
                             in a validation error.
                           properties:
+                            arn:
+                              description: 'ARN of resource. Deprecated: This field
+                                has no function and is going to be removed in the
+                                next release.'
+                              type: string
                             filters:
                               description: 'Filters is a set of key/value pairs used
                                 to identify a resource They are applied according
@@ -749,6 +754,11 @@ spec:
                           this instance. If not specified, the cluster subnet will
                           be used.
                         properties:
+                          arn:
+                            description: 'ARN of resource. Deprecated: This field
+                              has no function and is going to be removed in the next
+                              release.'
+                            type: string
                           filters:
                             description: 'Filters is a set of key/value pairs used
                               to identify a resource They are applied according to
diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml
index 73a7ef374..035cbee18 100644
--- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml
+++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml
@@ -94,6 +94,10 @@ spec:
                         be specified. Specifying more than one will result in a validation
                         error.
                       properties:
+                        arn:
+                          description: 'ARN of resource. Deprecated: This field has
+                            no function and is going to be removed in the next release.'
+                          type: string
                         filters:
                           description: 'Filters is a set of key/value pairs used to
                             identify a resource They are applied according to the
@@ -542,6 +546,10 @@ spec:
                         be specified. Specifying more than one will result in a validation
                         error.
                       properties:
+                        arn:
+                          description: 'ARN of resource. Deprecated: This field has
+                            no function and is going to be removed in the next release.'
+                          type: string
                         filters:
                           description: 'Filters is a set of key/value pairs used to
                             identify a resource They are applied according to the
diff --git a/exp/api/v1beta2/awsmachinepool_webhook.go b/exp/api/v1beta2/awsmachinepool_webhook.go
index 8ff20aa8d..762603b00 100644
--- a/exp/api/v1beta2/awsmachinepool_webhook.go
+++ b/exp/api/v1beta2/awsmachinepool_webhook.go
@@ -89,6 +89,9 @@ func (r *AWSMachinePool) validateSubnets() field.ErrorList {
 	}
 
 	for _, subnet := range r.Spec.Subnets {
+		if subnet.ARN != nil {
+			log.Info("ARN field is deprecated and is no operation function.")
+		}
 		if subnet.ID != nil && subnet.Filters != nil {
 			allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.subnets.filters"), "providing either subnet ID or filter is supported, should not provide both"))
 			break
@@ -104,6 +107,9 @@ func (r *AWSMachinePool) validateAdditionalSecurityGroups() field.ErrorList {
 		if sg.ID != nil && sg.Filters != nil {
 			allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.awsLaunchTemplate.AdditionalSecurityGroups"), "either ID or filters should be used"))
 		}
+		if sg.ARN != nil {
+			log.Info("ARN field is deprecated and is no operation function.")
+		}
 	}
 	return allErrs
 }
diff --git a/go.mod b/go.mod
index 12533b740..0e6fa59db 100644
--- a/go.mod
+++ b/go.mod
@@ -18,7 +18,6 @@ require (
 	github.com/golang/mock v1.6.0
 	github.com/google/go-cmp v0.5.9
 	github.com/google/goexpect v0.0.0-20210430020637-ab937bf7fd6f
-	github.com/google/gofuzz v1.2.0
 	github.com/onsi/ginkgo v1.16.5
 	github.com/onsi/gomega v1.24.1
 	github.com/pkg/errors v0.9.1
@@ -88,6 +87,7 @@ require (
 	github.com/google/gnostic v0.5.7-v3refs // indirect
 	github.com/google/go-github/v45 v45.2.0 // indirect
 	github.com/google/go-querystring v1.1.0 // indirect
+	github.com/google/gofuzz v1.2.0 // indirect
 	github.com/google/goterm v0.0.0-20190703233501-fc88cf888a3f // indirect
 	github.com/google/uuid v1.2.0 // indirect
 	github.com/hashicorp/hcl v1.0.0 // indirect
diff --git a/pkg/logger/logger.go b/pkg/logger/logger.go
index b343afc01..c2730c47c 100644
--- a/pkg/logger/logger.go
+++ b/pkg/logger/logger.go
@@ -1,19 +1,3 @@
-/*
-Copyright 2022 The Kubernetes Authors.
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-	http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
 // Package logger
 //nolint: logrlint
 package logger


Test patch:
diff --git a/api/v1beta1/conversion_test.go b/api/v1beta1/conversion_test.go
index 81667020f..f13dc2d75 100644
--- a/api/v1beta1/conversion_test.go
+++ b/api/v1beta1/conversion_test.go
@@ -21,51 +21,11 @@ import (
 
 	. "github.com/onsi/gomega"
 
-	fuzz "github.com/google/gofuzz"
-	"k8s.io/apimachinery/pkg/api/apitesting/fuzzer"
-	"k8s.io/apimachinery/pkg/runtime"
-	runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
-	"sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
+	runtime "k8s.io/apimachinery/pkg/runtime"
+	v1beta2 "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
 	utilconversion "sigs.k8s.io/cluster-api/util/conversion"
 )
 
-func fuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} {
-	return []interface{}{
-		AWSMachineFuzzer,
-		AWSMachineTemplateFuzzer,
-	}
-}
-
-func AWSMachineFuzzer(obj *AWSMachine, c fuzz.Continue) {
-	c.FuzzNoCustom(obj)
-	
-	// AWSMachine.Spec.Subnet.ARN and AWSMachine.Spec.AdditionalSecurityGroups.ARN has been removed in v1beta2, so setting it to nil in order to avoid v1beta1 --> v1beta2 --> v1beta1 round trip errors.
-	if obj.Spec.Subnet != nil {
-		obj.Spec.Subnet.ARN = nil
-	}
-	restored := make([]AWSResourceReference, len(obj.Spec.AdditionalSecurityGroups))
-	for _, sg := range obj.Spec.AdditionalSecurityGroups {
-		sg.ARN = nil
-		restored = append(restored, sg)
-	}
-	obj.Spec.AdditionalSecurityGroups = restored
-}
-
-func AWSMachineTemplateFuzzer(obj *AWSMachineTemplate, c fuzz.Continue) {
-	c.FuzzNoCustom(obj)
-	
-	// AWSMachineTemplate.Spec.Template.Spec.FailureDomain, AWSMachineTemplate.Spec.Template.Spec.Subnet.ARN and AWSMachineTemplate.Spec.Template.Spec.AdditionalSecurityGroups.ARN has been removed in v1beta2, so setting it to nil in order to avoid  v1beta1 --> v1beta2 --> v1beta round trip errors.
-	if obj.Spec.Template.Spec.Subnet != nil {
-		obj.Spec.Template.Spec.Subnet.ARN = nil
-	}
-	restored := make([]AWSResourceReference, len(obj.Spec.Template.Spec.AdditionalSecurityGroups))
-	for _, sg := range obj.Spec.Template.Spec.AdditionalSecurityGroups {
-		sg.ARN = nil
-		restored = append(restored, sg)
-	}
-	obj.Spec.Template.Spec.AdditionalSecurityGroups = restored
-}
-
 func TestFuzzyConversion(t *testing.T) {
 	g := NewWithT(t)
 	scheme := runtime.NewScheme()
@@ -82,14 +42,12 @@ func TestFuzzyConversion(t *testing.T) {
 		Scheme: scheme,
 		Hub:    &v1beta2.AWSMachine{},
 		Spoke:  &AWSMachine{},
-		FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs},
 	}))
 
 	t.Run("for AWSMachineTemplate", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
 		Scheme: scheme,
 		Hub:    &v1beta2.AWSMachineTemplate{},
 		Spoke:  &AWSMachineTemplate{},
-		FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs},
 	}))
 
 	t.Run("for AWSClusterStaticIdentity", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{
diff --git a/test/e2e/suites/managed/eks_ipv6_test.go b/test/e2e/suites/managed/eks_ipv6_test.go
index 1e99a2af3..59f873d28 100644
--- a/test/e2e/suites/managed/eks_ipv6_test.go
+++ b/test/e2e/suites/managed/eks_ipv6_test.go
@@ -22,6 +22,7 @@ package managed
 import (
 	"context"
 	"fmt"
+	"time"
 
 	"github.com/onsi/ginkgo"
 	. "github.com/onsi/gomega"
@@ -96,19 +97,32 @@ var _ = ginkgo.Describe("[managed] [general] [ipv6] EKS cluster tests", func() {
 			Name:      clusterName,
 		})
 		Expect(cluster).NotTo(BeNil(), "couldn't find CAPI cluster")
-		// Don't replace this with var pods *corev1.PodsList as that results in a nil pointer error from List.
-		pods := &corev1.PodList{}
-		listOptions := []client.ListOption{
-			client.InNamespace(namespace.Namespace),
-			client.MatchingLabels(map[string]string{"app": "aws-node"}),
-		}
-		clusterClient := e2eCtx.Environment.BootstrapClusterProxy.GetWorkloadCluster(ctx, namespace.Name, clusterName).GetClient()
-		err := clusterClient.List(ctx, pods, listOptions...)
-		Expect(err).ToNot(HaveOccurred())
-
-		for _, pod := range pods.Items {
-			Expect(net.IsIPv6String(pod.Status.PodIP)).To(BeTrue())
-		}
+
+		Eventually(func() bool {
+			pods := &corev1.PodList{}
+			listOptions := []client.ListOption{
+				client.InNamespace(namespace.Namespace),
+				client.MatchingLabels(map[string]string{"k8s-app": "aws-node"}),
+			}
+			clusterClient := e2eCtx.Environment.BootstrapClusterProxy.GetWorkloadCluster(ctx, namespace.Name, clusterName).GetClient()
+			err := clusterClient.List(ctx, pods, listOptions...)
+			Expect(err).ToNot(HaveOccurred())
+			shared.Byf("checking if pods list is empty: %d", len(pods.Items))
+			if len(pods.Items) == 0 {
+				return false
+			}
+			for _, pod := range pods.Items {
+				shared.Byf("checking if pod ip address is ipv6 based: %s/%s", pod.Name, pod.Status.PodIP)
+				if pod.Status.PodIP == "" {
+					return false
+				}
+				if !net.IsIPv6String(pod.Status.PodIP) {
+					return false
+				}
+			}
+
+			return true
+		}).WithTimeout(5*time.Minute).WithPolling(10*time.Second).Should(BeTrue(), "failed to wait for pods to appear and have ipv6 address")
 
 		framework.DeleteCluster(ctx, framework.DeleteClusterInput{
 			Deleter: e2eCtx.Environment.BootstrapClusterProxy.GetClient(),