Skip to content

Commit

Permalink
feat(backup/source/gitlab): Add skip support (like SKIP=registry, ...)
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejsika committed May 16, 2024
1 parent 7d91cd0 commit aaa6c18
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion backup/source/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

type GitlabSource struct {
NamePrefix string `yaml:"NamePrefix"`
Skip string `yaml:"Skip"`
}

func (s GitlabSource) Validate() error {
Expand All @@ -30,7 +31,17 @@ func (s GitlabSource) Backup() (backup_output.BackupOutput, error) {

bp := backup_process.BackupProcess{}
bp.Init()
err = bp.ExecWait("gitlab-backup", "create", "BACKUP="+backupName)

args := []string{
"create",
"BACKUP=" + backupName,
}

if s.Skip != "" {
args = append(args, "SKIP="+s.Skip)
}

err = bp.ExecWait("gitlab-backup", args...)
stderr, _ := bp.GetStderr()
if err != nil {
return backup_output.BackupOutput{
Expand Down

0 comments on commit aaa6c18

Please sign in to comment.