ci: fix commentstart, conditions, defaultorrequired, optionalorrequired and defaults findings in api types - #1314
Open
Mesut Oezdil (mesutoezdil) wants to merge 2 commits into
Conversation
Introduces the kube-api-linter tool (hack/tools/kube-api-linter) and .golangci-kal.yaml, wired into hack/verify-all.sh. Every finding currently produced against pkg/api/v1alpha1 is excluded precisely by field, some because the fix needs a Go API change (tracked in agent-substrate#207) and some file-wide for now (commentstart, conditions, defaultorrequired, optionalorrequired, defaults). This PR makes no content changes to the API types, so it carries no review burden beyond the tool and config themselves. Follow-up PRs remove the file-wide exclusions and fix those findings by class.
…ed and defaults findings in api types Removes the file-wide exclusions added in the tool-introduction PR and fixes every finding they were covering, including a few new ones from fields added since that PR was written (SystemInfoDataSource's data source fields, Capabilities.Add/Drop, Container.Resources, ContainerResources.Limits, ContainerReadyz.TimeoutSeconds, and all of csidriverconfig_types.go, which was not covered by any prior pass). - commentstart: field godocs now start with the serialized field name. - conditions: Conditions moved to the first position in ActorTemplateStatus and got the listType, listMapKey and patch markers. - defaultorrequired: SandboxConfigSpec.SandboxClass had both a default and required; now optional with omitempty, matching the same field on WorkerPoolSpec and ActorTemplateSpec. - optionalorrequired: missing +optional/+required markers added on ActorTemplateStatus, SystemInfoDataSource and CSIDriverConfig fields. - defaults: configured preferredDefaultMarker to kubebuilder:default since CRDs are generated with controller-gen, and added the omitzero tag SnapshotsConfig.OnResume needs for its default. hack/verify/kube-api-linter.sh passes with 0 issues. Generated CRDs regenerated; the only structural schema changes are the conditions listType/listMapKey and sandboxClass no longer required (it is defaulted, so behavior is unchanged), the rest is description text and the two new +optional/+required markers.
Mesut Oezdil (mesutoezdil)
force-pushed
the
feat/kube-api-linter-fix-doc-findings
branch
from
August 29, 2026 09:13
04239f8 to
a339cf1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #416 (the diff here includes that PR's commit until it merges, then shrinks to just this one).
Removes the file-wide exclusions #416 added and fixes the findings they were covering: commentstart (field godocs now start with the serialized field name), conditions (moved Conditions to the first position in ActorTemplateStatus with listType, listMapKey and patch markers), defaultorrequired (SandboxConfigSpec.SandboxClass had both a default and required, now optional with omitempty), optionalorrequired (missing +optional markers on ActorTemplateStatus fields), and defaults (configured preferredDefaultMarker to kubebuilder:default). Generated CRDs regenerated. Structural schema changes are only the conditions listType/listMapKey and sandboxClass no longer required (it is defaulted); the rest is description text.