Browse code

Change the volumes type to map[string]string to store both source and destination

Guillaume J. Charmes authored on 2013/04/10 10:08:03
Showing 2 changed files
... ...
@@ -915,21 +915,21 @@ func (opts AttachOpts) Get(val string) bool {
915 915
 }
916 916
 
917 917
 // PathOpts stores a unique set of absolute paths
918
-type PathOpts map[string]struct{}
918
+type PathOpts map[string]string
919 919
 
920 920
 func NewPathOpts() PathOpts {
921 921
 	return make(PathOpts)
922 922
 }
923 923
 
924 924
 func (opts PathOpts) String() string {
925
-	return fmt.Sprintf("%v", map[string]struct{}(opts))
925
+	return fmt.Sprintf("%v", map[string]string(opts))
926 926
 }
927 927
 
928 928
 func (opts PathOpts) Set(val string) error {
929 929
 	if !filepath.IsAbs(val) {
930 930
 		return fmt.Errorf("%s is not an absolute path", val)
931 931
 	}
932
-	opts[filepath.Clean(val)] = struct{}{}
932
+	opts[filepath.Clean(val)] = ""
933 933
 	return nil
934 934
 }
935 935
 
... ...
@@ -66,7 +66,7 @@ type Config struct {
66 66
 	Cmd          []string
67 67
 	Dns          []string
68 68
 	Image        string // Name of the image as it was passed by the operator (eg. could be symbolic)
69
-	Volumes      map[string]struct{}
69
+	Volumes      map[string]string
70 70
 }
71 71
 
72 72
 func ParseRun(args []string, stdout io.Writer, capabilities *Capabilities) (*Config, error) {
... ...
@@ -461,6 +461,7 @@ func (container *Container) Start() error {
461 461
 
462 462
 	// Init the lock
463 463
 	container.waitLock = make(chan struct{})
464
+
464 465
 	container.ToDisk()
465 466
 	go container.monitor()
466 467
 	return nil