atlantis: helm chart gitconfig option ignored
Running terraform with modules imported from private gitLab fails using the /etc/secret-gitconfig/gitconfig mounted helm gitconfig option. If I copy this file to /home/atlantis/.gitconfig then terraform succeeds. Atlantis appears to be ignoring the mounted /etc/secret-gitconfig/gitconfig file?
Error: Failed to download module
Could not download module "eks_ingress" (main.tf:109) source code from
"git::https://git.mycompany.com/high-five/tf-modules/eks-ingress.git?ref=v2.0.0":
error downloading
'https://git.mycompany.com/high-five/tf-modules/eks-ingress.git?ref=v2.0.0':
/usr/bin/git exited with 128: Cloning into '.terraform/modules/eks_ingress'...
remote: Not Found
fatal: repository 'https://github.com/high-five/tf-modules/eks-ingress.git/'
not found
File contents: /etc/secret-gitconfig/gitconfig
[url "https://username:password@git.mycompany.com/"]
insteadOf = https://git.mycompany.com/
Helm Chart:
gitconfig: |
[url "https://username:password@git.mycompany.com/""]
insteadOf = https://git.mycompany.com/
Atlantis version:
- name: atlantis
repository: https://runatlantis.github.io/helm-charts
version: "3.12.4"
image:
repository: runatlantis/atlantis
tag: v0.15.1
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 17 (7 by maintainers)
there’s a poststart hook in the statefulset that copies
/etc/secret-gitconfig/gitconfigto/home/atlantis/.gitconfig. this works fine, but atlantis overwrites/home/atlantis/.gitconfigwhen a user files a PR and runsatlantis planwith the following:i believe this is the logic that writes the git-related files
Setting
ATLANTIS_WRITE_GIT_CREDS=falseresults in a crashLoop because I am using a github app.Mounting a custom
/home/atlantis/.gitconfigresults inupdating the PR clone ref per https://github.com/runatlantis/atlantis/issues/1696 would solve my issue
We solved this issue as described in https://github.com/runatlantis/helm-charts/issues/222:
So our setup basically looks like this:
Hey thanks for the fast answer! Yeah so actually just tried to fork your chart and try to set to volume to be writable, but it resulted in the same issue. I also tried the lifecycle hook and the extra volumes from your link, but i get now an error that the hook is not running successfully:
So I think the fix is currently not working anymore with this chart. Any other idea how to use github apps with the latest version of your chart?
Just used the latest version of the helm chart (v5.0.2) and I am still running into the same issue. Helm values file looks like:
Error:
@Jeinhaus for reference the PR is https://github.com/runatlantis/helm-charts/pull/223
@ggujabidze If I remember correctly, there was an open issue or pr that wanted to revert some of these changes. But I can’t find it at the moment. I think the revert conflicted with some other changes that happened in the meantime.