Skip to content
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

Git Artifact does not support relative submodules (fixed in go-git v5.3.0) #7141

Closed
valorl opened this issue Nov 3, 2021 · 4 comments · Fixed by #7162
Closed

Git Artifact does not support relative submodules (fixed in go-git v5.3.0) #7141

valorl opened this issue Nov 3, 2021 · 4 comments · Fixed by #7162
Labels

Comments

@valorl
Copy link
Contributor

valorl commented Nov 3, 2021

Summary

Using GitArtifact to clone a Git repository with a submodule specified as a relative path, argoexec init fails with executor error: repository not found.

The error comes from go-git (my guess would be during the initial clone). See

As mentioned there, it has been fixed in v5.3.0.

Diagnostics

You can use the following workflow to reproduce. It tries to clone this example repo to which I added a submodule with a relative path (../argo-workflows).

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  name: clone-relative-submodule
spec:
  entrypoint: clone
  templates:
  - name: clone
    inputs:
      artifacts:
      - name: repo
        path: /repo
        git:
          repo: https://github.com/valorl/repository-with-relative-submodule.git
          revision: main
    script:
      image: alpine/git:latest
      command: [sh]
      workingDir: /repo
      source: |
        git status

For me on 3.0.7, this results in the following error in init log:

time="2021-11-03T13:40:45.372Z" level=info msg="Starting Workflow Executor" version="{v3.0.7 2021-05-25T19:03:05Z e79e7ccda747fa4487bf889142c744457c26e9f7 v3.0.7 clean go1.15.7 gc linux/amd64}"
time="2021-11-03T13:40:45.375Z" level=info msg="Creating a docker executor"
time="2021-11-03T13:40:45.375Z" level=info msg="Executor (version: v3.0.7, build_date: 2021-05-25T19:03:05Z) initialized (pod: ci-main/clone-relative-submodule) with template:\n{\"name\":\"clone\",\"inputs\":{\"artifacts\":[{\"name\":\"repo\",\"path\":\"/repo\",\"git\":{\"rep
o\":\"github.com/valorl/repository-with-relative-submodule\",\"revision\":\"main\"}}]},\"outputs\":{},\"metadata\":{},\"script\":{\"name\":\"\",\"image\":\"alpine/git:latest\",\"command\":[\"sh\"],\"workingDir\":\"/repo\",\"resources\":{},\"source\":\"git status\\n\"},\"archi
veLocation\":{\"archiveLogs\":true,\"s3\":{\"endpoint\":\"s3.amazonaws.com\",\"bucket\":\"*****\",\"region\":\"*****\",\"insecure\":false,\"useSDKCreds\":true,\"key\":\"*****\"}}}"
time="2021-11-03T13:40:45.375Z" level=info msg="Loading script source to /argo/staging/script"
time="2021-11-03T13:40:45.375Z" level=info msg="Start loading input artifacts..."
time="2021-11-03T13:40:45.375Z" level=info msg="Downloading artifact: repo"
time="2021-11-03T13:40:45.377Z" level=error msg="executor error: repository not found"
time="2021-11-03T13:40:45.377Z" level=info msg="Alloc=4721 TotalAlloc=8931 Sys=73297 NumGC=3 Goroutines=3"
time="2021-11-03T13:40:45.377Z" level=fatal msg="repository not found"

What Kubernetes provider are you using?
EKS

What executor are you running? Docker/K8SAPI/Kubelet/PNS/Emissary
Docker


Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.

@valorl valorl changed the title Git Artifact (go-git) does not support relative submodules (fixed in go-git v5.3.0) Git Artifact does not support relative submodules (fixed in go-git v5.3.0) Nov 3, 2021
@terrytangyuan
Copy link
Member

Would you like to upgrade it and then verify that fixes the issue?

@valorl
Copy link
Contributor Author

valorl commented Nov 3, 2021

@terrytangyuan I can give it a shot. Assuming I manage to get a successful build with that version of go-git, what's the best way to test that ? Is there maybe a way I can specify an alternative argoexec image for the init?

@terrytangyuan
Copy link
Member

You'll want to rebuild the images and then test locally: https://github.com/argoproj/argo-workflows/blob/master/docs/running-locally.md

You can specify a new argoexec image in your controller deployment.

@alexec alexec added good first issue Good for newcomers help wanted and removed triage labels Nov 3, 2021
valorl added a commit to valorl/argo-workflows that referenced this issue Nov 4, 2021
Upgrades src-d/go-git v4 to go-git/go-git v5.3.0.
See go-git/go-git#195.

Signed-off-by: valorl <11498571+valorl@users.noreply.github.com>
@valorl
Copy link
Contributor Author

valorl commented Nov 4, 2021

Thanks. I can confirm that upgrading go-git to v5.3.0 fixes this. See #7162, which is now ready for review.

@terrytangyuan terrytangyuan linked a pull request Nov 4, 2021 that will close this issue
1 task
terrytangyuan pushed a commit that referenced this issue Nov 4, 2021
Upgrades src-d/go-git v4 to go-git/go-git v5.3.0.
See go-git/go-git#195.

Signed-off-by: valorl <11498571+valorl@users.noreply.github.com>
@alexec alexec mentioned this issue Nov 5, 2021
25 tasks
@sarabala1979 sarabala1979 mentioned this issue Dec 15, 2021
73 tasks
sarabala1979 pushed a commit that referenced this issue Dec 15, 2021
Upgrades src-d/go-git v4 to go-git/go-git v5.3.0.
See go-git/go-git#195.

Signed-off-by: valorl <11498571+valorl@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants