VAULT-30189: enos_remote_exec: Use non-static ID as prefix for scripts #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
How to read this pull request
When
enos_remote_exec
executes a script on a remote machine it copiesthe contents to a local place on the target disk before executing it.
Because scripts can be re-used by different resources but provided
different env vars, we used to consider the env vars as part of the SHA
but it looks like it was it was erroneously removed[0] at some point.
What we have now is a case where multiple resources can use the same
script and therefore the same SHA in parallel. That leads to a race where
multiple resources are writing, executing, and cleaning up scripts with
the same SHA.
Instead of just reverting to the prior behavior, we now generate a
non-static ID for each
enos_remote_exec
resource at apply time. Whenwe copy over script contents we prepend this ID, along with the content
SHA, to prevent any script mod races.
[0] 44fe793
Signed-off-by: Ryan Cragun [email protected]
Checklist