kapicorp/kapitan

Kapitan fails to render Jinja template with `input_params`

ademariag opened this issue · 0 comments

Describe the bug/feature
Kapitan fails to render Jinja with input_params

while defining a simple input_params for ajinja template I realised that it was not working

Will add more soon
To Reproduce
Steps to reproduce the behavior:

gcloud --project {{input_params.gcp_project_id}}
parameters:
  scripts:
  - templates/scripts/gcloud
  scripts_params:
    gcp_project_id: ${gcp_project_id}
  kapitan:
    compile:
    ...
      - output_path: scripts
        input_type: jinja2
        input_paths: ${scripts}
        input_params: ${scripts_params}
Jinja2 error: failed to render /src/templates/scripts/gcloud: Jinja2 TemplateError: 'dict object' has no attribute 'gcp_project_id', at /src/templates/scripts/gcloud:5
Compile error: failed to compile target: dev

Expected behavior

gcloud --project isolabs-platform

This is possibly caused by this loop which would allow for input_params to only work for the first file being compiled

https://github.com/kapicorp/kapitan/blob/master/kapitan/inputs/base.py#L55