Remove unnecessary -z flag from tar extraction commands#2635
Remove unnecessary -z flag from tar extraction commands#2635rkoster merged 1 commit intocloudfoundry:mainfrom
Conversation
Modern tar implementations support automatic compression detection based on file signatures and fallback to filename suffixes. The -z flag is only required when reading from pipes or tape drives without random access. This change removes the -z flag from tar extraction commands in: - BOSH Director release and stemcell extraction - Job template extraction - Integration test utilities - CI export scripts The changes maintain compatibility with modern tar implementations while simplifying the codebase. Test utilities and pipe-based extractions correctly retain the -z flag where needed. This change is done in preparation for introducing a no-compression flag in the bosh create-release command, which will allow creating uncompressed release tarballs that can be processed with the simplified tar commands.
|
Running one-off integration suite at: |
There was a problem hiding this comment.
Just trying to clarify my understanding.
This is related to the --no-compression flag change because the -z flag on non-compressed files will cause tar to fail?
Any by removing the z, since tar can auto-detect, it can safely expand things that were tar-ed without compression?
Yep, exactly |
|
Merging this PR since it is a non breaking change and a path forward for the UX of the no compression feature has been determined during today's FI working group meeting (this was the previous blocker). |
Follow-up to PR cloudfoundry#2635 which removed the -z flag from tar extraction commands but missed the validate_tgz method in package_persister.rb and its corresponding test expectations. The -z flag forces gzip decompression, causing failures when processing non-gzip-compressed package archives. Modern tar auto-detects the compression format without needing the -z flag. Made-with: Cursor
Follow-up to PR #2635 which removed the -z flag from tar extraction commands but missed the validate_tgz method in package_persister.rb and its corresponding test expectations. The -z flag forces gzip decompression, causing failures when processing non-gzip-compressed package archives. Modern tar auto-detects the compression format without needing the -z flag. Made-with: Cursor
Summary
This PR removes the unnecessary
-zflag from tar extraction commands throughout the BOSH codebase. Modern tar implementations support automatic compression detection based on file signatures and fallback to filename suffixes.Changes Made
update_release.rb,update_stemcell.rb,release_job.rb, andjob_template_loader.rbTechnical Details
The
-zflag is only required when reading from pipes or tape drives without random access. For regular file operations, modern tar implementations can automatically detect compression formats using:.tgz,.tar.gz)Compatibility
-zflag where still needed (pipes, test utilities)Preparation for Future Enhancement
This change is done in preparation for introducing a
--no-compressionflag in thebosh create-releasecommand, which will allow creating uncompressed release tarballs that can be processed with the simplified tar commands.Testing
Exec.shcalls, so they verify error handling behavior rather than specific command syntaxReferences