Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deploy: ApplyParams: do not write params.env if there are no updates (o…
…pendatahub-io#1186) Optimize file operations, do not rewrite params.env on every reconcile if no updates for it. In practice updates happen only on the first run. Since updates happen in 2 loops, move actual update to own function which returns "number of updates" (actually 0 or 1, so acts as boolean) and use bitwise operations to accumulate updates for every field. It could be possible to use global boolean flag, but since it requires to be initiated before the loops and set when updates happen, the function should be guarded with mutex. Otherwise "true" value from one invocation can be reset to "false" by the next invocation". Signed-off-by: Yauheni Kaliuta <[email protected]> (cherry picked from commit 450e19f)
- Loading branch information