From 1e08918b54dc5c0a39253c3e31dfb48b97815d2e Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Wed, 10 Apr 2013 16:09:34 -0700 Subject: [PATCH] Switch back config to map[string]struct{} Upstream-commit: faf8daa7c68f2511dedfad15e1fd05f9eff077a2 Component: engine --- components/engine/commands.go | 6 +++--- components/engine/container.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/engine/commands.go b/components/engine/commands.go index 5f5f8d36f9..cb7b57ff00 100644 --- a/components/engine/commands.go +++ b/components/engine/commands.go @@ -915,21 +915,21 @@ func (opts AttachOpts) Get(val string) bool { } // PathOpts stores a unique set of absolute paths -type PathOpts map[string]string +type PathOpts map[string]struct{} func NewPathOpts() PathOpts { return make(PathOpts) } func (opts PathOpts) String() string { - return fmt.Sprintf("%v", map[string]string(opts)) + return fmt.Sprintf("%v", map[string]struct{}(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)] = "" + opts[filepath.Clean(val)] = struct{}{} return nil } diff --git a/components/engine/container.go b/components/engine/container.go index 4475fdac40..2edcd6776b 100644 --- a/components/engine/container.go +++ b/components/engine/container.go @@ -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]string + Volumes map[string]struct{} } func ParseRun(args []string, stdout io.Writer, capabilities *Capabilities) (*Config, error) {