Closed dataviruset closed 2 months ago
CT_CONFIG_DIR
just specifies where to look for ct.yaml
configuration file.
If you want to add additional repository, which is the reason for your error:
Error: no repository definition for https://charts.bitnami.com/bitnami.
you can use
$ ct lint --help
...
--chart-repos strings Additional chart repositories for dependency resolutions.
Repositories should be formatted as 'name=url' (ex: local=http://127.0.0.1:8879/charts).
May be specified multiple times or separate values with commas
In your case use --chart-repos=bitnami=https://charts.bitnami.com/bitnami
right after --target-branch main
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
CT_CONFIG_DIR
just specifies where to look forct.yaml
configuration file.If you want to add additional repository, which is the reason for your error:
Error: no repository definition for https://charts.bitnami.com/bitnami.
you can use
$ ct lint --help ... --chart-repos strings Additional chart repositories for dependency resolutions. Repositories should be formatted as 'name=url' (ex: local=http://127.0.0.1:8879/charts). May be specified multiple times or separate values with commas
In your case use
--chart-repos=bitnami=https://charts.bitnami.com/bitnami
right after--target-branch main
I think it's bad that ct or helm can't find the dependencies by itself even though they are defined with URLs in Chart.yaml
but I guess that's a separate issue. I worked around it like this:
repos="$(yq '.dependencies[] | select(.repository != null) | "\(.name)=\(.repository)"' charts/*/Chart.yaml)"
repo_args="$(echo "$repos" | sed '/^=$/d' | sort -u | awk '{printf "%s,", $0}' | sed 's/,$//')"
test -n "$repo_args" && chart_repos="--chart-repos $repo_args" || chart_repos=""
ct install --target-branch main $chart_repos
And now it seems to work for me.
But in some cases people might prefer to use a ct.yaml
file as it could be cleaner if they have multiple dependencies, as compared to adding a lot of --chart-repos
flags to the ct
command. But even though the dependencies added to the ct.yaml
file, the issue is still there. It seems the default CT_CONFIG_DIR
doesn't actually look in the same directory as the ct install
command is run in, because the dependency downloads don't work, as described in my issue.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
Is this a request for help?: Yes
Is this a BUG REPORT or FEATURE REQUEST? (choose one): Bug report
Version of Helm and Kubernetes:
What happened: With any value of
CT_CONFIG_DIR
, whenChart.lock
already exists, the followingct install
invocations fail because for some reasonct
refuses to download dependent charts:What you expected to happen:
ct install
to install the dependent chart and run normally as ifCT_CONFIG_DIR
wouldn't be set:How to reproduce it (as minimally and precisely as possible): See "What happened" above.
Anything else we need to know: I tried to understand how setting the environment variable could prevent the downloading of dependent charts (from the Bitnami repository in my case) but didn't understand how this code could affect it: https://github.com/helm/chart-testing/blob/65fa127f1d9c3972fc0bfbe41332b6c5d1d9665f/pkg/config/config.go#L209
When I used
ct
in GitHub Actions from chart-testing-action it seemsunset CT_CONFIG_DIR
wasn't enough but I also had to add act.yaml
file in the root of the repo containing this to make it working: