@@ -119,6 +119,49 @@ stringData:
119
119
# This is non-standard, but its use is encouraged to make this more secure.
120
120
# Omitting this results in the server's public key being blindly accepted.
121
121
` ` `
122
+ # # Known limitation with multiple Git SSH credentials
123
+
124
+ When annotating a `Secret` with multiple `tekton.dev/git-*` entries for different Git hosts, only the
125
+ first annotated Git credential may be used successfully.
126
+
127
+ For example :
128
+
129
+ ` ` ` yaml
130
+ apiVersion: v1
131
+ kind: Secret
132
+ metadata:
133
+ annotations:
134
+ tekton.dev/git-0: github.com
135
+ tekton.dev/git-1: gitlab.com
136
+ type: kubernetes.io/ssh-auth
137
+ stringData:
138
+ ssh-privatekey: <private-key>
139
+ ` ` `
140
+ In this case, the repository for tekton.dev/git-0 might clone correctly, while the repository for
141
+ tekton.dev/git-1 can fail with SSH authentication errors.
142
+
143
+ # # Workaround with multiple Git SSH credentials
144
+
145
+ As a workaround, you can configure multiple SSH keys for different repositories by mounting a workspace
146
+ that provides a custom SSH configuration file instead of relying solely on annotations.
147
+ If neither the annotation tekton.dev/git-* nor the Task param USER_HOME=/home/nonroot is set, and
148
+ you mount a workspace that contains a Secret with multiple SSH keys, git clone works as expected
149
+ by following the configuration in .ssh/config.
150
+
151
+ For example :
152
+
153
+ ` ` ` yaml
154
+ apiVersion: v1
155
+ kind: Secret
156
+ metadata:
157
+ name: git-credentials
158
+ namespace: test
159
+ type: Opaque
160
+ data:
161
+ config: <.ssh.config>
162
+ id_test: <private key for repo 1>
163
+ id_prod: <private key for repo 2>
164
+ ` ` `
122
165
123
166
# # Using `Secrets` as a non-root user
124
167
0 commit comments