jenkinsci / hetzner-cloud-plugin

Hetzner cloud integration for Jenkins
https://plugins.jenkins.io/hetzner-cloud/
Apache License 2.0
24 stars 8 forks source link

Support of private+public ip's #44

Closed eugen-korentsov closed 2 years ago

eugen-korentsov commented 2 years ago

What feature do you want to see added?

Hi, I want to use jenkins-slaves with an internal network ( because I have caching docker registry proxy, in the same network in Hetzner), but Jenkins master is outside of Hetzner datacenter, so is it possible to connect to public IP, but still attach the newly created server to the internal network?

Upstream changes

No response

rkosegi commented 2 years ago

Hi, current logic does not allow this kind of topology:

            if (serverDetail.getPrivateNet() != null && !serverDetail.getPrivateNet().isEmpty()) {
                ipv4 = serverDetail.getPrivateNet().get(0).getIp();
            } else {
                ipv4 = serverDetail.getPublicNet().getIpv4().getIp();
            }

which means that if you are attached to private network, there is no way to connect to agents via public IP.

This shouldn't be too difficult to implement ;)

eugen-korentsov commented 2 years ago

I will be very grateful if you implement it, thanks.