@@ -14,7 +14,6 @@ import (
1414
1515 "github.com/docker/docker/api/types"
1616 "github.com/docker/docker/api/types/container"
17- "github.com/docker/docker/api/types/mount"
1817 "github.com/docker/docker/api/types/network"
1918 "github.com/docker/docker/client"
2019 "github.com/pkg/errors"
@@ -51,7 +50,7 @@ type RestoreJob struct {
5150
5251// RestoreOptions defines a logical restore options.
5352type RestoreOptions struct {
54- DumpFile string `yaml:"dumpLocation"`
53+ DumpLocation string `yaml:"dumpLocation"`
5554 DockerImage string `yaml:"dockerImage"`
5655 DBName string `yaml:"dbname"`
5756 ForceInit bool `yaml:"forceInit"`
@@ -214,15 +213,7 @@ func (r *RestoreJob) buildContainerConfig(password string) *container.Config {
214213}
215214
216215func (r * RestoreJob ) buildHostConfig (ctx context.Context ) (* container.HostConfig , error ) {
217- hostConfig := & container.HostConfig {
218- Mounts : []mount.Mount {
219- {
220- Type : mount .TypeBind ,
221- Source : r .RestoreOptions .DumpFile ,
222- Target : r .RestoreOptions .DumpFile ,
223- },
224- },
225- }
216+ hostConfig := & container.HostConfig {}
226217
227218 if err := tools .AddVolumesToHostConfig (ctx , r .dockerClient , hostConfig , r .globalCfg .DataDir ); err != nil {
228219 return nil , err
@@ -253,7 +244,7 @@ func (r *RestoreJob) markDatabase(ctx context.Context, contID string) error {
253244}
254245
255246func (r * RestoreJob ) retrieveDataStateAt (ctx context.Context , contID string ) (string , error ) {
256- restoreMetaCmd := []string {"sh" , "-c" , "pg_restore --list " + r .RestoreOptions .DumpFile + " | head -n 10" }
247+ restoreMetaCmd := []string {"sh" , "-c" , "pg_restore --list " + r .RestoreOptions .DumpLocation + " | head -n 10" }
257248
258249 log .Dbg ("Running a restore metadata command: " , restoreMetaCmd )
259250
@@ -295,7 +286,7 @@ func (r *RestoreJob) buildLogicalRestoreCommand() []string {
295286 restoreCmd = append (restoreCmd , "--table" , table )
296287 }
297288
298- restoreCmd = append (restoreCmd , r .RestoreOptions .DumpFile )
289+ restoreCmd = append (restoreCmd , r .RestoreOptions .DumpLocation )
299290
300291 return restoreCmd
301292}
0 commit comments