This repository was archived by the owner on May 28, 2021. It is now read-only.

Description
Currently, the mysqldump backup provider writes the backup to the local filesystem and then opens the file and returns that as the io.Reader for the object storage client.
|
f, err := os.Create(tmpFile) |
|
if err != nil { |
|
return nil, "", err |
|
} |
|
defer f.Close() |
|
|
|
zw := gzip.NewWriter(f) |
|
defer zw.Close() |
|
cmd.SetStdout(zw) |
|
|
|
glog.V(4).Infof("running cmd: '%v'", cmd) |
|
err = cmd.Run() |
|
if err != nil { |
|
return nil, "", err |
|
} |
|
|
|
content, err := os.Open(tmpFile) |
|
if err != nil { |
|
return nil, "", err |
|
} |
|
return content, filepath.Base(tmpFile), nil |
We should upload directly to object storage without writing to disk.