mirror of https://github.com/helm/helm
The tar extraction loop in extractTar used a per-entry `defer outFile.Close()`, which runs only when the function returns. Every extracted file's descriptor therefore stayed open for the whole archive, so a large plugin archive could exhaust the process file-descriptor limit mid-extraction. Extract each regular file inside an anonymous function so the deferred close fires at the end of every iteration, on the success, error, and panic-unwind paths alike. At most one descriptor is now open at a time. Signed-off-by: Gates Wang <9372086+SetagGnaw@users.noreply.github.com>pull/32414/head
parent
6c45810119
commit
efad11c341
Loading…
Reference in new issue