Red Hat Bugzilla – Bug 984608
Unable to launch Jenkins slave if cloud domain contains a dash
Last modified: 2017-03-08 12:35 EST
If you have an OpenShift cloud domain such as my-openshift.com, Jenkins will be unable to launch builder slave gears because of an expectation that the only dash in the fqdn is the dash between the app name and the namespace.
The problem is that when Jenkins goes to launch the slave and download slave.jar, the URL gets messed up (see https://github.com/openshift/jenkins-cloud-plugin/blob/master/src/main/java/hudson/plugins/openshift/OpenShiftComputerLauncher.java#L70). It looks like if you pass something like mybldr-myns.my-openshift.com to getGearDNS, you get back jenkins-myns.my, instead of jenkins-myns.my-openshift.com.
Looking at the implementation for getGearDNS, it looks like it's trying to take the domain from the bldr gear and combine it with the app name of the jenkins gear. But because of the unexpected "-" in the cloud domain, the algorithm using the tokenizer fails.
Would it be possible to simplify this method to just return the value of OPENSHIFT_GEAR_DNS, which (I think) will just be the fqdn of the Jenkins app?
*** Bug 987146 has been marked as a duplicate of this bug. ***
FYI, to test this you simply need to create an OSE environment using openshift.sh and export CONF_DOMAIN="exa-mple.com".
Verify this bug on puddle: 1.2/2013-08-12.3
Set up an OSE env with domain "ose-test.com", create an app and launch jenkins build.
[root@dhcp-8-133 app1]# git push
[master e347933] update
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 aaa
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 254 bytes, done.
Total 2 (delta 1), reused 0 (delta 0)
remote: Executing Jenkins build.
remote: You can track your build at https://jj-11.ose-test.com/job/app1-build
remote: Waiting for build to schedule.....................................Done
remote: Waiting for job to complete.................................................................Done
remote: New build has been deployed.
4ade083..e347933 master -> master
And no errors found in jenkins server log.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.