Skip to content

Commit

Permalink
ValidateCommonFields should be private
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelSpeed committed Aug 14, 2023
1 parent ba76c78 commit 12eaa07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/webhooks/clusterclass.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions internal/webhooks/machinehealthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 &&
Expand Down

0 comments on commit 12eaa07

Please sign in to comment.