-
Notifications
You must be signed in to change notification settings - Fork 537
feat: add kube api linter in kagent #1759
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
Open
dongjiang1989
wants to merge
15
commits into
kagent-dev:main
Choose a base branch
from
dongjiang1989:add-kube-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
776b79b
add kube api linter checker
dongjiang1989 8cbe74f
fix make lint-api
dongjiang1989 2bda472
Merge branch 'main' into add-kube-api
EItanya 8afaf50
merge golangci-kal.yml to golanci-lint.yaml
dongjiang1989 cc8c0e9
merge golangci-kal.yml to golanci-lint.yaml
dongjiang1989 ab1c91b
use make lint
dongjiang1989 edcb520
add kube api linter checker
dongjiang1989 2530f3a
fix make lint-api
dongjiang1989 8bd19db
merge golangci-kal.yml to golanci-lint.yaml
dongjiang1989 8f0531e
merge golangci-kal.yml to golanci-lint.yaml
dongjiang1989 50f5e23
use make lint
dongjiang1989 a2cd093
t branch
dongjiang1989 93f9891
Merge branch 'main' into add-kube-api
dongjiang1989 2e38420
Merge branch 'add-kube-api' of github.com:dongjiang1989/kagent into a…
dongjiang1989 31acd05
update kube api linter
dongjiang1989 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| version: v2.11.3 | ||
| name: golangci-kube-api-linter | ||
| destination: ./tmp/bin/ | ||
| plugins: | ||
| - module: 'sigs.k8s.io/kube-api-linter' | ||
| version: v0.0.0-20260206102632-39e3d06a2850 | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| version: "2" | ||
| run: | ||
| go: "1.26" | ||
| allow-parallel-runners: true | ||
| linters: | ||
| default: none | ||
| enable: | ||
| - kubeapilinter | ||
| settings: | ||
| custom: | ||
| kubeapilinter: | ||
| type: module | ||
| description: KAL validates CRDs against Kubernetes API conventions. | ||
| settings: | ||
| linters: | ||
| enable: | ||
| - "conflictingmarkers" | ||
| - "duplicatemarkers" | ||
| - "nofloats" | ||
| - "optionalorrequired" | ||
| - "statussubresource" | ||
| - "uniquemarkers" | ||
| - "statusoptional" | ||
| - "nophase" | ||
| - "nonullable" | ||
| - "forbiddenmarkers" | ||
| - "nomaps" | ||
| disable: | ||
| - "*" | ||
|
dongjiang1989 marked this conversation as resolved.
Outdated
|
||
| lintersConfig: | ||
| conflictingmarkers: | ||
| conflicts: | ||
| - name: "default_vs_required" | ||
| sets: | ||
| - ["default", "kubebuilder:default"] | ||
| - ["required", "kubebuilder:validation:Required", "k8s:required"] | ||
| description: "A field with a default value cannot be required" | ||
| forbiddenmarkers: | ||
| markers: | ||
| - identifier: "+kubebuilder:pruning:PreserveUnknownFields" | ||
| - identifier: "+kubebuilder:validation:XPreserveUnknownFields" | ||
| - identifier: "+kubebuilder:validation:items:XPreserveUnknownFields" | ||
| - identifier: "+kubebuilder:validation:EmbeddedResource" | ||
| - identifier: "+kubebuilder:validation:XEmbeddedResource" | ||
| - identifier: "+kubebuilder:validation:items:XEmbeddedResource" | ||
| exclusions: | ||
| generated: strict | ||
| paths: | ||
| - _test\.go | ||
| - zz_generated.*\.go$ | ||
| rules: | ||
| - path: "./api/v1alpha.*" | ||
| linters: | ||
| - kubeapilinter | ||
|
dongjiang1989 marked this conversation as resolved.
Outdated
|
||
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.