Skip to content

Commit

Permalink
Merge pull request #61 from james-nesbitt/createnofailifcontainerexists
Browse files Browse the repository at this point in the history
make the create operation more graceful if the container already exists
  • Loading branch information
james-nesbitt committed Dec 10, 2015
2 parents 4c1b432 + dbfe6c3 commit ff84b7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions operation_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,14 @@ func (node *Node) Create(filters []string, cmdOverride []string, onlyDefault boo
* Create a container for a node
*/
func (instance *Instance) Create(overrideCmd []string, force bool) bool {

node := instance.Node

if !force && instance.HasContainer(false) {
node.log.Info(node.Name+"["+instance.Name+"]: Skipping node instance, which already has a container")
return false
}

/**
* Transform node data, into a format that can be used
* for the actual Docker call. This involves transforming
Expand Down
2 changes: 2 additions & 0 deletions operation_up.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ from beginning to fully operational, with a single command.
SYNTAX:
$/> coach {target} up
{targets} what target node instances the operation should process ($/> coach help targets)
TODO:
- building images may take a long time, so maybe it should be optional;
- pulling images may take a long time, so maybe it should be optional;
Expand Down

0 comments on commit ff84b7c

Please sign in to comment.