Backup - Compression override command doesn't handle certain options in omnibus
Summary
The compression override command does not handle certain options passed to the compression library
- Options with a value e.g.
gitlab-backup create COMPRESS_CMD="pigz -p 4"
. - Options provided with
--
. e.ggitlab-backup create COMPRESS_CMD="gzip --best"
.
It does handle
- A command without options. e.g.
gitlab-backup create COMPRESS_CMD=gzip
orgitlab-backup create COMPRESS_CMD="gzip"
- A command with a single option provided with
-
. e.g.gitlab-backup create COMPRESS_CMD="gzip -c"
Steps to reproduce
I tested this using a 16.6 nightly build (16.6.0+rnightly.307940.34fdcdd4-0) since the feature is not yet available in an official release.
- Install a GitLab build that contains the new feature
- Use the
COMPRESS_CMD
command with options to override the default gzip compression. e.g.gitlab-backup create COMPRESS_CMD="gzip -c --best"
- Operations fails with error
invalid option: --best
.
What is the current bug behavior?
The backup command with the compression override that includes options fails with invalid option error as described above.
What is the expected correct behavior?
The operation should succeed and handling the options provided correctly provided they are valid options for the chosen compression library.
Relevant logs and/or screenshots
This screenshot below confirms the COMPRESS_CMD command is supported on the build I am testing since the out put is confirming that pigz is overriding the default gzip command
Possible fixes
Edited by Sampath Ranasinghe