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 basic authentication fail #2409

Closed
r0bj opened this issue Apr 16, 2020 · 3 comments
Closed

git basic authentication fail #2409

r0bj opened this issue Apr 16, 2020 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@r0bj
Copy link

r0bj commented Apr 16, 2020

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:

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
@vdemeester
Copy link
Member

@r0bj Thanks for the issue. According to the documentation auth.md, for git basic-auth, https: seems to be required.

That said, I feel we may be able to infer https in the case it is not specificed.

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 16, 2020
@r0bj
Copy link
Author

r0bj commented Apr 16, 2020

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

@bobcatfish
Copy link
Collaborator

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.

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

No branches or pull requests

4 participants