How can I toggle on Jenkins' Enable Slave -> Master Access Control
(listed under Configure System), control from a Groovy script run using the script console?
I suspect the answer will involve the MasterKillSwitchConfiguration class.
Answer is:
Jenkins.instance.injector.getInstance(AdminWhitelistRule.class)
.setMasterKillSwitch(false);
Jenkins.instance.save()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.