Linter Rules
This topic describes the release linter and the linter rules.
Overview
The linter checks the manifest files in Replicated KOTS releases to ensure that there are no YAML syntax errors, that all required manifest files are present in the release to support installation with KOTS, and more.
The linter runs automatically against KOTS releases that you create in the Replicated vendor portal, and displays any error or warning messages in the vendor portal UI.
To lint manifest files from the command line, you can run the Replicated CLI replicated release lint command against the root directory of your application manifest files. You can also use the --lint flag when you create a release with the replicated release create command. For more information, see release lint and release create in the Replicated CLI section.
Linter Rules
This section lists the linter rules and the default rule levels (Info, Warn, Error). You can customize the default rule levels in the Replicated LinterConfig custom resource. For more information, see LintConfig.
allow-privilege-escalation
| Description | Notifies if any manifest file has allowPrivilegeEscalation set to true. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
application-icon
| Description | Requires an application icon. |
|---|---|
| Level | Warn |
| Applies To | Files with |
| Example | Example of correct YAML for this rule: |
application-spec
| Description | Requires an Application custom resource manifest file. Accepted value for |
|---|---|
| Level | Warn |
| Example | Example of matching YAML for this rule: |
application-statusInformers
| Description | Requires |
|---|---|
| Level | Warn |
| Applies To | Files with |
| Example | Example of correct YAML for this rule: |
config-option-invalid-type
| Description | Enforces valid types for Config items. For more information, see Items in Config. |
|---|---|
| Level | Error |
| Applies To | All files |
| Example | Correct: Incorrect:: |
config-option-is-circular
| Description | Enforces that all ConfigOption items do not reference themselves. |
|---|---|
| Level | Error |
| Applies To | Files with |
| Example | Incorrect: |
config-option-not-found
| Description | Requires all ConfigOption items to be defined in the |
|---|---|
| Level | Warn |
| Applies To | All files |
config-option-not-repeatable
| Description | Enforces that sub-templated ConfigOption items must be repeatable. |
|---|---|
| Level | Error |
| Applies To | All files |
config-option-password-type
| Description | Requires ConfigOption items with any of the following names to have
|
|---|---|
| Level | Warn |
| Applies To | All files |
| Example | Example of correct YAML for this rule: |
config-option-when-is-invalid
| Description | Enforces valid For more information, see when in Config. |
|---|---|
| Level | Error |
| Applies To | Files with kind: Config and apiVersion: kots.io/v1beta1. |
config-option-invalid-regex-validator
| Description | Enforces valid RE2 regular expressions pattern when regex validation is present. For more information, see Validation in Config. |
|---|---|
| Level | Error |
| Applies To | Files with kind: Config and apiVersion: kots.io/v1beta1. |
| Example | Correct: Incorrect: |
config-option-regex-validator-invalid-type
| Description | Enforces valid item type when regex validation is present. Item type should be For more information, see Validation in Config. |
|---|---|
| Level | Error |
| Applies To | Files with kind: Config and apiVersion: kots.io/v1beta1. |
| Example | Correct: Incorrect: |
config-spec
| Description | Requires a Config custom resource manifest file. Accepted value for Accepted value for |
|---|---|
| Level | Warn |
| Example | Example of matching YAML for this rule: |
container-image-latest-tag
| Description | Notifies if any manifest file has a container image tag appended with
:latest. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
container-image-local-image-name
| Description | Disallows any manifest file having a container image tag that includes LocalImageName. |
|---|---|
| Level | Error |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
container-resource-limits
| Description | Notifies if a spec.container has no resources.limits field. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
container-resource-requests
| Description | Notifies if a spec.container has no resources.requests field. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
container-resources
| Description | Notifies if a manifest file has no resources field. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
deprecated-kubernetes-installer-version
| Description | Disallows using the deprecated kURL installer
|
|---|---|
| Level | Warn |
| Applies To | Files with |
| Example | Correct: Incorrect: |
duplicate-helm-release-name
| Description | Enforces unique |
|---|---|
| Level | Error |
| Applies To | Files with |
duplicate-kots-kind
| Description | Disallows duplicate Replicated custom resources.
A release can only include one of each This rule disallows inclusion of more than one file with:
|
|---|---|
| Level | Error |
| Applies To | All files |
hardcoded-namespace
| Description | Notifies if any manifest file has a Replicated strongly recommends not specifying a namespace to allow for flexibility when deploying into end user environments. For more information, see Managing Application Namespaces. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
helm-archive-missing
| Description | Requires that a |
|---|---|
| Level | Error |
| Applies To | Releases with a HelmChart custom resource manifest file containing |
helm-chart-missing
| Description | Enforces that a HelmChart custom resource manifest file with |
|---|---|
| Level | Error |
| Applies To | Releases with a |
invalid-helm-release-name
| Description | Enforces valid
|
|---|---|
| Level | Warn |
| Applies To | Files with |
| Example | Example of correct YAML for this rule: |
invalid-kubernetes-installer
| Description | Enforces valid Replicated kURL add-on versions. kURL add-ons included in the kURL installer must pin specific versions rather than |
|---|---|
| Level | Error |
| Applies To | Files with
|
| Example | Correct: Incorrect: |
invalid-min-kots-version
| Description | Requires Accepts a |
|---|---|
| Level | Error |
| Applies To | Files with |
| Example | Example of correct YAML for this rule: |
invalid-rendered-yaml
| Description | Enforces valid YAML after rendering the manifests using the Config spec. |
|---|---|
| Level | Error |
| Applies To | YAML files |
| Example | Example Helm Chart: Correct Config: Resulting Rendered Helm Chart: Incorrect Config: Resulting Lint Error: Incorrectly Rendered Helm Chart: |
invalid-target-kots-version
| Description | Requires Accepts a |
|---|---|
| Level | Error |
| Applies To | Files with |
| Example | Example of correct YAML for this rule: |
invalid-type
| Description | Requires that the value of a property matches that property's expected type. |
|---|---|
| Level | Error |
| Applies To | All files |
| Example | Correct: Incorrect: |
invalid-yaml
| Description | Enforces valid YAML. |
|---|---|
| Level | Error |
| Applies To | YAML files |
| Example | Correct: Incorrect: |
may-contain-secrets
| Description | Notifies if any manifest file may contain secrets. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
missing-api-version-field
| Description | Requires the apiVersion: field in all files. |
|---|---|
| Level | Error |
| Applies To | All files |
| Example | Example of correct YAML for this rule: |
missing-kind-field
| Description | Requires the kind: field in all files. |
|---|---|
| Level | Error |
| Applies To | All files |
| Example | Example of correct YAML for this rule: |
nonexistent-status-informer-object
| Description | Requires that each The linter cannot evaluate If you configure status informers for Helm-managed resources, you can ignore |
|---|---|
| Level | Warning |
| Applies To | Compares |
preflight-spec
| Description | Requires a Preflight custom resource manifest file with:
and one of the following:
|
|---|---|
| Level | Warn |
| Example | Example of matching YAML for this rule: |
privileged
| Description | Notifies if any manifest file has privileged set to true. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
repeat-option-malformed-yamlpath
| Description | Enforces ConfigOption For more information, see Repeatable Item Template Targets in Config. |
|---|---|
| Level | Error |
| Applies To | All files |
| Example | Example of correct YAML for this rule: |
repeat-option-missing-template
| Description | Disallows repeating Config item with undefined For more information, see Repeatable Item Template Targets in Config. |
|---|---|
| Level | Error |
| Applies To | All files |
| Example | Example of correct YAML for this rule: |
repeat-option-missing-valuesByGroup
| Description | Disallows repeating Config item with undefined For more information, see Repeatable Items in Config. |
|---|---|
| Level | Error |
| Applies To | All files |
| Example | Example of correct YAML for this rule: |
replicas-1
| Description | Notifies if any manifest file has replicas set to 1. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
resource-limits-cpu
| Description | Notifies if a spec.container has no resources.limits.cpu field. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
resource-limits-memory
| Description | Notifies if a spec.container has no resources.limits.memory field. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
resource-requests-cpu
| Description | Notifies if a spec.container has no resources.requests.cpu field. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
resource-requests-memory
| Description | Notifies if a spec.container has no resources.requests.memory field. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
troubleshoot-spec
| Description | Requires a Troubleshoot manifest file. Accepted values for
Accepted values for
|
|---|---|
| Level | Warn |
| Example | Example of matching YAML for this rule: |
volume-docker-sock
| Description | Notifies if a spec.volumes has hostPath
set to /var/run/docker.sock. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |
volumes-host-paths
| Description | Notifies if a spec.volumes has defined a hostPath. |
|---|---|
| Level | Info |
| Applies To | All files |
| Example | Example of matching YAML for this rule: |