[JIRA] (JENKINS-46235) API does not allow to remove lockable resource

1 view
Skip to first unread message

travispavek@gmail.com (JIRA)

unread,
Aug 3, 2018, 4:23:02 PM8/3/18
to jenkinsc...@googlegroups.com
Travis Pavek commented on Improvement JENKINS-46235
 
Re: API does not allow to remove lockable resource

As a workaround, there is a removeAll option that you can say something like remove all resources where name matches 'somestr'.  For example this is what I do:

 

def all_lockable_resources = GlobalConfiguration.all().get(org.jenkins.plugins.lockableresources.LockableResourcesManager.class).resources

all_lockable_resources.removeAll { it.name.contains('somestr')}

I use a timestamp in my names and match off that.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

tobias-jenkins@23.gs (JIRA)

unread,
Oct 12, 2019, 8:54:03 AM10/12/19
to jenkinsc...@googlegroups.com

As I try to understand the usecase here (and the blatant violation of script security ): Is the introduction of "ephemeral" resources covering your use cases or do you need something more complex? If you need something more complex, maybe a new set of pipeline steps with proper permission checks is the better way? The LockableResourcesManager API was never designed for use in pipeline...

(As always, pull requests welcome, but I suspect such a feature could even be its own plugin "extending" the lockable-resources plugin)

This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages