Skip to content

Commit ff84b7c

Browse files
committed
Merge pull request #61 from james-nesbitt/createnofailifcontainerexists
make the create operation more graceful if the container already exists
2 parents 4c1b432 + dbfe6c3 commit ff84b7c

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

operation_create.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,14 @@ func (node *Node) Create(filters []string, cmdOverride []string, onlyDefault boo
102102
* Create a container for a node
103103
*/
104104
func (instance *Instance) Create(overrideCmd []string, force bool) bool {
105+
105106
node := instance.Node
106107

108+
if !force && instance.HasContainer(false) {
109+
node.log.Info(node.Name+"["+instance.Name+"]: Skipping node instance, which already has a container")
110+
return false
111+
}
112+
107113
/**
108114
* Transform node data, into a format that can be used
109115
* for the actual Docker call. This involves transforming

operation_up.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ from beginning to fully operational, with a single command.
3939
SYNTAX:
4040
$/> coach {target} up
4141
42+
{targets} what target node instances the operation should process ($/> coach help targets)
43+
4244
TODO:
4345
- building images may take a long time, so maybe it should be optional;
4446
- pulling images may take a long time, so maybe it should be optional;

0 commit comments

Comments
 (0)