From 1bd9420f29ab5c9befa0b130d0fa9a3916bb227e Mon Sep 17 00:00:00 2001 From: Stefan Bueringer Date: Fri, 24 May 2024 10:35:30 +0200 Subject: [PATCH] Fix indexing in ClusterClass webhook MHC validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stefan Büringer buringerst@vmware.com --- internal/webhooks/clusterclass.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/webhooks/clusterclass.go b/internal/webhooks/clusterclass.go index 6b7a78880b70..c74a553b779a 100644 --- a/internal/webhooks/clusterclass.go +++ b/internal/webhooks/clusterclass.go @@ -408,7 +408,7 @@ func validateMachineHealthCheckClasses(clusterClass *clusterv1.ClusterClass) fie if md.MachineHealthCheck == nil { continue } - fldPath := field.NewPath("spec", "workers", "machineDeployments", "machineHealthCheck").Index(i) + fldPath := field.NewPath("spec", "workers", "machineDeployments").Index(i).Child("machineHealthCheck") allErrs = append(allErrs, validateMachineHealthCheckClass(fldPath, clusterClass.Namespace, md.MachineHealthCheck)...) }