-
-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
atmos vendor pull
behaves differently than terraform init
for subdirectory based modules
#617
Comments
@mss thanks for testing it. Atmos uses the Can you please test the URL instead of Another problem could be that it uses both Can you please test a few things:
and let us know the results. Thank you |
Sorry, I see you point to this now in your "Context" section. This relates to:
There is a notable exception when it comes to SSH settings in |
@aknysh sounds like the fix is pointed to here:
We should be able to implement the same fix in atmos. |
@mss I see your latest opened issue here hashicorp/go-getter#493 If you have tested what I asked above ("Any other ssh URL that does not use //modules"), does it means that Thanks again for all the testing. Your help is appreciated, it will allow us to understand the root of the problem and fix it in Atmos |
Wow, that's some quick responses :-) Ok, maybe some additional info: We did not check if URLs without I now tried to use an URL without the double-slash and that does not work at all, even without the magic in Here is my use case: The first component is vendored properly but the second isn't (I put both into a single vendor file; the behaviour is the same when I use two files)
The weird thing is that if I strace the process then no Here is the `strace` output
One thing I also noticed in the strace output: Something first creates a |
@mss thanks. The second issue is different from the first one :) Anyway, I see both issue now. The second one is b/c of a combination of how The fixes will be in a new Atmos release. Thanks again for all the testing |
@mss please try this latest release https://github.com/cloudposse/atmos/releases/tag/v1.78.0 It fixes the second issue you raised ("I now tried to use an URL without the double-slash"). Regarding the first issue ( Thanks again |
Hey there. I have these exact issues. For the second issue (no I still have the behaviour that I have to set TMPDIR ( |
thanks @verygitmuchhub We'll have to look if we can set |
Describe the Bug
I must admit that this is a slightly esoteric use case and thus maybe some documentation at https://atmos.tools/cli/commands/vendor/pull#description would be sufficient.
Let's assume that we have some module source with the URL
git::ssh://[email protected]/tf/tf-modules.git//modules/account-vpc?ref=v0.1.0
(note the double-slash syntax to use the given subdirectory).For some reason are certain users or processes not able to access the repository via SSH but need to use HTTPS instead. Since it only affects this one server they add some config to
~/.gitconfig
like this:And that
work.config
file contains something like this:This configuration works and the modules are pulled via HTTPS instead of SSH if one creates a plain old Terraform root module and one calls
terraform init
.Now we want to use Atmos vendoring and add
vendor.yaml
:This won't use the given mirror but will (try to) use the original URL which may fail due to whatever networking issues are the reason the config was added in the first place.
Expected Behavior
I should not have to strace the atmos command to find out why my Git config which worked with Terraform does not work anymore with Atmos vendoring :-) It would be nice if it just worked as expected (like for Terraform) or the behaviour (ie. that a subdirectory-based module will be cloned to a subdirectory below
$TMPDIR
) was documented.Steps to Reproduce
See above (there is probably a more minimalistic reproducer possible). Some other Git features (badly written hooks?) than the one described might be affected, too.
Screenshots
No response
Environment
Additional Context
This is caused by an undocumented behaviour of go-getter (cf. hashicorp/go-getter#493) to pull an URL which refers to a subdirectory to
$TMPDIR
first and then copy over the wanted contents. So the$GIT_DIR
does not match the directory from theincludeIf
because the code is actually checked out to a temporary location like/tmp/getter12345/temp
.It does work in Terraform because they resolve the double-slash syntax themselves as pointed out in this comment (I linked to the OpenTofu source due to the current Terraform license but the code is the same).
The text was updated successfully, but these errors were encountered: