Skip to content
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

Lint for parameters being used in actions to which they don't apply #1018

Closed
carolynvs opened this issue Apr 29, 2020 · 0 comments · Fixed by #3034
Closed

Lint for parameters being used in actions to which they don't apply #1018

carolynvs opened this issue Apr 29, 2020 · 0 comments · Fixed by #3034
Labels
1 - 🍫 Eat chocolate _after_ emergency donuts

Comments

@carolynvs
Copy link
Member

After #1017, it will be a hard runtime failure if your porter.yaml attempts to use {{bundle.paramters.PARAM}} when PARAM was defined to not apply to the action where that templated value is used.

We should lint for this and hard fail so that we can detect and correct this problem at build time.

Example:

parameters:
- name: connstr
   type: string
   applyTo:
    - install

uninstall:
  - exec:
      description: "Use a non-applicable parameter"
      command: ./helpers.sh
      arguments:
      - "{{ bundle.parameters.connstr }}"

This should be an porter level linter, not a mixin specific linter, which would be our first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - 🍫 Eat chocolate _after_ emergency donuts
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant