Skip to content

Commit

Permalink
Merge pull request #4 from kayac/fature/v0.3.0
Browse files Browse the repository at this point in the history
Fature/v0.3.0
  • Loading branch information
mashiike authored Nov 10, 2021
2 parents 459b255 + ce31d83 commit 0ad2f44
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
strategy:
matrix:
go:
- 1.16
- 1.17
name: Build
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 9 additions & 2 deletions cmd/mascaras/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@ import (
"strings"
"syscall"

"github.com/hashicorp/logutils"
"github.com/fatih/color"
"github.com/fujiwara/logutils"
"github.com/kayac/mascaras"
"github.com/mashiike/didumean"
)

var filter = &logutils.LevelFilter{
Levels: []logutils.LogLevel{"debug", "info", "warn", "error"},
Levels: []logutils.LogLevel{"debug", "info", "warn", "error"},
ModifierFuncs: []logutils.ModifierFunc{
nil,
nil,
logutils.Color(color.FgYellow),
logutils.Color(color.FgRed, color.BgBlack),
},
MinLevel: logutils.LogLevel("info"),
Writer: os.Stderr,
}
Expand Down
4 changes: 4 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type Config struct {
DBUserName string `json:"db_user_name,omitempty" yaml:"db_user_name,omitempty"`
DBUserPassword string `json:"db_user_password,omitempty" yaml:"db_user_password,omitempty"`
Database string `json:"database,omitempty" yaml:"database,omitempty"`
SSLMode string `json:"ssl_mode,omitempty" yaml:"ssl_mode,omitempty"`
SQLFile string `json:"sql_file,omitempty" yaml:"sql_file,omitempty"`
SourceDBClusterIdentifier string `json:"source_db_cluster_identifier,omitempty" yaml:"source_db_cluster_identifier,omitempty"`
Interactive bool `json:"interactive,omitempty" yaml:"interactive,omitempty"`
Expand Down Expand Up @@ -59,6 +60,7 @@ func DefaultConfig() *Config {
},
DBUserName: "root",
EnableExportTask: false,
SSLMode: "disable",
}
}

Expand All @@ -85,6 +87,7 @@ func (cfg *Config) SetFlags(f *flag.FlagSet) {
f.StringVar(&cfg.DBUserPassword, "db-user-password", cfg.DBUserPassword, "Cloned Aurora DB user password.")
f.StringVar(&cfg.Database, "database", cfg.Database, "Cloned Aurora DB sql target database.")
f.BoolVar(&cfg.EnableExportTask, "enable-export-task", cfg.EnableExportTask, "created snapshot export to s3")
f.StringVar(&cfg.SSLMode, "ssl-mode", cfg.SSLMode, "ssl mode setting apply only PostgreSQL type Aurora DB")
f.StringVar(&cfg.SQLFile, "sql-file", cfg.SQLFile, "")
f.StringVar(&cfg.SourceDBClusterIdentifier, "src-db-cluster", cfg.SourceDBClusterIdentifier, "")
f.BoolVar(&cfg.Interactive, "interactive", cfg.Interactive, "after mask sql, Launch an interactive prompt after executing SQL")
Expand Down Expand Up @@ -121,6 +124,7 @@ func (cfg *Config) MergeIn(o *Config) *Config {
cfg.DBUserPassword = coalesceString(o.DBUserPassword, cfg.DBUserPassword)
cfg.Database = coalesceString(o.Database, cfg.Database)
cfg.EnableExportTask = o.EnableExportTask || cfg.EnableExportTask
cfg.SSLMode = coalesceString(o.SSLMode, cfg.SSLMode)
cfg.SQLFile = coalesceString(o.SQLFile, cfg.SQLFile)
cfg.SourceDBClusterIdentifier = coalesceString(o.SourceDBClusterIdentifier, cfg.SourceDBClusterIdentifier)
cfg.Interactive = o.Interactive || cfg.Interactive
Expand Down
37 changes: 30 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
module github.com/kayac/mascaras

go 1.16
go 1.17

require (
github.com/Songmu/flextime v0.1.0
github.com/aws/aws-sdk-go v1.38.57
github.com/chzyer/logex v1.1.10 // indirect
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
github.com/hashicorp/logutils v1.0.0
github.com/kayac/go-config v0.5.1
github.com/fatih/color v1.13.0
github.com/fujiwara/logutils v1.1.0
github.com/kayac/go-config v0.6.0
github.com/lestrrat-go/backoff/v2 v2.0.8
github.com/lib/pq v1.10.4
github.com/mashiike/didumean v0.1.2
github.com/mashiike/mysqlbatch v0.2.2
github.com/stretchr/testify v1.6.1
github.com/mashiike/mysqlbatch v0.3.0
github.com/stretchr/testify v1.7.0
)

require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/agnivade/levenshtein v1.0.3 // indirect
github.com/chzyer/logex v1.1.10 // indirect
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/lestrrat-go/option v1.0.0 // indirect
github.com/mattn/go-colorable v0.1.9 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
29 changes: 21 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,20 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c h1:TUuUh0Xgj97tLMNtWtNvI9mIV6isjEb9lBMNv+77IGM=
github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fujiwara/logutils v1.1.0 h1:JAYmqW40d/ZjzouB01sfZiaTxwNe4hwmB6lLajZqm1s=
github.com/fujiwara/logutils v1.1.0/go.mod h1:pdb/Uk70rjQWEmFm/OvYH7OG8meZt1fEIqC0qZbvro4=
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y=
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/kayac/go-config v0.5.1 h1:TbqadCm/HQeXtTJ6WnozpldBtm8KKfucPM+5tL/KCP8=
github.com/kayac/go-config v0.5.1/go.mod h1:5C4ZN+sMjYpEX0bi+AcgF6g0hZYVdzZiV16TEyzAzfk=
github.com/kayac/go-config v0.6.0 h1:Y4l9tsWrUCvT1id8tbO4aT4SdGxbYqd8lqSe5l1GrK0=
github.com/kayac/go-config v0.6.0/go.mod h1:5C4ZN+sMjYpEX0bi+AcgF6g0hZYVdzZiV16TEyzAzfk=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
Expand All @@ -40,10 +42,17 @@ github.com/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf
github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y=
github.com/lestrrat-go/option v1.0.0 h1:WqAWL8kh8VcSoD6xjSH34/1m8yxluXQbDeKNfvFeEO4=
github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk=
github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mashiike/didumean v0.1.2 h1:AhwQPxF4mXj6Sx7LYV2w0wikE8xsLyH/bSemCnunbOg=
github.com/mashiike/didumean v0.1.2/go.mod h1:AFYcY3noJ6rqD64KPYrSC/wRgMeEZxP6NsGQ4p5aUpQ=
github.com/mashiike/mysqlbatch v0.2.2 h1:QSGgMozGCc3SMtCRJ/dWo9KnPqth2v9Yzb2LE4FcAdw=
github.com/mashiike/mysqlbatch v0.2.2/go.mod h1:29Ej3fEllCDd/53OcfSD4dQ8/nT6BY4AvgIB+FSl/RY=
github.com/mashiike/mysqlbatch v0.3.0 h1:x7dg+RxSZHo21NNUSXHVB128MALOxz0sJ/QfK1Vs+d0=
github.com/mashiike/mysqlbatch v0.3.0/go.mod h1:ah/2TnQZFyZrhghJ3zg9VYybchIEm8BTIA7H2vHqi2g=
github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
Expand All @@ -59,17 +68,21 @@ github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down
80 changes: 58 additions & 22 deletions mascaras.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package mascaras

import (
"context"
"database/sql"
"errors"
"fmt"
"io"
Expand All @@ -16,14 +17,15 @@ import (
"github.com/aws/aws-sdk-go/service/rds/rdsiface"
"github.com/chzyer/readline"
"github.com/lestrrat-go/backoff/v2"
_ "github.com/lib/pq"
"github.com/mashiike/mysqlbatch"
)

type App struct {
rdsSvc rdsiface.RDSAPI
cfg *Config
baseInterval time.Duration
newExecuter func(cfg *Config, host string, port int) (executer, error)
newExecuter func(cfg *Config, dbtype string, host string, port int) (executer, error)
stdin io.ReadCloser
stderr io.Writer
}
Expand Down Expand Up @@ -74,19 +76,40 @@ type executer interface {
Close() error
}

func defaultNewExecuter(cfg *Config, host string, port int) (executer, error) {
mysqlConfig := &mysqlbatch.Config{
User: cfg.DBUserName,
Host: host,
Password: cfg.DBUserPassword,
Port: port,
Database: cfg.Database,
}
executer, err := mysqlbatch.New(mysqlConfig)
if err != nil {
return nil, err
func defaultNewExecuter(cfg *Config, dbtype string, host string, port int) (executer, error) {
switch dbtype {
case "mysql":
mysqlConfig := &mysqlbatch.Config{
User: cfg.DBUserName,
Host: host,
Password: cfg.DBUserPassword,
Port: port,
Database: cfg.Database,
}
executer, err := mysqlbatch.New(mysqlConfig)
if err != nil {
return nil, err
}
return executer, nil
case "postgresql":
db, err := sql.Open("postgres",
fmt.Sprintf(
"user=%s host=%s password=%s port=%d dbname=%s sslmode=%s",
cfg.DBUserName,
host,
cfg.DBUserPassword,
port,
cfg.Database,
cfg.SSLMode,
),
)
if err != nil {
return nil, err
}
return mysqlbatch.NewWithDB(db), nil
}
return executer, nil
return nil, errors.New("unknown dbtype")

}

func (app *App) Run(ctx context.Context, sourceDBClusterIdentifier string) error {
Expand All @@ -98,13 +121,15 @@ func (app *App) Run(ctx context.Context, sourceDBClusterIdentifier string) error
if sourceDBClusterIdentifier == "" {
return errors.New("source db cluster is required")
}
var maskSQLExists bool
maskSQL := "-- nothing to do\n"
if maskSQLFile != "" {
var err error
maskSQL, err = readSQL(maskSQLFile)
if err != nil {
return err
}
maskSQLExists = true
}
log.Println("[debug] sql:", maskSQL)
tempDBClusterIdentifier := app.cfg.TempCluster.DBClusterIdentifier
Expand All @@ -125,6 +150,16 @@ func (app *App) Run(ctx context.Context, sourceDBClusterIdentifier string) error
if err != nil {
return fmt.Errorf("RestoreDBClusterToPointInTime:%w", err)
}
var dbtype string
switch *restoreOutput.DBCluster.Engine {
case "aurora", "aurora-mysql": // aurora (for MySQL 5.6-compatible Aurora), aurora-mysql (for MySQL 5.7-compatible Aurora)
dbtype = "mysql"
case "aurora-postgresql":
dbtype = "postgresql"
default:
log.Printf("[warn] unknown engine `%s` mascaras don't know. decided that it was a MySQL type DB.\n", *restoreOutput.DBCluster.Engine)
dbtype = "mysql"
}
cleanupInfo := &cleanupInfo{
tempDBClusterIdentifier: &tempDBClusterIdentifier,
}
Expand Down Expand Up @@ -161,13 +196,14 @@ func (app *App) Run(ctx context.Context, sourceDBClusterIdentifier string) error
if err != nil {
return err
}

maskedTime, err := app.executeSQL(ctx, maskSQL, maskSQLFile, *tempDBCluster.DBClusterIdentifier, *tempDBClusterEndpoint.Endpoint, int(*tempDBCluster.Port))
if err != nil {
return err
}
if err := app.waitDBClusterLatestRestorableTime(ctx, tempDBClusterIdentifier, maskedTime); err != nil {
return err
if maskSQLExists || app.cfg.Interactive {
maskedTime, err := app.executeSQL(ctx, dbtype, maskSQL, maskSQLFile, *tempDBCluster.DBClusterIdentifier, *tempDBClusterEndpoint.Endpoint, int(*tempDBCluster.Port))
if err != nil {
return err
}
if err := app.waitDBClusterLatestRestorableTime(ctx, tempDBClusterIdentifier, maskedTime); err != nil {
return err
}
}
snapshotIdentifer := tempDBClusterIdentifier + "-snapshot"
log.Println("[info] create snapshot:", snapshotIdentifer)
Expand Down Expand Up @@ -217,8 +253,8 @@ func (app *App) Run(ctx context.Context, sourceDBClusterIdentifier string) error
return nil
}

func (app *App) executeSQL(ctx context.Context, maskSQL, maskSQLLoc string, hostID, host string, port int) (time.Time, error) {
executer, err := app.newExecuter(app.cfg, host, port)
func (app *App) executeSQL(ctx context.Context, dbtype string, maskSQL, maskSQLLoc string, hostID, host string, port int) (time.Time, error) {
executer, err := app.newExecuter(app.cfg, dbtype, host, port)
if err != nil {
return time.Time{}, err
}
Expand Down
5 changes: 3 additions & 2 deletions mascaras_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestAppRun(t *testing.T) {
{
casetag: "no mask",
clusterIdentifier: MockSuccessDBClusterIdentifier,
expectedSQL: "-- nothing to do\n",
expectedSQL: "",
noMask: true,
},
{
Expand All @@ -110,7 +110,7 @@ func TestAppRun(t *testing.T) {
app := &App{
rdsSvc: svc,
baseInterval: time.Millisecond,
newExecuter: func(_ *Config, host string, _ int) (executer, error) {
newExecuter: func(_ *Config, dbtype, host string, _ int) (executer, error) {
e.host = host
return e, nil
},
Expand Down Expand Up @@ -184,6 +184,7 @@ func TestConfigMergeIn(t *testing.T) {
DBUserName: "admin",
DBUserPassword: "super_password",
Database: "db01",
SSLMode: "disable",
EnableExportTask: true,
ExportTask: ExportTaskConfig{
TaskIdentifier: "test-out",
Expand Down
1 change: 1 addition & 0 deletions mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (svc *mockRDSService) RestoreDBClusterToPointInTimeWithContext(
DBCluster: &rds.DBCluster{
DBClusterArn: aws.String(dbClusterARNPrefix + *input.DBClusterIdentifier),
Port: aws.Int64(3306),
Engine: aws.String("aurora-test"),
},
}
return output, nil
Expand Down

0 comments on commit 0ad2f44

Please sign in to comment.