org.jenkins-ci.plugins
@@ -44,6 +46,7 @@
org.jenkins-ci
annotation-indexer
+ 1.17
org.jenkins-ci.plugins
@@ -59,10 +62,7 @@
commons-codec
commons-codec
-
- com.google.code.gson
- gson
-
+
@@ -73,4 +73,4 @@
-
+
\ No newline at end of file
diff --git a/plugin/src/main/java/com/redhat/jenkins/nodesharingfrontend/SharedNodeFactory.java b/plugin/src/main/java/com/redhat/jenkins/nodesharingfrontend/SharedNodeFactory.java
index 374b655c..94558d24 100644
--- a/plugin/src/main/java/com/redhat/jenkins/nodesharingfrontend/SharedNodeFactory.java
+++ b/plugin/src/main/java/com/redhat/jenkins/nodesharingfrontend/SharedNodeFactory.java
@@ -28,7 +28,11 @@
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import hudson.model.Node;
+import hudson.slaves.CommandLauncher;
+import hudson.slaves.ComputerLauncher;
import jenkins.model.Jenkins;
+import org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval;
+import org.jenkinsci.plugins.scriptsecurity.scripts.languages.SystemCommandLanguage;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
@@ -55,6 +59,14 @@ public static SharedNode transform(@Nonnull NodeDefinition def) throws IllegalAr
private static SharedNode decorate(@Nonnull SharedNode node) throws IllegalArgumentException {
node.setRetentionStrategy(new SharedOnceRetentionStrategy(1));
node.setMode(Node.Mode.EXCLUSIVE);
+
+ // Approve command launcher's script. It is script from orchestrator, that we trust.
+ ComputerLauncher launcher = node.getLauncher();
+ if (launcher instanceof CommandLauncher) {
+ CommandLauncher cl = (CommandLauncher) launcher;
+ ScriptApproval.get().preapprove(cl.getCommand(), SystemCommandLanguage.get());
+ }
+
if (node.getNumExecutors() != 1) {
throw new IllegalArgumentException("Shared Nodes must have exactly 1 executor");
}
diff --git a/plugin/src/main/java/com/redhat/jenkins/nodesharingfrontend/SharedOnceRetentionStrategy.java b/plugin/src/main/java/com/redhat/jenkins/nodesharingfrontend/SharedOnceRetentionStrategy.java
index e4070c04..06e0b103 100644
--- a/plugin/src/main/java/com/redhat/jenkins/nodesharingfrontend/SharedOnceRetentionStrategy.java
+++ b/plugin/src/main/java/com/redhat/jenkins/nodesharingfrontend/SharedOnceRetentionStrategy.java
@@ -13,8 +13,8 @@
import hudson.slaves.AbstractCloudSlave;
import hudson.slaves.CloudRetentionStrategy;
import hudson.slaves.OfflineCause;
-import hudson.util.TimeUnit2;
+import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -43,7 +43,7 @@ public long check(final AbstractCloudComputer c) {
// terminate. If it's not already trying to terminate then lets terminate manually.
if (c.isIdle() && !disabled) {
final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
- if (idleMilliseconds > TimeUnit2.MINUTES.toMillis(idleMinutes)) {
+ if (idleMilliseconds > TimeUnit.MINUTES.toMillis(idleMinutes)) {
LOGGER.log(Level.INFO, "Disconnecting {0}", c.getName());
done(c);
}
diff --git a/plugin/src/main/resources/index.jelly b/plugin/src/main/resources/index.jelly
index db9975f5..9a3850fb 100644
--- a/plugin/src/main/resources/index.jelly
+++ b/plugin/src/main/resources/index.jelly
@@ -3,5 +3,5 @@
This view is used to render the installed plugins page.
-->
- This plugin consumes nodes shared by pool of preconfigured machines.
+ Share machines as Jenkins agents across multiple Jenkins masters. This plugin consumes nodes from the share pool of preconfigured machines.
diff --git a/pom.xml b/pom.xml
index eb5fd2d1..3ea9472b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,9 +1,22 @@
4.0.0
+
+
+
+
+ io.jenkins.tools.bom
+ bom-2.375.x
+ 1841.v7b_22c5218e1a
+ import
+ pom
+
+
+
+
org.jenkins-ci.plugins
plugin
- 3.33
+ 4.54
org.jenkins-ci.plugins.nodesharing
@@ -41,138 +54,113 @@
-
-
-
-
-
- org.jenkins-ci.plugins.nodesharing
- node-sharing-executor
- ${project.version}
-
-
- org.jenkins-ci.plugins.nodesharing
- node-sharing-lib
- ${project.version}
-
-
- org.jenkins-ci.plugins.nodesharing
- node-sharing-orchestrator
- ${project.version}
-
-
-
-
- org.jenkins-ci
- annotation-indexer
- 1.11
-
-
- org.jenkins-ci
- symbol-annotation
- 1.7
-
-
- org.jenkins-ci.main
- jenkins-test-harness
- 2.56
-
-
- org.jenkins-ci.modules
- instance-identity
- 2.1
-
-
- org.jenkins-ci.modules
- ssh-cli-auth
- 1.4
-
-
- org.jenkins-ci.plugins
- cloud-stats
- 0.20
-
-
- org.jenkins-ci.plugins
- credentials
- 2.1.16
-
-
- org.jenkins-ci.plugins
- resource-disposer
- 0.12
-
-
- org.jenkins-ci.plugins
- script-security
- 1229.v4880b_b_e905a_6
-
-
- org.jenkins-ci.plugins
- ssh-credentials
- 1.13
-
-
- org.jenkins-ci.plugins
- ssh-slaves
- 1.10
-
-
- org.jenkins-ci.plugins
- ws-cleanup
- 0.36
-
-
- org.jenkins-ci.plugins
- structs
- 1.7
-
-
-
-
- io.jenkins
- configuration-as-code
- ${configuration-as-code.version}
-
-
- io.jenkins.configuration-as-code
- test-harness
- ${configuration-as-code.version}
-
-
-
-
- com.google.code.gson
- gson
- 2.8.0
-
-
- commons-codec
- commons-codec
- 1.11
-
-
- org.apache.httpcomponents
- httpclient
- 4.5.2
-
-
-
-
+
+
+
+ org.jenkins-ci
+ annotation-indexer
+ 1.17
+
+
+ org.jenkins-ci.main
+ jenkins-test-harness
+ 1945.v0efff5a_03b_78
+
+
+ org.jenkins-ci.modules
+ instance-identity
+
+
+ org.jenkins-ci.modules
+ ssh-cli-auth
+ 1.8
+
+
+ org.jenkins-ci.plugins
+ cloud-stats
+ 267.v577e3742c282
+
+
+ org.jenkins-ci.plugins
+ credentials
+
+
+ org.jenkins-ci.plugins
+ resource-disposer
+
+
+ org.jenkins-ci.plugins
+ script-security
+
+
+ org.jenkins-ci.plugins
+ ssh-credentials
+
+
+ org.jenkins-ci.plugins
+ ssh-slaves
+
+
+ org.jenkins-ci.plugins
+ ws-cleanup
+
+
+ org.jenkins-ci.plugins
+ structs
+
org.jenkins-ci.plugins
git-client
- 1.17.1
+
+
+ org.jenkins-ci.plugins
+ command-launcher
-
-
- org.jenkins-ci.modules
- sshd
- 2.0
+
+
+ io.jenkins
+ configuration-as-code
test
+
+ io.jenkins.configuration-as-code
+ test-harness
+ test
+
+
+
+
+ com.google.code.gson
+ gson
+ 2.10.1
+
+
+ commons-codec
+ commons-codec
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5.13
+
+
+ org.apache.httpcomponents
+ httpcore
+ 4.4.15
+
+
+ org.json
+ json
+ 20220320
+
+
+ org.slf4j
+ slf4j-api
+ 2.0.5
+
+
@@ -204,17 +192,14 @@
scm:git:git://github.com/jenkinsci/node-sharing-plugin.git
scm:git:git@github.com:jenkinsci/node-sharing-plugin.git
https://github.com/jenkinsci/node-sharing-plugin
- parent-1.2.6
+ node-sharing-parent-2.0.8
- 2.60.3
- 8
- 2.40
- UTF-8
+ 2.375.3
+ 11
+ 0.5C
false
false
- 0.5C
- 1.36
-
+
\ No newline at end of file