feat: add kube-api-linter checker#421
Conversation
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
✅ Deploy Preview for agent-sandbox canceled.
|
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
yongruilin
left a comment
There was a problem hiding this comment.
As the contributor of kube-api-linter, I'm happy to see this integration.
Left some comments for better integration and consistency.
Co-authored-by: Yongrui Lin <yongrlin@google.com>
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
|
TOOD: Add |
yongruilin
left a comment
There was a problem hiding this comment.
The current PR doesn't cover the api/v1alpha1/ . I think there should be lint issues need to be addressed in sandbox_types.go as well.
You can apply my suggested change to .golangci-kal.yml and run make lint-api to reveal the issues.
dev/tools/.golangci-kal.yml
Outdated
| - path-except: api/.* | ||
| linters: | ||
| - kubeapilinter | ||
| - path-except: extensions/api/.* | ||
| linters: | ||
| - kubeapilinter |
There was a problem hiding this comment.
| - path-except: api/.* | |
| linters: | |
| - kubeapilinter | |
| - path-except: extensions/api/.* | |
| linters: | |
| - kubeapilinter | |
| - path-except: "api/.*" | |
| linters: | |
| - kubeapilinter |
The two separate path-except rules mean an issue is excluded if it matches either rule. Files under api/v1alpha1/ pass rule 1 but get excluded by rule 2. So KAL only runs on extensions/api/, missing all issues in core api/.
Actually, a single rule is enough to cover both paths.
There was a problem hiding this comment.
This maybe rule check bug?
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
yongruilin
left a comment
There was a problem hiding this comment.
/lgtm
Thanks!
@janetkuo for API doc change
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dongjiang1989, janetkuo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* add kube-api-linter checker Signed-off-by: dongjiang1989 <dongjiang1989@126.com> * fix by codereview Signed-off-by: dongjiang1989 <dongjiang1989@126.com> * rm no use file Signed-off-by: dongjiang1989 <dongjiang1989@126.com> * revert dev/ci/presubmits/lint-go Signed-off-by: dongjiang1989 <dongjiang1989@126.com> * update chmod 755 Signed-off-by: dongjiang1989 <dongjiang1989@126.com> * Update dev/tools/lint-api Co-authored-by: Yongrui Lin <yongrlin@google.com> * Update extensions/api/v1alpha1/sandboxclaim_types.go * fix lint-api Signed-off-by: dongjiang1989 <dongjiang1989@126.com> * update by codereview Signed-off-by: dongjiang1989 <dongjiang1989@126.com> * update make gen Signed-off-by: dongjiang1989 <dongjiang1989@126.com> * revert nit Signed-off-by: dongjiang1989 <dongjiang1989@126.com> --------- Signed-off-by: dongjiang1989 <dongjiang1989@126.com> Co-authored-by: Yongrui Lin <yongrlin@google.com>
Add kube-api-linter: https://github.com/kubernetes-sigs/kube-api-linter