Skip to content

Commit

Permalink
Fix indexing in ClusterClass webhook MHC validation
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Büringer buringerst@vmware.com
  • Loading branch information
sbueringer authored and k8s-infra-cherrypick-robot committed May 24, 2024
1 parent 8e15b9e commit d935ed8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/webhooks/clusterclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)...)
}
Expand Down

0 comments on commit d935ed8

Please sign in to comment.