Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Add check for ID already in use.
Browse files Browse the repository at this point in the history
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
  • Loading branch information
mrunalp authored and vmarmol committed Dec 5, 2014
1 parent 66e6806 commit 3f26e9a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion linux_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ type linuxFactory struct {

func (l *linuxFactory) Create(id string, config *Config) (Container, error) {
if !idRegex.MatchString(id) {
return nil, newGenericError(fmt.Errorf("Invalid id format: %s ", id), InvalidIdFormat)
return nil, newGenericError(fmt.Errorf("Invalid id format: %v", id), InvalidIdFormat)
}

containerRoot := filepath.Join(l.root, id)
if _, err := os.Stat(containerRoot); err == nil {
return nil, newGenericError(fmt.Errorf("Container with id exists: %v", id), IdInUse)
}

panic("not implemented")
Expand Down

0 comments on commit 3f26e9a

Please sign in to comment.