You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Roadmap 2025/07 Ability to choose the git push error default behavior
As a the DevOps of my team, I want to be able to connect to my git platform using a private ssh key instead of a token.
What to do
1. Add a sshPrivateKey field in the gitUser struct
When getting the user's secret, check for the Secret type (secret.Type). If it is kubernetes.io/basic-auth, then keep the existing lines (get username & password). If it is kubernetes.io/ssh-auth, then get the ssh-privatekey key from the Secret like describe in the Kubernetes documentation.
Create a http.BasicAuth object that will be used to clone & push. Create a function that build the BasicAuth depending on the the type (basic auth or ssh). Replace the existing ones with the global one.
Roadmap 2025/07 Ability to choose the git push error default behavior
As a the DevOps of my team, I want to be able to connect to my git platform using a private ssh key instead of a token.
What to do
1. Add a
sshPrivateKey
field in thegitUser
structsyngit/internal/interceptor/webhook_request_checker.go
Lines 26 to 30 in 4b54d53
2. Allow
kubernetes.io/ssh-auth
secret typeWhen getting the user's secret, check for the
Secret
type (secret.Type
). If it iskubernetes.io/basic-auth
, then keep the existing lines (getusername
&password
). If it iskubernetes.io/ssh-auth
, then get thessh-privatekey
key from theSecret
like describe in the Kubernetes documentation.syngit/internal/interceptor/webhook_request_checker.go
Lines 414 to 422 in 4b54d53
3. Add the ssh private key to the existing
gitUser
syngit/internal/interceptor/webhook_request_checker.go
Lines 424 to 428 in 4b54d53
4. Add a
sshPrivateKey
field in theGitPusher
structsyngit/internal/interceptor/git_pusher.go
Lines 24 to 35 in 4b54d53
5. Global
BasicAuth
Create a
http.BasicAuth
object that will be used to clone & push. Create a function that build theBasicAuth
depending on the the type (basic auth or ssh). Replace the existing ones with the global one.syngit/internal/interceptor/git_pusher.go
Lines 269 to 272 in 4b54d53
Each
http.BasicAuth
object must also be changed in the repo retriever file.Remove the
Name
field from the commit signature (because it can not to exist if the type is ssh).syngit/internal/interceptor/git_pusher.go
Lines 241 to 245 in 4b54d53
Additional context
If you have any questions, please tag @damsien.
The text was updated successfully, but these errors were encountered: