Pipeline: git basic authentication fail

Created on 16 Apr 2020  路  3Comments  路  Source: tektoncd/pipeline

Expected Behavior

Tekton generates valid /tekton/home/.git-credentials file and git basic authentication works.

Actual Behavior

Tekton generates invalid /tekton/home/.git-credentials file and git basic authentication fails.

Steps to Reproduce the Problem

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]

Additional Info

  • 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"}
  • Tekton Pipeline version:
Client version: 0.8.0
Pipeline version: v0.11.1
kinbug

All 3 comments

@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.

Was this page helpful?
0 / 5 - 0 ratings