Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-36544] Fix Node Properties on Jenkins 2.205+ (#440)
* [JENKINS-36544] Fix Node Properties on Jenkins 2.205+ This is a follow-up fix for PR #382. In 2.204, the "Configure Clouds" screen was on the main /configure system configuration page. As a result, `${it}` referred to the global system object, aka the Hudson instance. In 2.205, PR jenkinsci/jenkins#4339 merged, which moves the Configure Clouds section to a new page: /configureClouds. As a result of that change, `${it}` no longer refers to the Hudson instance, but to a new GlobalCloudConfiguration object. That object does not have the `getNodePropertyDescriptors()` method, so it is not able to populate the "Node Properties" block. Switching that to `${app}` gives it a correct reference to the Hudson object, and that allows it to show the Node Properties block on all Jenkins versions, both before and after v2.205. * Use the correct form of getNodePropertyDescriptors() Current master is calling `${it.getNodePropertyDescriptors()}`, but on Jenkins versions <= 2.204, that is calling the method on the global Jenkins node (via Node class). It should instead be using the version of the method that was added in SlaveTemplate, and to do that from a Jelly script, it needs to be moved into the SlaveTemplate.DescriptorImpl class.
- Loading branch information