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-clone task cannot handle backslash in the username of a secret #3887

Closed
kulon opened this issue Apr 15, 2021 · 4 comments · Fixed by #4337
Closed

git-clone task cannot handle backslash in the username of a secret #3887

kulon opened this issue Apr 15, 2021 · 4 comments · Fixed by #4337
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@kulon
Copy link

kulon commented Apr 15, 2021

The git-clone task fails if the secret associated with the service account used to run the task contains a backslash "\" in the username. For example, if the username of the secret contains a value "domain\firstname.lastname", the git-clone task will throw the following error:

Error running git [init /workspace/output/]: exit status 128\nfatal: bad config line 4 in file /tekton/home/.gitconfig\n","stacktrace":"github.com/tektoncd/pipeline/pkg/git.run\n\t/opt/app-root/src/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:47\ngit.luolix.top/tektoncd/pipeline/pkg/git.Fetch\n\t/opt/app-root/src/go/src/github.com/tektoncd/pipeline/pkg/git/git.go:74\nmain.main\n\t/opt/app-root/src/go/src/github.com/tektoncd/pipeline/cmd/git-init/main.go:52\nruntime.main\n\t/usr/lib/golang/src/runtime/proc.go:203"}
{"level":"fatal","ts":1618348159.1216874,"caller":"git-init/main.go:53","msg":"Error fetching git repository: exit status 128","stacktrace":"main.main\n\t/opt/app-root/src/go/src/github.com/tektoncd/pipeline/cmd/git-init/main.go:53\nruntime.main\n\t/usr/lib/golang/src/runtime/proc.go:203"}

A workaround would be to use a different form of the username if applicable. For example, the following format would be handled successfully by the task: "firstname.lastname@mycompany.com".

The issue has occurred in the following environment:

OpenShift cluster - 4.6.17

Red Hat OpenShift Pipelines Operator - 1.2.3
Components:
Tekton Pipelines: v0.16.3
Tekton Triggers: v0.8.1
ClusterTasks based on Tekton Catalog 0.16

@kulon kulon added the kind/bug Categorizes issue or PR as related to a bug. label Apr 15, 2021
@tekton-robot
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 14, 2021
@tekton-robot
Copy link
Collaborator

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle rotten

Send feedback to tektoncd/plumbing.

@tekton-robot tekton-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 15, 2021
@pritidesai
Copy link
Member

@kulon are you still running into this issue? or have a workaround?

@abayer
Copy link
Contributor

abayer commented Oct 27, 2021

/assign @abayer
/remove-lifecycle rotten

@tekton-robot tekton-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Oct 27, 2021
abayer added a commit to abayer/tektoncd-pipeline that referenced this issue Oct 27, 2021
Fixes tektoncd#3887

The proper format for a username like `foo\bar` in `.gitconfig` is `username = foo\\bar` - i.e., the `\` needs to be escaped.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
abayer added a commit to abayer/tektoncd-pipeline that referenced this issue Oct 28, 2021
Fixes tektoncd#3887

The proper format for a username like `foo\bar` in `.gitconfig` is `username = foo\\bar` - i.e., the `\` needs to be escaped.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
tekton-robot pushed a commit that referenced this issue Oct 28, 2021
Fixes #3887

The proper format for a username like `foo\bar` in `.gitconfig` is `username = foo\\bar` - i.e., the `\` needs to be escaped.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants