Skip to content

GIT CLONE of a repo with a submodule fails #164

@kmannislands

Description

@kmannislands

What went wrong?

using earthly's built-in GIT CLONE of a repository with a submodule reports an authentication failure.

This was a known issue of earthly:
earthly#2362
earthly#3002

What should have happened?

GIT CLONE should use the same auth credentials and known hosts for submodules as for the main repository (?)

In my case submodules are described with a relative path in the .gitmodule file like ../submodule so the above statement is certainly the case. However fully qualified repo paths should work as well

What earthly version?

All

Buildkit Logs

For code like

REPO_CHECKOUT:
    FUNCTION
    ARG --required REPO_NAME
    ARG --required REF

    GIT CLONE --branch $REF ssh://[email protected]/org/$REPO_NAME.git $REPO_NAME

where REPO_NAME is a repository let's say org/repo that uses a submodule in the same org let's say org/submodule

+target(s/o/repo.git) *failed* | HEAD is now at 656f4g
+target(s/o/repo.git) *failed* | Submodule 'x/x/x' (ssh:[email protected]/org/submodule.git) registered for path 'x/x/x'
+target(s/o/repo.git) *failed* | Cloning into '/tmp/earthly/buildkit/runc-overlayfs/snapshots/snapshots/23449/fs/x/x/x'...
+target(s/o/repo.git) *failed* | [email protected]: Permission denied (publickey).
+target(s/o/repo.git) *failed* | fatal: Could not read from remote repository.
+target(s/o/repo.git) *failed* | Please make sure you have the correct access rights
+target(s/o/repo.git) *failed* | and the repository exists.
+target(s/o/repo.git) *failed* | fatal: clone of 'ssh:[email protected]/org/submodule.git' into submodule path '/tmp/earthly/buildkit/runc-overlayfs/snapshots/snapshots/23449/fs/x/x/x' failed

Other Helpful Information

I believe this has to be solved in https://github.com/earthbuild/buildkit where GIT CLONE is truly implemented (git as a buildkit source)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions