Linter Rules
This topic describes the linter and the rules for the linter.
Using the Linter
The linter checks the manifest files for applications packaged with Replicated to ensure that there are no YAML syntax errors, that all required manifest files are present in the release, and more.
The linter runs automatically against releases that you create in the Replicated vendor portal, and displays any error or warning messages in the vendor portal UI.
To lint your application manifest files, 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.
You can customize the default rule levels in the Replicated LinterConfig custom resource. For more information, see LintConfig.
Linter Rules
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 kind: Application and apiVersion: kots.io/v1beta1. |
| 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 statusInformers. |
|---|---|
| Level | Warn |
| Applies To | Files with kind: Application and apiVersion: kots.io/v1beta1. |
| 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 kind: Config and apiVersion: kots.io/v1beta1. |
| Example | Incorrect: |
config-option-not-found
| Description | Requires all ConfigOption items to be defined in the Config custom resource manifest file. |
|---|---|
| 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-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 Kubernetes installer
|
|---|---|
| Level | Warn |
| Applies To | Files with kind: Installer and apiVersion: kurl.sh/v1beta1. |
| Example | Correct: Incorrect: |
duplicate-helm-release-name
| Description | Enforces unique |
|---|---|
| Level | Error |
| Applies To | Files with kind: HelmChart and apiVersion: kots.io/v1beta1. |
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 kind: HelmChart and apiVersion: kots.io/v1beta1. |
helm-chart-missing
| Description | Enforces that a HelmChart custom resource manifest file with |
|---|---|
| Level | Error |
| Applies To | Releases with a *.tar.gz archive file present. |
invalid-helm-release-name
| Description | Enforces valid
|
|---|---|
| Level | Warn |
| Applies To | Files with kind: HelmChart and apiVersion: kots.io/v1beta1. |
| Example | Example of correct YAML for this rule: |
invalid-kubernetes-installer
| Description | Enforces valid Kubernetes installer add-on versions. Add-ons included in the Kubernetes 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 kind: Application and apiVersion: kots.io/v1beta1. |
| Example | Example of correct YAML for this rule: |
invalid-target-kots-version
| Description | Requires Accepts a |
|---|---|
| Level | Error |
| Applies To | Files with kind: Application and apiVersion: kots.io/v1beta1 |
| 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 hostPathset 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: |