-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Enterprise Git clone fails in tekton taskrun #2703
Comments
Could you post a sanitized copy of the Pod YAML that ran for this TaskRun? You can get the Pod's name by checking the kubectl get -o yaml pod <name of pod> I'm interested to take a look at the args that were passed to the creds-init initContainer and the volumes that were provided to it. Also, just to confirm: your |
@sbwsg : I have generated a base64 encoded output of the ssh-privatekey and known_hosts, have aligned them in a single line but that also failed with similar error as mentioned in my original post. Then I tried to put them in separate line for UI convenience as the string is too long. The sanitized copy of pod yaml is attached. |
Ah, it looks like maybe you're passing an |
@sbwsg : The following example says to use the URL - https://github.com/tektoncd/pipeline/blob/master/docs/tutorial.md#specifying-task-inputs-and-outputs However let me try with the one you suggesting and let you know |
@sbwsg : I replaced the URL to git@ ssh-style URL and it worked like a charm. Thanks a ton! (I had spent almost 2 days in this issue and finally now fixed) Note: I have a separate issue now with image push to OCP registry, do I open a separate issue or continue in this issue thread? |
Sure, a new issue would be great, thanks! |
Issue: The enterprise git (github.xxx.com) clone step fails when running the taskrun in tekton.
Platform: OpenShift: 3.11
Tekton Pipeline version: v0.12.1
Step name: step-git-source-clone
Error log:
{"level":"error","ts":1590679054.7200413,"caller":"git/git.go:41","msg":"Error running git [fetch --recurse-submodules=yes --depth=1 origin --update-head-ok --force master]: exit status 128\nfatal: could not read Username for 'https://github.xxx.com': No such device or address\n","stacktrace":"github.com/tektoncd/pipeline/pkg/git.run\n\tgithub.com/tektoncd/pipeline/pkg/git/git.go:41\ngithub.com/tektoncd/pipeline/pkg/git.Fetch\n\tgithub.com/tektoncd/pipeline/pkg/git/git.go:116\nmain.main\n\tgithub.com/tektoncd/pipeline/cmd/git-init/main.go:53\nruntime.main\n\truntime/proc.go:203"}
I'm not sure why this step is trying to look for a username when the enterprise git authentication should happen via ssh. Please find the config of the secrets and serviceaccount. Note that the ssh keys are in base64 encoded format.
Note - The secret is added to service account for taskrun. Reference link for configuring ssh git: https://github.com/tektoncd/pipeline/blob/master/docs/auth.md#ssh-authentication-git
Any help to fix this issue?
--
(edited by sbwsg to restore the indentation to the YAML snippets)
The text was updated successfully, but these errors were encountered: