Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to lock one resource from list, not by label #582

Closed
KovalovVladislav opened this issue Nov 17, 2023 · 2 comments
Closed

Ability to lock one resource from list, not by label #582

KovalovVladislav opened this issue Nov 17, 2023 · 2 comments

Comments

@KovalovVladislav
Copy link

KovalovVladislav commented Nov 17, 2023

What feature do you want to see added?

There is corner case when we have automated lockable resource creation with YAML configuration. When resource is removed from this configuration, it is still present in lockable resources configuration. So it still can be locked by label.
It would be really nice if you will add ability to lock resources from specific list of names or ability to specify include/exclude expressions to lock step.

Upstream changes

No response

@mPokornyETM
Copy link
Contributor

I am not sure if I understand it corectly, but I think this shall helps you

https://github.com/jenkinsci/lockable-resources-plugin#multiple-resource-lock
and you can exclude resource by label like

// has labelA but NOT labelB
lock(label: 'labelA && !labelB', variable : 'someVar') {
echo 'acquired by: ' + env.someVar;
}

@KovalovVladislav
Copy link
Author

@mPokornyETM thanks! I will try it shortly. If it works, it is exactly what I need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants