Skip to content

Commit a8e8d46

Browse files
committed
fix lint and enforce order
1 parent f7be064 commit a8e8d46

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pkg/crd/markers/validation.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,10 @@ func (m XValidation) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
660660
return nil
661661
}
662662

663+
func (XValidation) ApplyPriority() ApplyPriority {
664+
return ApplyPriorityDefault
665+
}
666+
663667
func (fields AtMostOneOf) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
664668
if len(fields) == 0 {
665669
return nil
@@ -672,9 +676,9 @@ func (fields AtMostOneOf) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
672676
return xvalidation.ApplyToSchema(schema)
673677
}
674678

675-
func (_ AtMostOneOf) ApplyPriority() ApplyPriority {
679+
func (AtMostOneOf) ApplyPriority() ApplyPriority {
676680
// explicitly go after XValidation markers so that the ordering is deterministic
677-
return ApplyPriorityDefault + 1
681+
return XValidation{}.ApplyPriority() + 1
678682
}
679683

680684
func (fields ExactlyOneOf) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
@@ -689,9 +693,9 @@ func (fields ExactlyOneOf) ApplyToSchema(schema *apiext.JSONSchemaProps) error {
689693
return xvalidation.ApplyToSchema(schema)
690694
}
691695

692-
func (_ ExactlyOneOf) ApplyPriority() ApplyPriority {
696+
func (ExactlyOneOf) ApplyPriority() ApplyPriority {
693697
// explicitly go after XValidation markers so that the ordering is deterministic
694-
return ApplyPriorityDefault + 1
698+
return XValidation{}.ApplyPriority() + 1
695699
}
696700

697701
// fieldsToOneOfCelRuleStr converts a slice of field names to a string representation

0 commit comments

Comments
 (0)