Porter Lint Messages
- exec-100
- porter-100
- porter-101
- porter-102
- porter-103
- porter-104
- porter-105
- porter-106
- porter-107
- porter-108
- porter-109
- porter-110
- porter-111
- porter-112
exec-100
The exec-100 warning is a message generated by the porter lint command when it detects a potential problem with the use of an embedded Bash script in the exec mixin of a Porter bundle. The exec mixin is a feature of Porter that allows you to run commands on a computer from a porter.yaml manifest file.
The exec-100 warning suggests that it is a best practice to avoid using embedded Bash scripts in exec mixins, and to use scripts instead.
Using embedded Bash scripts can be problematic because they can be difficult to read and understand, and they can also be insecure if they are not written correctly. It’s generally a good idea to avoid using embedded Bash scripts if possible, and to use scripts instead.
To fix the problem indicated by the exec-100 warning, you can try replacing any embedded Bash scripts in your exec mixins with scripts.
You can find more information about best practices for using the exec mixin on the Porter website at the following URL: https://porter.sh(/docs/best-practices/exec-mixin/)#use-scripts.
porter-100
The porter-100 error is a message generated by the porter lint command when it detects when a parameter name has one of the reserved prefixes porter- and porter_.
The porter-100 error suggests that a parameter has been created which uses one of the reserved prefixes.
Using a reserved prefix can be problematic as it can overwrite a predefined parameter resulting in undeterministic behaviour.
To fix the problem indicated by the porter-100 error, you should replace the prefix of any newly defined parameters to not start with “porter”.
You can find more information about parameters in following URL: https://porter.sh/quickstart/parameters/.
porter-101
The porter-101 error suggests that an action uses a parameter that is not available to it.
This is an of a manifest triggering the error (shorten for brevity):
parameters:
- name: uninstallParam
type: string
applyTo:
- uninstall # Notice the parameter only applies to the uninstall action
install:
- exec:
description: "Install Hello World"
command: ./helpers.sh
arguments:
- install
- "${ bundle.parameters.uninstallParam }"To fix the problem indicated by the porter-101 error, you should ensure that all parameters used in the action applies to the actions where it is referenced.
You can find more information about applyTo in the following URL: https://porter.sh/docs/bundle/manifest/#parameter-types.
porter-102
The porter-102 error is a message generated by the porter lint command when it detects that multiple dependencies are defined with the same name.
Multiple dependencies with the same name results in undefined behaviour.
To fix the problem, you should name ensure all dependencies have different names.
You can find more information about dependencies in Dependencies.
porter-103
The porter-103 error is a message generated by the porter lint command when it detects that a dependency maps a parameter that is not defined on the dependency bundle.
dependencies:
requires:
- name: mysql
bundle:
reference: "getporter/mysql:v0.1.0"
parameters:
NOT_A_REAL_PARAM: "some value" # This parameter isn't defined on the mysql bundleMapping a value to a parameter that doesn’t exist on the dependency bundle results in a failure when the dependency is installed.
To fix the problem, check the dependency bundle for the parameters it actually defines, and correct the name in your parameters mapping.
You can find more information about dependencies in Dependencies.
porter-104
The porter-104 error is the same check as porter-103, but for the credentials mapping of a dependency: it is generated when a dependency maps a credential that is not defined on the dependency bundle.
dependencies:
requires:
- name: mysql
bundle:
reference: "getporter/mysql:v0.1.0"
credentials:
NOT_A_REAL_CRED: "some value" # This credential isn't defined on the mysql bundleTo fix the problem, check the dependency bundle for the credentials it actually defines, and correct the name in your credentials mapping.
You can find more information about dependencies in Dependencies.
porter-105
The porter-105 warning is generated by the porter lint command when it cannot resolve a dependency’s bundle reference, either because the reference is invalid or because it could not be pulled from its cache or registry.
Because the bundle could not be resolved, porter cannot check that its parameters and credentials mappings (porter-103, porter-104) are valid, so that check is skipped for this dependency.
To fix the problem, check that the dependency’s bundle.reference is correct and reachable, for example by running porter pull <reference>.
porter-106
The porter-106 error is generated by the porter lint command when a template variable used in a dependency’s parameters, credentials, or outputs mapping isn’t one of the variables supported in the dependencies section: bundle.*, installation.*, and (only within a dependency’s own outputs mapping) the outputs.NAME shorthand.
porter-106, porter-107, porter-108, and porter-109 only run when the dependencies-v2 experimental flag is enabled.
dependencies:
requires:
- name: mysql
bundle:
reference: "getporter/mysql:v0.1.0"
parameters:
dbstuff: "${env.SOME_VAR}" # env.* isn't a supported variable here
outputs:
connstr: "${outputs.port}" # outputs.* is only valid inside a dependency's own outputs mappingTo fix the problem, use bundle.parameters.NAME, bundle.credentials.NAME, bundle.outputs.NAME, bundle.dependencies.DEP.outputs.NAME, installation.name, installation.namespace, installation.id, or, only within a dependency’s own outputs mapping, the outputs.NAME shorthand for that dependency’s own outputs.
You can find more information about dependencies in Dependencies.
porter-107
The porter-107 error is generated by the porter lint command when a bundle.parameters.NAME template variable used in a dependency’s mapping references a parameter that isn’t defined on the parent bundle.
parameters:
- name: stuff
dependencies:
requires:
- name: mysql
bundle:
reference: "getporter/mysql:v0.1.0"
parameters:
dbstuff: "${bundle.parameters.wrongName}" # not defined aboveTo fix the problem, check the parent bundle’s parameters section for the parameter it actually defines, and correct the name.
You can find more information about dependencies in Dependencies.
porter-108
The porter-108 error is the same check as porter-107, but for the bundle.credentials.NAME template variable: it is generated when a dependency’s mapping references a credential that isn’t defined on the parent bundle.
credentials:
- name: token
dependencies:
requires:
- name: mysql
bundle:
reference: "getporter/mysql:v0.1.0"
credentials:
token: "${bundle.credentials.wrongName}" # not defined aboveTo fix the problem, check the parent bundle’s credentials section for the credential it actually defines, and correct the name.
You can find more information about dependencies in Dependencies.
porter-109
The porter-109 error is generated by the porter lint command when an outputs.NAME (or long-form bundle.dependencies.DEP.outputs.NAME) template variable references an output that isn’t defined for that dependency, or references a dependency name that isn’t declared under dependencies.requires at all.
An output is considered defined for a dependency if it’s declared directly as a key in that dependency’s own outputs mapping in porter.yaml, or if it’s declared on the dependency’s resolved bundle.
dependencies:
requires:
- name: mysql
bundle:
reference: "getporter/mysql:v0.1.0"
outputs:
connstr: "https://${outputs.user}:${outputs.password}@${bundle.parameters.host}:${outputs.wrongName}"To fix the problem, check the dependency bundle (or its own outputs mapping) for the output it actually defines, and correct the name, or correct the dependency name if it was misspelled.
You can find more information about dependencies in Dependencies.
porter-110
The porter-110 warning is generated by the porter lint command when a dependency’s bundle defines a required parameter that isn’t mapped in the dependency’s parameters section.
porter-110 and porter-111 only run when the dependencies-v2 experimental flag is enabled.
dependencies:
requires:
- name: mysql
bundle:
reference: "getporter/mysql:v0.1.0"
# mysql requires a "database" parameter, but it isn't mapped hereHaving an unmapped required parameter doesn’t cause the dependency to fail on its own, but the dependency’s install will fail unless a value is supplied some other way (or the dependency provides its own default). This is common when a dependency is declared against a bundle interface, since the concrete bundle satisfying the interface isn’t known until install time and may require different parameters than the one pinned as the default bundle.reference here.
To fix the problem, add a mapping in parameters for the required parameter, using a value from the parent bundle or a hard-coded value.
You can find more information about dependencies in Dependencies.
porter-111
The porter-111 warning is the same check as porter-110, but for the credentials mapping of a dependency: it is generated when a dependency’s bundle defines a required credential that isn’t mapped in the dependency’s credentials section.
dependencies:
requires:
- name: mysql
bundle:
reference: "getporter/mysql:v0.1.0"
# mysql requires a "token" credential, but it isn't mapped hereTo fix the problem, add a mapping in credentials for the required credential, using a value from the parent bundle.
You can find more information about dependencies in Dependencies.
porter-112
The porter-112 error is generated by the porter lint command when an action step (install, upgrade, uninstall, or a custom action) references a bundle.dependencies.DEP.outputs.NAME template variable directly.
porter-112 only runs when the dependencies-v2 experimental flag is enabled.
dependencies:
requires:
- name: mysql
bundle:
reference: "getporter/mysql:v0.1.0"
install:
- exec:
description: "Install Hello World"
command: ./helpers.sh
arguments:
- install
- "${ bundle.dependencies.mysql.outputs.dbCon }" # not allowed directly in an action stepA dependency’s output is only wired up inside dependencies.requires[], either into another dependency’s parameters/credentials mapping, or promoted to a bundle output via that dependency’s own outputs mapping. Action steps can’t reference it directly; the value has to be promoted first.
To fix the problem, promote the dependency’s output to a bundle output by adding it to the dependency’s outputs mapping and declaring it under the bundle’s top-level outputs, then reference it in the action step as bundle.outputs.NAME instead.
You can find more information about dependencies in Dependencies.