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/01 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/01 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/controller/webhook_request_checker.go
Lines 22 to 26 in 7f756db
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/controller/webhook_request_checker.go
Lines 258 to 266 in 7f756db
3. Add the ssh private key to the existing
gitUser
syngit/internal/controller/webhook_request_checker.go
Lines 268 to 272 in 7f756db
4. Add a
sshPrivateKey
field in theGitPusher
structsyngit/internal/controller/git_pusher.go
Lines 25 to 37 in 7f756db
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/controller/git_pusher.go
Lines 52 to 55 in 7f756db
syngit/internal/controller/git_pusher.go
Lines 258 to 261 in 7f756db
Remove the
Name
field from the commit signature (because it can not to exist if the type is ssh).syngit/internal/controller/git_pusher.go
Lines 235 to 239 in 7f756db
Additional context
If you have any questions, please tag @damsien.
The text was updated successfully, but these errors were encountered: