MCPcopy
hub / github.com/cubefs/cubefs / rmContainerOnNode

Function rmContainerOnNode

deploy/cmd/docker.go:23–33  ·  view source on GitHub ↗
(nodeUser, node, containerName string)

Source from the content-addressed store, hash-verified

21}
22
23func rmContainerOnNode(nodeUser, node, containerName string) (string, error) {
24 if ok, _ := checkContainerExistence(nodeUser, node, containerName); ok {
25 cmd := exec.Command("ssh", nodeUser+"@"+node, "docker rm ", containerName)
26 _, err := cmd.Output()
27 if err != nil {
28 return fmt.Sprintf("failed rm %s on node %s", containerName, node), err
29 }
30 return fmt.Sprintf("successful rm %s on node %s", containerName, node), nil
31 }
32 return fmt.Sprintf("%s on node %s already removed", containerName, node), nil
33}
34
35func startMasterContainerOnNode(nodeUser, node, containerName, dataDir string) (string, error) {
36 cmd := exec.Command("ssh", nodeUser+"@"+node,

Callers 6

stopAllDataNodeFunction · 0.85
stopAllMetaNodeFunction · 0.85
stopAllMasterFunction · 0.85

Calls 2

checkContainerExistenceFunction · 0.85
OutputMethod · 0.65

Tested by

no test coverage detected