From 12eaa071c26eef91cba14328a140398bab6229a7 Mon Sep 17 00:00:00 2001 From: Joel Speed Date: Mon, 14 Aug 2023 15:41:44 +0100 Subject: [PATCH] ValidateCommonFields should be private --- internal/webhooks/clusterclass.go | 2 +- internal/webhooks/machinehealthcheck.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/webhooks/clusterclass.go b/internal/webhooks/clusterclass.go index 2cb3250fb895..ecf3bb9b7f0b 100644 --- a/internal/webhooks/clusterclass.go +++ b/internal/webhooks/clusterclass.go @@ -366,7 +366,7 @@ func validateMachineHealthCheckClass(fldPath *field.Path, namepace string, m *cl RemediationTemplate: m.RemediationTemplate, }} - return (&MachineHealthCheck{}).ValidateCommonFields(&mhc, fldPath) + return (&MachineHealthCheck{}).validateCommonFields(&mhc, fldPath) } func validateClusterClassMetadata(clusterClass *clusterv1.ClusterClass) field.ErrorList { diff --git a/internal/webhooks/machinehealthcheck.go b/internal/webhooks/machinehealthcheck.go index d081a1a511e7..a6cbfb95ab93 100644 --- a/internal/webhooks/machinehealthcheck.go +++ b/internal/webhooks/machinehealthcheck.go @@ -157,7 +157,7 @@ func (webhook *MachineHealthCheck) validate(oldMHC, newMHC *clusterv1.MachineHea ) } - allErrs = append(allErrs, webhook.ValidateCommonFields(newMHC, specPath)...) + allErrs = append(allErrs, webhook.validateCommonFields(newMHC, specPath)...) if len(allErrs) == 0 { return nil @@ -167,7 +167,7 @@ func (webhook *MachineHealthCheck) validate(oldMHC, newMHC *clusterv1.MachineHea // ValidateCommonFields validates UnhealthyConditions NodeStartupTimeout, MaxUnhealthy, and RemediationTemplate of the MHC. // These are the fields in common with other types which define MachineHealthChecks such as MachineHealthCheckClass and MachineHealthCheckTopology. -func (webhook *MachineHealthCheck) ValidateCommonFields(m *clusterv1.MachineHealthCheck, fldPath *field.Path) field.ErrorList { +func (webhook *MachineHealthCheck) validateCommonFields(m *clusterv1.MachineHealthCheck, fldPath *field.Path) field.ErrorList { var allErrs field.ErrorList if m.Spec.NodeStartupTimeout != nil &&