Skip to content

Support SSH protocol for GIT actions #254

Open
@yogeek

Description

@yogeek

Issue description

I configured the resources as indicated in the "getting started" guide for this to work with a private self-hosted gitlab instance.
The instructions mention a gitlab token that is used to both clone repositories with HTTP and call gitlab APIs
However, as my gitlab enables only SSH as the git protocol, it cannot work and fails with the following error:

remote: Git access over HTTP is not allowed

cf. https://cloud-native.slack.com/archives/C06NXPYQ06B/p1744302627392379

So today it is only possible to use HTTP protocol for git related actions.

Proposal

It would be useful to support the use of SSH protocol in addition to the HTTP one for all git actions (like cloning the repository, but maybe also other actions...?).

Implementation idea

A solution could be to add a new "protocol" choice to the user like it is already done in argocd applicationset code : https://github.com/argoproj/argo-cd/blob/master/pkg/apis/application/v1alpha1/applicationset_types.go#L440

In the case of SSH, the idea would be to leave to the user the creation of the SSH key and to handle two credentials, as it is already done in ArgoCD where the admin has to provide :

  • 1 secret with a SSH key for ArgoCD to clone the repositories
  • 1 secret with a token for ArgoCD ApplicationSet to discover SCM repositories and generate ArgoCD apps

Instead of rewriting all this stuff, do you think this logic can be retrieved from the argocd repository that is already dealing with all the different use cases related to git actions and scmproviders ? (cf. https://github.com/argoproj/argo-cd/tree/master/util/git)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions