-
Notifications
You must be signed in to change notification settings - Fork 182
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
Empty ressource is not allowed anymore #619
Comments
Ok, I see. That make sense. |
We have a similar usecase that used to work but doesn't any more. def extra = []
if (params.platform == "openstack") {
extra = [[resource: "openstack_cluster"]]
} else if ....
// more branches
}
lock(extra: extra, variable: "RESOURCE") {
sh '''./job.sh "${platform}"'''
} we use extra because some platforms don't lock anything, some use |
Seems like this issue has been introduced by d4e51cc#diff-643ee7a8c516946248ee3aaa251d25acd9b0fa035a45e654be76eecda7906403R104-R106 |
Similar to #615 |
A workaround is to add a random string if the list is empty. E.g.
|
As there is applicable work arround, I will close this issue now. @johannesacco thx |
Seems to work as workaround, don't like all |
Please fix this. The author went on an ego trip and pushed this commit without any review, and now we see multiple tickets asking why this feature was broken without providing any alternative solution. The example in the issue is obviously simplistic to push a narrative without understanding why devs are using it. This needs to be fixed for labels. |
Introduced by #579 |
Ephemeral resources are really bad think. So I will reopen it, and hopefully somebody will take time and fix it in proeper way. |
FYI: When I provide PR, I wat for longer time for review (~ fe days) In the past 2 yers I became only few reviews, because no body interseted. Therefor pls, do not use wording like "The author went on an ego trip" Without my ego trip, you will still have all the concurent modification excpetions .... . When you want, you can participate on this plugin too. Provide a fix, and I will review the changes as well. All kind of contributions are welcome. But pls be respectfull. thx |
Jenkins and plugins versions report
Environment
(not all plugins are listed for security reasons)
What Operating System are you using (both controller, and any agents involved in the problem)?
This is not the problem
Reproduction steps
In a declarative pipeline, use lock resource with an empty string (to say 'do not lock') :
Alternative : use null.
Expected Results
Should be valid and lock nothing.
Actual Results
Generate an error as the label must not be empty :
Anything else?
We cannot set empty, we cannot set null, so in a declarative pipeline we cannot choose dynamically if we want a lock or not.
We should be able to define the lock with a function depending on the context :
Was working with version 1102.vde5663d777cf : we could set an empty string to not lock at all.
Are you interested in contributing a fix?
Maybe
The text was updated successfully, but these errors were encountered: