catalog: `git-clone` `0.7` --> `0.8` is not compatible with many linux installations
Expected Behavior
git-clone task succeeds
Actual Behavior
git-clone task fails
Steps to Reproduce the Problem
kubectl apply -f pipeline.yamlfrom the attached repro.zipkubectl create -f pipelinerun.yamlfrom repro.zip- With
git-cloneversion0.7it succeeds - With
git-cloneversion0.8it fails
Additional Info
The failure occurs after this log line:
[fetch-source : clone] + rm -rf /workspace/output//lost+found
which I assume is because https://github.com/tektoncd/catalog/pull/1034 has git-clone executing as a non-root user.
Here is the code being executed at that time.
I tried working around this issue by tweaking the params in my pipeline.yaml:
params:
- name: deleteExisting
value: "false"
But that just moves the error over to git-init:
[clone] + /ko-app/git-init '-url=https://github.com/bendory/mini-true.git' '-revision=' '-refspec=' '-path=/workspace/output/' '-sslVerify=true' '-submodules=true' '-depth=1' '-sparseCheckoutDirectories='
[clone] {"level":"error","ts":1660183685.4823325,"caller":"git/git.go:55","msg":"Error running git [init /workspace/output/]: exit status 1\n/workspace/output/.git: Permission denied\n","stacktrace":"github.com/tektoncd/pipeline/pkg/git.run\n\tgithub.com/tektoncd/pipeline/pkg/git/git.go:55\ngithub.com/tektoncd/pipeline/pkg/git.Fetch\n\tgithub.com/tektoncd/pipeline/pkg/git/git.go:84\nmain.main\n\tgithub.com/tektoncd/pipeline/cmd/git-init/main.go:53\nruntime.main\n\truntime/proc.go:225"}
[clone] {"level":"fatal","ts":1660183685.4831095,"caller":"git-init/main.go:54","msg":"Error fetching git repository: exit status 1","stacktrace":"main.main\n\tgithub.com/tektoncd/pipeline/cmd/git-init/main.go:54\nruntime.main\n\truntime/proc.go:225"}
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 16 (10 by maintainers)
Commits related to this issue
- Update `podTemplate.securityContext.fsGroup`. This enables us to use the latest `git-clone` task in hub. Context: https://github.com/tektoncd/catalog/issues/1044 — committed to bendory/tekton-on-gcp by bendory 2 years ago
- [git-clone] Update docs, etc for nonroot user This commit updates the docs, samples and tests required to run this task as a non-root user. Fix #1044 — committed to concaf/catalog by concaf 2 years ago
- [git-clone] Update docs, etc for nonroot user This commit updates the docs, samples and tests required to run this task as a non-root user. Fix #1044 — committed to tektoncd/catalog by concaf 2 years ago
New issue has been created. https://github.com/tektoncd/catalog/issues/1052
@tonyhsuclrous updated how-to guide here - https://github.com/tektoncd/website/pull/425