Skip to content

Add Conditions linter to verify conditions type, tags and markers #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

JoelSpeed
Copy link
Contributor

This PR adds a new linter, that checks for Conditions fields within structs within an API, and makes sure that they match the format expected

// +listType=map
// +listMapKey=type
// +patchStrategy=merge
// +patchMergeKey=type
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,opt,name=conditions"`

It provides configuration to skip the protobuf tags for APIs that do not need it, as well as suggests that the conditions should always be the first in the list. This is also configurable.

@JoelSpeed JoelSpeed mentioned this pull request Dec 6, 2024
27 tasks
@JoelSpeed JoelSpeed merged commit c9d4a4c into main Dec 11, 2024
2 checks passed
@JoelSpeed JoelSpeed deleted the conditions branch December 11, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant