Repository: kubernetes-sigs/cluster-api
Pull request #4653 (2021-05-24 12:53:18)

🌱 Add enxebre as reviewer
<!-- please add a icon to the title of this PR (see https://sigs.k8s.io/cluster-api/VERSIONING.md), and delete this line and similar ones -->
<!-- the icon will be either ⚠️ (:warning:, major or breaking changes), ✨ (:sparkles:, feature additions), 🐛 (:bug:, patch and bugfixes), 📖 (:book:, documentation or proposals), or 🌱 (:seedling:, minor or other) -->

**What this PR does / why we need it**:
Add Alberto as reviewer.
Proposals: https://github.com/kubernetes-sigs/cluster-api/search?q=enxebre
PRs: https://github.com/kubernetes-sigs/cluster-api/pulls?q=is%3Apr+is%3Aclosed+author%3Aenxebre
Reviews: https://github.com/kubernetes-sigs/cluster-api/pulls?page=1&q=is%3Apr+enxebre
Issues: https://github.com/kubernetes-sigs/cluster-api/issues?q=is%3Aissue+author%3Aenxebre+

cc @fabriziopandini @CecileRobertMichon @vincepri @JoelSpeed @sbueringer 

**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 #



Patch:
diff --git a/.golangci.yml b/.golangci.yml
index 4b161837c..358d834aa 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -48,6 +48,8 @@ issues:
     - Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
     # The following are being worked on to remove their exclusion. This list should be reduced or go away all together over time.
     # If it is decided they will not be addressed they should be moved above this comment.
+    - (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)
+    - package comment should be of the form "Package (.+) ..."
     - Subprocess launch(ed with variable|ing should be audited)
     - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
     - (G104|G307)
diff --git a/OWNERS_ALIASES b/OWNERS_ALIASES
index 154711f29..5751a7ffb 100644
--- a/OWNERS_ALIASES
+++ b/OWNERS_ALIASES
@@ -28,6 +28,7 @@ aliases:
   cluster-api-reviewers:
   - JoelSpeed
   - sbueringer
+  - enxebre
 
   # -----------------------------------------------------------
   # OWNER_ALIASES for docs/book
diff --git a/api/v1alpha3/doc.go b/api/v1alpha3/doc.go
index ccbb4ca7e..f0da60a3f 100644
--- a/api/v1alpha3/doc.go
+++ b/api/v1alpha3/doc.go
@@ -14,6 +14,5 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package v1alpha3 contains the v1alpha3 API implementation.
 // +k8s:conversion-gen=sigs.k8s.io/cluster-api/api/v1alpha4
 package v1alpha3
diff --git a/bootstrap/kubeadm/api/v1alpha3/doc.go b/bootstrap/kubeadm/api/v1alpha3/doc.go
index 0a4418801..521995bcd 100644
--- a/bootstrap/kubeadm/api/v1alpha3/doc.go
+++ b/bootstrap/kubeadm/api/v1alpha3/doc.go
@@ -14,6 +14,5 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package v1alpha3 contains the v1alpha3 API implementation.
 // +k8s:conversion-gen=sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4
 package v1alpha3
diff --git a/bootstrap/kubeadm/controllers/doc.go b/bootstrap/kubeadm/controllers/doc.go
deleted file mode 100644
index e6c967968..000000000
--- a/bootstrap/kubeadm/controllers/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 controllers implements the Kubeadm controllers.
-package controllers
diff --git a/bootstrap/kubeadm/internal/cloudinit/doc.go b/bootstrap/kubeadm/internal/cloudinit/doc.go
deleted file mode 100644
index d1d6b48d9..000000000
--- a/bootstrap/kubeadm/internal/cloudinit/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 cloudinit implements kubeadm cloudinit functionality.
-package cloudinit
diff --git a/bootstrap/kubeadm/internal/cloudinit/node.go b/bootstrap/kubeadm/internal/cloudinit/node.go
index 80a143242..5bb466e60 100644
--- a/bootstrap/kubeadm/internal/cloudinit/node.go
+++ b/bootstrap/kubeadm/internal/cloudinit/node.go
@@ -53,5 +53,6 @@ func NewNode(input *NodeInput) ([]byte, error) {
 		return nil, err
 	}
 	input.Header = cloudConfigHeader
+	input.WriteFiles = append(input.WriteFiles, input.AdditionalFiles...)
 	return generate("Node", nodeCloudInit, input)
 }
diff --git a/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go b/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go
index c4c0ca725..538c5b8a7 100644
--- a/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go
+++ b/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package locking implements locking functionality.
 package locking
 
 import (
diff --git a/bootstrap/kubeadm/types/doc.go b/bootstrap/kubeadm/types/doc.go
deleted file mode 100644
index 233316228..000000000
--- a/bootstrap/kubeadm/types/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 utils contains Kubeadm utility types.
-package utils
diff --git a/bootstrap/kubeadm/types/utils.go b/bootstrap/kubeadm/types/utils.go
index 7c9d49bf6..ef1b55c73 100644
--- a/bootstrap/kubeadm/types/utils.go
+++ b/bootstrap/kubeadm/types/utils.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package utils contains Kubeadm utility types.
 package utils
 
 import (
diff --git a/bootstrap/kubeadm/types/v1beta1/doc.go b/bootstrap/kubeadm/types/v1beta1/doc.go
index d77d1926e..2e10e12c1 100644
--- a/bootstrap/kubeadm/types/v1beta1/doc.go
+++ b/bootstrap/kubeadm/types/v1beta1/doc.go
@@ -14,11 +14,13 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package v1beta1 contains a mirror of kubeadm API v1beta1 API, required because it is not possible to import k/K.
-//
-// IMPORTANT: Do not change these files!
-// IMPORTANT: only for KubeadmConfig serialization/deserialization, and should not be used for other purposes.
-//
+/*
+This packages contains a mirror of kubeadm API v1beta1 API, required because it is not possible to import k/K.
+
+IMPORTANT: Do not change these files!
+IMPORTANT: only for KubeadmConfig serialization/deserialization, and should not be used for other purposes.
+*/
+
 // +k8s:conversion-gen=sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4
 // +k8s:deepcopy-gen=package
 package v1beta1 // import "sigs.k8s.io/cluster-api/bootstrap/kubeadm/kubeadm/v1beta1"
diff --git a/bootstrap/kubeadm/types/v1beta2/doc.go b/bootstrap/kubeadm/types/v1beta2/doc.go
index 8b905003f..1ee2cbe28 100644
--- a/bootstrap/kubeadm/types/v1beta2/doc.go
+++ b/bootstrap/kubeadm/types/v1beta2/doc.go
@@ -14,11 +14,13 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package v1beta2 contains a mirror of kubeadm API v1beta2 API, required because it is not possible to import k/K.
-//
-// IMPORTANT: Do not change these files!
-// IMPORTANT: only for KubeadmConfig serialization/deserialization, and should not be used for other purposes.
-//
+/*
+This packages contains a mirror of kubeadm API v1beta2 API, required because it is not possible to import k/K.
+
+IMPORTANT: Do not change these files!
+IMPORTANT: only for KubeadmConfig serialization/deserialization, and should not be used for other purposes.
+*/
+
 // +k8s:conversion-gen=sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4
 // +k8s:deepcopy-gen=package
 package v1beta2 // import "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types/v1beta2"
diff --git a/bootstrap/util/configowner.go b/bootstrap/util/configowner.go
index b38f39286..2d977ba04 100644
--- a/bootstrap/util/configowner.go
+++ b/bootstrap/util/configowner.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package util implements kubeadm utility functionality.
 package util
 
 import (
diff --git a/cmd/clusterctl/client/alpha/doc.go b/cmd/clusterctl/client/alpha/doc.go
deleted file mode 100644
index 0ef6063c4..000000000
--- a/cmd/clusterctl/client/alpha/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 alpha implements clusterctl alpha functionality.
-package alpha
diff --git a/cmd/clusterctl/client/cluster/doc.go b/cmd/clusterctl/client/cluster/doc.go
deleted file mode 100644
index 98658f988..000000000
--- a/cmd/clusterctl/client/cluster/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 cluster implements clusterctl cluster functionality.
-package cluster
diff --git a/cmd/clusterctl/client/config/doc.go b/cmd/clusterctl/client/config/doc.go
deleted file mode 100644
index 4130035cc..000000000
--- a/cmd/clusterctl/client/config/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 config implements clusterctl config functionality.
-package config
diff --git a/cmd/clusterctl/client/doc.go b/cmd/clusterctl/client/doc.go
deleted file mode 100644
index 6ff2a50d8..000000000
--- a/cmd/clusterctl/client/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 client implements clusterctl client functionality.
-package client
diff --git a/cmd/clusterctl/client/repository/doc.go b/cmd/clusterctl/client/repository/doc.go
deleted file mode 100644
index 63dd977bf..000000000
--- a/cmd/clusterctl/client/repository/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 repository implements clusterctl repository functionality.
-package repository
diff --git a/cmd/clusterctl/client/tree/doc.go b/cmd/clusterctl/client/tree/doc.go
index d8590e367..9ba3ff635 100644
--- a/cmd/clusterctl/client/tree/doc.go
+++ b/cmd/clusterctl/client/tree/doc.go
@@ -14,8 +14,10 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+package tree
+
 /*
-Package tree supports the generation of an "at glance" view of a Cluster API cluster designed to help the user in quickly
+This package support the generation of an "at glance" view of a Cluster API cluster designed to help the user in quickly
 understanding if there are problems and where.
 
 The "at glance" view is based on the idea that we should avoid to overload the user with information, but instead
@@ -51,4 +53,3 @@ e.g is virtual node, is group node, meta name etc.
 
 The Discovery object uses the ObjectTree to build the "at glance" view of a Cluster API.
 */
-package tree
diff --git a/cmd/clusterctl/client/yamlprocessor/processor.go b/cmd/clusterctl/client/yamlprocessor/processor.go
index 62123f690..5ff060396 100644
--- a/cmd/clusterctl/client/yamlprocessor/processor.go
+++ b/cmd/clusterctl/client/yamlprocessor/processor.go
@@ -13,8 +13,6 @@ 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 yamlprocessor implements YAML processing.
 package yamlprocessor
 
 // Processor defines the methods necessary for creating a specific yaml
diff --git a/cmd/clusterctl/cmd/config.go b/cmd/clusterctl/cmd/config.go
index ad7b1e16d..9e18cb60d 100644
--- a/cmd/clusterctl/cmd/config.go
+++ b/cmd/clusterctl/cmd/config.go
@@ -22,8 +22,8 @@ import (
 
 var configCmd = &cobra.Command{
 	Use:   "config",
-	Short: "Display clusterctl configuration.",
-	Long:  `Display clusterctl configuration.`,
+	Short: "Display provider configuration and templates to create workload clusters.",
+	Long:  `Display provider configuration and templates to create workload clusters.`,
 }
 
 func init() {
diff --git a/cmd/clusterctl/cmd/config_cluster.go b/cmd/clusterctl/cmd/config_cluster.go
index 2daac7e9a..03fc88792 100644
--- a/cmd/clusterctl/cmd/config_cluster.go
+++ b/cmd/clusterctl/cmd/config_cluster.go
@@ -25,11 +25,6 @@ import (
 	"sigs.k8s.io/cluster-api/cmd/clusterctl/client"
 )
 
-/*
-NOTE: This command is deprecated in favor of `clusterctl generate cluster`. The source code is located at `cmd/clusterctl/cmd/generate_cluster.go`.
-This file will be removed in 0.5.x. Do not make any changes to this file.
-*/
-
 type configClusterOptions struct {
 	kubeconfig             string
 	kubeconfigContext      string
@@ -95,7 +90,6 @@ var configClusterClusterCmd = &cobra.Command{
 	RunE: func(cmd *cobra.Command, args []string) error {
 		return runGetClusterTemplate(cmd, args[0])
 	},
-	Deprecated: "use `clusterctl generate cluster` instead",
 }
 
 func init() {
diff --git a/cmd/clusterctl/cmd/config_provider.go b/cmd/clusterctl/cmd/config_provider.go
index e3de481f6..ae1c8c284 100644
--- a/cmd/clusterctl/cmd/config_provider.go
+++ b/cmd/clusterctl/cmd/config_provider.go
@@ -28,11 +28,6 @@ import (
 	"sigs.k8s.io/cluster-api/cmd/clusterctl/client"
 )
 
-/*
-NOTE: This command is deprecated in favor of `clusterctl generate provider`. The source code is located at `cmd/clusterctl/cmd/generate_provider.go`.
-This file will be removed in 0.5.x. Do not make any changes to this file.
-*/
-
 const (
 	// ComponentsOutputYaml is an option used to print the components in yaml format.
 	ComponentsOutputYaml = "yaml"
@@ -84,7 +79,6 @@ var configProviderCmd = &cobra.Command{
 	RunE: func(cmd *cobra.Command, args []string) error {
 		return runGetComponents()
 	},
-	Deprecated: "use `clusterctl generate provider` instead",
 }
 
 func init() {
diff --git a/cmd/clusterctl/cmd/doc.go b/cmd/clusterctl/cmd/doc.go
deleted file mode 100644
index 2b4c7b6e2..000000000
--- a/cmd/clusterctl/cmd/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 cmd implements clusterctl commands.
-package cmd
diff --git a/cmd/clusterctl/cmd/generate_cluster.go b/cmd/clusterctl/cmd/generate_cluster.go
deleted file mode 100644
index a8e40c458..000000000
--- a/cmd/clusterctl/cmd/generate_cluster.go
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
-Copyright 2021 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 cmd
-
-import (
-	"fmt"
-	"github.com/spf13/cobra"
-	"sigs.k8s.io/cluster-api/cmd/clusterctl/client"
-)
-
-type generateClusterOptions struct {
-	kubeconfig             string
-	kubeconfigContext      string
-	flavor                 string
-	infrastructureProvider string
-
-	targetNamespace          string
-	kubernetesVersion        string
-	controlPlaneMachineCount int64
-	workerMachineCount       int64
-
-	url                string
-	configMapNamespace string
-	configMapName      string
-	configMapDataKey   string
-
-	listVariables bool
-}
-
-var gc = &generateClusterOptions{}
-
-var generateClusterClusterCmd = &cobra.Command{
-	Use:   "cluster",
-	Short: "Generate templates for creating workload clusters.",
-	Long: LongDesc(`
-		Generate templates for creating workload clusters.
-
-		clusterctl ships with a list of known providers; if necessary, edit
-		$HOME/.cluster-api/clusterctl.yaml to add new provider or to customize existing ones.
-
-		Each provider configuration links to a repository; clusterctl uses this information
-		to fetch templates when creating a new cluster.`),
-
-	Example: Examples(`
-		# Generates a yaml file for creating workload clusters using
-		# the pre-installed infrastructure and bootstrap providers.
-		clusterctl generate cluster my-cluster
-
-		# Generates a yaml file for creating workload clusters using
-		# a specific version of the AWS infrastructure provider.
-		clusterctl generate cluster my-cluster --infrastructure=aws:v0.4.1
-
-		# Generates a yaml file for creating workload clusters in a custom namespace.
-		clusterctl generate cluster my-cluster --target-namespace=foo
-
-		# Generates a yaml file for creating workload clusters with a specific Kubernetes version.
-		clusterctl generate cluster my-cluster --kubernetes-version=v1.19.1
-
-		# Generates a yaml file for creating workload clusters with a
-		# custom number of nodes (if supported by the provider's templates).
-		clusterctl generate cluster my-cluster --control-plane-machine-count=3 --worker-machine-count=10
-
-		# Generates a yaml file for creating workload clusters using a template stored in a ConfigMap.
-		clusterctl generate cluster my-cluster --from-config-map MyTemplates
-
-		# Generates a yaml file for creating workload clusters using a template from a specific URL.
-		clusterctl generate cluster my-cluster --from https://github.com/foo-org/foo-repository/blob/master/cluster-template.yaml
-
-		# Generates a yaml file for creating workload clusters using a template stored locally.
-		clusterctl generate cluster my-cluster --from ~/workspace/cluster-template.yaml
-
-		# Prints the list of variables required by the yaml file for creating workload cluster.
-		clusterctl generate cluster my-cluster --list-variables`),
-
-	Args: cobra.ExactArgs(1),
-	RunE: func(cmd *cobra.Command, args []string) error {
-		return runGenerateClusterTemplate(cmd, args[0])
-	},
-}
-
-func init() {
-	generateClusterClusterCmd.Flags().StringVar(&gc.kubeconfig, "kubeconfig", "",
-		"Path to a kubeconfig file to use for the management cluster. If empty, default discovery rules apply.")
-	generateClusterClusterCmd.Flags().StringVar(&gc.kubeconfigContext, "kubeconfig-context", "",
-		"Context to be used within the kubeconfig file. If empty, current context will be used.")
-
-	// flags for the template variables
-	generateClusterClusterCmd.Flags().StringVarP(&gc.targetNamespace, "target-namespace", "n", "",
-		"The namespace to use for the workload cluster. If unspecified, the current namespace will be used.")
-	generateClusterClusterCmd.Flags().StringVar(&gc.kubernetesVersion, "kubernetes-version", "",
-		"The Kubernetes version to use for the workload cluster. If unspecified, the value from OS environment variables or the .cluster-api/clusterctl.yaml config file will be used.")
-	generateClusterClusterCmd.Flags().Int64Var(&gc.controlPlaneMachineCount, "control-plane-machine-count", 1,
-		"The number of control plane machines for the workload cluster.")
-	generateClusterClusterCmd.Flags().Int64Var(&gc.workerMachineCount, "worker-machine-count", 0,
-		"The number of worker machines for the workload cluster.")
-
-	// flags for the repository source
-	generateClusterClusterCmd.Flags().StringVarP(&gc.infrastructureProvider, "infrastructure", "i", "",
-		"The infrastructure provider to read the workload cluster template from. If unspecified, the default infrastructure provider will be used.")
-	generateClusterClusterCmd.Flags().StringVarP(&gc.flavor, "flavor", "f", "",
-		"The workload cluster template variant to be used when reading from the infrastructure provider repository. If unspecified, the default cluster template will be used.")
-
-	// flags for the url source
-	generateClusterClusterCmd.Flags().StringVar(&gc.url, "from", "",
-		"The URL to read the workload cluster template from. If unspecified, the infrastructure provider repository URL will be used")
-
-	// flags for the config map source
-	generateClusterClusterCmd.Flags().StringVar(&gc.configMapName, "from-config-map", "",
-		"The ConfigMap to read the workload cluster template from. This can be used as alternative to read from the provider repository or from an URL")
-	generateClusterClusterCmd.Flags().StringVar(&gc.configMapNamespace, "from-config-map-namespace", "",
-		"The namespace where the ConfigMap exists. If unspecified, the current namespace will be used")
-	generateClusterClusterCmd.Flags().StringVar(&gc.configMapDataKey, "from-config-map-key", "",
-		fmt.Sprintf("The ConfigMap.Data key where the workload cluster template is hosted. If unspecified, %q will be used", client.DefaultCustomTemplateConfigMapKey))
-
-	// other flags
-	generateClusterClusterCmd.Flags().BoolVar(&gc.listVariables, "list-variables", false,
-		"Returns the list of variables expected by the template instead of the template yaml")
-
-	generateCmd.AddCommand(generateClusterClusterCmd)
-}
-
-func runGenerateClusterTemplate(cmd *cobra.Command, name string) error {
-	c, err := client.New(cfgFile)
-	if err != nil {
-		return err
-	}
-
-	templateOptions := client.GetClusterTemplateOptions{
-		Kubeconfig:        client.Kubeconfig{Path: gc.kubeconfig, Context: gc.kubeconfigContext},
-		ClusterName:       name,
-		TargetNamespace:   gc.targetNamespace,
-		KubernetesVersion: gc.kubernetesVersion,
-		ListVariablesOnly: gc.listVariables,
-	}
-
-	if cmd.Flags().Changed("control-plane-machine-count") {
-		templateOptions.ControlPlaneMachineCount = &gc.controlPlaneMachineCount
-	}
-	if cmd.Flags().Changed("worker-machine-count") {
-		templateOptions.WorkerMachineCount = &gc.workerMachineCount
-	}
-
-	if gc.url != "" {
-		templateOptions.URLSource = &client.URLSourceOptions{
-			URL: gc.url,
-		}
-	}
-
-	if gc.configMapNamespace != "" || gc.configMapName != "" || gc.configMapDataKey != "" {
-		templateOptions.ConfigMapSource = &client.ConfigMapSourceOptions{
-			Namespace: gc.configMapNamespace,
-			Name:      gc.configMapName,
-			DataKey:   gc.configMapDataKey,
-		}
-	}
-
-	if gc.infrastructureProvider != "" || gc.flavor != "" {
-		templateOptions.ProviderRepositorySource = &client.ProviderRepositorySourceOptions{
-			InfrastructureProvider: gc.infrastructureProvider,
-			Flavor:                 gc.flavor,
-		}
-	}
-
-	template, err := c.GetClusterTemplate(templateOptions)
-	if err != nil {
-		return err
-	}
-
-	if gc.listVariables {
-		return printVariablesOutput(template)
-	}
-
-	return printYamlOutput(template)
-}
diff --git a/cmd/clusterctl/cmd/generate_provider.go b/cmd/clusterctl/cmd/generate_provider.go
deleted file mode 100644
index 4bade88ea..000000000
--- a/cmd/clusterctl/cmd/generate_provider.go
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
-Copyright 2021 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 cmd
-
-import (
-	"github.com/pkg/errors"
-	"github.com/spf13/cobra"
-	clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3"
-	"sigs.k8s.io/cluster-api/cmd/clusterctl/client"
-)
-
-type generateProvidersOptions struct {
-	coreProvider           string
-	bootstrapProvider      string
-	controlPlaneProvider   string
-	infrastructureProvider string
-	targetNamespace        string
-	watchingNamespace      string
-	textOutput             bool
-}
-
-var gpo = &generateProvidersOptions{}
-
-var generateProviderCmd = &cobra.Command{
-	Use:   "provider",
-	Args:  cobra.NoArgs,
-	Short: "Generate templates for provider components.",
-	Long: LongDesc(`
-		Generate templates for provider components.
-
-		clusterctl fetches the provider components from the provider repository and performs variable substitution.
-		
-		Variable values are either sourced from the clusterctl config file or
-		from environment variables`),
-
-	Example: Examples(`
-		# Generates a yaml file for creating provider with variable values using
-        # components defined in the provider repository.
-		clusterctl generate provider --infrastructure aws
-
-		# Generates a yaml file for creating provider for a specific version with variable values using
-        # components defined in the provider repository.
-		clusterctl generate provider --infrastructure aws:v0.4.1
-
-		# Displays information about a specific infrastructure provider.
-		# If applicable, prints out the list of required environment variables.
-		clusterctl generate provider --infrastructure aws --describe
-
-		# Displays information about a specific version of the infrastructure provider.
-		clusterctl generate provider --infrastructure aws:v0.4.1 --describe`),
-
-	RunE: func(cmd *cobra.Command, args []string) error {
-		return runGenerateProviderComponents()
-	},
-}
-
-func init() {
-	generateProviderCmd.Flags().StringVar(&gpo.coreProvider, "core", "",
-		"Core provider and version (e.g. cluster-api:v0.3.0)")
-	generateProviderCmd.Flags().StringVarP(&gpo.infrastructureProvider, "infrastructure", "i", "",
-		"Infrastructure provider and version (e.g. aws:v0.5.0)")
-	generateProviderCmd.Flags().StringVarP(&gpo.bootstrapProvider, "bootstrap", "b", "",
-		"Bootstrap provider and version (e.g. kubeadm:v0.3.0)")
-	generateProviderCmd.Flags().StringVarP(&gpo.controlPlaneProvider, "control-plane", "c", "",
-		"ControlPlane provider and version (e.g. kubeadm:v0.3.0)")
-	generateProviderCmd.Flags().StringVar(&gpo.targetNamespace, "target-namespace", "",
-		"The target namespace where the provider should be deployed. If unspecified, the components default namespace is used.")
-	generateProviderCmd.Flags().StringVar(&gpo.watchingNamespace, "watching-namespace", "",
-		"Namespace the provider should watch when reconciling objects. If unspecified, all namespaces are watched.")
-	generateProviderCmd.Flags().BoolVar(&gpo.textOutput, "describe", false,
-		"Generate configuration without variable substitution.")
-
-	generateCmd.AddCommand(generateProviderCmd)
-}
-
-func runGenerateProviderComponents() error {
-	providerName, providerType, err := parseProvider()
-	if err != nil {
-		return err
-	}
-	c, err := client.New(cfgFile)
-	if err != nil {
-		return err
-	}
-
-	options := client.ComponentsOptions{
-		TargetNamespace:   gpo.targetNamespace,
-		WatchingNamespace: gpo.watchingNamespace,
-	}
-	components, err := c.GetProviderComponents(providerName, providerType, options)
-	if err != nil {
-		return err
-	}
-
-	if gpo.textOutput {
-		return printComponentsAsText(components)
-	}
-
-	return printYamlOutput(components)
-}
-
-// parseProvider parses command line flags and returns the provider name and type.
-func parseProvider() (string, clusterctlv1.ProviderType, error) {
-	providerName := gpo.coreProvider
-	providerType := clusterctlv1.CoreProviderType
-	if gpo.bootstrapProvider != "" {
-		if providerName != "" {
-			return "", "", errors.New("only one of --core, --bootstrap, --control-plane, --infrastructure should be set")
-		}
-		providerName = gpo.bootstrapProvider
-		providerType = clusterctlv1.BootstrapProviderType
-	}
-	if gpo.controlPlaneProvider != "" {
-		if providerName != "" {
-			return "", "", errors.New("only one of --core, --bootstrap, --control-plane, --infrastructure should be set")
-		}
-		providerName = gpo.controlPlaneProvider
-		providerType = clusterctlv1.ControlPlaneProviderType
-	}
-	if gpo.infrastructureProvider != "" {
-		if providerName != "" {
-			return "", "", errors.New("only one of --core, --bootstrap, --control-plane, --infrastructure should be set")
-		}
-		providerName = gpo.infrastructureProvider
-		providerType = clusterctlv1.InfrastructureProviderType
-	}
-	if providerName == "" {
-		return "", "", errors.New("at least one of --core, --bootstrap, --control-plane, --infrastructure should be set")
-	}
-
-	return providerName, providerType, nil
-}
diff --git a/cmd/clusterctl/cmd/rollout/pause.go b/cmd/clusterctl/cmd/rollout/pause.go
index e95996450..541b11249 100644
--- a/cmd/clusterctl/cmd/rollout/pause.go
+++ b/cmd/clusterctl/cmd/rollout/pause.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package rollout implements the clusterctl rollout command.
 package rollout
 
 import (
diff --git a/cmd/clusterctl/cmd/util.go b/cmd/clusterctl/cmd/util.go
deleted file mode 100644
index 36963ddfb..000000000
--- a/cmd/clusterctl/cmd/util.go
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-Copyright 2021 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 cmd
-
-import (
-	"fmt"
-	"os"
-	"path/filepath"
-	"strings"
-
-	"github.com/pkg/errors"
-
-	"sigs.k8s.io/cluster-api/cmd/clusterctl/client"
-)
-
-// printYamlOutput prints the yaml content of a generated template to stdout.
-func printYamlOutput(printer client.YamlPrinter) error {
-	yaml, err := printer.Yaml()
-	if err != nil {
-		return err
-	}
-	yaml = append(yaml, '\n')
-
-	if _, err := os.Stdout.Write(yaml); err != nil {
-		return errors.Wrap(err, "failed to write yaml to Stdout")
-	}
-	return nil
-}
-
-// printVariablesOutput prints the expected variables in the template to stdout.
-func printVariablesOutput(printer client.YamlPrinter) error {
-	if len(printer.Variables()) > 0 {
-		fmt.Println("Variables:")
-		for _, v := range printer.Variables() {
-			fmt.Printf("  - %s\n", v)
-		}
-	}
-	fmt.Println()
-	return nil
-}
-
-// printComponentsAsText prints information about the components to stdout.
-func printComponentsAsText(c client.Components) error {
-	dir, file := filepath.Split(c.URL())
-	// Remove the version suffix from the URL since we already display it
-	// separately.
-	baseURL, _ := filepath.Split(strings.TrimSuffix(dir, "/"))
-	fmt.Printf("Name:               %s\n", c.Name())
-	fmt.Printf("Type:               %s\n", c.Type())
-	fmt.Printf("URL:                %s\n", baseURL)
-	fmt.Printf("Version:            %s\n", c.Version())
-	fmt.Printf("File:               %s\n", file)
-	fmt.Printf("TargetNamespace:    %s\n", c.TargetNamespace())
-	fmt.Printf("WatchingNamespace:  %s\n", c.WatchingNamespace())
-	if len(c.Variables()) > 0 {
-		fmt.Println("Variables:")
-		for _, v := range c.Variables() {
-			fmt.Printf("  - %s\n", v)
-		}
-	}
-	if len(c.Images()) > 0 {
-		fmt.Println("Images:")
-		for _, v := range c.Images() {
-			fmt.Printf("  - %s\n", v)
-		}
-	}
-	fmt.Println()
-
-	return nil
-}
diff --git a/cmd/clusterctl/config/embedded_manifest.go b/cmd/clusterctl/config/embedded_manifest.go
index f278d741e..312bebe5e 100644
--- a/cmd/clusterctl/config/embedded_manifest.go
+++ b/cmd/clusterctl/config/embedded_manifest.go
@@ -13,8 +13,6 @@ 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 config implements clusterctl config functionality.
 package config
 
 import _ "embed"
diff --git a/cmd/clusterctl/internal/scheme/scheme.go b/cmd/clusterctl/internal/scheme/scheme.go
index 1956de541..138f5630d 100644
--- a/cmd/clusterctl/internal/scheme/scheme.go
+++ b/cmd/clusterctl/internal/scheme/scheme.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package scheme implements clusterctl scheme functionality.
 package scheme
 
 import (
diff --git a/cmd/clusterctl/internal/util/doc.go b/cmd/clusterctl/internal/util/doc.go
deleted file mode 100644
index 7bda1e336..000000000
--- a/cmd/clusterctl/internal/util/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 util implements clusterctl utilty functions.
-package util
diff --git a/controllers/doc.go b/controllers/doc.go
index 3abdb1a9d..e9ed777c1 100644
--- a/controllers/doc.go
+++ b/controllers/doc.go
@@ -14,5 +14,4 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package controllers implements controllers.
 package controllers
diff --git a/controllers/external/doc.go b/controllers/external/doc.go
deleted file mode 100644
index fb21f5378..000000000
--- a/controllers/external/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 external implements external controller types.
-package external
diff --git a/controllers/mdutil/doc.go b/controllers/mdutil/doc.go
deleted file mode 100644
index 6653a2265..000000000
--- a/controllers/mdutil/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 mdutil implements MachineDeployment utilities.
-package mdutil
diff --git a/controllers/mdutil/util.go b/controllers/mdutil/util.go
index 2bdd47002..c7ef2e587 100644
--- a/controllers/mdutil/util.go
+++ b/controllers/mdutil/util.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package mdutil implements MachineDeployment utilities.
 package mdutil
 
 import (
diff --git a/controllers/noderefutil/providerid.go b/controllers/noderefutil/providerid.go
index e1f9bb585..85b94c702 100644
--- a/controllers/noderefutil/providerid.go
+++ b/controllers/noderefutil/providerid.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package noderefutil implements NodeRef utils.
 package noderefutil
 
 import (
diff --git a/controllers/remote/doc.go b/controllers/remote/doc.go
deleted file mode 100644
index ff86a4332..000000000
--- a/controllers/remote/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 remote implements remote controllers.
-package remote
diff --git a/controllers/remote/fake/cluster.go b/controllers/remote/fake/cluster.go
index 237ce2503..b41f4baf7 100644
--- a/controllers/remote/fake/cluster.go
+++ b/controllers/remote/fake/cluster.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package fake implements testing fakes.
 package fake
 
 import (
diff --git a/controlplane/kubeadm/api/v1alpha3/conversion.go b/controlplane/kubeadm/api/v1alpha3/conversion.go
index 033262a0b..7edfab18c 100644
--- a/controlplane/kubeadm/api/v1alpha3/conversion.go
+++ b/controlplane/kubeadm/api/v1alpha3/conversion.go
@@ -19,6 +19,7 @@ package v1alpha3
 import (
 	apiconversion "k8s.io/apimachinery/pkg/conversion"
 	"sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4"
+
 	utilconversion "sigs.k8s.io/cluster-api/util/conversion"
 	"sigs.k8s.io/controller-runtime/pkg/conversion"
 )
@@ -37,7 +38,6 @@ func (src *KubeadmControlPlane) ConvertTo(destRaw conversion.Hub) error {
 	}
 
 	dest.Spec.RolloutStrategy = restored.Spec.RolloutStrategy
-	dest.Spec.MachineTemplate.ObjectMeta = restored.Spec.MachineTemplate.ObjectMeta
 
 	return nil
 }
@@ -69,12 +69,10 @@ func (dest *KubeadmControlPlaneList) ConvertFrom(srcRaw conversion.Hub) error {
 
 func Convert_v1alpha4_KubeadmControlPlaneSpec_To_v1alpha3_KubeadmControlPlaneSpec(in *v1alpha4.KubeadmControlPlaneSpec, out *KubeadmControlPlaneSpec, s apiconversion.Scope) error {
 	out.UpgradeAfter = in.RolloutAfter
-	out.InfrastructureTemplate = in.MachineTemplate.InfrastructureRef
 	return autoConvert_v1alpha4_KubeadmControlPlaneSpec_To_v1alpha3_KubeadmControlPlaneSpec(in, out, s)
 }
 
 func Convert_v1alpha3_KubeadmControlPlaneSpec_To_v1alpha4_KubeadmControlPlaneSpec(in *KubeadmControlPlaneSpec, out *v1alpha4.KubeadmControlPlaneSpec, s apiconversion.Scope) error {
 	out.RolloutAfter = in.UpgradeAfter
-	out.MachineTemplate.InfrastructureRef = in.InfrastructureTemplate
 	return autoConvert_v1alpha3_KubeadmControlPlaneSpec_To_v1alpha4_KubeadmControlPlaneSpec(in, out, s)
 }
diff --git a/controlplane/kubeadm/api/v1alpha3/doc.go b/controlplane/kubeadm/api/v1alpha3/doc.go
index a80c8a4cd..d24536248 100644
--- a/controlplane/kubeadm/api/v1alpha3/doc.go
+++ b/controlplane/kubeadm/api/v1alpha3/doc.go
@@ -14,6 +14,5 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package v1alpha3 contains the v1alpha3 API implementation.
 // +k8s:conversion-gen=sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4
 package v1alpha3
diff --git a/controlplane/kubeadm/api/v1alpha3/zz_generated.conversion.go b/controlplane/kubeadm/api/v1alpha3/zz_generated.conversion.go
index ceba5976a..569cd9210 100644
--- a/controlplane/kubeadm/api/v1alpha3/zz_generated.conversion.go
+++ b/controlplane/kubeadm/api/v1alpha3/zz_generated.conversion.go
@@ -160,7 +160,7 @@ func Convert_v1alpha4_KubeadmControlPlaneList_To_v1alpha3_KubeadmControlPlaneLis
 func autoConvert_v1alpha3_KubeadmControlPlaneSpec_To_v1alpha4_KubeadmControlPlaneSpec(in *KubeadmControlPlaneSpec, out *v1alpha4.KubeadmControlPlaneSpec, s conversion.Scope) error {
 	out.Replicas = (*int32)(unsafe.Pointer(in.Replicas))
 	out.Version = in.Version
-	// WARNING: in.InfrastructureTemplate requires manual conversion: does not exist in peer-type
+	out.InfrastructureTemplate = in.InfrastructureTemplate
 	if err := apiv1alpha3.Convert_v1alpha3_KubeadmConfigSpec_To_v1alpha4_KubeadmConfigSpec(&in.KubeadmConfigSpec, &out.KubeadmConfigSpec, s); err != nil {
 		return err
 	}
@@ -172,7 +172,7 @@ func autoConvert_v1alpha3_KubeadmControlPlaneSpec_To_v1alpha4_KubeadmControlPlan
 func autoConvert_v1alpha4_KubeadmControlPlaneSpec_To_v1alpha3_KubeadmControlPlaneSpec(in *v1alpha4.KubeadmControlPlaneSpec, out *KubeadmControlPlaneSpec, s conversion.Scope) error {
 	out.Replicas = (*int32)(unsafe.Pointer(in.Replicas))
 	out.Version = in.Version
-	// WARNING: in.MachineTemplate requires manual conversion: does not exist in peer-type
+	out.InfrastructureTemplate = in.InfrastructureTemplate
 	if err := apiv1alpha3.Convert_v1alpha4_KubeadmConfigSpec_To_v1alpha3_KubeadmConfigSpec(&in.KubeadmConfigSpec, &out.KubeadmConfigSpec, s); err != nil {
 		return err
 	}
diff --git a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go b/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go
index 87e3a15bb..c32bb75ae 100644
--- a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go
+++ b/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go
@@ -58,9 +58,9 @@ type KubeadmControlPlaneSpec struct {
 	// Version defines the desired Kubernetes version.
 	Version string `json:"version"`
 
-	// MachineTemplate contains information about how machines
-	// should be shaped when creating or updating a control plane.
-	MachineTemplate KubeadmControlPlaneMachineTemplate `json:"machineTemplate"`
+	// InfrastructureTemplate is a required reference to a custom resource
+	// offered by an infrastructure provider.
+	InfrastructureTemplate corev1.ObjectReference `json:"infrastructureTemplate"`
 
 	// KubeadmConfigSpec is a KubeadmConfigSpec
 	// to use for initializing and joining machines to the control plane.
@@ -85,17 +85,6 @@ type KubeadmControlPlaneSpec struct {
 	RolloutStrategy *RolloutStrategy `json:"rolloutStrategy,omitempty"`
 }
 
-type KubeadmControlPlaneMachineTemplate struct {
-	// Standard object's metadata.
-	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
-	// +optional
-	ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"`
-
-	// InfrastructureRef is a required reference to a custom resource
-	// offered by an infrastructure provider.
-	InfrastructureRef corev1.ObjectReference `json:"infrastructureRef"`
-}
-
 // RolloutStrategy describes how to replace existing machines
 // with new ones.
 type RolloutStrategy struct {
diff --git a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_webhook.go b/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_webhook.go
index 7e3da35dc..0361aa5c3 100644
--- a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_webhook.go
+++ b/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_webhook.go
@@ -54,8 +54,8 @@ func (in *KubeadmControlPlane) Default() {
 		in.Spec.Replicas = &replicas
 	}
 
-	if in.Spec.MachineTemplate.InfrastructureRef.Namespace == "" {
-		in.Spec.MachineTemplate.InfrastructureRef.Namespace = in.Namespace
+	if in.Spec.InfrastructureTemplate.Namespace == "" {
+		in.Spec.InfrastructureTemplate.Namespace = in.Namespace
 	}
 
 	if !strings.HasPrefix(in.Spec.Version, "v") {
@@ -112,7 +112,7 @@ const (
 // ValidateUpdate implements webhook.Validator so a webhook will be registered for the type.
 func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error {
 	// add a * to indicate everything beneath is ok.
-	// For example, {"spec", "*"} will allow any path under "spec" to change.
+	// For example, {"spec", "*"} will allow any path under "spec" to change, such as spec.infrastructureTemplate.name
 	allowedPaths := [][]string{
 		{"metadata", "*"},
 		{spec, kubeadmConfigSpec, clusterConfiguration, "etcd", "local", "imageRepository"},
@@ -130,8 +130,7 @@ func (in *KubeadmControlPlane) ValidateUpdate(old runtime.Object) error {
 		{spec, kubeadmConfigSpec, files},
 		{spec, kubeadmConfigSpec, "verbosity"},
 		{spec, kubeadmConfigSpec, users},
-		{spec, "machineTemplate", "metadata"},
-		{spec, "machineTemplate", "infrastructureRef", "name"},
+		{spec, "infrastructureTemplate", "name"},
 		{spec, "replicas"},
 		{spec, "version"},
 		{spec, "rolloutAfter"},
@@ -275,32 +274,12 @@ func (in *KubeadmControlPlane) validateCommon() (allErrs field.ErrorList) {
 		}
 	}
 
-	if in.Spec.MachineTemplate.InfrastructureRef.APIVersion == "" {
+	if in.Spec.InfrastructureTemplate.Namespace != in.Namespace {
 		allErrs = append(
 			allErrs,
 			field.Invalid(
-				field.NewPath("spec", "machineTemplate", "infrastructure", "apiVersion"),
-				in.Spec.MachineTemplate.InfrastructureRef.APIVersion,
-				"cannot be empty",
-			),
-		)
-	}
-	if in.Spec.MachineTemplate.InfrastructureRef.Kind == "" {
-		allErrs = append(
-			allErrs,
-			field.Invalid(
-				field.NewPath("spec", "machineTemplate", "infrastructure", "kind"),
-				in.Spec.MachineTemplate.InfrastructureRef.Kind,
-				"cannot be empty",
-			),
-		)
-	}
-	if in.Spec.MachineTemplate.InfrastructureRef.Namespace != in.Namespace {
-		allErrs = append(
-			allErrs,
-			field.Invalid(
-				field.NewPath("spec", "machineTemplate", "infrastructure", "namespace"),
-				in.Spec.MachineTemplate.InfrastructureRef.Namespace,
+				field.NewPath("spec", "infrastructureTemplate", "namespace"),
+				in.Spec.InfrastructureTemplate.Namespace,
 				"must match metadata.namespace",
 			),
 		)
diff --git a/controlplane/kubeadm/api/v1alpha4/zz_generated.deepcopy.go b/controlplane/kubeadm/api/v1alpha4/zz_generated.deepcopy.go
index 18ce20741..ea03ac537 100644
--- a/controlplane/kubeadm/api/v1alpha4/zz_generated.deepcopy.go
+++ b/controlplane/kubeadm/api/v1alpha4/zz_generated.deepcopy.go
@@ -86,23 +86,6 @@ func (in *KubeadmControlPlaneList) DeepCopyObject() runtime.Object {
 	return nil
 }
 
-// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
-func (in *KubeadmControlPlaneMachineTemplate) DeepCopyInto(out *KubeadmControlPlaneMachineTemplate) {
-	*out = *in
-	in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
-	out.InfrastructureRef = in.InfrastructureRef
-}
-
-// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmControlPlaneMachineTemplate.
-func (in *KubeadmControlPlaneMachineTemplate) DeepCopy() *KubeadmControlPlaneMachineTemplate {
-	if in == nil {
-		return nil
-	}
-	out := new(KubeadmControlPlaneMachineTemplate)
-	in.DeepCopyInto(out)
-	return out
-}
-
 // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
 func (in *KubeadmControlPlaneSpec) DeepCopyInto(out *KubeadmControlPlaneSpec) {
 	*out = *in
@@ -111,7 +94,7 @@ func (in *KubeadmControlPlaneSpec) DeepCopyInto(out *KubeadmControlPlaneSpec) {
 		*out = new(int32)
 		**out = **in
 	}
-	in.MachineTemplate.DeepCopyInto(&out.MachineTemplate)
+	out.InfrastructureTemplate = in.InfrastructureTemplate
 	in.KubeadmConfigSpec.DeepCopyInto(&out.KubeadmConfigSpec)
 	if in.RolloutAfter != nil {
 		in, out := &in.RolloutAfter, &out.RolloutAfter
diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml
index 86cf1c599..ba8b5123b 100644
--- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml
+++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml
@@ -1221,6 +1221,43 @@ spec:
           spec:
             description: KubeadmControlPlaneSpec defines the desired state of KubeadmControlPlane.
             properties:
+              infrastructureTemplate:
+                description: InfrastructureTemplate is a required reference to a custom
+                  resource offered by an infrastructure provider.
+                properties:
+                  apiVersion:
+                    description: API version of the referent.
+                    type: string
+                  fieldPath:
+                    description: 'If referring to a piece of an object instead of
+                      an entire object, this string should contain a valid JSON/Go
+                      field access statement, such as desiredState.manifest.containers[2].
+                      For example, if the object reference is to a container within
+                      a pod, this would take on a value like: "spec.containers{name}"
+                      (where "name" refers to the name of the container that triggered
+                      the event) or if no container name is specified "spec.containers[2]"
+                      (container with index 2 in this pod). This syntax is chosen
+                      only to have some well-defined way of referencing a part of
+                      an object. TODO: this design is not final and this field is
+                      subject to change in the future.'
+                    type: string
+                  kind:
+                    description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
+                    type: string
+                  name:
+                    description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
+                    type: string
+                  namespace:
+                    description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
+                    type: string
+                  resourceVersion:
+                    description: 'Specific resourceVersion to which this reference
+                      is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
+                    type: string
+                  uid:
+                    description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
+                    type: string
+                type: object
               kubeadmConfigSpec:
                 description: KubeadmConfigSpec is a KubeadmConfigSpec to use for initializing
                   and joining machines to the control plane.
@@ -2135,71 +2172,6 @@ spec:
                     format: int32
                     type: integer
                 type: object
-              machineTemplate:
-                description: MachineTemplate contains information about how machines
-                  should be shaped when creating or updating a control plane.
-                properties:
-                  infrastructureRef:
-                    description: InfrastructureRef is a required reference to a custom
-                      resource offered by an infrastructure provider.
-                    properties:
-                      apiVersion:
-                        description: API version of the referent.
-                        type: string
-                      fieldPath:
-                        description: 'If referring to a piece of an object instead
-                          of an entire object, this string should contain a valid
-                          JSON/Go field access statement, such as desiredState.manifest.containers[2].
-                          For example, if the object reference is to a container within
-                          a pod, this would take on a value like: "spec.containers{name}"
-                          (where "name" refers to the name of the container that triggered
-                          the event) or if no container name is specified "spec.containers[2]"
-                          (container with index 2 in this pod). This syntax is chosen
-                          only to have some well-defined way of referencing a part
-                          of an object. TODO: this design is not final and this field
-                          is subject to change in the future.'
-                        type: string
-                      kind:
-                        description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
-                        type: string
-                      name:
-                        description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
-                        type: string
-                      namespace:
-                        description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
-                        type: string
-                      resourceVersion:
-                        description: 'Specific resourceVersion to which this reference
-                          is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
-                        type: string
-                      uid:
-                        description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
-                        type: string
-                    type: object
-                  metadata:
-                    description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
-                    properties:
-                      annotations:
-                        additionalProperties:
-                          type: string
-                        description: 'Annotations is an unstructured key value map
-                          stored with a resource that may be set by external tools
-                          to store and retrieve arbitrary metadata. They are not queryable
-                          and should be preserved when modifying objects. More info:
-                          http://kubernetes.io/docs/user-guide/annotations'
-                        type: object
-                      labels:
-                        additionalProperties:
-                          type: string
-                        description: 'Map of string keys and values that can be used
-                          to organize and categorize (scope and select) objects. May
-                          match selectors of replication controllers and services.
-                          More info: http://kubernetes.io/docs/user-guide/labels'
-                        type: object
-                    type: object
-                required:
-                - infrastructureRef
-                type: object
               nodeDrainTimeout:
                 description: 'NodeDrainTimeout is the total amount of time that the
                   controller will spend on draining a controlplane node The default
@@ -2247,8 +2219,8 @@ spec:
                 description: Version defines the desired Kubernetes version.
                 type: string
             required:
+            - infrastructureTemplate
             - kubeadmConfigSpec
-            - machineTemplate
             - version
             type: object
           status:
diff --git a/controlplane/kubeadm/controllers/controller.go b/controlplane/kubeadm/controllers/controller.go
index 347ef36c8..3a27a7c77 100644
--- a/controlplane/kubeadm/controllers/controller.go
+++ b/controlplane/kubeadm/controllers/controller.go
@@ -19,8 +19,6 @@ package controllers
 import (
 	"context"
 	"fmt"
-	expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4"
-	"sigs.k8s.io/cluster-api/feature"
 	"time"
 
 	"sigs.k8s.io/cluster-api/util/collections"
@@ -237,7 +235,7 @@ func (r *KubeadmControlPlaneReconciler) reconcile(ctx context.Context, cluster *
 	log.Info("Reconcile KubeadmControlPlane")
 
 	// Make sure to reconcile the external infrastructure reference.
-	if err := r.reconcileExternalReference(ctx, cluster, &kcp.Spec.MachineTemplate.InfrastructureRef); err != nil {
+	if err := r.reconcileExternalReference(ctx, cluster, kcp.Spec.InfrastructureTemplate); err != nil {
 		return ctrl.Result{}, err
 	}
 
@@ -425,16 +423,8 @@ func (r *KubeadmControlPlaneReconciler) reconcileDelete(ctx context.Context, clu
 	// all the machines are deleted in parallel.
 	conditions.SetAggregate(kcp, controlplanev1.MachinesReadyCondition, ownedMachines.ConditionGetters(), conditions.AddSourceRef(), conditions.WithStepCounterIf(false))
 
-	allMachinePools := &expv1.MachinePoolList{}
-	// Get all machine pools.
-	if feature.Gates.Enabled(feature.MachinePool) {
-		allMachinePools, err = r.managementCluster.GetMachinePoolsForCluster(ctx, cluster)
-		if err != nil {
-			return ctrl.Result{}, err
-		}
-	}
 	// Verify that only control plane machines remain
-	if len(allMachines) != len(ownedMachines) || len(allMachinePools.Items) != 0 {
+	if len(allMachines) != len(ownedMachines) {
 		log.Info("Waiting for worker nodes to be deleted first")
 		conditions.MarkFalse(kcp, controlplanev1.ResizedCondition, clusterv1.DeletingReason, clusterv1.ConditionSeverityInfo, "Waiting for worker nodes to be deleted first")
 		return ctrl.Result{RequeueAfter: deleteRequeueAfter}, nil
diff --git a/controlplane/kubeadm/controllers/doc.go b/controlplane/kubeadm/controllers/doc.go
deleted file mode 100644
index e6c967968..000000000
--- a/controlplane/kubeadm/controllers/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 controllers implements the Kubeadm controllers.
-package controllers
diff --git a/controlplane/kubeadm/controllers/helpers.go b/controlplane/kubeadm/controllers/helpers.go
index f536396f2..cac2d01cc 100644
--- a/controlplane/kubeadm/controllers/helpers.go
+++ b/controlplane/kubeadm/controllers/helpers.go
@@ -120,12 +120,12 @@ func (r *KubeadmControlPlaneReconciler) adoptKubeconfigSecret(ctx context.Contex
 	return nil
 }
 
-func (r *KubeadmControlPlaneReconciler) reconcileExternalReference(ctx context.Context, cluster *clusterv1.Cluster, ref *corev1.ObjectReference) error {
+func (r *KubeadmControlPlaneReconciler) reconcileExternalReference(ctx context.Context, cluster *clusterv1.Cluster, ref corev1.ObjectReference) error {
 	if !strings.HasSuffix(ref.Kind, external.TemplateSuffix) {
 		return nil
 	}
 
-	obj, err := external.Get(ctx, r.Client, ref, cluster.Namespace)
+	obj, err := external.Get(ctx, r.Client, &ref, cluster.Namespace)
 	if err != nil {
 		return err
 	}
@@ -162,12 +162,11 @@ func (r *KubeadmControlPlaneReconciler) cloneConfigsAndGenerateMachine(ctx conte
 	// Clone the infrastructure template
 	infraRef, err := external.CloneTemplate(ctx, &external.CloneTemplateInput{
 		Client:      r.Client,
-		TemplateRef: &kcp.Spec.MachineTemplate.InfrastructureRef,
+		TemplateRef: &kcp.Spec.InfrastructureTemplate,
 		Namespace:   kcp.Namespace,
 		OwnerRef:    infraCloneOwner,
 		ClusterName: cluster.Name,
-		Labels:      internal.ControlPlaneMachineLabelsForCluster(kcp, cluster.Name),
-		Annotations: kcp.Spec.MachineTemplate.ObjectMeta.Annotations,
+		Labels:      internal.ControlPlaneLabelsForCluster(cluster.Name),
 	})
 	if err != nil {
 		// Safe to return early here since no resources have been created yet.
@@ -238,8 +237,7 @@ func (r *KubeadmControlPlaneReconciler) generateKubeadmConfig(ctx context.Contex
 		ObjectMeta: metav1.ObjectMeta{
 			Name:            names.SimpleNameGenerator.GenerateName(kcp.Name + "-"),
 			Namespace:       kcp.Namespace,
-			Labels:          internal.ControlPlaneMachineLabelsForCluster(kcp, cluster.Name),
-			Annotations:     kcp.Spec.MachineTemplate.ObjectMeta.Annotations,
+			Labels:          internal.ControlPlaneLabelsForCluster(cluster.Name),
 			OwnerReferences: []metav1.OwnerReference{owner},
 		},
 		Spec: *spec,
@@ -263,10 +261,9 @@ func (r *KubeadmControlPlaneReconciler) generateKubeadmConfig(ctx context.Contex
 func (r *KubeadmControlPlaneReconciler) generateMachine(ctx context.Context, kcp *controlplanev1.KubeadmControlPlane, cluster *clusterv1.Cluster, infraRef, bootstrapRef *corev1.ObjectReference, failureDomain *string) error {
 	machine := &clusterv1.Machine{
 		ObjectMeta: metav1.ObjectMeta{
-			Name:        names.SimpleNameGenerator.GenerateName(kcp.Name + "-"),
-			Namespace:   kcp.Namespace,
-			Labels:      internal.ControlPlaneMachineLabelsForCluster(kcp, cluster.Name),
-			Annotations: kcp.Spec.MachineTemplate.ObjectMeta.Annotations,
+			Name:      names.SimpleNameGenerator.GenerateName(kcp.Name + "-"),
+			Namespace: kcp.Namespace,
+			Labels:    internal.ControlPlaneLabelsForCluster(cluster.Name),
 			OwnerReferences: []metav1.OwnerReference{
 				*metav1.NewControllerRef(kcp, controlplanev1.GroupVersion.WithKind("KubeadmControlPlane")),
 			},
diff --git a/controlplane/kubeadm/internal/cluster.go b/controlplane/kubeadm/internal/cluster.go
index 419bea8f9..a99f1dd9d 100644
--- a/controlplane/kubeadm/internal/cluster.go
+++ b/controlplane/kubeadm/internal/cluster.go
@@ -21,7 +21,6 @@ import (
 	"crypto/tls"
 	"crypto/x509"
 	"fmt"
-	expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4"
 	"time"
 
 	clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
@@ -45,7 +44,6 @@ type ManagementCluster interface {
 	ctrlclient.Reader
 
 	GetMachinesForCluster(ctx context.Context, cluster *clusterv1.Cluster, filters ...collections.Func) (collections.Machines, error)
-	GetMachinePoolsForCluster(ctx context.Context, cluster *clusterv1.Cluster) (*expv1.MachinePoolList, error)
 	GetWorkloadCluster(ctx context.Context, clusterKey client.ObjectKey) (WorkloadCluster, error)
 }
 
@@ -80,19 +78,6 @@ func (m *Management) GetMachinesForCluster(ctx context.Context, cluster *cluster
 	return collections.GetFilteredMachinesForCluster(ctx, m.Client, cluster, filters...)
 }
 
-// GetMachinePoolsForCluster returns a list of machine pools owned by the cluster.
-func (m *Management) GetMachinePoolsForCluster(ctx context.Context, cluster *clusterv1.Cluster) (*expv1.MachinePoolList, error) {
-	selectors := []client.ListOption{
-		client.InNamespace(cluster.GetNamespace()),
-		client.MatchingLabels{
-			clusterv1.ClusterLabelName: cluster.GetName(),
-		},
-	}
-	machinePoolList := &expv1.MachinePoolList{}
-	err := m.Client.List(ctx, machinePoolList, selectors...)
-	return machinePoolList, err
-}
-
 // GetWorkloadCluster builds a cluster object.
 // The cluster comes with an etcd client generator to connect to any etcd pod living on a managed machine.
 func (m *Management) GetWorkloadCluster(ctx context.Context, clusterKey client.ObjectKey) (WorkloadCluster, error) {
diff --git a/controlplane/kubeadm/internal/cluster_labels.go b/controlplane/kubeadm/internal/cluster_labels.go
index 4adffc6b9..f67b7c382 100644
--- a/controlplane/kubeadm/internal/cluster_labels.go
+++ b/controlplane/kubeadm/internal/cluster_labels.go
@@ -18,18 +18,12 @@ package internal
 
 import (
 	clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
-	controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4"
 )
 
-// ControlPlaneMachineLabelsForCluster returns a set of labels to add to a control plane machine for this specific cluster.
-func ControlPlaneMachineLabelsForCluster(kcp *controlplanev1.KubeadmControlPlane, clusterName string) map[string]string {
-	labels := kcp.Spec.MachineTemplate.ObjectMeta.Labels
-	if labels == nil {
-		labels = map[string]string{}
+// ControlPlaneLabelsForCluster returns a set of labels to add to a control plane machine for this specific cluster.
+func ControlPlaneLabelsForCluster(clusterName string) map[string]string {
+	return map[string]string{
+		clusterv1.ClusterLabelName:             clusterName,
+		clusterv1.MachineControlPlaneLabelName: "",
 	}
-
-	// Always force these labels over the ones coming from the spec.
-	labels[clusterv1.ClusterLabelName] = clusterName
-	labels[clusterv1.MachineControlPlaneLabelName] = ""
-	return labels
 }
diff --git a/controlplane/kubeadm/internal/control_plane.go b/controlplane/kubeadm/internal/control_plane.go
index 29b6ba5bd..9b943f433 100644
--- a/controlplane/kubeadm/internal/control_plane.go
+++ b/controlplane/kubeadm/internal/control_plane.go
@@ -107,9 +107,9 @@ func (c *ControlPlane) Version() *string {
 	return &c.KCP.Spec.Version
 }
 
-// MachineInfrastructureTemplateRef returns the KubeadmControlPlane's infrastructure template for Machines.
-func (c *ControlPlane) MachineInfrastructureTemplateRef() *corev1.ObjectReference {
-	return &c.KCP.Spec.MachineTemplate.InfrastructureRef
+// InfrastructureTemplate returns the KubeadmControlPlane's infrastructure template.
+func (c *ControlPlane) InfrastructureTemplate() *corev1.ObjectReference {
+	return &c.KCP.Spec.InfrastructureTemplate
 }
 
 // AsOwnerReference returns an owner reference to the KubeadmControlPlane.
@@ -205,8 +205,7 @@ func (c *ControlPlane) GenerateKubeadmConfig(spec *bootstrapv1.KubeadmConfigSpec
 		ObjectMeta: metav1.ObjectMeta{
 			Name:            names.SimpleNameGenerator.GenerateName(c.KCP.Name + "-"),
 			Namespace:       c.KCP.Namespace,
-			Labels:          ControlPlaneMachineLabelsForCluster(c.KCP, c.Cluster.Name),
-			Annotations:     c.KCP.Spec.MachineTemplate.ObjectMeta.Annotations,
+			Labels:          ControlPlaneLabelsForCluster(c.Cluster.Name),
 			OwnerReferences: []metav1.OwnerReference{owner},
 		},
 		Spec: *spec,
@@ -218,10 +217,9 @@ func (c *ControlPlane) GenerateKubeadmConfig(spec *bootstrapv1.KubeadmConfigSpec
 func (c *ControlPlane) NewMachine(infraRef, bootstrapRef *corev1.ObjectReference, failureDomain *string) *clusterv1.Machine {
 	return &clusterv1.Machine{
 		ObjectMeta: metav1.ObjectMeta{
-			Name:        names.SimpleNameGenerator.GenerateName(c.KCP.Name + "-"),
-			Namespace:   c.KCP.Namespace,
-			Labels:      ControlPlaneMachineLabelsForCluster(c.KCP, c.Cluster.Name),
-			Annotations: c.KCP.Spec.MachineTemplate.ObjectMeta.Annotations,
+			Name:      names.SimpleNameGenerator.GenerateName(c.KCP.Name + "-"),
+			Namespace: c.KCP.Namespace,
+			Labels:    ControlPlaneLabelsForCluster(c.Cluster.Name),
 			OwnerReferences: []metav1.OwnerReference{
 				*metav1.NewControllerRef(c.KCP, controlplanev1.GroupVersion.WithKind("KubeadmControlPlane")),
 			},
@@ -263,7 +261,7 @@ func (c *ControlPlane) MachinesNeedingRollout() collections.Machines {
 		// Machines that are scheduled for rollout (KCP.Spec.RolloutAfter set, the RolloutAfter deadline is expired, and the machine was created before the deadline).
 		collections.ShouldRolloutAfter(&c.reconciliationTime, c.KCP.Spec.RolloutAfter),
 		// Machines that do not match with KCP config.
-		collections.Not(MatchesMachineSpec(c.infraResources, c.kubeadmConfigs, c.KCP)),
+		collections.Not(MatchesKCPConfiguration(c.infraResources, c.kubeadmConfigs, c.KCP)),
 	)
 }
 
diff --git a/controlplane/kubeadm/internal/doc.go b/controlplane/kubeadm/internal/doc.go
deleted file mode 100644
index 615c27668..000000000
--- a/controlplane/kubeadm/internal/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 internal contains internal implementation details for the Kubeadm Control Plane.
-package internal
diff --git a/controlplane/kubeadm/internal/etcd/fake/client.go b/controlplane/kubeadm/internal/etcd/fake/client.go
index ee6d9efb7..98ce83c9a 100644
--- a/controlplane/kubeadm/internal/etcd/fake/client.go
+++ b/controlplane/kubeadm/internal/etcd/fake/client.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package fake implements testing fakes.
 package fake
 
 import (
diff --git a/controlplane/kubeadm/internal/etcd/util/util.go b/controlplane/kubeadm/internal/etcd/util/util.go
index bb7dc836b..9876aa7ea 100644
--- a/controlplane/kubeadm/internal/etcd/util/util.go
+++ b/controlplane/kubeadm/internal/etcd/util/util.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package util implements etcd utility functions.
 package util
 
 import (
diff --git a/controlplane/kubeadm/internal/filters.go b/controlplane/kubeadm/internal/filters.go
index 85c5faabc..b2b5da9f6 100644
--- a/controlplane/kubeadm/internal/filters.go
+++ b/controlplane/kubeadm/internal/filters.go
@@ -25,16 +25,12 @@ import (
 	bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4"
 	controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4"
 	"sigs.k8s.io/cluster-api/util/collections"
-	"sigs.k8s.io/controller-runtime/pkg/client"
 )
 
-// MatchesMachineSpec returns a filter to find all machines that matches with KCP config and do not require any rollout.
+// MatchesKCPConfiguration returns a filter to find all machines that matches with KCP config and do not require any rollout.
 // Kubernetes version, infrastructure template, and KubeadmConfig field need to be equivalent.
-func MatchesMachineSpec(infraConfigs map[string]*unstructured.Unstructured, machineConfigs map[string]*bootstrapv1.KubeadmConfig, kcp *controlplanev1.KubeadmControlPlane) func(machine *clusterv1.Machine) bool {
+func MatchesKCPConfiguration(infraConfigs map[string]*unstructured.Unstructured, machineConfigs map[string]*bootstrapv1.KubeadmConfig, kcp *controlplanev1.KubeadmControlPlane) func(machine *clusterv1.Machine) bool {
 	return collections.And(
-		func(machine *clusterv1.Machine) bool {
-			return matchMachineTemplateMetadata(kcp, machine)
-		},
 		collections.MatchesKubernetesVersion(kcp.Spec.Version),
 		MatchesKubeadmBootstrapConfig(machineConfigs, kcp),
 		MatchesTemplateClonedFrom(infraConfigs, kcp),
@@ -63,13 +59,8 @@ func MatchesTemplateClonedFrom(infraConfigs map[string]*unstructured.Unstructure
 		}
 
 		// Check if the machine's infrastructure reference has been created from the current KCP infrastructure template.
-		if clonedFromName != kcp.Spec.MachineTemplate.InfrastructureRef.Name ||
-			clonedFromGroupKind != kcp.Spec.MachineTemplate.InfrastructureRef.GroupVersionKind().GroupKind().String() {
-			return false
-		}
-
-		// Check if the machine template metadata matches with the infrastructure object.
-		if !matchMachineTemplateMetadata(kcp, infraObj) {
+		if clonedFromName != kcp.Spec.InfrastructureTemplate.Name ||
+			clonedFromGroupKind != kcp.Spec.InfrastructureTemplate.GroupVersionKind().GroupKind().String() {
 			return false
 		}
 		return true
@@ -88,29 +79,10 @@ func MatchesKubeadmBootstrapConfig(machineConfigs map[string]*bootstrapv1.Kubead
 			return false
 		}
 
-		bootstrapRef := machine.Spec.Bootstrap.ConfigRef
-		if bootstrapRef == nil {
-			// Missing bootstrap reference should not be considered as unmatching.
-			// This is a safety precaution to avoid selecting machines that are broken, which in the future should be remediated separately.
-			return true
-		}
-
-		machineConfig, found := machineConfigs[machine.Name]
-		if !found {
-			// Return true here because failing to get KubeadmConfig should not be considered as unmatching.
-			// This is a safety precaution to avoid rolling out machines if the client or the api-server is misbehaving.
-			return true
-		}
-
-		// Check if the machine template metadata matches with the infrastructure object.
-		if !matchMachineTemplateMetadata(kcp, machineConfig) {
-			return false
-		}
-
 		// Check if KCP and machine InitConfiguration or JoinConfiguration matches
 		// NOTE: only one between init configuration and join configuration is set on a machine, depending
 		// on the fact that the machine was the initial control plane node or a joining control plane node.
-		return matchInitOrJoinConfiguration(machineConfig, kcp)
+		return matchInitOrJoinConfiguration(machineConfigs, kcp, machine)
 	}
 }
 
@@ -150,8 +122,16 @@ func matchClusterConfiguration(kcp *controlplanev1.KubeadmControlPlane, machine
 
 // matchInitOrJoinConfiguration verifies if KCP and machine InitConfiguration or JoinConfiguration matches.
 // NOTE: By extension this method takes care of detecting changes in other fields of the KubeadmConfig configuration (e.g. Files, Mounts etc.)
-func matchInitOrJoinConfiguration(machineConfig *bootstrapv1.KubeadmConfig, kcp *controlplanev1.KubeadmControlPlane) bool {
-	if machineConfig == nil {
+func matchInitOrJoinConfiguration(machineConfigs map[string]*bootstrapv1.KubeadmConfig, kcp *controlplanev1.KubeadmControlPlane, machine *clusterv1.Machine) bool {
+	bootstrapRef := machine.Spec.Bootstrap.ConfigRef
+	if bootstrapRef == nil {
+		// Missing bootstrap reference should not be considered as unmatching.
+		// This is a safety precaution to avoid selecting machines that are broken, which in the future should be remediated separately.
+		return true
+	}
+
+	machineConfig, found := machineConfigs[machine.Name]
+	if !found {
 		// Return true here because failing to get KubeadmConfig should not be considered as unmatching.
 		// This is a safety precaution to avoid rolling out machines if the client or the api-server is misbehaving.
 		return true
@@ -232,30 +212,3 @@ func cleanupConfigFields(kcpConfig *bootstrapv1.KubeadmConfigSpec, machineConfig
 		machineConfig.Spec.JoinConfiguration.TypeMeta = kcpConfig.JoinConfiguration.TypeMeta
 	}
 }
-
-// matchMachineTemplateMetadata matches the machine template object meta information,
-// specifically annotations and labels, against an object.
-func matchMachineTemplateMetadata(kcp *controlplanev1.KubeadmControlPlane, obj client.Object) bool {
-	// Check if annotations and labels match.
-	if !isSubsetMapOf(kcp.Spec.MachineTemplate.ObjectMeta.Annotations, obj.GetAnnotations()) {
-		return false
-	}
-	if !isSubsetMapOf(kcp.Spec.MachineTemplate.ObjectMeta.Labels, obj.GetLabels()) {
-		return false
-	}
-	return true
-}
-
-func isSubsetMapOf(base map[string]string, existing map[string]string) bool {
-loopBase:
-	for key, value := range base {
-		for existingKey, existingValue := range existing {
-			if existingKey == key && existingValue == value {
-				continue loopBase
-			}
-		}
-		// Return false right away if a key value pair wasn't found.
-		return false
-	}
-	return true
-}
diff --git a/controlplane/kubeadm/internal/proxy/addr.go b/controlplane/kubeadm/internal/proxy/addr.go
index d29f4dc25..0c8f2d755 100644
--- a/controlplane/kubeadm/internal/proxy/addr.go
+++ b/controlplane/kubeadm/internal/proxy/addr.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package proxy implements kubeadm proxy functionality.
 package proxy
 
 import (
diff --git a/errors/doc.go b/errors/doc.go
deleted file mode 100644
index 81c288385..000000000
--- a/errors/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 errors implements error functionality.
-package errors
diff --git a/exp/addons/api/v1alpha3/doc.go b/exp/addons/api/v1alpha3/doc.go
index e87dca87a..abc6b654b 100644
--- a/exp/addons/api/v1alpha3/doc.go
+++ b/exp/addons/api/v1alpha3/doc.go
@@ -14,6 +14,5 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package v1alpha3 contains the v1alpha3 API implementation.
 // +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4
 package v1alpha3
diff --git a/exp/addons/controllers/doc.go b/exp/addons/controllers/doc.go
deleted file mode 100644
index fe1e583eb..000000000
--- a/exp/addons/controllers/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 controllers implements experimental addon controllers.
-package controllers
diff --git a/exp/addons/controllers/predicates/resource_predicates.go b/exp/addons/controllers/predicates/resource_predicates.go
index b297fa99e..68042516a 100644
--- a/exp/addons/controllers/predicates/resource_predicates.go
+++ b/exp/addons/controllers/predicates/resource_predicates.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package predicates implements predicate functionality.
 package predicates
 
 import (
diff --git a/exp/api/v1alpha3/doc.go b/exp/api/v1alpha3/doc.go
index 781a05726..3311fd5c9 100644
--- a/exp/api/v1alpha3/doc.go
+++ b/exp/api/v1alpha3/doc.go
@@ -14,6 +14,5 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package v1alpha3 contains the v1alpha3 API implementation.
 // +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/api/v1alpha4
 package v1alpha3
diff --git a/exp/controllers/doc.go b/exp/controllers/doc.go
deleted file mode 100644
index a58a55ea3..000000000
--- a/exp/controllers/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 controllers implements experimental controllers.
-package controllers
diff --git a/exp/doc.go b/exp/doc.go
index 62612cb7c..68e7b8738 100644
--- a/exp/doc.go
+++ b/exp/doc.go
@@ -14,5 +14,4 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package exp implements experimental code.
 package exp
diff --git a/exp/util/util.go b/exp/util/util.go
index 93cb93054..e175e7bd5 100644
--- a/exp/util/util.go
+++ b/exp/util/util.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package util implements utility functions.
 package util
 
 import (
diff --git a/feature/feature.go b/feature/feature.go
index e9b288a70..9bac3ad3f 100644
--- a/feature/feature.go
+++ b/feature/feature.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package feature implements feature functionality.
 package feature
 
 import (
diff --git a/go.mod b/go.mod
index c8221f426..07fd1d59c 100644
--- a/go.mod
+++ b/go.mod
@@ -26,15 +26,15 @@ require (
 	go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489
 	golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
 	google.golang.org/grpc v1.27.1
-	k8s.io/api v0.21.1
-	k8s.io/apiextensions-apiserver v0.21.1
-	k8s.io/apimachinery v0.21.1
-	k8s.io/apiserver v0.21.1
-	k8s.io/client-go v0.21.1
-	k8s.io/cluster-bootstrap v0.21.1
-	k8s.io/component-base v0.21.1
+	k8s.io/api v0.21.0
+	k8s.io/apiextensions-apiserver v0.21.0
+	k8s.io/apimachinery v0.21.0
+	k8s.io/apiserver v0.21.0
+	k8s.io/client-go v0.21.0
+	k8s.io/cluster-bootstrap v0.21.0
+	k8s.io/component-base v0.21.0
 	k8s.io/klog/v2 v2.8.0
-	k8s.io/kubectl v0.21.1
+	k8s.io/kubectl v0.21.0
 	k8s.io/utils v0.0.0-20210305010621-2afb4311ab10
 	sigs.k8s.io/controller-runtime v0.9.0-beta.5
 	sigs.k8s.io/kind v0.9.0
diff --git a/go.sum b/go.sum
index 2996144ae..e05728d2c 100644
--- a/go.sum
+++ b/go.sum
@@ -333,6 +333,8 @@ github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z
 github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
 github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
 github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
+github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
+github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
 github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
 github.com/gosuri/uitable v0.0.4 h1:IG2xLKRvErL3uhY6e1BylFzG+aJiwQviDDTfOKeKTpY=
 github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo=
@@ -1026,31 +1028,24 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
 honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=
 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
+k8s.io/api v0.21.0 h1:gu5iGF4V6tfVCQ/R+8Hc0h7H1JuEhzyEi9S4R5LM8+Y=
 k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU=
-k8s.io/api v0.21.1 h1:94bbZ5NTjdINJEdzOkpS4vdPhkb1VFpTYC9zh43f75c=
-k8s.io/api v0.21.1/go.mod h1:FstGROTmsSHBarKc8bylzXih8BLNYTiS3TZcsoEDg2s=
+k8s.io/apiextensions-apiserver v0.21.0 h1:Nd4uBuweg6ImzbxkC1W7xUNZcCV/8Vt10iTdTIVF3hw=
 k8s.io/apiextensions-apiserver v0.21.0/go.mod h1:gsQGNtGkc/YoDG9loKI0V+oLZM4ljRPjc/sql5tmvzc=
-k8s.io/apiextensions-apiserver v0.21.1 h1:AA+cnsb6w7SZ1vD32Z+zdgfXdXY8X9uGX5bN6EoPEIo=
-k8s.io/apiextensions-apiserver v0.21.1/go.mod h1:KESQFCGjqVcVsZ9g0xX5bacMjyX5emuWcS2arzdEouA=
 k8s.io/apimachinery v0.18.8/go.mod h1:6sQd+iHEqmOtALqOFjSWp2KZ9F0wlU/nWm0ZgsYWMig=
+k8s.io/apimachinery v0.21.0 h1:3Fx+41if+IRavNcKOz09FwEXDBG6ORh6iMsTSelhkMA=
 k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY=
-k8s.io/apimachinery v0.21.1 h1:Q6XuHGlj2xc+hlMCvqyYfbv3H7SRGn2c8NycxJquDVs=
-k8s.io/apimachinery v0.21.1/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY=
+k8s.io/apiserver v0.21.0 h1:1hWMfsz+cXxB77k6/y0XxWxwl6l9OF26PC9QneUVn1Q=
 k8s.io/apiserver v0.21.0/go.mod h1:w2YSn4/WIwYuxG5zJmcqtRdtqgW/J2JRgFAqps3bBpg=
-k8s.io/apiserver v0.21.1 h1:wTRcid53IhxhbFt4KTrFSw8tAncfr01EP91lzfcygVg=
-k8s.io/apiserver v0.21.1/go.mod h1:nLLYZvMWn35glJ4/FZRhzLG/3MPxAaZTgV4FJZdr+tY=
-k8s.io/cli-runtime v0.21.1/go.mod h1:TI9Bvl8lQWZB2KqE91QLCp9AZE4l29zNFnj/x4IX4Fw=
+k8s.io/cli-runtime v0.21.0/go.mod h1:XoaHP93mGPF37MkLbjGVYqg3S1MnsFdKtiA/RZzzxOo=
+k8s.io/client-go v0.21.0 h1:n0zzzJsAQmJngpC0IhgFcApZyoGXPrDIAD601HD09ag=
 k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA=
-k8s.io/client-go v0.21.1 h1:bhblWYLZKUu+pm50plvQF8WpY6TXdRRtcS/K9WauOj4=
-k8s.io/client-go v0.21.1/go.mod h1:/kEw4RgW+3xnBGzvp9IWxKSNA+lXn3A7AuH3gdOAzLs=
-k8s.io/cluster-bootstrap v0.21.1 h1:wrk2jHNrXK7LKwLfmgZRkk0Od3LJtBmf2t5+cFHxdOE=
-k8s.io/cluster-bootstrap v0.21.1/go.mod h1:izdXmPTfqI9gkjQLf9PQ1Y9/DSqG54zU2UByEzgdajs=
+k8s.io/cluster-bootstrap v0.21.0 h1:9CfnWrvXm12k6fP3WR3ist76rrqGq6H5pRVEUvEc4Ws=
+k8s.io/cluster-bootstrap v0.21.0/go.mod h1:rs7i1JpBCa56YNmnYxFJuoUghIwpMzDidY8ZmqiRnrQ=
 k8s.io/code-generator v0.21.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q=
-k8s.io/code-generator v0.21.1/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q=
+k8s.io/component-base v0.21.0 h1:tLLGp4BBjQaCpS/KiuWh7m2xqvAdsxLm4ATxHSe5Zpg=
 k8s.io/component-base v0.21.0/go.mod h1:qvtjz6X0USWXbgmbfXR+Agik4RZ3jv2Bgr5QnZzdPYw=
-k8s.io/component-base v0.21.1 h1:iLpj2btXbR326s/xNQWmPNGu0gaYSjzn7IN/5i28nQw=
-k8s.io/component-base v0.21.1/go.mod h1:NgzFZ2qu4m1juby4TnrmpR8adRk6ka62YdH5DkIIyKA=
-k8s.io/component-helpers v0.21.1/go.mod h1:FtC1flbiQlosHQrLrRUulnKxE4ajgWCGy/67fT2GRlQ=
+k8s.io/component-helpers v0.21.0/go.mod h1:tezqefP7lxfvJyR+0a+6QtVrkZ/wIkyMLK4WcQ3Cj8U=
 k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
 k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
 k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
@@ -1064,9 +1059,9 @@ k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
 k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E=
 k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 h1:vEx13qjvaZ4yfObSSXW7BrMc/KQBBT/Jyee8XtLf4x0=
 k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE=
-k8s.io/kubectl v0.21.1 h1:ySEusoeSgSDSiSBncDMsNrthSa3OSlXqT4R2rf1VFTw=
-k8s.io/kubectl v0.21.1/go.mod h1:PMYR88MqESuysBM/MX+Vu4JbX/50nY4d4kny+SPEI2U=
-k8s.io/metrics v0.21.1/go.mod h1:pyDVLsLe++FIGDBFU80NcW4xMFsuiVTWL8Zfi7+PpNo=
+k8s.io/kubectl v0.21.0 h1:WZXlnG/yjcE4LWO2g6ULjFxtzK6H1TKzsfaBFuVIhNg=
+k8s.io/kubectl v0.21.0/go.mod h1:EU37NukZRXn1TpAkMUoy8Z/B2u6wjHDS4aInsDzVvks=
+k8s.io/metrics v0.21.0/go.mod h1:L3Ji9EGPP1YBbfm9sPfEXSpnj8i24bfQbAFAsW0NueQ=
 k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 k8s.io/utils v0.0.0-20210305010621-2afb4311ab10 h1:u5rPykqiCpL+LBfjRkXvnK71gOgIdmq3eHUEkPrbeTI=
@@ -1079,10 +1074,10 @@ sigs.k8s.io/controller-runtime v0.9.0-beta.5 h1:yteq8am8lUFvlI/bfIgySMp/MqAPXiAg
 sigs.k8s.io/controller-runtime v0.9.0-beta.5/go.mod h1:ufPDuvefw2Y1KnBgHQrLdOjueYlj+XJV2AszbT+WTxs=
 sigs.k8s.io/kind v0.9.0 h1:SoDlXq6pEc7dGagHULNRCCBYrLH6xOi7lqXTRXeAlg4=
 sigs.k8s.io/kind v0.9.0/go.mod h1:cxKQWwmbtRDzQ+RNKnR6gZG6fjbeTtItp5cGf+ww+1Y=
-sigs.k8s.io/kustomize/api v0.8.8/go.mod h1:He1zoK0nk43Pc6NlV085xDXDXTNprtcyKZVm3swsdNY=
-sigs.k8s.io/kustomize/cmd/config v0.9.10/go.mod h1:Mrby0WnRH7hA6OwOYnYpfpiY0WJIMgYrEDfwOeFdMK0=
-sigs.k8s.io/kustomize/kustomize/v4 v4.1.2/go.mod h1:PxBvo4WGYlCLeRPL+ziT64wBXqbgfcalOS/SXa/tcyo=
-sigs.k8s.io/kustomize/kyaml v0.10.17/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg=
+sigs.k8s.io/kustomize/api v0.8.5/go.mod h1:M377apnKT5ZHJS++6H4rQoCHmWtt6qTpp3mbe7p6OLY=
+sigs.k8s.io/kustomize/cmd/config v0.9.7/go.mod h1:MvXCpHs77cfyxRmCNUQjIqCmZyYsbn5PyQpWiq44nW0=
+sigs.k8s.io/kustomize/kustomize/v4 v4.0.5/go.mod h1:C7rYla7sI8EnxHE/xEhRBSHMNfcL91fx0uKmUlUhrBk=
+sigs.k8s.io/kustomize/kyaml v0.10.15/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg=
 sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
 sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
 sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
diff --git a/util/annotations/helpers.go b/util/annotations/helpers.go
index b0ae79d05..720b85ad1 100644
--- a/util/annotations/helpers.go
+++ b/util/annotations/helpers.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package annotations implements annotation helper functions.
 package annotations
 
 import (
diff --git a/util/certs/certs.go b/util/certs/certs.go
index 225438bb4..dc0236ba8 100644
--- a/util/certs/certs.go
+++ b/util/certs/certs.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package certs implements cert handling utilities.
 package certs
 
 import (
diff --git a/util/collections/helpers.go b/util/collections/helpers.go
index 1d989e795..bb0cc56d6 100644
--- a/util/collections/helpers.go
+++ b/util/collections/helpers.go
@@ -14,12 +14,10 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package collections implements collection utilities.
 package collections
 
 import (
 	"context"
-
 	"github.com/pkg/errors"
 	clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
 	"sigs.k8s.io/controller-runtime/pkg/client"
diff --git a/util/conditions/doc.go b/util/conditions/doc.go
deleted file mode 100644
index 019d42d7c..000000000
--- a/util/conditions/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2020 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 conditions implements condition utilities.
-package conditions
diff --git a/util/conditions/unstructured.go b/util/conditions/unstructured.go
index dfd50d50f..47fcf98e0 100644
--- a/util/conditions/unstructured.go
+++ b/util/conditions/unstructured.go
@@ -13,7 +13,6 @@ 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 conditions
 
 import (
diff --git a/util/container/image.go b/util/container/image.go
index 91b32ce6c..739ca24c3 100644
--- a/util/container/image.go
+++ b/util/container/image.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package container implements container utility functionality.
 package container
 
 import (
diff --git a/util/conversion/conversion.go b/util/conversion/conversion.go
index f2e6a64f3..b69aaa52a 100644
--- a/util/conversion/conversion.go
+++ b/util/conversion/conversion.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package conversion implements conversion utilities.
 package conversion
 
 import (
diff --git a/util/defaulting/defaulting.go b/util/defaulting/defaulting.go
index fd637069c..022690717 100644
--- a/util/defaulting/defaulting.go
+++ b/util/defaulting/defaulting.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package defaulting implements defaulting webook functionality.
 package defaulting
 
 import (
diff --git a/util/deprecated.go b/util/deprecated.go
index f422189ef..987781b8d 100644
--- a/util/deprecated.go
+++ b/util/deprecated.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package util implements utilities.
 package util
 
 import (
diff --git a/util/failuredomains/failure_domains.go b/util/failuredomains/failure_domains.go
index d373298e0..ee3ae209a 100644
--- a/util/failuredomains/failure_domains.go
+++ b/util/failuredomains/failure_domains.go
@@ -14,13 +14,12 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package failuredomains implements FailureDomain utility functions.
 package failuredomains
 
 import (
+	"k8s.io/klog/v2/klogr"
 	"sort"
 
-	"k8s.io/klog/v2/klogr"
 	"k8s.io/utils/pointer"
 
 	clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
diff --git a/util/kubeconfig/kubeconfig.go b/util/kubeconfig/kubeconfig.go
index aa3d675e4..67f09b191 100644
--- a/util/kubeconfig/kubeconfig.go
+++ b/util/kubeconfig/kubeconfig.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package kubeconfig implements utilities for working with kubeconfigs.
 package kubeconfig
 
 import (
diff --git a/util/labels/helpers.go b/util/labels/helpers.go
index 187825204..87219632d 100644
--- a/util/labels/helpers.go
+++ b/util/labels/helpers.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package labels implements label utility functions.
 package labels
 
 import (
diff --git a/util/patch/doc.go b/util/patch/doc.go
deleted file mode 100644
index 4e61ec09e..000000000
--- a/util/patch/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 patch implements patch utilities.
-package patch
diff --git a/util/predicates/cluster_predicates.go b/util/predicates/cluster_predicates.go
index 52c32cd4e..8d91dc69d 100644
--- a/util/predicates/cluster_predicates.go
+++ b/util/predicates/cluster_predicates.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package predicates implements predicate utilities.
 package predicates
 
 import (
diff --git a/util/record/recorder.go b/util/record/recorder.go
index 37a9f0eef..e573654e6 100644
--- a/util/record/recorder.go
+++ b/util/record/recorder.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package record implements recording functionality.
 package record
 
 import (
diff --git a/util/resource/resource.go b/util/resource/resource.go
index 9041d2563..629827cf7 100644
--- a/util/resource/resource.go
+++ b/util/resource/resource.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package resource implements resource utilites.
 package resource
 
 import "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
diff --git a/util/secret/doc.go b/util/secret/doc.go
deleted file mode 100644
index 39e7eb9c4..000000000
--- a/util/secret/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 secret implements utilities for secret handling.
-package secret
diff --git a/util/version/version.go b/util/version/version.go
index 1290e64be..6e8d9c79a 100644
--- a/util/version/version.go
+++ b/util/version/version.go
@@ -14,15 +14,13 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package version implements version handling.
 package version
 
 import (
-	"regexp"
-	"strconv"
-
 	"github.com/blang/semver"
 	"github.com/pkg/errors"
+	"regexp"
+	"strconv"
 )
 
 var (
diff --git a/util/yaml/yaml.go b/util/yaml/yaml.go
index 40ddeaf94..3a7bb1995 100644
--- a/util/yaml/yaml.go
+++ b/util/yaml/yaml.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package yaml implements yaml utility functions.
 package yaml
 
 import (
diff --git a/version/version.go b/version/version.go
index 92d556e29..322cbd1a7 100644
--- a/version/version.go
+++ b/version/version.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package version implements version handling code.
 package version
 
 import (


Test patch:
diff --git a/bootstrap/kubeadm/internal/cloudinit/node_test.go b/bootstrap/kubeadm/internal/cloudinit/node_test.go
deleted file mode 100644
index e66ca7067..000000000
--- a/bootstrap/kubeadm/internal/cloudinit/node_test.go
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
-Copyright 2021 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 cloudinit
-
-import (
-	"fmt"
-	"testing"
-
-	bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4"
-	"sigs.k8s.io/yaml"
-)
-
-func TestNewNode(t *testing.T) {
-	tests := []struct {
-		name    string
-		input   *NodeInput
-		check   func([]byte) error
-		wantErr bool
-	}{
-		{
-			"check for duplicated write_files",
-			&NodeInput{
-				BaseUserData: BaseUserData{
-					AdditionalFiles: []bootstrapv1.File{
-						{
-							Path:        "/etc/foo.conf",
-							Content:     "bar",
-							Owner:       "root",
-							Permissions: "0644",
-						},
-					},
-				},
-			},
-			checkWriteFiles("/etc/foo.conf", "/run/kubeadm/kubeadm-join-config.yaml", "/run/cluster-api/placeholder"),
-			false,
-		},
-		{
-			"check for existence of /run/kubeadm/kubeadm-join-config.yaml and /run/cluster-api/placeholder",
-			&NodeInput{},
-			checkWriteFiles("/run/kubeadm/kubeadm-join-config.yaml", "/run/cluster-api/placeholder"),
-			false,
-		},
-	}
-	for _, tt := range tests {
-		t.Run(tt.name, func(t *testing.T) {
-			got, err := NewNode(tt.input)
-			if (err != nil) != tt.wantErr {
-				t.Errorf("NewNode() error = %v, wantErr %v", err, tt.wantErr)
-				return
-			}
-			if err := tt.check(got); err != nil {
-				t.Errorf("%v: got = %s", err, got)
-			}
-		})
-	}
-}
-
-func checkWriteFiles(files ...string) func(b []byte) error {
-	return func(b []byte) error {
-		var cloudinitData struct {
-			WriteFiles []struct {
-				Path string `json:"path"`
-			} `json:"write_files"`
-		}
-
-		if err := yaml.Unmarshal(b, &cloudinitData); err != nil {
-			return err
-		}
-
-		gotFiles := map[string]bool{}
-		for _, f := range cloudinitData.WriteFiles {
-			gotFiles[f.Path] = true
-		}
-		for _, file := range files {
-			if !gotFiles[file] {
-				return fmt.Errorf("expected %q to exist in CloudInit's write_files", file)
-			}
-		}
-		if len(files) != len(cloudinitData.WriteFiles) {
-			return fmt.Errorf("expected to have %d files generated to CloudInit's write_files, got %d", len(files), len(cloudinitData.WriteFiles))
-		}
-
-		return nil
-	}
-}
diff --git a/cmd/clusterctl/internal/test/doc.go b/cmd/clusterctl/internal/test/doc.go
deleted file mode 100644
index fe2683c98..000000000
--- a/cmd/clusterctl/internal/test/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 test implements test functionality.
-package test
diff --git a/cmd/clusterctl/internal/test/providers/bootstrap/generic_types.go b/cmd/clusterctl/internal/test/providers/bootstrap/generic_types.go
index 6b06e29d4..01fd7c538 100644
--- a/cmd/clusterctl/internal/test/providers/bootstrap/generic_types.go
+++ b/cmd/clusterctl/internal/test/providers/bootstrap/generic_types.go
@@ -14,6 +14,9 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+/*
+package bootstrap defines the types for a generic bootstrap provider used for tests
+*/
 package bootstrap
 
 import (
diff --git a/cmd/clusterctl/internal/test/providers/bootstrap/groupversion_info.go b/cmd/clusterctl/internal/test/providers/bootstrap/groupversion_info.go
index d801afb61..48e1a9b4e 100644
--- a/cmd/clusterctl/internal/test/providers/bootstrap/groupversion_info.go
+++ b/cmd/clusterctl/internal/test/providers/bootstrap/groupversion_info.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package bootstrap defines the types for a generic bootstrap provider used for tests.
 // +kubebuilder:object:generate=true
 // +groupName=bootstrap.cluster.x-k8s.io
 package bootstrap
diff --git a/cmd/clusterctl/internal/test/providers/controlplane/generic_types.go b/cmd/clusterctl/internal/test/providers/controlplane/generic_types.go
index 41c5b5983..dfbe64990 100644
--- a/cmd/clusterctl/internal/test/providers/controlplane/generic_types.go
+++ b/cmd/clusterctl/internal/test/providers/controlplane/generic_types.go
@@ -14,6 +14,9 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+/*
+package controlplane defines the types for a generic control plane provider used for tests
+*/
 package controlplane
 
 import (
diff --git a/cmd/clusterctl/internal/test/providers/controlplane/groupversion_info.go b/cmd/clusterctl/internal/test/providers/controlplane/groupversion_info.go
index 382448a2f..f90fa9540 100644
--- a/cmd/clusterctl/internal/test/providers/controlplane/groupversion_info.go
+++ b/cmd/clusterctl/internal/test/providers/controlplane/groupversion_info.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package controlplane defines the types for a generic control plane provider used for tests.
 // +kubebuilder:object:generate=true
 // +groupName=controlplane.cluster.x-k8s.io
 package controlplane
diff --git a/cmd/clusterctl/internal/test/providers/external/generic_types.go b/cmd/clusterctl/internal/test/providers/external/generic_types.go
index 18d380fc0..19458356b 100644
--- a/cmd/clusterctl/internal/test/providers/external/generic_types.go
+++ b/cmd/clusterctl/internal/test/providers/external/generic_types.go
@@ -14,6 +14,9 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+/*
+package external defines the types for a generic external provider used for tests
+*/
 package external
 
 import (
diff --git a/cmd/clusterctl/internal/test/providers/external/groupversion_info.go b/cmd/clusterctl/internal/test/providers/external/groupversion_info.go
index 333a7ca09..fa0b2ccbc 100644
--- a/cmd/clusterctl/internal/test/providers/external/groupversion_info.go
+++ b/cmd/clusterctl/internal/test/providers/external/groupversion_info.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package external defines the types for a generic external provider used for tests.
 // +kubebuilder:object:generate=true
 // +groupName=custom.cluster.x-k8s.io
 package external
diff --git a/cmd/clusterctl/internal/test/providers/infrastructure/generic_types.go b/cmd/clusterctl/internal/test/providers/infrastructure/generic_types.go
index b6660863b..8458fd51f 100644
--- a/cmd/clusterctl/internal/test/providers/infrastructure/generic_types.go
+++ b/cmd/clusterctl/internal/test/providers/infrastructure/generic_types.go
@@ -14,6 +14,9 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+/*
+package infrastructure defines the types for a generic infrastructure provider used for tests
+*/
 package infrastructure
 
 import (
diff --git a/cmd/clusterctl/internal/test/providers/infrastructure/groupversion_info.go b/cmd/clusterctl/internal/test/providers/infrastructure/groupversion_info.go
index d39aaaf26..7195a81a3 100644
--- a/cmd/clusterctl/internal/test/providers/infrastructure/groupversion_info.go
+++ b/cmd/clusterctl/internal/test/providers/infrastructure/groupversion_info.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package infrastructure defines the types for a generic infrastructure provider used for tests.
 // +kubebuilder:object:generate=true
 // +groupName=infrastructure.cluster.x-k8s.io
 package infrastructure
diff --git a/controlplane/kubeadm/api/v1alpha3/webhook_test.go b/controlplane/kubeadm/api/v1alpha3/webhook_test.go
index 07579b77d..b6991fce6 100644
--- a/controlplane/kubeadm/api/v1alpha3/webhook_test.go
+++ b/controlplane/kubeadm/api/v1alpha3/webhook_test.go
@@ -34,12 +34,11 @@ import (
 
 func TestKubeadmControlPlaneConversion(t *testing.T) {
 	g := NewWithT(t)
-
 	ns, err := testEnv.CreateNamespace(ctx, fmt.Sprintf("conversion-webhook-%s", util.RandomString(5)))
 	g.Expect(err).ToNot(HaveOccurred())
 	infraMachineTemplateName := fmt.Sprintf("test-machinetemplate-%s", util.RandomString(5))
 	controlPlaneName := fmt.Sprintf("test-controlpane-%s", util.RandomString(5))
-	controlPlane := &KubeadmControlPlane{
+	controlPane := &KubeadmControlPlane{
 		ObjectMeta: metav1.ObjectMeta{
 			Name:      controlPlaneName,
 			Namespace: ns.Name,
@@ -87,8 +86,8 @@ func TestKubeadmControlPlaneConversion(t *testing.T) {
 		},
 	}
 
-	g.Expect(testEnv.Create(ctx, controlPlane)).To(Succeed())
+	g.Expect(testEnv.Create(ctx, controlPane)).To(Succeed())
 	defer func(do ...client.Object) {
 		g.Expect(testEnv.Cleanup(ctx, do...)).To(Succeed())
-	}(ns, controlPlane)
+	}(ns, controlPane)
 }
diff --git a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_webhook_test.go b/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_webhook_test.go
index 6c3cba83a..aa1b89a21 100644
--- a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_webhook_test.go
+++ b/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_webhook_test.go
@@ -37,29 +37,20 @@ func TestKubeadmControlPlaneDefault(t *testing.T) {
 			Namespace: "foo",
 		},
 		Spec: KubeadmControlPlaneSpec{
-			Version: "v1.18.3",
-			MachineTemplate: KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					APIVersion: "test/v1alpha1",
-					Kind:       "UnknownInfraMachine",
-					Name:       "foo",
-				},
-			},
-			RolloutStrategy: &RolloutStrategy{},
+			Version:                "v1.18.3",
+			InfrastructureTemplate: corev1.ObjectReference{},
+			RolloutStrategy:        &RolloutStrategy{},
 		},
 	}
 	updateDefaultingValidationKCP := kcp.DeepCopy()
 	updateDefaultingValidationKCP.Spec.Version = "v1.18.3"
-	updateDefaultingValidationKCP.Spec.MachineTemplate.InfrastructureRef = corev1.ObjectReference{
-		APIVersion: "test/v1alpha1",
-		Kind:       "UnknownInfraMachine",
-		Name:       "foo",
-		Namespace:  "foo",
+	updateDefaultingValidationKCP.Spec.InfrastructureTemplate = corev1.ObjectReference{
+		Namespace: "foo",
 	}
 	t.Run("for KubeadmControlPLane", utildefaulting.DefaultValidateTest(updateDefaultingValidationKCP))
 	kcp.Default()
 
-	g.Expect(kcp.Spec.MachineTemplate.InfrastructureRef.Namespace).To(Equal(kcp.Namespace))
+	g.Expect(kcp.Spec.InfrastructureTemplate.Namespace).To(Equal(kcp.Namespace))
 	g.Expect(kcp.Spec.Version).To(Equal("v1.18.3"))
 	g.Expect(kcp.Spec.RolloutStrategy.Type).To(Equal(RollingUpdateStrategyType))
 	g.Expect(kcp.Spec.RolloutStrategy.RollingUpdate.MaxSurge.IntVal).To(Equal(int32(1)))
@@ -72,13 +63,9 @@ func TestKubeadmControlPlaneValidateCreate(t *testing.T) {
 			Namespace: "foo",
 		},
 		Spec: KubeadmControlPlaneSpec{
-			MachineTemplate: KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					APIVersion: "test/v1alpha1",
-					Kind:       "UnknownInfraMachine",
-					Namespace:  "foo",
-					Name:       "infraTemplate",
-				},
+			InfrastructureTemplate: corev1.ObjectReference{
+				Namespace: "foo",
+				Name:      "infraTemplate",
 			},
 			Replicas: pointer.Int32Ptr(1),
 			Version:  "v1.19.0",
@@ -97,7 +84,7 @@ func TestKubeadmControlPlaneValidateCreate(t *testing.T) {
 	invalidMaxSurge.Spec.RolloutStrategy.RollingUpdate.MaxSurge.IntVal = int32(3)
 
 	invalidNamespace := valid.DeepCopy()
-	invalidNamespace.Spec.MachineTemplate.InfrastructureRef.Namespace = "bar"
+	invalidNamespace.Spec.InfrastructureTemplate.Namespace = "bar"
 
 	missingReplicas := valid.DeepCopy()
 	missingReplicas.Spec.Replicas = nil
@@ -203,13 +190,9 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
 			Namespace: "foo",
 		},
 		Spec: KubeadmControlPlaneSpec{
-			MachineTemplate: KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					APIVersion: "test/v1alpha1",
-					Kind:       "UnknownInfraMachine",
-					Namespace:  "foo",
-					Name:       "infraTemplate",
-				},
+			InfrastructureTemplate: corev1.ObjectReference{
+				Namespace: "foo",
+				Name:      "infraTemplate",
 			},
 			Replicas: pointer.Int32Ptr(1),
 			RolloutStrategy: &RolloutStrategy{
@@ -317,7 +300,7 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
 			},
 		},
 	}
-	validUpdate.Spec.MachineTemplate.InfrastructureRef.Name = "orange"
+	validUpdate.Spec.InfrastructureTemplate.Name = "orange"
 	validUpdate.Spec.Replicas = pointer.Int32Ptr(5)
 	now := metav1.NewTime(time.Now())
 	validUpdate.Spec.RolloutAfter = &now
@@ -329,7 +312,7 @@ func TestKubeadmControlPlaneValidateUpdate(t *testing.T) {
 	scaleToEven.Spec.Replicas = pointer.Int32Ptr(2)
 
 	invalidNamespace := before.DeepCopy()
-	invalidNamespace.Spec.MachineTemplate.InfrastructureRef.Namespace = "bar"
+	invalidNamespace.Spec.InfrastructureTemplate.Namespace = "bar"
 
 	missingReplicas := before.DeepCopy()
 	missingReplicas.Spec.Replicas = nil
@@ -821,13 +804,9 @@ func TestKubeadmControlPlaneValidateUpdateAfterDefaulting(t *testing.T) {
 		},
 		Spec: KubeadmControlPlaneSpec{
 			Version: "v1.19.0",
-			MachineTemplate: KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					APIVersion: "test/v1alpha1",
-					Kind:       "UnknownInfraMachine",
-					Namespace:  "foo",
-					Name:       "infraTemplate",
-				},
+			InfrastructureTemplate: corev1.ObjectReference{
+				Namespace: "foo",
+				Name:      "infraTemplate",
 			},
 		},
 	}
@@ -857,7 +836,7 @@ func TestKubeadmControlPlaneValidateUpdateAfterDefaulting(t *testing.T) {
 				g.Expect(err).To(HaveOccurred())
 			} else {
 				g.Expect(err).To(Succeed())
-				g.Expect(tt.kcp.Spec.MachineTemplate.InfrastructureRef.Namespace).To(Equal(tt.before.Namespace))
+				g.Expect(tt.kcp.Spec.InfrastructureTemplate.Namespace).To(Equal(tt.before.Namespace))
 				g.Expect(tt.kcp.Spec.Version).To(Equal("v1.19.0"))
 				g.Expect(tt.kcp.Spec.RolloutStrategy.Type).To(Equal(RollingUpdateStrategyType))
 				g.Expect(tt.kcp.Spec.RolloutStrategy.RollingUpdate.MaxSurge.IntVal).To(Equal(int32(1)))
diff --git a/controlplane/kubeadm/controllers/controller_test.go b/controlplane/kubeadm/controllers/controller_test.go
index ed8fef165..1558c2a6a 100644
--- a/controlplane/kubeadm/controllers/controller_test.go
+++ b/controlplane/kubeadm/controllers/controller_test.go
@@ -19,8 +19,6 @@ package controllers
 import (
 	"context"
 	"fmt"
-	expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4"
-	"sigs.k8s.io/cluster-api/feature"
 	"sync"
 	"testing"
 	"time"
@@ -213,14 +211,6 @@ func TestReconcileNoClusterOwnerRef(t *testing.T) {
 		},
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
 			Version: "v1.16.6",
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					Kind:       "UnknownInfraMachine",
-					APIVersion: "test/v1alpha1",
-					Name:       "foo",
-					Namespace:  "test",
-				},
-			},
 		},
 	}
 	kcp.Default()
@@ -251,14 +241,6 @@ func TestReconcileNoKCP(t *testing.T) {
 		},
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
 			Version: "v1.16.6",
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					Kind:       "UnknownInfraMachine",
-					APIVersion: "test/v1alpha1",
-					Name:       "foo",
-					Namespace:  "test",
-				},
-			},
 		},
 	}
 
@@ -289,14 +271,6 @@ func TestReconcileNoCluster(t *testing.T) {
 		},
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
 			Version: "v1.16.6",
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					Kind:       "UnknownInfraMachine",
-					APIVersion: "test/v1alpha1",
-					Name:       "foo",
-					Namespace:  "test",
-				},
-			},
 		},
 	}
 	kcp.Default()
@@ -338,14 +312,6 @@ func TestReconcilePaused(t *testing.T) {
 		},
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
 			Version: "v1.16.6",
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					Kind:       "UnknownInfraMachine",
-					APIVersion: "test/v1alpha1",
-					Name:       "foo",
-					Namespace:  "test",
-				},
-			},
 		},
 	}
 	kcp.Default()
@@ -391,14 +357,6 @@ func TestReconcileClusterNoEndpoints(t *testing.T) {
 		},
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
 			Version: "v1.16.6",
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					Kind:       "UnknownInfraMachine",
-					APIVersion: "test/v1alpha1",
-					Name:       "foo",
-					Namespace:  "test",
-				},
-			},
 		},
 	}
 	kcp.Default()
@@ -461,7 +419,7 @@ func TestKubeadmControlPlaneReconciler_adoption(t *testing.T) {
 				ObjectMeta: metav1.ObjectMeta{
 					Namespace: cluster.Namespace,
 					Name:      name,
-					Labels:    internal.ControlPlaneMachineLabelsForCluster(kcp, cluster.Name),
+					Labels:    internal.ControlPlaneLabelsForCluster(cluster.Name),
 				},
 				Spec: clusterv1.MachineSpec{
 					Bootstrap: clusterv1.Bootstrap{
@@ -524,7 +482,7 @@ func TestKubeadmControlPlaneReconciler_adoption(t *testing.T) {
 				ObjectMeta: metav1.ObjectMeta{
 					Namespace: cluster.Namespace,
 					Name:      name,
-					Labels:    internal.ControlPlaneMachineLabelsForCluster(kcp, cluster.Name),
+					Labels:    internal.ControlPlaneLabelsForCluster(cluster.Name),
 				},
 				Spec: clusterv1.MachineSpec{
 					Bootstrap: clusterv1.Bootstrap{
@@ -632,7 +590,7 @@ func TestKubeadmControlPlaneReconciler_adoption(t *testing.T) {
 				ObjectMeta: metav1.ObjectMeta{
 					Namespace: cluster.Namespace,
 					Name:      name,
-					Labels:    internal.ControlPlaneMachineLabelsForCluster(kcp, cluster.Name),
+					Labels:    internal.ControlPlaneLabelsForCluster(cluster.Name),
 				},
 				Spec: clusterv1.MachineSpec{
 					Bootstrap: clusterv1.Bootstrap{
@@ -689,7 +647,7 @@ func TestKubeadmControlPlaneReconciler_adoption(t *testing.T) {
 					ObjectMeta: metav1.ObjectMeta{
 						Namespace: cluster.Namespace,
 						Name:      "test0",
-						Labels:    internal.ControlPlaneMachineLabelsForCluster(kcp, cluster.Name),
+						Labels:    internal.ControlPlaneLabelsForCluster(cluster.Name),
 					},
 					Spec: clusterv1.MachineSpec{
 						Bootstrap: clusterv1.Bootstrap{
@@ -773,13 +731,11 @@ func TestReconcileInitializeControlPlane(t *testing.T) {
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
 			Replicas: nil,
 			Version:  "v1.16.6",
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					Kind:       genericMachineTemplate.GetKind(),
-					APIVersion: genericMachineTemplate.GetAPIVersion(),
-					Name:       genericMachineTemplate.GetName(),
-					Namespace:  cluster.Namespace,
-				},
+			InfrastructureTemplate: corev1.ObjectReference{
+				Kind:       genericMachineTemplate.GetKind(),
+				APIVersion: genericMachineTemplate.GetAPIVersion(),
+				Name:       genericMachineTemplate.GetName(),
+				Namespace:  cluster.Namespace,
 			},
 			KubeadmConfigSpec: bootstrapv1.KubeadmConfigSpec{},
 		},
@@ -1276,55 +1232,6 @@ func TestKubeadmControlPlaneReconciler_reconcileDelete(t *testing.T) {
 		g.Expect(controlPlaneMachines.Items).To(HaveLen(3))
 	})
 
-	t.Run("does not remove any control plane Machines if MachinePools exist", func(t *testing.T) {
-		_ = feature.MutableGates.Set("MachinePool=true")
-		g := NewWithT(t)
-
-		cluster, kcp, _ := createClusterWithControlPlane()
-		controllerutil.AddFinalizer(kcp, controlplanev1.KubeadmControlPlaneFinalizer)
-
-		workerMachinePool := &expv1.MachinePool{
-			ObjectMeta: metav1.ObjectMeta{
-				Name:      "worker",
-				Namespace: cluster.Namespace,
-				Labels: map[string]string{
-					clusterv1.ClusterLabelName: cluster.Name,
-				},
-			},
-		}
-
-		initObjs := []client.Object{cluster.DeepCopy(), kcp.DeepCopy(), workerMachinePool.DeepCopy()}
-
-		for i := 0; i < 3; i++ {
-			m, _ := createMachineNodePair(fmt.Sprintf("test-%d", i), cluster, kcp, true)
-			initObjs = append(initObjs, m)
-		}
-
-		fakeClient := newFakeClient(g, initObjs...)
-
-		r := &KubeadmControlPlaneReconciler{
-			Client: fakeClient,
-			managementCluster: &fakeManagementCluster{
-				Management: &internal.Management{Client: fakeClient},
-				Workload:   fakeWorkloadCluster{},
-			},
-			recorder: record.NewFakeRecorder(32),
-		}
-
-		result, err := r.reconcileDelete(ctx, cluster, kcp)
-		g.Expect(result).To(Equal(ctrl.Result{RequeueAfter: deleteRequeueAfter}))
-		g.Expect(err).To(BeNil())
-
-		g.Expect(kcp.Finalizers).To(ContainElement(controlplanev1.KubeadmControlPlaneFinalizer))
-
-		controlPlaneMachines := clusterv1.MachineList{}
-		labels := map[string]string{
-			clusterv1.MachineControlPlaneLabelName: "",
-		}
-		g.Expect(fakeClient.List(ctx, &controlPlaneMachines, client.MatchingLabels(labels))).To(Succeed())
-		g.Expect(controlPlaneMachines.Items).To(HaveLen(3))
-	})
-
 	t.Run("removes the finalizer if no control plane Machines exist", func(t *testing.T) {
 		g := NewWithT(t)
 
@@ -1415,13 +1322,11 @@ func createClusterWithControlPlane() (*clusterv1.Cluster, *controlplanev1.Kubead
 			},
 		},
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					Kind:       "GenericMachineTemplate",
-					Namespace:  namespace,
-					Name:       "infra-foo",
-					APIVersion: "generic.io/v1",
-				},
+			InfrastructureTemplate: corev1.ObjectReference{
+				Kind:       "GenericMachineTemplate",
+				Namespace:  namespace,
+				Name:       "infra-foo",
+				APIVersion: "generic.io/v1",
 			},
 			Replicas: pointer.Int32Ptr(int32(3)),
 			Version:  "v1.16.6",
@@ -1475,7 +1380,7 @@ func createMachineNodePair(name string, cluster *clusterv1.Cluster, kcp *control
 		ObjectMeta: metav1.ObjectMeta{
 			Namespace: cluster.Namespace,
 			Name:      name,
-			Labels:    internal.ControlPlaneMachineLabelsForCluster(kcp, cluster.Name),
+			Labels:    internal.ControlPlaneLabelsForCluster(cluster.Name),
 			OwnerReferences: []metav1.OwnerReference{
 				*metav1.NewControllerRef(kcp, controlplanev1.GroupVersion.WithKind("KubeadmControlPlane")),
 			},
diff --git a/controlplane/kubeadm/controllers/fakes_test.go b/controlplane/kubeadm/controllers/fakes_test.go
index 980ed366f..a42f3fce2 100644
--- a/controlplane/kubeadm/controllers/fakes_test.go
+++ b/controlplane/kubeadm/controllers/fakes_test.go
@@ -21,18 +21,16 @@ import (
 	"github.com/blang/semver"
 	clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4"
 	"sigs.k8s.io/cluster-api/controlplane/kubeadm/internal"
-	expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4"
 	"sigs.k8s.io/cluster-api/util/collections"
 	"sigs.k8s.io/controller-runtime/pkg/client"
 )
 
 type fakeManagementCluster struct {
 	// TODO: once all client interactions are moved to the Management cluster this can go away
-	Management   *internal.Management
-	Machines     collections.Machines
-	MachinePools *expv1.MachinePoolList
-	Workload     fakeWorkloadCluster
-	Reader       client.Reader
+	Management *internal.Management
+	Machines   collections.Machines
+	Workload   fakeWorkloadCluster
+	Reader     client.Reader
 }
 
 func (f *fakeManagementCluster) Get(ctx context.Context, key client.ObjectKey, obj client.Object) error {
@@ -54,13 +52,6 @@ func (f *fakeManagementCluster) GetMachinesForCluster(c context.Context, cluster
 	return f.Machines, nil
 }
 
-func (f *fakeManagementCluster) GetMachinePoolsForCluster(c context.Context, cluster *clusterv1.Cluster) (*expv1.MachinePoolList, error) {
-	if f.Management != nil {
-		return f.Management.GetMachinePoolsForCluster(c, cluster)
-	}
-	return f.MachinePools, nil
-}
-
 type fakeWorkloadCluster struct {
 	*internal.Workload
 	Status            internal.ClusterStatus
diff --git a/controlplane/kubeadm/controllers/helpers_test.go b/controlplane/kubeadm/controllers/helpers_test.go
index 602359c17..53adfe86e 100644
--- a/controlplane/kubeadm/controllers/helpers_test.go
+++ b/controlplane/kubeadm/controllers/helpers_test.go
@@ -357,13 +357,11 @@ func TestCloneConfigsAndGenerateMachine(t *testing.T) {
 			Namespace: cluster.Namespace,
 		},
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					Kind:       genericMachineTemplate.GetKind(),
-					APIVersion: genericMachineTemplate.GetAPIVersion(),
-					Name:       genericMachineTemplate.GetName(),
-					Namespace:  cluster.Namespace,
-				},
+			InfrastructureTemplate: corev1.ObjectReference{
+				Kind:       genericMachineTemplate.GetKind(),
+				APIVersion: genericMachineTemplate.GetAPIVersion(),
+				Name:       genericMachineTemplate.GetName(),
+				Namespace:  cluster.Namespace,
 			},
 			Version: "v1.16.6",
 		},
@@ -441,13 +439,11 @@ func TestCloneConfigsAndGenerateMachineFail(t *testing.T) {
 			Namespace: cluster.Namespace,
 		},
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					Kind:       genericMachineTemplate.GetKind(),
-					APIVersion: genericMachineTemplate.GetAPIVersion(),
-					Name:       genericMachineTemplate.GetName(),
-					Namespace:  cluster.Namespace,
-				},
+			InfrastructureTemplate: corev1.ObjectReference{
+				Kind:       genericMachineTemplate.GetKind(),
+				APIVersion: genericMachineTemplate.GetAPIVersion(),
+				Name:       genericMachineTemplate.GetName(),
+				Namespace:  cluster.Namespace,
 			},
 			Version: "v1.16.6",
 		},
@@ -465,7 +461,7 @@ func TestCloneConfigsAndGenerateMachineFail(t *testing.T) {
 	}
 
 	// Try to break Infra Cloning
-	kcp.Spec.MachineTemplate.InfrastructureRef.Name = "something_invalid"
+	kcp.Spec.InfrastructureTemplate.Name = "something_invalid"
 	g.Expect(r.cloneConfigsAndGenerateMachine(ctx, cluster, kcp, bootstrapSpec, nil)).To(HaveOccurred())
 	g.Expect(&kcp.GetConditions()[0]).Should(conditions.HaveSameStateOf(&clusterv1.Condition{
 		Type:     controlplanev1.MachinesCreatedCondition,
diff --git a/controlplane/kubeadm/controllers/status_test.go b/controlplane/kubeadm/controllers/status_test.go
index 446586119..a6ec08c25 100644
--- a/controlplane/kubeadm/controllers/status_test.go
+++ b/controlplane/kubeadm/controllers/status_test.go
@@ -56,13 +56,6 @@ func TestKubeadmControlPlaneReconciler_updateStatusNoMachines(t *testing.T) {
 		},
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
 			Version: "v1.16.6",
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					APIVersion: "test/v1alpha1",
-					Kind:       "UnknownInfraMachine",
-					Name:       "foo",
-				},
-			},
 		},
 	}
 	kcp.Default()
@@ -112,13 +105,6 @@ func TestKubeadmControlPlaneReconciler_updateStatusAllMachinesNotReady(t *testin
 		},
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
 			Version: "v1.16.6",
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					APIVersion: "test/v1alpha1",
-					Kind:       "UnknownInfraMachine",
-					Name:       "foo",
-				},
-			},
 		},
 	}
 	kcp.Default()
@@ -177,13 +163,6 @@ func TestKubeadmControlPlaneReconciler_updateStatusAllMachinesReady(t *testing.T
 		},
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
 			Version: "v1.16.6",
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					APIVersion: "test/v1alpha1",
-					Kind:       "UnknownInfraMachine",
-					Name:       "foo",
-				},
-			},
 		},
 	}
 	kcp.Default()
@@ -250,13 +229,6 @@ func TestKubeadmControlPlaneReconciler_updateStatusMachinesReadyMixed(t *testing
 		},
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
 			Version: "v1.16.6",
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					APIVersion: "test/v1alpha1",
-					Kind:       "UnknownInfraMachine",
-					Name:       "foo",
-				},
-			},
 		},
 	}
 	kcp.Default()
@@ -323,13 +295,6 @@ func TestKubeadmControlPlaneReconciler_machinesCreatedIsIsTrueEvenWhenTheNodesAr
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
 			Version:  "v1.16.6",
 			Replicas: pointer.Int32Ptr(3),
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					APIVersion: "test/v1alpha1",
-					Kind:       "UnknownInfraMachine",
-					Name:       "foo",
-				},
-			},
 		},
 	}
 	kcp.Default()
diff --git a/controlplane/kubeadm/controllers/upgrade_test.go b/controlplane/kubeadm/controllers/upgrade_test.go
index d09fca800..a79c61b91 100644
--- a/controlplane/kubeadm/controllers/upgrade_test.go
+++ b/controlplane/kubeadm/controllers/upgrade_test.go
@@ -153,7 +153,7 @@ func TestKubeadmControlPlaneReconciler_RolloutStrategy_ScaleDown(t *testing.T) {
 			ObjectMeta: metav1.ObjectMeta{
 				Namespace: cluster.Namespace,
 				Name:      name,
-				Labels:    internal.ControlPlaneMachineLabelsForCluster(kcp, cluster.Name),
+				Labels:    internal.ControlPlaneLabelsForCluster(cluster.Name),
 			},
 			Spec: clusterv1.MachineSpec{
 				Bootstrap: clusterv1.Bootstrap{
diff --git a/controlplane/kubeadm/internal/filters_test.go b/controlplane/kubeadm/internal/filters_test.go
index 16d7c12e1..454705130 100644
--- a/controlplane/kubeadm/internal/filters_test.go
+++ b/controlplane/kubeadm/internal/filters_test.go
@@ -273,12 +273,20 @@ func TestMatchInitOrJoinConfiguration(t *testing.T) {
 	t.Run("returns true if the machine does not have a bootstrap config", func(t *testing.T) {
 		g := NewWithT(t)
 		kcp := &controlplanev1.KubeadmControlPlane{}
-		g.Expect(matchInitOrJoinConfiguration(nil, kcp)).To(BeTrue())
+		m := &clusterv1.Machine{}
+		g.Expect(matchInitOrJoinConfiguration(nil, kcp, m)).To(BeTrue())
 	})
 	t.Run("returns true if the there are problems reading the bootstrap config", func(t *testing.T) {
 		g := NewWithT(t)
 		kcp := &controlplanev1.KubeadmControlPlane{}
-		g.Expect(matchInitOrJoinConfiguration(nil, kcp)).To(BeTrue())
+		m := &clusterv1.Machine{
+			Spec: clusterv1.MachineSpec{
+				Bootstrap: clusterv1.Bootstrap{
+					ConfigRef: &corev1.ObjectReference{},
+				},
+			},
+		}
+		g.Expect(matchInitOrJoinConfiguration(nil, kcp, m)).To(BeTrue())
 	})
 	t.Run("returns true if InitConfiguration is equal", func(t *testing.T) {
 		g := NewWithT(t)
@@ -326,7 +334,7 @@ func TestMatchInitOrJoinConfiguration(t *testing.T) {
 				},
 			},
 		}
-		g.Expect(matchInitOrJoinConfiguration(machineConfigs[m.Name], kcp)).To(BeTrue())
+		g.Expect(matchInitOrJoinConfiguration(machineConfigs, kcp, m)).To(BeTrue())
 	})
 	t.Run("returns false if InitConfiguration is NOT equal", func(t *testing.T) {
 		g := NewWithT(t)
@@ -378,7 +386,7 @@ func TestMatchInitOrJoinConfiguration(t *testing.T) {
 				},
 			},
 		}
-		g.Expect(matchInitOrJoinConfiguration(machineConfigs[m.Name], kcp)).To(BeFalse())
+		g.Expect(matchInitOrJoinConfiguration(machineConfigs, kcp, m)).To(BeFalse())
 	})
 	t.Run("returns true if JoinConfiguration is equal", func(t *testing.T) {
 		g := NewWithT(t)
@@ -426,7 +434,7 @@ func TestMatchInitOrJoinConfiguration(t *testing.T) {
 				},
 			},
 		}
-		g.Expect(matchInitOrJoinConfiguration(machineConfigs[m.Name], kcp)).To(BeTrue())
+		g.Expect(matchInitOrJoinConfiguration(machineConfigs, kcp, m)).To(BeTrue())
 	})
 	t.Run("returns false if JoinConfiguration is NOT equal", func(t *testing.T) {
 		g := NewWithT(t)
@@ -478,7 +486,7 @@ func TestMatchInitOrJoinConfiguration(t *testing.T) {
 				},
 			},
 		}
-		g.Expect(matchInitOrJoinConfiguration(machineConfigs[m.Name], kcp)).To(BeFalse())
+		g.Expect(matchInitOrJoinConfiguration(machineConfigs, kcp, m)).To(BeFalse())
 	})
 	t.Run("returns false if some other configurations are not equal", func(t *testing.T) {
 		g := NewWithT(t)
@@ -527,7 +535,7 @@ func TestMatchInitOrJoinConfiguration(t *testing.T) {
 				},
 			},
 		}
-		g.Expect(matchInitOrJoinConfiguration(machineConfigs[m.Name], kcp)).To(BeFalse())
+		g.Expect(matchInitOrJoinConfiguration(machineConfigs, kcp, m)).To(BeFalse())
 	})
 }
 
@@ -834,94 +842,6 @@ func TestMatchesKubeadmBootstrapConfig(t *testing.T) {
 		f := MatchesKubeadmBootstrapConfig(machineConfigs, kcp)
 		g.Expect(f(m)).To(BeFalse())
 	})
-	t.Run("should match on labels and annotations", func(t *testing.T) {
-		kcp := &controlplanev1.KubeadmControlPlane{
-			Spec: controlplanev1.KubeadmControlPlaneSpec{
-				MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-					ObjectMeta: clusterv1.ObjectMeta{
-						Annotations: map[string]string{
-							"test": "annotation",
-						},
-						Labels: map[string]string{
-							"test": "labels",
-						},
-					},
-				},
-				KubeadmConfigSpec: bootstrapv1.KubeadmConfigSpec{
-					ClusterConfiguration: &bootstrapv1.ClusterConfiguration{},
-					InitConfiguration:    &bootstrapv1.InitConfiguration{},
-					JoinConfiguration:    &bootstrapv1.JoinConfiguration{},
-				},
-			},
-		}
-		m := &clusterv1.Machine{
-			TypeMeta: metav1.TypeMeta{
-				Kind:       "KubeadmConfig",
-				APIVersion: clusterv1.GroupVersion.String(),
-			},
-			ObjectMeta: metav1.ObjectMeta{
-				Namespace: "default",
-				Name:      "test",
-			},
-			Spec: clusterv1.MachineSpec{
-				Bootstrap: clusterv1.Bootstrap{
-					ConfigRef: &corev1.ObjectReference{
-						Kind:       "KubeadmConfig",
-						Namespace:  "default",
-						Name:       "test",
-						APIVersion: bootstrapv1.GroupVersion.String(),
-					},
-				},
-			},
-		}
-		machineConfigs := map[string]*bootstrapv1.KubeadmConfig{
-			m.Name: {
-				TypeMeta: metav1.TypeMeta{
-					Kind:       "KubeadmConfig",
-					APIVersion: bootstrapv1.GroupVersion.String(),
-				},
-				ObjectMeta: metav1.ObjectMeta{
-					Namespace: "default",
-					Name:      "test",
-				},
-				Spec: bootstrapv1.KubeadmConfigSpec{
-					JoinConfiguration: &bootstrapv1.JoinConfiguration{},
-				},
-			},
-		}
-
-		t.Run("by returning false if neither labels or annotations match", func(t *testing.T) {
-			g := NewWithT(t)
-			machineConfigs[m.Name].Annotations = nil
-			machineConfigs[m.Name].Labels = nil
-			f := MatchesKubeadmBootstrapConfig(machineConfigs, kcp)
-			g.Expect(f(m)).To(BeFalse())
-		})
-
-		t.Run("by returning false if only labels don't match", func(t *testing.T) {
-			g := NewWithT(t)
-			machineConfigs[m.Name].Annotations = kcp.Spec.MachineTemplate.ObjectMeta.Annotations
-			machineConfigs[m.Name].Labels = nil
-			f := MatchesKubeadmBootstrapConfig(machineConfigs, kcp)
-			g.Expect(f(m)).To(BeFalse())
-		})
-
-		t.Run("by returning false if only annotations don't match", func(t *testing.T) {
-			g := NewWithT(t)
-			machineConfigs[m.Name].Annotations = nil
-			machineConfigs[m.Name].Labels = kcp.Spec.MachineTemplate.ObjectMeta.Labels
-			f := MatchesKubeadmBootstrapConfig(machineConfigs, kcp)
-			g.Expect(f(m)).To(BeFalse())
-		})
-
-		t.Run("by returning true if both labels and annotations match", func(t *testing.T) {
-			g := NewWithT(t)
-			machineConfigs[m.Name].Labels = kcp.Spec.MachineTemplate.ObjectMeta.Labels
-			machineConfigs[m.Name].Annotations = kcp.Spec.MachineTemplate.ObjectMeta.Annotations
-			f := MatchesKubeadmBootstrapConfig(machineConfigs, kcp)
-			g.Expect(f(m)).To(BeTrue())
-		})
-	})
 }
 
 func TestMatchesTemplateClonedFrom(t *testing.T) {
@@ -949,101 +869,6 @@ func TestMatchesTemplateClonedFrom(t *testing.T) {
 			MatchesTemplateClonedFrom(map[string]*unstructured.Unstructured{}, kcp)(machine),
 		).To(BeTrue())
 	})
-
-	t.Run("matches labels or annotations", func(t *testing.T) {
-		kcp := &controlplanev1.KubeadmControlPlane{
-			ObjectMeta: metav1.ObjectMeta{
-				Namespace: "default",
-			},
-			Spec: controlplanev1.KubeadmControlPlaneSpec{
-				MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-					ObjectMeta: clusterv1.ObjectMeta{
-						Annotations: map[string]string{
-							"test": "annotation",
-						},
-						Labels: map[string]string{
-							"test": "labels",
-						},
-					},
-					InfrastructureRef: corev1.ObjectReference{
-						Kind:       "GenericMachineTemplate",
-						Namespace:  "default",
-						Name:       "infra-foo",
-						APIVersion: "generic.io/v1",
-					},
-				},
-			},
-		}
-		m := &clusterv1.Machine{
-			Spec: clusterv1.MachineSpec{
-				InfrastructureRef: corev1.ObjectReference{
-					Kind:       "GenericMachine",
-					Namespace:  "default",
-					Name:       "infra-foo",
-					APIVersion: "generic.io/v1",
-				},
-			},
-		}
-
-		infraConfigs := map[string]*unstructured.Unstructured{
-			m.Name: {
-				Object: map[string]interface{}{
-					"kind":       "InfrastructureMachine",
-					"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4",
-					"metadata": map[string]interface{}{
-						"name":      "infra-config1",
-						"namespace": "default",
-					},
-				},
-			},
-		}
-
-		t.Run("by returning false if neither labels or annotations match", func(t *testing.T) {
-			g := NewWithT(t)
-			infraConfigs[m.Name].SetAnnotations(map[string]string{
-				clusterv1.TemplateClonedFromNameAnnotation:      "infra-foo",
-				clusterv1.TemplateClonedFromGroupKindAnnotation: "GenericMachineTemplate.generic.io",
-			})
-			infraConfigs[m.Name].SetLabels(nil)
-			f := MatchesTemplateClonedFrom(infraConfigs, kcp)
-			g.Expect(f(m)).To(BeFalse())
-		})
-
-		t.Run("by returning false if only labels don't match", func(t *testing.T) {
-			g := NewWithT(t)
-			infraConfigs[m.Name].SetAnnotations(map[string]string{
-				clusterv1.TemplateClonedFromNameAnnotation:      "infra-foo",
-				clusterv1.TemplateClonedFromGroupKindAnnotation: "GenericMachineTemplate.generic.io",
-				"test": "annotation",
-			})
-			infraConfigs[m.Name].SetLabels(nil)
-			f := MatchesTemplateClonedFrom(infraConfigs, kcp)
-			g.Expect(f(m)).To(BeFalse())
-		})
-
-		t.Run("by returning false if only annotations don't match", func(t *testing.T) {
-			g := NewWithT(t)
-			infraConfigs[m.Name].SetAnnotations(map[string]string{
-				clusterv1.TemplateClonedFromNameAnnotation:      "infra-foo",
-				clusterv1.TemplateClonedFromGroupKindAnnotation: "GenericMachineTemplate.generic.io",
-			})
-			infraConfigs[m.Name].SetLabels(kcp.Spec.MachineTemplate.ObjectMeta.Labels)
-			f := MatchesTemplateClonedFrom(infraConfigs, kcp)
-			g.Expect(f(m)).To(BeFalse())
-		})
-
-		t.Run("by returning true if both labels and annotations match", func(t *testing.T) {
-			g := NewWithT(t)
-			infraConfigs[m.Name].SetAnnotations(map[string]string{
-				clusterv1.TemplateClonedFromNameAnnotation:      "infra-foo",
-				clusterv1.TemplateClonedFromGroupKindAnnotation: "GenericMachineTemplate.generic.io",
-				"test": "annotation",
-			})
-			infraConfigs[m.Name].SetLabels(kcp.Spec.MachineTemplate.ObjectMeta.Labels)
-			f := MatchesTemplateClonedFrom(infraConfigs, kcp)
-			g.Expect(f(m)).To(BeTrue())
-		})
-	})
 }
 
 func TestMatchesTemplateClonedFrom_WithClonedFromAnnotations(t *testing.T) {
@@ -1052,13 +877,11 @@ func TestMatchesTemplateClonedFrom_WithClonedFromAnnotations(t *testing.T) {
 			Namespace: "default",
 		},
 		Spec: controlplanev1.KubeadmControlPlaneSpec{
-			MachineTemplate: controlplanev1.KubeadmControlPlaneMachineTemplate{
-				InfrastructureRef: corev1.ObjectReference{
-					Kind:       "GenericMachineTemplate",
-					Namespace:  "default",
-					Name:       "infra-foo",
-					APIVersion: "generic.io/v1",
-				},
+			InfrastructureTemplate: corev1.ObjectReference{
+				Kind:       "GenericMachineTemplate",
+				Namespace:  "default",
+				Name:       "infra-foo",
+				APIVersion: "generic.io/v1",
 			},
 		},
 	}
diff --git a/hack/boilerplate/test/fail.go b/hack/boilerplate/test/fail.go
index bbaaf6414..16159c5ac 100644
--- a/hack/boilerplate/test/fail.go
+++ b/hack/boilerplate/test/fail.go
@@ -16,5 +16,4 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package test contains test boilerplate.
 package test
diff --git a/test/e2e/data/infrastructure-docker/v1alpha4/bases/cluster-with-kcp.yaml b/test/e2e/data/infrastructure-docker/v1alpha4/bases/cluster-with-kcp.yaml
index fad8fa127..0d15fb6d9 100644
--- a/test/e2e/data/infrastructure-docker/v1alpha4/bases/cluster-with-kcp.yaml
+++ b/test/e2e/data/infrastructure-docker/v1alpha4/bases/cluster-with-kcp.yaml
@@ -52,11 +52,10 @@ metadata:
     kcp-adoption.step2: ""
 spec:
   replicas: ${CONTROL_PLANE_MACHINE_COUNT}
-  machineTemplate:
-    infrastructureRef:
-      kind: DockerMachineTemplate
-      apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
-      name: "${CLUSTER_NAME}-control-plane"
+  infrastructureTemplate:
+    kind: DockerMachineTemplate
+    apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
+    name: "${CLUSTER_NAME}-control-plane"
   kubeadmConfigSpec:
     clusterConfiguration:
       controllerManager:
diff --git a/test/e2e/doc.go b/test/e2e/doc.go
deleted file mode 100644
index 64ed68ee0..000000000
--- a/test/e2e/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 e2e implements end to end testing.
-package e2e
diff --git a/test/e2e/internal/log/doc.go b/test/e2e/internal/log/doc.go
deleted file mode 100644
index 9964ba27b..000000000
--- a/test/e2e/internal/log/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 log implements log handling.
-package log
diff --git a/test/framework/bootstrap/interfaces.go b/test/framework/bootstrap/interfaces.go
index df86a470e..d621cad63 100644
--- a/test/framework/bootstrap/interfaces.go
+++ b/test/framework/bootstrap/interfaces.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package bootstrap implements bootstrap functionality for e2e testing.
 package bootstrap
 
 import "context"
diff --git a/test/framework/clusterctl/doc.go b/test/framework/clusterctl/doc.go
deleted file mode 100644
index 2e29162a1..000000000
--- a/test/framework/clusterctl/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 clusterctl implements clusterctl interaction.
-package clusterctl
diff --git a/test/framework/clusterctl/logger/logger.go b/test/framework/clusterctl/logger/logger.go
index c957b1b59..33d673fdf 100644
--- a/test/framework/clusterctl/logger/logger.go
+++ b/test/framework/clusterctl/logger/logger.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package logger implements clusterctl logging functionality.
 package logger
 
 import (
diff --git a/test/framework/doc.go b/test/framework/doc.go
deleted file mode 100644
index 6993cf5b3..000000000
--- a/test/framework/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 framework implements the test framework.
-package framework
diff --git a/test/framework/exec/command.go b/test/framework/exec/command.go
index 3b8525f7e..89dcdb179 100644
--- a/test/framework/exec/command.go
+++ b/test/framework/exec/command.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package exec implements command execution functionality.
 package exec
 
 import (
diff --git a/test/framework/ginkgoextensions/output.go b/test/framework/ginkgoextensions/output.go
index 5f6eb6c7e..0c9a487b6 100644
--- a/test/framework/ginkgoextensions/output.go
+++ b/test/framework/ginkgoextensions/output.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package ginkgoextensions extends ginko.
 package ginkgoextensions
 
 import (
diff --git a/test/framework/internal/log/log.go b/test/framework/internal/log/log.go
index 9ee0fe7ca..c672fcb41 100644
--- a/test/framework/internal/log/log.go
+++ b/test/framework/internal/log/log.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package log implements test framework logging.
 package log
 
 import (
diff --git a/test/framework/kubernetesversions/template.go b/test/framework/kubernetesversions/template.go
index 3c6bdf6e5..182ac6445 100644
--- a/test/framework/kubernetesversions/template.go
+++ b/test/framework/kubernetesversions/template.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package kubernetesversions implements kubernetes version functions.
 package kubernetesversions
 
 import (
diff --git a/test/framework/kubetest/run.go b/test/framework/kubetest/run.go
index 9b49aa386..6ad362e9a 100644
--- a/test/framework/kubetest/run.go
+++ b/test/framework/kubetest/run.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package kubetest implmements kubetest functionality.
 package kubetest
 
 import (
diff --git a/test/helpers/client.go b/test/helpers/client.go
index 033617ec9..20c495e20 100644
--- a/test/helpers/client.go
+++ b/test/helpers/client.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package helpers implements test helpers.
 package helpers
 
 import (
diff --git a/test/infrastructure/docker/api/v1alpha3/doc.go b/test/infrastructure/docker/api/v1alpha3/doc.go
index c4497d19b..7b2307144 100644
--- a/test/infrastructure/docker/api/v1alpha3/doc.go
+++ b/test/infrastructure/docker/api/v1alpha3/doc.go
@@ -14,6 +14,5 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package v1alpha3 contains the v1alpha3 API implementation.
 // +k8s:conversion-gen=sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4
 package v1alpha3
diff --git a/test/infrastructure/docker/controllers/dockercluster_controller.go b/test/infrastructure/docker/controllers/dockercluster_controller.go
index e44142182..c9047c98d 100644
--- a/test/infrastructure/docker/controllers/dockercluster_controller.go
+++ b/test/infrastructure/docker/controllers/dockercluster_controller.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package controllers implements controller functionality.
 package controllers
 
 import (
diff --git a/test/infrastructure/docker/docker/doc.go b/test/infrastructure/docker/docker/doc.go
deleted file mode 100644
index 5f588b1fe..000000000
--- a/test/infrastructure/docker/docker/doc.go
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright 2021 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 docker implements docker functionality.
-package docker
diff --git a/test/infrastructure/docker/docker/types/node.go b/test/infrastructure/docker/docker/types/node.go
index 8c7b5a4c0..11b1c2ee6 100644
--- a/test/infrastructure/docker/docker/types/node.go
+++ b/test/infrastructure/docker/docker/types/node.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package types implements type functionality.
 package types
 
 import (
diff --git a/test/infrastructure/docker/examples/machine-pool.yaml b/test/infrastructure/docker/examples/machine-pool.yaml
index e23052ee6..bf9d52100 100644
--- a/test/infrastructure/docker/examples/machine-pool.yaml
+++ b/test/infrastructure/docker/examples/machine-pool.yaml
@@ -30,12 +30,11 @@ metadata:
 spec:
   replicas: 1
   version: v1.19.1
-  machineTemplate:
-    infrastructureRef:
-      apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
-      kind: DockerMachineTemplate
-      name: controlplane
-      namespace: default
+  infrastructureTemplate:
+    apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
+    kind: DockerMachineTemplate
+    name: controlplane
+    namespace: default
   kubeadmConfigSpec:
     clusterConfiguration:
       controllerManager:
diff --git a/test/infrastructure/docker/examples/simple-cluster-ipv6.yaml b/test/infrastructure/docker/examples/simple-cluster-ipv6.yaml
index 833269a3a..eb79ebc01 100644
--- a/test/infrastructure/docker/examples/simple-cluster-ipv6.yaml
+++ b/test/infrastructure/docker/examples/simple-cluster-ipv6.yaml
@@ -45,12 +45,11 @@ metadata:
 spec:
   replicas: 1
   version: v1.19.1
-  machineTemplate:
-    infrastructureRef:
-      apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
-      kind: DockerMachineTemplate
-      name: controlplane
-      namespace: default
+  infrastructureTemplate:
+    apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
+    kind: DockerMachineTemplate
+    name: controlplane
+    namespace: default
   kubeadmConfigSpec:
     clusterConfiguration:
       apiServer:
diff --git a/test/infrastructure/docker/examples/simple-cluster.yaml b/test/infrastructure/docker/examples/simple-cluster.yaml
index fad1e78db..64d4c8599 100644
--- a/test/infrastructure/docker/examples/simple-cluster.yaml
+++ b/test/infrastructure/docker/examples/simple-cluster.yaml
@@ -45,12 +45,11 @@ metadata:
 spec:
   replicas: 1
   version: v1.19.1
-  machineTemplate:
-    infrastructureRef:
-      apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
-      kind: DockerMachineTemplate
-      name: controlplane
-      namespace: default
+  infrastructureTemplate:
+    apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
+    kind: DockerMachineTemplate
+    name: controlplane
+    namespace: default
   kubeadmConfigSpec:
     clusterConfiguration:
       apiServer:
diff --git a/test/infrastructure/docker/exp/api/v1alpha3/doc.go b/test/infrastructure/docker/exp/api/v1alpha3/doc.go
index d7be0b9d8..b518c01c4 100644
--- a/test/infrastructure/docker/exp/api/v1alpha3/doc.go
+++ b/test/infrastructure/docker/exp/api/v1alpha3/doc.go
@@ -14,6 +14,5 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package v1alpha3 contains the v1alpha3 API implementation.
 // +k8s:conversion-gen=sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1alpha4
 package v1alpha3
diff --git a/test/infrastructure/docker/exp/controllers/dockermachinepool_controller.go b/test/infrastructure/docker/exp/controllers/dockermachinepool_controller.go
index 590961cc7..6393abaa8 100644
--- a/test/infrastructure/docker/exp/controllers/dockermachinepool_controller.go
+++ b/test/infrastructure/docker/exp/controllers/dockermachinepool_controller.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package controllers implements controller functionality.
 package controllers
 
 import (
diff --git a/test/infrastructure/docker/exp/docker/nodepool.go b/test/infrastructure/docker/exp/docker/nodepool.go
index d15635f40..5d634cf0f 100644
--- a/test/infrastructure/docker/exp/docker/nodepool.go
+++ b/test/infrastructure/docker/exp/docker/nodepool.go
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
-// Package docker implements docker functionality.
 package docker
 
 import (
diff --git a/test/infrastructure/docker/go.mod b/test/infrastructure/docker/go.mod
index e90fdf65e..bcd9e6103 100644
--- a/test/infrastructure/docker/go.mod
+++ b/test/infrastructure/docker/go.mod
@@ -7,10 +7,10 @@ require (
 	github.com/onsi/gomega v1.11.0
 	github.com/pkg/errors v0.9.1
 	github.com/spf13/pflag v1.0.5
-	k8s.io/api v0.21.1
-	k8s.io/apimachinery v0.21.1
-	k8s.io/client-go v0.21.1
-	k8s.io/component-base v0.21.1
+	k8s.io/api v0.21.0
+	k8s.io/apimachinery v0.21.0
+	k8s.io/client-go v0.21.0
+	k8s.io/component-base v0.21.0
 	k8s.io/klog/v2 v2.8.0
 	k8s.io/utils v0.0.0-20210305010621-2afb4311ab10
 	sigs.k8s.io/cluster-api v0.3.3
diff --git a/test/infrastructure/docker/go.sum b/test/infrastructure/docker/go.sum
index 403bc8612..60e10975a 100644
--- a/test/infrastructure/docker/go.sum
+++ b/test/infrastructure/docker/go.sum
@@ -958,31 +958,24 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
 honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
+k8s.io/api v0.21.0 h1:gu5iGF4V6tfVCQ/R+8Hc0h7H1JuEhzyEi9S4R5LM8+Y=
 k8s.io/api v0.21.0/go.mod h1:+YbrhBBGgsxbF6o6Kj4KJPJnBmAKuXDeS3E18bgHNVU=
-k8s.io/api v0.21.1 h1:94bbZ5NTjdINJEdzOkpS4vdPhkb1VFpTYC9zh43f75c=
-k8s.io/api v0.21.1/go.mod h1:FstGROTmsSHBarKc8bylzXih8BLNYTiS3TZcsoEDg2s=
+k8s.io/apiextensions-apiserver v0.21.0 h1:Nd4uBuweg6ImzbxkC1W7xUNZcCV/8Vt10iTdTIVF3hw=
 k8s.io/apiextensions-apiserver v0.21.0/go.mod h1:gsQGNtGkc/YoDG9loKI0V+oLZM4ljRPjc/sql5tmvzc=
-k8s.io/apiextensions-apiserver v0.21.1 h1:AA+cnsb6w7SZ1vD32Z+zdgfXdXY8X9uGX5bN6EoPEIo=
-k8s.io/apiextensions-apiserver v0.21.1/go.mod h1:KESQFCGjqVcVsZ9g0xX5bacMjyX5emuWcS2arzdEouA=
 k8s.io/apimachinery v0.18.8/go.mod h1:6sQd+iHEqmOtALqOFjSWp2KZ9F0wlU/nWm0ZgsYWMig=
+k8s.io/apimachinery v0.21.0 h1:3Fx+41if+IRavNcKOz09FwEXDBG6ORh6iMsTSelhkMA=
 k8s.io/apimachinery v0.21.0/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY=
-k8s.io/apimachinery v0.21.1 h1:Q6XuHGlj2xc+hlMCvqyYfbv3H7SRGn2c8NycxJquDVs=
-k8s.io/apimachinery v0.21.1/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY=
+k8s.io/apiserver v0.21.0 h1:1hWMfsz+cXxB77k6/y0XxWxwl6l9OF26PC9QneUVn1Q=
 k8s.io/apiserver v0.21.0/go.mod h1:w2YSn4/WIwYuxG5zJmcqtRdtqgW/J2JRgFAqps3bBpg=
-k8s.io/apiserver v0.21.1 h1:wTRcid53IhxhbFt4KTrFSw8tAncfr01EP91lzfcygVg=
-k8s.io/apiserver v0.21.1/go.mod h1:nLLYZvMWn35glJ4/FZRhzLG/3MPxAaZTgV4FJZdr+tY=
-k8s.io/cli-runtime v0.21.1/go.mod h1:TI9Bvl8lQWZB2KqE91QLCp9AZE4l29zNFnj/x4IX4Fw=
+k8s.io/cli-runtime v0.21.0/go.mod h1:XoaHP93mGPF37MkLbjGVYqg3S1MnsFdKtiA/RZzzxOo=
+k8s.io/client-go v0.21.0 h1:n0zzzJsAQmJngpC0IhgFcApZyoGXPrDIAD601HD09ag=
 k8s.io/client-go v0.21.0/go.mod h1:nNBytTF9qPFDEhoqgEPaarobC8QPae13bElIVHzIglA=
-k8s.io/client-go v0.21.1 h1:bhblWYLZKUu+pm50plvQF8WpY6TXdRRtcS/K9WauOj4=
-k8s.io/client-go v0.21.1/go.mod h1:/kEw4RgW+3xnBGzvp9IWxKSNA+lXn3A7AuH3gdOAzLs=
-k8s.io/cluster-bootstrap v0.21.1 h1:wrk2jHNrXK7LKwLfmgZRkk0Od3LJtBmf2t5+cFHxdOE=
-k8s.io/cluster-bootstrap v0.21.1/go.mod h1:izdXmPTfqI9gkjQLf9PQ1Y9/DSqG54zU2UByEzgdajs=
+k8s.io/cluster-bootstrap v0.21.0 h1:9CfnWrvXm12k6fP3WR3ist76rrqGq6H5pRVEUvEc4Ws=
+k8s.io/cluster-bootstrap v0.21.0/go.mod h1:rs7i1JpBCa56YNmnYxFJuoUghIwpMzDidY8ZmqiRnrQ=
 k8s.io/code-generator v0.21.0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q=
-k8s.io/code-generator v0.21.1/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q=
+k8s.io/component-base v0.21.0 h1:tLLGp4BBjQaCpS/KiuWh7m2xqvAdsxLm4ATxHSe5Zpg=
 k8s.io/component-base v0.21.0/go.mod h1:qvtjz6X0USWXbgmbfXR+Agik4RZ3jv2Bgr5QnZzdPYw=
-k8s.io/component-base v0.21.1 h1:iLpj2btXbR326s/xNQWmPNGu0gaYSjzn7IN/5i28nQw=
-k8s.io/component-base v0.21.1/go.mod h1:NgzFZ2qu4m1juby4TnrmpR8adRk6ka62YdH5DkIIyKA=
-k8s.io/component-helpers v0.21.1/go.mod h1:FtC1flbiQlosHQrLrRUulnKxE4ajgWCGy/67fT2GRlQ=
+k8s.io/component-helpers v0.21.0/go.mod h1:tezqefP7lxfvJyR+0a+6QtVrkZ/wIkyMLK4WcQ3Cj8U=
 k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
 k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
 k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
@@ -996,8 +989,8 @@ k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec=
 k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E=
 k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 h1:vEx13qjvaZ4yfObSSXW7BrMc/KQBBT/Jyee8XtLf4x0=
 k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE=
-k8s.io/kubectl v0.21.1/go.mod h1:PMYR88MqESuysBM/MX+Vu4JbX/50nY4d4kny+SPEI2U=
-k8s.io/metrics v0.21.1/go.mod h1:pyDVLsLe++FIGDBFU80NcW4xMFsuiVTWL8Zfi7+PpNo=
+k8s.io/kubectl v0.21.0/go.mod h1:EU37NukZRXn1TpAkMUoy8Z/B2u6wjHDS4aInsDzVvks=
+k8s.io/metrics v0.21.0/go.mod h1:L3Ji9EGPP1YBbfm9sPfEXSpnj8i24bfQbAFAsW0NueQ=
 k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 k8s.io/utils v0.0.0-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 k8s.io/utils v0.0.0-20210305010621-2afb4311ab10 h1:u5rPykqiCpL+LBfjRkXvnK71gOgIdmq3eHUEkPrbeTI=
@@ -1010,10 +1003,10 @@ sigs.k8s.io/controller-runtime v0.9.0-beta.5 h1:yteq8am8lUFvlI/bfIgySMp/MqAPXiAg
 sigs.k8s.io/controller-runtime v0.9.0-beta.5/go.mod h1:ufPDuvefw2Y1KnBgHQrLdOjueYlj+XJV2AszbT+WTxs=
 sigs.k8s.io/kind v0.9.0 h1:SoDlXq6pEc7dGagHULNRCCBYrLH6xOi7lqXTRXeAlg4=
 sigs.k8s.io/kind v0.9.0/go.mod h1:cxKQWwmbtRDzQ+RNKnR6gZG6fjbeTtItp5cGf+ww+1Y=
-sigs.k8s.io/kustomize/api v0.8.8/go.mod h1:He1zoK0nk43Pc6NlV085xDXDXTNprtcyKZVm3swsdNY=
-sigs.k8s.io/kustomize/cmd/config v0.9.10/go.mod h1:Mrby0WnRH7hA6OwOYnYpfpiY0WJIMgYrEDfwOeFdMK0=
-sigs.k8s.io/kustomize/kustomize/v4 v4.1.2/go.mod h1:PxBvo4WGYlCLeRPL+ziT64wBXqbgfcalOS/SXa/tcyo=
-sigs.k8s.io/kustomize/kyaml v0.10.17/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg=
+sigs.k8s.io/kustomize/api v0.8.5/go.mod h1:M377apnKT5ZHJS++6H4rQoCHmWtt6qTpp3mbe7p6OLY=
+sigs.k8s.io/kustomize/cmd/config v0.9.7/go.mod h1:MvXCpHs77cfyxRmCNUQjIqCmZyYsbn5PyQpWiq44nW0=
+sigs.k8s.io/kustomize/kustomize/v4 v4.0.5/go.mod h1:C7rYla7sI8EnxHE/xEhRBSHMNfcL91fx0uKmUlUhrBk=
+sigs.k8s.io/kustomize/kyaml v0.10.15/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg=
 sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
 sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw=
 sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
diff --git a/test/infrastructure/docker/templates/cluster-template-development.yaml b/test/infrastructure/docker/templates/cluster-template-development.yaml
index 9706b2f28..55d50aca7 100644
--- a/test/infrastructure/docker/templates/cluster-template-development.yaml
+++ b/test/infrastructure/docker/templates/cluster-template-development.yaml
@@ -46,12 +46,11 @@ metadata:
   namespace: "${NAMESPACE}"
 spec:
   replicas: ${CONTROL_PLANE_MACHINE_COUNT}
-  machineTemplate:
-    infrastructureRef:
-      kind: DockerMachineTemplate
-      apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
-      name: "${CLUSTER_NAME}-control-plane"
-      namespace: "${NAMESPACE}"
+  infrastructureTemplate:
+    kind: DockerMachineTemplate
+    apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
+    name: "${CLUSTER_NAME}-control-plane"
+    namespace: "${NAMESPACE}"
   kubeadmConfigSpec:
     clusterConfiguration:
       controllerManager: