So, if I'm correct it's actually Go's dependency logic that fails here. It's just that Dagger doesn't support all the auth patterns that Go relies on, leading to a surprising behavior when trying to download a private Go dependency without the auth, on GitLab (and only gitlab):
GitLab, when trying to resolve a private repository, does not hint the correct root of repo when failing, it fallbacks to a generic gitlab.com/org/repo (security by design / obfuscation)
You can test that by removing all your auth locally and trying, you should have the exact same error
So, it's very likely that it's currently failing because your local auth setup is still not supported inside Dagger's codegen runtime: we currently only support ssh auth for private Go dependencies on the Go SDK
So, 2 things to do to unlock yourself:
- making sure that the ssh-agent is present and accessible [env var
SSH_AUTH_SOCK is set]
- update your
.gitconfig with some insteadOf to transform those private go refs into an ssh format
During that codegen phase, Dagger will load the socket and the .gitconfig