Skip to content

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

  1. Options with a value e.g. gitlab-backup create COMPRESS_CMD="pigz -p 4".
  2. Options provided with --. e.g gitlab-backup create COMPRESS_CMD="gzip --best".

It does handle

  1. A command without options. e.g. gitlab-backup create COMPRESS_CMD=gzip or gitlab-backup create COMPRESS_CMD="gzip"
  2. 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.

  1. Install a GitLab build that contains the new feature
  2. Use the COMPRESS_CMD command with options to override the default gzip compression. e.g. gitlab-backup create COMPRESS_CMD="gzip -c --best"
  3. 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

Example of error image

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

image

Possible fixes

Edited by Sampath Ranasinghe