Problem using secret backend in helm dependency source
Zeratyl06 opened this issue · comments
Describe the bug/feature
When I try to use the secret backend in the helm dependency source, I get an error when I compile.
To Reproduce
Steps to reproduce the behavior:
Configuration example
kapitan:
dependencies:
- type: helm
chart_name: metrics-backend
version: 0.1.3
source: 'https://gitlab+deploy-token-23:?{gpg:${project_name}/package_registries@b2b-frontend}@gitlab.com/api/v4/projects/21/packages/helm/stable'
output_path: components/${project_name}/charts/metrics-backend
Run command
pipenv run kapitan compile --fetch --reveal
See error
Invalid inventory structure
Error: 'https://gitlab+deploy-token-23:?{gpg:market-frontend/package_registries@b2b-frontend}@gitlab.com/api/v4/projects/21/packages/helm/stable' is not a 'uri'
On instance:
"https://gitlab+deploy-token-23:?{gpg:market-frontend/package_registries@b2b-frontend}@gitlab.com/api/v4/projects/21/packages/helm/stable"
If I use the cleartext password, the compilation succeeds.
Expected behavior
Add support for specifying a username and password when accessing private helm repositories or using a secret backend in helm dependencies of the source field.
If it's a bug (please complete the following information):
pipenv --version
pipenv, version 11.9.0
pipenv run python --version
Python 3.8.5
pipenv run kapitan --version
0.30.0
Hey @Zeratyl06 , this is because the dependencies get fetched before the actual compile / resolving-refs step, so its not a bug, but more like unsupported behavior. I don't think, that we are going to tackle this, because it would require an additional step, where references get resolved before the start of everything.
If you want to implement it, you could insert the step in the kapitan/targets.py
file before the dependencies get fetched.