-
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
git auth with multiple keys for the same provider fail #2407
Comments
More thoughts about it, if it's not possible to create single |
Or maybe at least we can make the |
It is indeed one of the current limitiation of
The /kind feature |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/reopen |
@sbwsg: Reopened this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This remains an issue and we've had a user in slack recently query us about it. I think longer-term the Credentials UX improvements I'm trying to push in #2343 will allow users to handle this problem but I would like to keep it on the radar until optional workspaces or an equivalent feature are well-supported. |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
/remove-lifecycle stale |
Is my understanding correct that if we have 2 repos, defined via PipelineResources as: apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
name: backend-repo
spec:
type: git
params:
- name: url
value: [email protected]/team/pga-backend.git
- name: revision
value: main
---
apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
name: frontend-repo
spec:
type: git
params:
- name: url
value: [email protected]:team/pga-frontend.git
- name: revision
value: main then both of these should have just a single and same github deployment key for both repos in github repo settings? |
Are you using these If you use them as part of separate Tasks of a Pipeline you can assign each Task its own ServiceAccount + Secret. So the deploy keys can be different. The more robust approach is to build a Pipeline that uses |
thank you Scott! Makes total sense! |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Expected Behavior
Multiple ssh keys to the same host/provider (eg. github) are working.
Actual Behavior
Only first ssh key for github is working, rest is failing.
Steps to Reproduce the Problem
Two different secrets with two different ssh keys for two different github repos:
ServiceAccount:
It produces
.ssh/config
like this:For ssh this config is fine but git for some reason respect only first
IdentityFile
clause and ignores rest. So in this case you can only authenticate torepo1
. Authentication torepo2
will fail - github will complain that the repository doesn't match.So in order to authenticate properly with git and multiple ssh keys,
.ssh/config
file should look similar to this:Unfortunately git client then should also use those fake hosts:
and
For this reason, above workaround seems not quite reasonable since you can have git repo url dynamically fetched from git push webhook and then it would be in a form:
[email protected]:example/repo1.git
or[email protected]:example/repo2.git
Additional Info
This is particularly painful with github because it doesn't allow to use the same deploy key for different repos so you need to use different keys. And this it how you hit this issue.
Kubernetes version:
Output of
kubectl version
:The text was updated successfully, but these errors were encountered: