mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-04 15:45:52 +00:00
[JENKINS-18381] Provide a mechanism to differentiate between node
properties that are applicable to the master node only and node properties that can be applied to all nodes
This commit is contained in:
1 parent
2c8da0b8c8
commit
48e8010231
4 files changed
+35
-1
No files matched your search
@@ -796,6 +796,22 @@ public class Functions {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns those node properties which can be configured as global node properties.
|
||||
*
|
||||
* @since 1.520
|
||||
*/
|
||||
public static List<NodePropertyDescriptor> getGlobalNodePropertyDescriptors() {
|
||||
List<NodePropertyDescriptor> result = new ArrayList<NodePropertyDescriptor>();
|
||||
Collection<NodePropertyDescriptor> list = (Collection) Jenkins.getInstance().getDescriptorList(NodeProperty.class);
|
||||
for (NodePropertyDescriptor npd : list) {
|
||||
if (npd.isApplicableAsGlobal()) {
|
||||
result.add(npd);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all the descriptors sorted by their inheritance tree of {@link Describable}
|
||||
* so that descriptors of similar types come nearby.
|
||||
|
||||
Reference in new issue
Block a user