cnoe-io / idpbuilder

Spin up a complete internal developer platform with only Docker required as a dependency.
https://cloud-native.slack.com/archives/C05TN9WFN5S
Apache License 2.0
160 stars 49 forks source link

[Bug]: Cannot git clone a gitea repository using ssh #227

Open cmoulliard opened 4 months ago

cmoulliard commented 4 months ago

What is your environment, configuration, and command?

We cannot git clone an internal gitea repository using ssh

git clone git@gitea.cnoe.localtest.me:giteaAdmin/idpbuilder-localdev-my-app-manifests.git
Cloning into 'idpbuilder-localdev-my-app-manifests'...
ssh: connect to host gitea.cnoe.localtest.me port 22: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

What did you do and What did you see instead?

We should be able to ssh / git clone a gitea repository as reported here "HowTo" https://github.com/cnoe-io/idpbuilder/issues/32 if we bind the ssh port of gitea with the nodePort and that we expose too this port on the kind cluster

Until now, gitea is configured with port 22/2222

Screenshot 2024-04-26 at 17 29 19

Additional Information. Logs.

No response

nabuskey commented 4 months ago

Good catch. I haven't really needed to clone from gitea to local so did not test this.

cmoulliard commented 3 months ago

We should perhaps pause the inclusion of new features till we have enough "testing coverage" about the platform using Github workflows

nimakaviani commented 3 months ago

whats the use case for which you need to clone the gitea repository? is it for core packages or custom packages?

cmoulliard commented 3 months ago

whats the use case for which you need to clone the gitea repository? For every project added post creation where users would like to use argocd + gitea or even backstage + gitea etc

Bnjoroge1 commented 3 weeks ago

Faced this issue as well. I fixed it by just port-forwarding from the NodePort to 22, and works fine locally. Is there a better approach to fix this in idpbuilder? Happy to look into it with some pointers!

nabuskey commented 3 weeks ago

I think you need to update the extraPortMappings field in kind config. We probably cannot use the default port 22 though. It needs elevated permissions and may collide with ssh service already running on the host.

cmoulliard commented 2 weeks ago

We can, for sure, use a different port but then it will be needed to change the URL of the repo to git clone - https://stackoverflow.com/questions/5767850/git-on-custom-ssh-port. This is not really user friendly ...