-
Notifications
You must be signed in to change notification settings - Fork 563
Enable Kubernetes API Linter #3917
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, very much appreciate the effort. Just one nit.
/approve
|
||
jobs: | ||
golangci: | ||
name: lint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: lint | |
name: kube-api-lint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @rikatz!
- name: Build KAL | ||
run: golangci-lint custom | ||
- name: run api linter | ||
run: ./bin/golangci-kube-api-linter run -c ./.golangci-kal.yml ./... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget trailing new line here.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rikatz, robscott, shaneutt The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind test
What this PR does / why we need it: This PR enables Kube API Linter with a small set of validations. The enabled validations doesn't present a breaking change on existing APIs, and the plan is to progressively enable other linters that may present more disrupting changes on follow up PRs after discussion with Gateway API group.
Does this PR introduce a user-facing change?:
Note for reviewers:
The ongoing discussion is part of the document https://docs.google.com/document/d/1DSyP7Vt9E9wX2ku1C0AvCLqQe9cCiDPCLiPP0wXFYQw/edit?tab=t.0 and the thread https://kubernetes.slack.com/archives/CR0H13KGA/p1751923997220399
The proposed changes on this PR contains fix for validations that are not breaking change, and are separated on different commits per enabled linter.
For newer validations, we should enable the linters just for new changes and existing violations should be fixed individually as they may not break existing GA'd APIs.
This run contains the execution of the linter as per this PR without enabling the feature for only changed files, showing that the enabled linters don't trigger any violation.