You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kube-api-linter is a custom linter designed to enforce Kubernetes API conventions and best practices. Since Kubebuilder is centered around building Kubernetes APIs and controllers, enforcing these standards early in the development process can help ensure high-quality, compliant APIs.
Integrating it into our tooling would provide users with immediate feedback about common issues or violations, leading to more robust and consistent operator development.
Even if we decide not to adopt it, this effort will still help us identify and possibly fix latent API issues.
What is the value vs. risk of including this linter by default?
Why should we include or exclude it from the user scaffolds?
Does it provide immediate benefit without noise or confusion?
Only if the linter proves valuable and stable should we consider merging this into the default scaffolds.
Note: Adding it to the Kubebuilder CLI itself is more straightforward; adding it to the scaffolds created by Kubebuilder requires an evaluation to determine whether we should move forward.
What do you want to happen?
Proposal: Integrate
kube-api-linter
into Kubebuilderkube-api-linter
is a custom linter designed to enforce Kubernetes API conventions and best practices. Since Kubebuilder is centered around building Kubernetes APIs and controllers, enforcing these standards early in the development process can help ensure high-quality, compliant APIs.Integrating it into our tooling would provide users with immediate feedback about common issues or violations, leading to more robust and consistent operator development.
Even if we decide not to adopt it, this effort will still help us identify and possibly fix latent API issues.
✅ Why
⚙️ What
Update Kubebuilder’s
.golangci.yml
Add
kube-api-linter
to:https://github.com/kubernetes-sigs/kubebuilder/blob/master/.golangci.yml
Update the scaffolding logic
.golangci.yml
golangci.go
init.go
lines 181–183Regenerate after changes
➕ Pros
➖ Cons
🧪 Suggested Steps – Workflow
Phase 1: Kubebuilder (core project)
Create a PR to add
kube-api-linter
to Kubebuilder itselfCheck for issues/failures in CI
If CI passes and the linter adds value, merge the PR
Phase 2: Scaffolding (generated user projects)
Create a separate PR to add
kube-api-linter
into the scaffolded.golangci.yml
golangci.go
init.go
Check if scaffolded projects generate with issues
Fix any issues found
Evaluate critically
Only if the linter proves valuable and stable should we consider merging this into the default scaffolds.
Note: Adding it to the Kubebuilder CLI itself is more straightforward; adding it to the scaffolds created by Kubebuilder requires an evaluation to determine whether we should move forward.
Reference: https://golangci-lint.run/contributing/new-linters/
Extra Labels
No response
The text was updated successfully, but these errors were encountered: