mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Change the volumes type to map[string]string to store both source and destination
This commit is contained in:
parent
1df5f4094b
commit
35d704c8a0
2 changed files with 5 additions and 4 deletions
|
@ -915,21 +915,21 @@ func (opts AttachOpts) Get(val string) bool {
|
|||
}
|
||||
|
||||
// PathOpts stores a unique set of absolute paths
|
||||
type PathOpts map[string]struct{}
|
||||
type PathOpts map[string]string
|
||||
|
||||
func NewPathOpts() PathOpts {
|
||||
return make(PathOpts)
|
||||
}
|
||||
|
||||
func (opts PathOpts) String() string {
|
||||
return fmt.Sprintf("%v", map[string]struct{}(opts))
|
||||
return fmt.Sprintf("%v", map[string]string(opts))
|
||||
}
|
||||
|
||||
func (opts PathOpts) Set(val string) error {
|
||||
if !filepath.IsAbs(val) {
|
||||
return fmt.Errorf("%s is not an absolute path", val)
|
||||
}
|
||||
opts[filepath.Clean(val)] = struct{}{}
|
||||
opts[filepath.Clean(val)] = ""
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ type Config struct {
|
|||
Cmd []string
|
||||
Dns []string
|
||||
Image string // Name of the image as it was passed by the operator (eg. could be symbolic)
|
||||
Volumes map[string]struct{}
|
||||
Volumes map[string]string
|
||||
}
|
||||
|
||||
func ParseRun(args []string, stdout io.Writer, capabilities *Capabilities) (*Config, error) {
|
||||
|
@ -461,6 +461,7 @@ func (container *Container) Start() error {
|
|||
|
||||
// Init the lock
|
||||
container.waitLock = make(chan struct{})
|
||||
|
||||
container.ToDisk()
|
||||
go container.monitor()
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue