Skip to content

arrayofstruct Linter is not aware of AtLeastOneOf or ExactlyOneOf markers #178

@snorwin

Description

@snorwin

Currently, the linter enforces that at least one field in a struct must have a required marker (e.g., +required). However, it should also accept cases where the entire struct includes a validation marker that has an equivalent meaning, e.g.:

+kubebuilder:validation:AtLeastOneOf
+kubebuilder:validation:ExactlyOneOf

In such cases, the struct-level validation marker already enforces that at least one field is required, so the linter should not raise an error.

It might make sense to add a configuration option to this linter that allows specifying field- and type-level markers which should be interpreted as fulfilling the required constraint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions