mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-27 10:28:28 +00:00
Evaluate settings values before passing it to task closure (#26243)
The secure settings tool reads from stdIn and we use a closure to provide a value for this. Yet, we evaluate they value too late and end up with the last provided value for all keys.
This commit is contained in:
parent
cfad6688b0
commit
d26c8b5c88
@ -351,8 +351,9 @@ class ClusterFormationTasks {
|
||||
String key = entry.getKey()
|
||||
String name = taskName(parent, node, 'addToKeystore#' + key)
|
||||
Task t = configureExecTask(name, project, parentTask, node, esKeystoreUtil, 'add', key, '-x')
|
||||
String settingsValue = entry.getValue() // eval this early otherwise it will not use the right value
|
||||
t.doFirst {
|
||||
standardInput = new ByteArrayInputStream(entry.getValue().getBytes(StandardCharsets.UTF_8))
|
||||
standardInput = new ByteArrayInputStream(settingsValue.getBytes(StandardCharsets.UTF_8))
|
||||
}
|
||||
parentTask = t
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user