Skip to content

Add a basic schema validation for config files #978

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
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions schemas/kube-lint-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "KubeLinter Configuration",
"type": "object",
"properties": {
"checks": {
"type": "object",
"description": "Configure which built-in checks to run or skip",
"properties": {
"doNotAutoAddDefaults": {
"type": "boolean",
"description": "Disable all built-in checks"
},
"addAllBuiltIn": {
"type": "boolean",
"description": "Enable all built-in checks. Takes precedence over doNotAutoAddDefaults"
},
"ignorePaths": {
"type": "array",
"description": "File or directory globs to skip. Uses https://pkg.go.dev/github.com/bmatcuk/doublestar#Match syntax",
"items": {
"type": "string"
}
},
"include": {
"type": "array",
"description": "List of specific checks to run. Exclude always takes precedence over include",
"items": {
"type": "string"
}
},
"exclude": {
"type": "array",
"description": "List of specific checks to skip (takes precedence over include)",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"customChecks": {
"type": "array",
"description": "User-defined checks based on templates",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Unique identifier for this custom check"
},
"template": {
"type": "string",
"description": "Template name (e.g. required-annotation, required-label)"
},
"params": {
"type": "object",
"description": "Template-specific parameters",
"additionalProperties": true
},
"scope": {
"type": "object",
"description": "Limit this check to certain Kubernetes object kinds",
"properties": {
"objectKinds": {
"type": "array",
"items": {
"type": "string"
},
"description": "E.g. DeploymentLike, Service. Supported values are listed in: https://github.com/stackrox/kube-linter/tree/main/pkg/objectkinds"
}
},
"additionalProperties": false
},
"remediation": {
"type": "string",
"description": "Custom message shown when this check fails"
}
},
"required": [
"name",
"template"
],
"additionalProperties": false
}
}
},
"additionalProperties": false
}
Loading