'Can't access files ('.Files') using helm subchart

I have a sub-chart which is being used by many other Charts, the sub-chart has a Deployment file in it that is using access files. The deployment includes the following line {{- range $value := .Files.Lines "test.list" }} and test.list file is under the main chart.

MAIN CHART
├── Chart.yaml (with dependency for the sub-chart)
├── values.yaml
└── test.list

SUB CHART
├── Chart.yaml
├── templates
│   ├── deployment.yaml (including the {{- range $value := .Files.Lines "test.list" }}
└── values.yaml

Unfortunately, the test.list file is being ignored unless I am moving it inside the sub-chart. Is there anyway to solve this issue?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source