From c00fd47885897518351c80c81b60a15a1f127cea Mon Sep 17 00:00:00 2001 From: "Md. Ishtiaq Islam" Date: Wed, 22 May 2024 17:30:53 +0600 Subject: [PATCH] Add `--ignore-table=mysql.user` to mysql-args (#777) Signed-off-by: Md. Ishtiaq Islam --- pkg/backup.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/backup.go b/pkg/backup.go index 0e3f4940..1b86f0f0 100644 --- a/pkg/backup.go +++ b/pkg/backup.go @@ -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" @@ -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)