Tekton generates valid /tekton/home/.git-credentials file and git basic authentication works.
Tekton generates invalid /tekton/home/.git-credentials file and git basic authentication fails.
taskrun.yaml:
apiVersion: v1
kind: Secret
metadata:
name: basic-auth-test
annotations:
tekton.dev/git-0: github.com
type: kubernetes.io/basic-auth
stringData:
username: user
password: seecretpass
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: build-image-test
secrets:
- name: basic-auth-test
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: test
spec:
serviceAccountName: build-image-test
taskSpec:
steps:
- name: test
image: alpine
script: |
cat /tekton/home/.git-credentials
output:
+ cat /tekton/home/.git-credentials
//user:[email protected]
Note: instead of proper line:
https//user:[email protected]
there is:
//user:[email protected]
Kubernetes version:
Output of kubectl version:
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.4", GitCommit:"8d8aa39598534325ad77120c120a22b3a990b5ea", GitTreeState:"clean", BuildDate:"2020-03-12T23:41:24Z", GoVersion:"go1.14", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.4", GitCommit:"8d8aa39598534325ad77120c120a22b3a990b5ea", GitTreeState:"clean", BuildDate:"2020-03-12T20:55:23Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}
Client version: 0.8.0
Pipeline version: v0.11.1
@r0bj Thanks for the issue. According to the documentation auth.md, for git basic-auth, https://github.com seems to be required.
That said, I feel we may be able to infer https in the case it is not specificed.
/kind bug
@vdemeester indeed, protocol (https) should be specified in annotation, thanks for pointing that out. I was working with git ssh before and there is no protocol specified in annotation so that's why I missed it.
Sounds like you've been able to make it work @r0bj ? I'm going to close this but plz re-open if I'm wrong.