Repository: kubernetes-sigs/cluster-api
Pull request #7744 (2022-12-13 15:05:04)

[release-1.3] 🌱 KCP should avoid to reconcile certificates too early
This is an automated cherry-pick of #7727

/assign fabriziopandini

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

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

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

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

- **[OWNERS](https://github.com/kubernetes-sigs/cluster-api/blob/release-1.3/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["vincepri"]} -->
k8s-ci-robot: @k8s-infra-cherrypick-robot: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-cluster-api-test-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-test-release-1-3/1602681025220055040) | true | `/test pull-cluster-api-test-release-1-3`

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

<details>

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

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-cluster-api-test-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-test-release-1-3/1602681025220055040) | true | `/test pull-cluster-api-test-release-1-3`
pull-cluster-api-build-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-build-release-1-3/1602681025052282880) | true | `/test pull-cluster-api-build-release-1-3`

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

<details>

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

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-cluster-api-test-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-test-release-1-3/1602681025220055040) | true | `/test pull-cluster-api-test-release-1-3`
pull-cluster-api-build-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-build-release-1-3/1602681025052282880) | true | `/test pull-cluster-api-build-release-1-3`
pull-cluster-api-e2e-informing-ipv6-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-e2e-informing-ipv6-release-1-3/1602681025454936064) | false | `/test pull-cluster-api-e2e-informing-ipv6-release-1-3`

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

<details>

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

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-cluster-api-test-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-test-release-1-3/1602681025220055040) | true | `/test pull-cluster-api-test-release-1-3`
pull-cluster-api-build-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-build-release-1-3/1602681025052282880) | true | `/test pull-cluster-api-build-release-1-3`
pull-cluster-api-e2e-informing-ipv6-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-e2e-informing-ipv6-release-1-3/1602681025454936064) | false | `/test pull-cluster-api-e2e-informing-ipv6-release-1-3`
pull-cluster-api-test-mink8s-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-test-mink8s-release-1-3/1602681025270386688) | true | `/test pull-cluster-api-test-mink8s-release-1-3`

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

<details>

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

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-cluster-api-test-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-test-release-1-3/1602681025220055040) | true | `/test pull-cluster-api-test-release-1-3`
pull-cluster-api-build-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-build-release-1-3/1602681025052282880) | true | `/test pull-cluster-api-build-release-1-3`
pull-cluster-api-e2e-informing-ipv6-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-e2e-informing-ipv6-release-1-3/1602681025454936064) | false | `/test pull-cluster-api-e2e-informing-ipv6-release-1-3`
pull-cluster-api-test-mink8s-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-test-mink8s-release-1-3/1602681025270386688) | true | `/test pull-cluster-api-test-mink8s-release-1-3`
pull-cluster-api-e2e-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-e2e-release-1-3/1602681025333301248) | true | `/test pull-cluster-api-e2e-release-1-3`
pull-cluster-api-verify-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-verify-release-1-3/1602681025165529088) | true | `/test pull-cluster-api-verify-release-1-3`
pull-cluster-api-e2e-informing-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-e2e-informing-release-1-3/1602681025396215808) | false | `/test pull-cluster-api-e2e-informing-release-1-3`

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

<details>

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

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-cluster-api-test-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-test-release-1-3/1602681025220055040) | true | `/test pull-cluster-api-test-release-1-3`
pull-cluster-api-build-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-build-release-1-3/1602681025052282880) | true | `/test pull-cluster-api-build-release-1-3`
pull-cluster-api-e2e-informing-ipv6-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-e2e-informing-ipv6-release-1-3/1602681025454936064) | false | `/test pull-cluster-api-e2e-informing-ipv6-release-1-3`
pull-cluster-api-test-mink8s-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-test-mink8s-release-1-3/1602681025270386688) | true | `/test pull-cluster-api-test-mink8s-release-1-3`
pull-cluster-api-e2e-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-e2e-release-1-3/1602681025333301248) | true | `/test pull-cluster-api-e2e-release-1-3`
pull-cluster-api-verify-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-verify-release-1-3/1602681025165529088) | true | `/test pull-cluster-api-verify-release-1-3`
pull-cluster-api-e2e-informing-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-e2e-informing-release-1-3/1602681025396215808) | false | `/test pull-cluster-api-e2e-informing-release-1-3`
pull-cluster-api-apidiff-release-1-3 | ba85c1831cddf980810518db4192d8f2ad2fd990 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_cluster-api/7744/pull-cluster-api-apidiff-release-1-3/1602681025111003136) | false | `/test pull-cluster-api-apidiff-release-1-3`

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

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
fabriziopandini: /retest
ykakarap: /retest
ykakarap: Netlify is currently having pipeline issues: https://www.netlifystatus.com/

One it is back to green we should re-trigger the jobs. `/retest` does not seem to re-trigger the Netlify jobs. These might need to be manually triggered using the "re-run jobs" button in github.
fabriziopandini: /lgtm
/approve
k8s-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/cluster-api/pull/7744#issuecomment-1349539049" title="Approved">fabriziopandini</a>*

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

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

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

- ~~[OWNERS](https://github.com/kubernetes-sigs/cluster-api/blob/release-1.3/OWNERS)~~ [fabriziopandini]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/api/v1beta1/machinedeployment_webhook.go b/api/v1beta1/machinedeployment_webhook.go
index 6a5d6646c..65fa45f48 100644
--- a/api/v1beta1/machinedeployment_webhook.go
+++ b/api/v1beta1/machinedeployment_webhook.go
@@ -25,7 +25,6 @@ import (
 	"k8s.io/apimachinery/pkg/labels"
 	"k8s.io/apimachinery/pkg/runtime"
 	"k8s.io/apimachinery/pkg/util/intstr"
-	"k8s.io/apimachinery/pkg/util/validation"
 	"k8s.io/apimachinery/pkg/util/validation/field"
 	"k8s.io/utils/pointer"
 	ctrl "sigs.k8s.io/controller-runtime"
@@ -77,19 +76,6 @@ func (m *MachineDeployment) ValidateDelete() error {
 
 func (m *MachineDeployment) validate(old *MachineDeployment) error {
 	var allErrs field.ErrorList
-	// The MachineDeployment name is used as a label value. This check ensures names which are not be valid label values are rejected.
-	if errs := validation.IsValidLabelValue(m.Name); len(errs) != 0 {
-		for _, err := range errs {
-			allErrs = append(
-				allErrs,
-				field.Invalid(
-					field.NewPath("metadata", "name"),
-					m.Name,
-					fmt.Sprintf("must be a valid label value: %s", err),
-				),
-			)
-		}
-	}
 	specPath := field.NewPath("spec")
 	selector, err := metav1.LabelSelectorAsSelector(&m.Spec.Selector)
 	if err != nil {
diff --git a/controlplane/kubeadm/internal/controllers/controller.go b/controlplane/kubeadm/internal/controllers/controller.go
index 072ce2f96..838dbf0ca 100644
--- a/controlplane/kubeadm/internal/controllers/controller.go
+++ b/controlplane/kubeadm/internal/controllers/controller.go
@@ -621,6 +621,11 @@ func (r *KubeadmControlPlaneReconciler) reconcileCertificateExpiries(ctx context
 		return ctrl.Result{}, nil
 	}
 
+	// Return if KCP is not yet initialized (no API server to contact for checking certificate expiration).
+	if !controlPlane.KCP.Status.Initialized {
+		return ctrl.Result{}, nil
+	}
+
 	// Ignore machines which are being deleted.
 	machines := controlPlane.Machines.Filter(collections.Not(collections.HasDeletionTimestamp))
 
diff --git a/go.mod b/go.mod
index 36af70653..c9488b071 100644
--- a/go.mod
+++ b/go.mod
@@ -20,7 +20,7 @@ require (
 	github.com/google/go-github/v45 v45.2.0
 	github.com/google/gofuzz v1.2.0
 	github.com/mattn/go-runewidth v0.0.14 // indirect
-	github.com/onsi/ginkgo/v2 v2.6.0
+	github.com/onsi/ginkgo/v2 v2.5.0
 	github.com/onsi/gomega v1.24.1
 	github.com/pkg/errors v0.9.1
 	github.com/spf13/cobra v1.6.1
diff --git a/go.sum b/go.sum
index 6589ad96c..9006ecd1f 100644
--- a/go.sum
+++ b/go.sum
@@ -483,8 +483,8 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn
 github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
 github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
 github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
-github.com/onsi/ginkgo/v2 v2.6.0 h1:9t9b9vRUbFq3C4qKFCGkVuq/fIHji802N1nrtkh1mNc=
-github.com/onsi/ginkgo/v2 v2.6.0/go.mod h1:63DOGlLAH8+REH8jUGdL3YpCpu7JODesutUjdENfUAc=
+github.com/onsi/ginkgo/v2 v2.5.0 h1:TRtrvv2vdQqzkwrQ1ke6vtXf7IK34RBUJafIy1wMwls=
+github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw=
 github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E=
 github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM=
 github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
diff --git a/hack/tools/go.sum b/hack/tools/go.sum
index 01bde7bc3..48444a538 100644
--- a/hack/tools/go.sum
+++ b/hack/tools/go.sum
@@ -406,7 +406,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW
 github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
 github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
-github.com/onsi/ginkgo/v2 v2.6.0 h1:9t9b9vRUbFq3C4qKFCGkVuq/fIHji802N1nrtkh1mNc=
+github.com/onsi/ginkgo/v2 v2.5.0 h1:TRtrvv2vdQqzkwrQ1ke6vtXf7IK34RBUJafIy1wMwls=
 github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E=
 github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM=
 github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
diff --git a/internal/webhooks/cluster.go b/internal/webhooks/cluster.go
index 1948abfa4..ef6a6d870 100644
--- a/internal/webhooks/cluster.go
+++ b/internal/webhooks/cluster.go
@@ -26,7 +26,6 @@ import (
 	"github.com/pkg/errors"
 	apierrors "k8s.io/apimachinery/pkg/api/errors"
 	"k8s.io/apimachinery/pkg/runtime"
-	"k8s.io/apimachinery/pkg/util/validation"
 	"k8s.io/apimachinery/pkg/util/validation/field"
 	ctrl "sigs.k8s.io/controller-runtime"
 	"sigs.k8s.io/controller-runtime/pkg/client"
@@ -150,19 +149,6 @@ func (webhook *Cluster) ValidateDelete(_ context.Context, _ runtime.Object) erro
 
 func (webhook *Cluster) validate(ctx context.Context, oldCluster, newCluster *clusterv1.Cluster) error {
 	var allErrs field.ErrorList
-	// The Cluster name is used as a label value. This check ensures that names which are not valid label values are rejected.
-	if errs := validation.IsValidLabelValue(newCluster.Name); len(errs) != 0 {
-		for _, err := range errs {
-			allErrs = append(
-				allErrs,
-				field.Invalid(
-					field.NewPath("metadata", "name"),
-					newCluster.Name,
-					fmt.Sprintf("must be a valid label value %s", err),
-				),
-			)
-		}
-	}
 	specPath := field.NewPath("spec")
 	if newCluster.Spec.InfrastructureRef != nil && newCluster.Spec.InfrastructureRef.Namespace != newCluster.Namespace {
 		allErrs = append(


Test patch:
diff --git a/api/v1beta1/machinedeployment_webhook_test.go b/api/v1beta1/machinedeployment_webhook_test.go
index c7ccc4800..4ab87a471 100644
--- a/api/v1beta1/machinedeployment_webhook_test.go
+++ b/api/v1beta1/machinedeployment_webhook_test.go
@@ -67,45 +67,14 @@ func TestMachineDeploymentValidation(t *testing.T) {
 
 	goodMaxSurgeInt := intstr.FromInt(1)
 	goodMaxUnavailableInt := intstr.FromInt(0)
+
 	tests := []struct {
 		name      string
-		md        MachineDeployment
-		mdName    string
 		selectors map[string]string
 		labels    map[string]string
 		strategy  MachineDeploymentStrategy
 		expectErr bool
 	}{
-		{
-			name:      "pass with name of under 63 characters",
-			mdName:    "short-name",
-			expectErr: false,
-		},
-		{
-			name:      "pass with _, -, . characters in name",
-			mdName:    "thisNameContains.A_Non-Alphanumeric",
-			expectErr: false,
-		},
-		{
-			name:      "error with name of more than 63 characters",
-			mdName:    "thisNameIsReallyMuchLongerThanTheMaximumLengthOfSixtyThreeCharacters",
-			expectErr: true,
-		},
-		{
-			name:      "error when name starts with NonAlphanumeric character",
-			mdName:    "-thisNameStartsWithANonAlphanumeric",
-			expectErr: true,
-		},
-		{
-			name:      "error when name ends with NonAlphanumeric character",
-			mdName:    "thisNameEndsWithANonAlphanumeric.",
-			expectErr: true,
-		},
-		{
-			name:      "error when name contains invalid NonAlphanumeric character",
-			mdName:    "thisNameContainsInvalid!@NonAlphanumerics",
-			expectErr: true,
-		},
 		{
 			name:      "should return error on mismatch",
 			selectors: map[string]string{"foo": "bar"},
@@ -194,9 +163,6 @@ func TestMachineDeploymentValidation(t *testing.T) {
 		t.Run(tt.name, func(t *testing.T) {
 			g := NewWithT(t)
 			md := &MachineDeployment{
-				ObjectMeta: metav1.ObjectMeta{
-					Name: tt.mdName,
-				},
 				Spec: MachineDeploymentSpec{
 					Strategy: &tt.strategy,
 					Selector: metav1.LabelSelector{
diff --git a/controlplane/kubeadm/internal/controllers/controller_test.go b/controlplane/kubeadm/internal/controllers/controller_test.go
index c2b42f855..3ec316110 100644
--- a/controlplane/kubeadm/internal/controllers/controller_test.go
+++ b/controlplane/kubeadm/internal/controllers/controller_test.go
@@ -918,7 +918,9 @@ func TestReconcileCertificateExpiries(t *testing.T) {
 	detectedExpiry := time.Now().Add(25 * 24 * time.Hour)
 
 	cluster := newCluster(&types.NamespacedName{Name: "foo", Namespace: metav1.NamespaceDefault})
-	kcp := &controlplanev1.KubeadmControlPlane{}
+	kcp := &controlplanev1.KubeadmControlPlane{
+		Status: controlplanev1.KubeadmControlPlaneStatus{Initialized: true},
+	}
 	machineWithoutExpiryAnnotation := &clusterv1.Machine{
 		ObjectMeta: metav1.ObjectMeta{
 			Name: "machineWithoutExpiryAnnotation",
diff --git a/internal/webhooks/cluster_test.go b/internal/webhooks/cluster_test.go
index 2d12487d1..d403f8dc0 100644
--- a/internal/webhooks/cluster_test.go
+++ b/internal/webhooks/cluster_test.go
@@ -518,36 +518,6 @@ func TestClusterValidation(t *testing.T) {
 							CIDRBlocks: []string{"10.10.10.10", "11.11.11.11"}}}).
 					Build(),
 			},
-			{
-				name:      "pass with name of under 63 characters",
-				expectErr: false,
-				in:        builder.Cluster("fooNamespace", "short-name").Build(),
-			},
-			{
-				name:      "pass with _, -, . characters in name",
-				in:        builder.Cluster("fooNamespace", "thisNameContains.A_Non-Alphanumeric").Build(),
-				expectErr: false,
-			},
-			{
-				name:      "fails if cluster name is longer than 63 characters",
-				in:        builder.Cluster("fooNamespace", "thisNameIsReallyMuchLongerThanTheMaximumLengthOfSixtyThreeCharacters").Build(),
-				expectErr: true,
-			},
-			{
-				name:      "error when name starts with NonAlphanumeric character",
-				in:        builder.Cluster("fooNamespace", "-thisNameStartsWithANonAlphanumeric").Build(),
-				expectErr: true,
-			},
-			{
-				name:      "error when name ends with NonAlphanumeric character",
-				in:        builder.Cluster("fooNamespace", "thisNameEndsWithANonAlphanumeric.").Build(),
-				expectErr: true,
-			},
-			{
-				name:      "error when name contains invalid NonAlphanumeric character",
-				in:        builder.Cluster("fooNamespace", "thisNameContainsInvalid!@NonAlphanumerics").Build(),
-				expectErr: true,
-			},
 		}
 	)
 	for _, tt := range tests {
diff --git a/test/go.mod b/test/go.mod
index 391da4cd8..8993fc509 100644
--- a/test/go.mod
+++ b/test/go.mod
@@ -10,7 +10,7 @@ require (
 	github.com/docker/go-connections v0.4.0
 	github.com/flatcar/ignition v0.36.2
 	github.com/go-logr/logr v1.2.3
-	github.com/onsi/ginkgo/v2 v2.6.0
+	github.com/onsi/ginkgo/v2 v2.5.0
 	github.com/onsi/gomega v1.24.1
 	github.com/pkg/errors v0.9.1
 	github.com/spf13/pflag v1.0.5
diff --git a/test/go.sum b/test/go.sum
index 7b6240b73..eea795fa8 100644
--- a/test/go.sum
+++ b/test/go.sum
@@ -435,8 +435,8 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA
 github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
 github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
 github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
-github.com/onsi/ginkgo/v2 v2.6.0 h1:9t9b9vRUbFq3C4qKFCGkVuq/fIHji802N1nrtkh1mNc=
-github.com/onsi/ginkgo/v2 v2.6.0/go.mod h1:63DOGlLAH8+REH8jUGdL3YpCpu7JODesutUjdENfUAc=
+github.com/onsi/ginkgo/v2 v2.5.0 h1:TRtrvv2vdQqzkwrQ1ke6vtXf7IK34RBUJafIy1wMwls=
+github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw=
 github.com/onsi/gomega v1.24.1 h1:KORJXNNTzJXzu4ScJWssJfJMnJ+2QJqhoQSRwNlze9E=
 github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM=
 github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=