Skip to content

Commit

Permalink
Add --ignore-table=mysql.user to mysql-args (#777)
Browse files Browse the repository at this point in the history
Signed-off-by: Md. Ishtiaq Islam <[email protected]>
  • Loading branch information
ishtiaqhimel authored May 22, 2024
1 parent 7ccbafa commit c00fd47
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package pkg
import (
"context"
"path/filepath"
"strings"

api_v1beta1 "stash.appscode.dev/apimachinery/apis/stash/v1beta1"
stash "stash.appscode.dev/apimachinery/client/clientset/versioned"
Expand Down Expand Up @@ -221,6 +222,9 @@ func (opt *mysqlOptions) backupMySQL(targetRef api_v1beta1.TargetRef) (*restic.B
}

session.setUserArgs(opt.myArgs)
if strings.Contains(opt.myArgs, "--all-databases") {
session.cmd.Args = append(session.cmd.Args, "--ignore-table=mysql.user")
}

// add backup command in the pipeline
opt.backupOptions.StdinPipeCommands = append(opt.backupOptions.StdinPipeCommands, *session.cmd)
Expand Down

0 comments on commit c00fd47

Please sign in to comment.