Skip to content

Commit dc54b40

Browse files
authored
Merge pull request #1112 from jglick/setupHost
2 parents ccac154 + 4071d65 commit dc54b40

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/test/java/org/csanchez/jenkins/plugins/kubernetes/KubernetesTestUtil.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static KubernetesCloud setupCloud(Object test, TestName name) throws Kube
117117
return cloud;
118118
}
119119

120-
public static void setupHost() throws Exception {
120+
public static void setupHost(KubernetesCloud cloud) throws Exception {
121121
// Agents running in Kubernetes (minikube) need to connect to this server, so localhost does not work
122122
URL url = new URL(JenkinsLocationConfiguration.get().getUrl());
123123
String hostAddress = System.getProperty("jenkins.host.address");
@@ -127,8 +127,7 @@ public static void setupHost() throws Exception {
127127
System.err.println("Calling home to address: " + hostAddress);
128128
URL nonLocalhostUrl = new URL(url.getProtocol(), hostAddress, url.getPort(),
129129
url.getFile());
130-
// TODO better to set KUBERNETES_JENKINS_URL
131-
JenkinsLocationConfiguration.get().setUrl(nonLocalhostUrl.toString());
130+
cloud.setJenkinsUrl(nonLocalhostUrl.toString());
132131

133132
Integer slaveAgentPort = Integer.getInteger("slaveAgentPort");
134133
if (slaveAgentPort != null) {

src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/AbstractKubernetesPipelineTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void configureCloud() throws Exception {
148148
cloud.getTemplates().clear();
149149
cloud.addTemplate(buildBusyboxTemplate("busybox"));
150150

151-
setupHost();
151+
setupHost(cloud);
152152

153153
r.jenkins.clouds.add(cloud);
154154

src/test/java/org/csanchez/jenkins/plugins/kubernetes/pipeline/RestartPipelineTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public void configureCloud() throws Exception {
128128
cloud.getTemplates().clear();
129129
cloud.addTemplate(buildBusyboxTemplate("busybox"));
130130

131-
setupHost();
131+
setupHost(cloud);
132132

133133
story.j.jenkins.clouds.add(cloud);
134134
}

0 commit comments

Comments
 (0)