Skip to content

Commit

Permalink
Merge pull request #50 from slankdev/slankdev-fix-down
Browse files Browse the repository at this point in the history
internal/pkg/shell: fix down behavior
  • Loading branch information
slankdev authored Jul 26, 2020
2 parents 62116c1 + 014f844 commit 525a74d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/pkg/shell/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (node *Node) DeleteNode() (deleteNodeCmds []string) {
var deleteCmd string

if node.Type == "docker" || node.Type == "" {
deleteCmd = fmt.Sprintf("docker rm -f %s", node.Name)
deleteCmd = fmt.Sprintf("docker rm -f %s || true", node.Name)
} else if node.Type == "netns" {
deleteCmd = fmt.Sprintf("ip netns del %s", node.Name)
} else {
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/shell/shell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func TestNode_DeleteNode(t *testing.T) {
},
},
},
want: []string{"docker rm -f R1", "rm -rf /var/run/netns/R1"},
want: []string{"docker rm -f R1 || true", "rm -rf /var/run/netns/R1"},
},
{
name: "delete netns",
Expand Down

0 comments on commit 525a74d

Please sign in to comment.