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

Sort requested resources by user defined groovy script #669

Open
mPokornyETM opened this issue Jun 13, 2024 · 0 comments
Open

Sort requested resources by user defined groovy script #669

mPokornyETM opened this issue Jun 13, 2024 · 0 comments

Comments

@mPokornyETM
Copy link
Contributor

What feature do you want to see added?

When the resources are requested by label, it is possible to pick resources randomly or just by index, when there are added.

It will be great to provide a feature to sort the resources by user defined groovy script.

ex:
name | labels
resource1 | nwcard:1 nwcard:2
resource2 | nwcard:1

def sortScript = { if (resource.hasLabel('nwcard:2') return 0; else return 1; }
lock(label : 'nwcard:1', quantity : 1, sortBy : sortScript) { echo 'I am locked') }

Upstream changes

No response

Are you interested in contributing this feature?

No response

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

1 participant