Skip to content

feat: add kube-api-linter checker#421

Merged
k8s-ci-robot merged 11 commits intokubernetes-sigs:mainfrom
dongjiang1989:add-kube-api-linter
Mar 19, 2026
Merged

feat: add kube-api-linter checker#421
k8s-ci-robot merged 11 commits intokubernetes-sigs:mainfrom
dongjiang1989:add-kube-api-linter

Conversation

@dongjiang1989
Copy link
Copy Markdown
Member

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 16, 2026

Deploy Preview for agent-sandbox canceled.

Name Link
🔨 Latest commit be20b18
🔍 Latest deploy log https://app.netlify.com/projects/agent-sandbox/deploys/69bb4feaa2060a00081e855b

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 16, 2026
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>
Copy link
Copy Markdown
Contributor

@yongruilin yongruilin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
dongjiang1989 and others added 2 commits March 18, 2026 09:11
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
@dongjiang1989
Copy link
Copy Markdown
Member Author

TOOD: Add presubmit-agent-sandbox-lint-api in test-infra. @dongjiang1989

Copy link
Copy Markdown
Contributor

@yongruilin yongruilin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +66 to +71
- path-except: api/.*
linters:
- kubeapilinter
- path-except: extensions/api/.*
linters:
- kubeapilinter
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yongruilin Thanks 🙏
U are right!
Updated!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This maybe rule check bug?

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Copy link
Copy Markdown
Contributor

@yongruilin yongruilin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one nit, then LGTM

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Copy link
Copy Markdown
Contributor

@yongruilin yongruilin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Thanks!
@janetkuo for API doc change

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 19, 2026
Copy link
Copy Markdown
Member

@janetkuo janetkuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 19, 2026
@k8s-ci-robot k8s-ci-robot merged commit 62cce73 into kubernetes-sigs:main Mar 19, 2026
10 checks passed
@dongjiang1989 dongjiang1989 deleted the add-kube-api-linter branch March 19, 2026 04:33
nadolskit pushed a commit to nadolskit/agent-sandbox that referenced this pull request Mar 20, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants