tazjin/kontemplate

insertFile function path

Closed this issue · 3 comments

I'm trying to use insertFile function and when run "template" command the path of the included file put a "../" on top of the path and the error i get is "file not found".

I can change the base path where i run the command of course, but is there another way to do this? Like an absolute path or removing the "../".

Hope I explained myself.

Any suggestion?

Hey, I see you closed this again - did you figure out a solution?

Yes, the "problem" was in my environment file, in the path variable i have something like this :

include 
     - name: something 
     path: ../something/path

and my folders structure is like:

.
├── components
|   ├── component1
|   └── component2
|      ├── config.yaml
|      └── deployment.yaml
├── environments
|   ├── environment.yaml
|   └── environment1.yaml

I guess the path include worked well for the components but not for the insertFile.
Now i run the kontemplate apply from the environment folder directly and not from the base folder.

Aha, yes, file paths are relative to the context file. Hmm, I remember someone else getting confused about this before - maybe it should be made more obvious somewhere.