[9.1] (backport #18091) Preserve mtime explicitly when creating tar artifacts #18112
+5
−3
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.
Release notes
Improvement to logstash release artifacts file metadata: mtime is preserved when buiilding tar archives
What does this PR do?
When building tar archives, explicitly set mtime. This avoids losing that information in the minitar
Writer.add_file_simple
methodhttps://github.com/halostatue/minitar/blob/a531136b17b9efdddf0a0f39537845b454c2371e/lib/minitar/writer.rb#L139
Why is it important/What is the impact to the user?
Files containing mtime 0 lead to undesireable behavior in some use cases #17925 and do not show any clues to modification time. Avoiding setting mtime to 0 in many cases will help provide artifacts with the least amount of surprise to users.
Checklist
Related issues
This is an automatic backport of pull request #18091 done by [Mergify](https://mergify.com).