Skip to content

Commit

Permalink
Merge pull request #1253 from Vlatombe/websocket-injection
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlatombe authored Oct 26, 2022
2 parents 8932362 + 80eaa79 commit 562bba6
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.csanchez.jenkins.plugins.kubernetes;

import edu.umd.cs.findbugs.annotations.NonNull;
import java.io.IOException;
import java.util.HashSet;
import java.util.Objects;
Expand Down Expand Up @@ -556,13 +557,14 @@ public KubernetesSlave build() throws IOException, Descriptor.FormException {
nodeDescription == null ? podTemplate.getName() : nodeDescription,
cloud.name,
label == null ? podTemplate.getLabel() : label,
computerLauncher == null ? defaultLauncher() : computerLauncher,
decorateLauncher(computerLauncher == null ? new KubernetesLauncher(cloud.getJenkinsTunnel(), null) : computerLauncher),
retentionStrategy == null ? determineRetentionStrategy() : retentionStrategy);
}

private KubernetesLauncher defaultLauncher() {
KubernetesLauncher launcher = new KubernetesLauncher(cloud.getJenkinsTunnel(), null);
launcher.setWebSocket(cloud.isWebSocket());
private ComputerLauncher decorateLauncher(@NonNull ComputerLauncher launcher) {
if (launcher instanceof KubernetesLauncher) {
((KubernetesLauncher) launcher).setWebSocket(cloud.isWebSocket());
}
return launcher;
}

Expand Down

0 comments on commit 562bba6

Please sign in to comment.