Skip to content

Commit

Permalink
Use args5_7 for MySQL 5.7.x backup
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed Oct 17, 2023
1 parent 6255a69 commit 7dfba84
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions apis/installer/v1alpha1/stash_catalog_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ type StashMysqlSpec struct {
type MySQLBackup struct {
// +optional
Args string `json:"args"`
// +optional
Args57 string `json:"args5_7"`
}

type MySQLRestore struct {
Expand Down
1 change: 1 addition & 0 deletions charts/stash-catalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ The following table lists the configurable parameters of the `stash-catalog` cha
| mongodb.restore.args | Arguments to pass to `mongorestore` command during restore process | <code>""</code> |
| mysql.enabled | If true, deploys MySQL addon | <code>true</code> |
| mysql.backup.args | Arguments to pass to `mysqldump` command during bakcup process | <code>"--all-databases"</code> |
| mysql.backup.args5_7 | Arguments to pass to `mysqldump` command during MySQL 5.7.x bakcup process | <code>""</code> |
| mysql.restore.args | Arguments to pass to `mysql` command during restore process | <code>""</code> |
| perconaxtradb.enabled | If true, deploys Percona XtraDB addon | <code>true</code> |
| perconaxtradb.backup.args | Arguments to pass to `mysqldump` command during bakcup process | <code>"--all-databases"</code> |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
- --enable-cache=${ENABLE_CACHE:=true}
- --max-connections=${MAX_CONNECTIONS:=0}
- --hostname=${HOSTNAME:=}
- --mysql-args=${args:={{ .Values.mysql.backup.args }}}
- --mysql-args=${args:={{ .Values.mysql.backup.args5_7 }}}
- --wait-timeout=${waitTimeout:={{ .Values.waitTimeout}}}
- --namespace=${NAMESPACE:=default}
- --appbinding=${TARGET_NAME:=}
Expand Down
2 changes: 2 additions & 0 deletions charts/stash-catalog/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ properties:
properties:
args:
type: string
args5_7:
type: string
type: object
enabled:
type: boolean
Expand Down
2 changes: 2 additions & 0 deletions charts/stash-catalog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ mysql:
backup:
# Arguments to pass to `mysqldump` command during bakcup process
args: "--all-databases"
# Arguments to pass to `mysqldump` command during MySQL 5.7.x bakcup process
args5_7: ""
restore:
# Arguments to pass to `mysql` command during restore process
args: ""
Expand Down
2 changes: 2 additions & 0 deletions charts/stash/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ properties:
properties:
args:
type: string
args5_7:
type: string
type: object
enabled:
type: boolean
Expand Down
6 changes: 5 additions & 1 deletion hack/fmt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ func main() {

case "mysql":
if strings.HasPrefix(args[i], "--mysql-args=") {
args[i] = fmt.Sprintf(`--mysql-args=${args:={{ .Values.%s.%s.args }}}`, loc.App, r.Type)
if r.Resource.GetName() == "mysql-backup-5.7.25" {
args[i] = fmt.Sprintf(`--mysql-args=${args:={{ .Values.%s.%s.args5_7 }}}`, loc.App, r.Type)
} else {
args[i] = fmt.Sprintf(`--mysql-args=${args:={{ .Values.%s.%s.args }}}`, loc.App, r.Type)
}
}

case "perconaxtradb":
Expand Down

0 comments on commit 7dfba84

Please sign in to comment.