mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-08 04:50:16 +00:00
remove added cleanup.go file
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
// Cleanup removes the Docker Compose containers and testnet directory.
|
||||
func Cleanup(testnet *e2e.Testnet) error {
|
||||
err := cleanupDocker(testnet.Name)
|
||||
err := cleanupDocker()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -20,7 +20,7 @@ func Cleanup(testnet *e2e.Testnet) error {
|
||||
|
||||
// cleanupDocker removes all E2E resources (with label e2e=True), regardless
|
||||
// of testnet.
|
||||
func cleanupDocker(name string) error {
|
||||
func cleanupDocker() error {
|
||||
logger.Info("Removing Docker containers and networks")
|
||||
|
||||
// GNU xargs requires the -r flag to not run when input is empty, macOS
|
||||
@@ -28,13 +28,13 @@ func cleanupDocker(name string) error {
|
||||
xargsR := `$(if [[ $OSTYPE == "linux-gnu"* ]]; then echo -n "-r"; fi)`
|
||||
|
||||
err := exec("bash", "-c", fmt.Sprintf(
|
||||
"docker container ls -qa --filter label=\"name=%v\" | xargs %v docker container rm -f", name, xargsR))
|
||||
"docker container ls -qa --filter label=e2e | xargs %v docker container rm -f", xargsR))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return exec("bash", "-c", fmt.Sprintf(
|
||||
"docker network ls -q --filter label=\"name=%v\"| xargs %v docker network rm", name, xargsR))
|
||||
"docker network ls -q --filter label=e2e | xargs %v docker network rm", xargsR))
|
||||
}
|
||||
|
||||
// cleanupDir cleans up a testnet directory
|
||||
|
||||
Reference in New Issue
Block a user